Rank fixes, visual fixes, lets hope things work!
This commit is contained in:
parent
d8311d860e
commit
5f509ca488
@ -9,7 +9,7 @@ public class HostServerCommand extends CommandBase<PersonalServerManager>
|
||||
{
|
||||
public HostServerCommand(PersonalServerManager plugin)
|
||||
{
|
||||
super(plugin, Rank.LEGEND, "host");
|
||||
super(plugin, Rank.ULTRA, "hostserver");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,8 +11,14 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.jsonchat.ClickEvent;
|
||||
import mineplex.core.common.jsonchat.Color;
|
||||
import mineplex.core.common.jsonchat.HoverEvent;
|
||||
import mineplex.core.common.jsonchat.JsonMessage;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.ServerGroup;
|
||||
@ -22,6 +28,7 @@ import mineplex.serverdata.ServerRepository;
|
||||
public class PersonalServerManager extends MiniPlugin
|
||||
{
|
||||
private ServerRepository _repository;
|
||||
private CoreClientManager _clientManager;
|
||||
|
||||
private boolean _us;
|
||||
|
||||
@ -33,6 +40,8 @@ public class PersonalServerManager extends MiniPlugin
|
||||
{
|
||||
super("Personal Server Manager", plugin);
|
||||
|
||||
_clientManager = clientManager;
|
||||
|
||||
setupConfigValues();
|
||||
|
||||
_us = plugin.getConfig().getBoolean("serverstatus.us");
|
||||
@ -57,8 +66,27 @@ public class PersonalServerManager extends MiniPlugin
|
||||
{
|
||||
if (_interfaceItem.equals(event.getPlayer().getItemInHand()))
|
||||
{
|
||||
hostServer(event.getPlayer(), event.getPlayer().getName());
|
||||
if (_clientManager.Get(event.getPlayer()).GetRank().Has(Rank.ULTRA))
|
||||
{
|
||||
showHostMessage(event.getPlayer());
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Server", "Only players with " + F.rank(Rank.ULTRA) + C.mBody + "+ can host private servers"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void showHostMessage(Player player)
|
||||
{
|
||||
UtilPlayer.message(player, C.cRed + "------------------------------------------------");
|
||||
UtilPlayer.message(player, "This will create a Mineplex Player Server for you.");
|
||||
UtilPlayer.message(player, "Here you can play your favourite games with friends!");
|
||||
new JsonMessage("Please ").click(ClickEvent.RUN_COMMAND, "/hostserver")
|
||||
.hover(HoverEvent.SHOW_TEXT, C.cGray + "Click to Create Server")
|
||||
.extra("CLICK HERE").color(Color.GREEN).extra(" to confirm you want to do this.")
|
||||
.color(Color.WHITE).send(JsonMessage.MessageType.CHAT_BOX, player);
|
||||
UtilPlayer.message(player, C.cRed + "------------------------------------------------");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -322,7 +322,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
lore.add(ChatColor.RESET + C.cGreen + "Hosted by a Staff Member");
|
||||
}
|
||||
|
||||
ShopItem shopItem = new ShopItem(Material.SKULL_ITEM, server, lore.toArray(new String[0]), 1, false, false);
|
||||
ShopItem shopItem = new ShopItem(Material.SKULL_ITEM, (byte)3, server, lore.toArray(new String[0]), 1, false, false);
|
||||
SkullMeta meta = (SkullMeta) shopItem.getItemMeta();
|
||||
meta.setOwner(hostName);
|
||||
shopItem.setItemMeta(meta);
|
||||
|
Loading…
Reference in New Issue
Block a user