some little fixes

This commit is contained in:
Mini-Chiss 2015-08-11 16:33:32 +02:00
parent f7d9476191
commit 89dab7ec85
5 changed files with 11 additions and 46 deletions

View File

@ -92,7 +92,7 @@ public class GadgetManager extends MiniPlugin
addGadget(new ItemTNT(this));
addGadget(new ItemMelonLauncher(this));
addGadget(new ItemFleshHook(this));
//addGadget(new ItemPaintballGun(this));
addGadget(new ItemPaintballGun(this));
addGadget(new ItemBatGun(this));
addGadget(new ItemCoinBomb(this));
addGadget(new ItemPaintbrush(this));

View File

@ -61,45 +61,6 @@ public class ItemPaintballGun extends ItemGadget
Location loc = event.getEntity().getLocation().add(event.getEntity().getVelocity());
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 49);
byte color = 2;
double r = Math.random();
if (r > 0.8) color = 4;
else if (r > 0.6) color = 5;
else if (r > 0.4) color = 9;
else if (r > 0.2) color = 14;
for (Block block : UtilBlock.getInRadius(loc, 3d).keySet())
{
if (block.getType() == Material.PORTAL)
return;
if (block.getType() == Material.CACTUS)
return;
if (block.getType() == Material.SUGAR_CANE_BLOCK)
return;
}
List<Block> blocks = new ArrayList<Block>();
blocks.addAll(UtilBlock.getInRadius(loc, 1.5d).keySet());
GadgetBlockEvent gadgetEvent = new GadgetBlockEvent(this, blocks);
Bukkit.getServer().getPluginManager().callEvent(gadgetEvent);
if (gadgetEvent.isCancelled())
return;
for (Block block : gadgetEvent.getBlocks())
{
if (!UtilBlock.solid(block))
continue;
if (block.getType() == Material.CARPET)
Manager.getBlockRestore().Add(block, 171, color, 4000);
else
Manager.getBlockRestore().Add(block, 35, color, 4000);
}
}
@EventHandler

View File

@ -89,10 +89,10 @@ public class MenuPage extends BasePage
if (host)
{
GiveAdminButton giveAdminButton = new GiveAdminButton(getPlugin(), getShop());
addButton(4 + 9, new ShopItem(Material.DIAMOND_SWORD, "Give Admin", new String[]{}, 1, false), giveAdminButton);
addButton(4 + 9, new ShopItem(Material.DIAMOND_SWORD, "Give Co-Host", new String[]{}, 1, false), giveAdminButton);
RemoveAdminButton removeAdminButton = new RemoveAdminButton(getPlugin(), getShop());
addButton(4 + 18, new ShopItem(Material.GOLD_SWORD, "Remove Admin", new String[]{}, 1, false), removeAdminButton);
addButton(4 + 18, new ShopItem(Material.GOLD_SWORD, "Remove Co-Host", new String[]{}, 1, false), removeAdminButton);
KillButton killButton = new KillButton(getPlugin());
addButton(8 + 18, new ShopItem(Material.TNT, "Kill Private Server",

View File

@ -90,9 +90,9 @@ public class GameChatManager implements Listener
else if (Manager.GetGameHostManager().isAdmin(event.getPlayer(), false))
{
if (Manager.GetGameHostManager().isEventServer())
rankStr = C.cDGreen + C.Bold + "Event Admin ";
rankStr = C.cDGreen + C.Bold + "Event Co-Host ";
else
rankStr = C.cDGreen + C.Bold + "MPS Admin ";
rankStr = C.cDGreen + C.Bold + "MPS Co-Host ";
}
else
{

View File

@ -230,6 +230,10 @@ public class GameHostManager implements Listener
_hostRank = Manager.GetClients().Get(_host).GetRank();
System.out.println("Game Host Joined.");
//Limit player count!
if (Manager.GetServerConfig().MaxPlayers > getMaxPlayerCap())
Manager.GetServerConfig().MaxPlayers = getMaxPlayerCap();
if (isEventServer())
worldeditPermissionSet(event.getPlayer(), true);
}
@ -642,7 +646,7 @@ public class GameHostManager implements Listener
{
_adminList.add(player.getName());
_onlineAdmins.add(player);
UtilPlayer.message(player, F.main("Server", "You were given admin privileges."));
UtilPlayer.message(player, F.main("Server", "You were given Co-Host privileges."));
if (isEventServer())
worldeditPermissionSet(player, true);
@ -660,7 +664,7 @@ public class GameHostManager implements Listener
{
player.closeInventory();
}
UtilPlayer.message(player, F.main("Server", "Your admin privileges were removed."));
UtilPlayer.message(player, F.main("Server", "Your Co-Host privileges were removed."));
player.setGameMode(GameMode.SURVIVAL);