Add some more event commands, fix some existing event commands and change permissions for event related commands to be executeable by EVENT_MODERATOR

This commit is contained in:
Sarah 2017-03-15 14:33:56 +01:00 committed by cnr
parent 0bbd0659a0
commit fdee6b1163
10 changed files with 366 additions and 117 deletions

View File

@ -17,6 +17,7 @@ public enum Rank
JNR_DEV("Jr.Dev", "jrdev", ChatColor.GOLD, "Junior Developers work behind the scenes to \ncreate new games and features, and fix bugs to \ngive the best experience.", -1),
SUPPORT("Support", "spp", ChatColor.BLUE, "Support agents handle tickets and \nprovide customer service.", 47),
CMOD("C.Mod", "cmod", ChatColor.GOLD, "Clans Moderators are members of the Clans Management Senior Mod team. \nTheir duties include moderation and support within the Clans servers. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 32),
EVENT_MODERATOR("Sr.Mod", "eventmod", ChatColor.GOLD, "Senior Moderators are members of a special \nSenior Moderator team where they have to fulfill specific tasks. \nJust like Moderators, you can always ask them for help. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 44),
SNR_MODERATOR("Sr.Mod", "srmod", ChatColor.GOLD, "Senior Moderators are members of a special \nSenior Moderator team where they have to fulfill specific tasks. \nJust like Moderators, you can always ask them for help. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 44),
MODERATOR("Mod", "mod", ChatColor.GOLD, "Moderators enforce rules and provide help to \nanyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 32),
HELPER("Trainee", "train", ChatColor.GOLD, "Trainees are moderators-in-training. \nTheir duties include enforcing the rules and \nproviding help to anyone with questions or concerns. \n\nFor assistance, contact them using " + F.elem("/a <message>") + ".", 24),
@ -151,4 +152,4 @@ public enum Rank
{
return _forumId;
}
}
}

View File

@ -12,7 +12,10 @@ public class HostEventServerCommand extends CommandBase<PersonalServerManager>
{
public HostEventServerCommand(PersonalServerManager plugin)
{
super(plugin, Rank.ADMIN, "hostevent");
super(plugin, Rank.ADMIN, new Rank[]
{
Rank.EVENT_MODERATOR
}, "hostevent");
}
@Override
@ -26,6 +29,6 @@ public class HostEventServerCommand extends CommandBase<PersonalServerManager>
UtilPlayer.message(caller, F.main("Disguise", "You can't create a event server while you are disguised!"));
return;
}
Plugin.hostServer(caller, caller.getName(), true);
Plugin.hostServer(caller, caller.getName(), true);
}
}

View File

@ -0,0 +1,34 @@
package mineplex.core.personalServer;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
public class HostPersonalEventServer extends CommandBase<PersonalServerManager>
{
public HostPersonalEventServer(PersonalServerManager plugin)
{
super(plugin, Rank.ADMIN, new Rank[]
{
Rank.EVENT_MODERATOR
}, "hostmes");
}
@Override
public void Execute(Player caller, String[] args)
{
if (!Recharge.Instance.use(caller, "Host Event", 30000, false, false))
return;
if(Plugin.getClients().Get(caller).isDisguised())
{
UtilPlayer.message(caller, F.main("Disguise", "You can't create a event server while you are disguised!"));
return;
}
Plugin.hostServer(caller, caller.getName(), false, true);
}
}

View File

@ -106,6 +106,7 @@ public class PersonalServerManager extends MiniPlugin
{
addCommand(new HostServerCommand(this));
addCommand(new HostEventServerCommand(this));
addCommand(new HostPersonalEventServer(this));
}
private void setupConfigValues()
@ -124,6 +125,11 @@ public class PersonalServerManager extends MiniPlugin
}
public void hostServer(Player player, String serverName, boolean eventServer)
{
hostServer(player, serverName, eventServer, false);
}
public void hostServer(Player player, String serverName, boolean eventServer, boolean eventgame)
{
int ram = 1024;
int cpu = 1;
@ -143,7 +149,16 @@ public class PersonalServerManager extends MiniPlugin
createGroup(player, "EVENT", ram, cpu, 40, 80, "Event", eventServer);
}
else
createGroup(player, serverName, ram, cpu, 40, 80, "Smash", eventServer);
{
if (eventgame)
{
createGroup(player, serverName, ram, cpu, 40, 80, "Event", eventServer);
}
else
{
createGroup(player, serverName, ram, cpu, 40, 80, "Smash", eventServer);
}
}
}
public void hostCommunityServer(Player host, Community community)

View File

@ -47,7 +47,9 @@ public class PreferenceMenu extends Menu<PreferencesManager>
if (rank.has(Rank.HELPER) && !rank.has(Rank.ADMIN))
{
preferences.remove(Preference.INVISIBILITY);
preferences.remove(Preference.FORCE_FIELD);
if (rank != Rank.EVENT_MODERATOR)
preferences.remove(Preference.FORCE_FIELD);
}
else if (rank == Rank.YOUTUBE || rank == Rank.TWITCH)
{

View File

@ -1632,7 +1632,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
// Disables gadgets if player count is greater than 40
int playerCount = UtilServer.getPlayers().length;
getCosmeticManager().getGadgetManager().setGadgetEnabled(playerCount <= 40);
getCosmeticManager().getGadgetManager().setGadgetEnabled(playerCount <= (GetGameHostManager().isEventServer() ? 120 : 40));
}
/*public void saveBasicStats(final Game game)

View File

@ -6,31 +6,6 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import mineplex.core.MiniPlugin;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.creature.event.CreatureKillEntitiesEvent;
import mineplex.core.event.StackerEvent;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.give.Give;
import mineplex.core.mount.Mount;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.bridge.Bridge;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Effect;
@ -54,6 +29,7 @@ import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
@ -62,6 +38,36 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.MiniPlugin;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.creature.event.CreatureKillEntitiesEvent;
import mineplex.core.event.StackerEvent;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.give.Give;
import mineplex.core.mount.Mount;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.bridge.Bridge;
import nautilus.game.arcade.game.games.smash.SuperSmash;
import nautilus.game.arcade.game.games.survivalgames.SurvivalGames;
import nautilus.game.arcade.kit.Kit;
public class EventModule extends MiniPlugin
{
@ -78,6 +84,8 @@ public class EventModule extends MiniPlugin
private ArrayList<Player> _damage;
private boolean _allowStacker;
private boolean _keepInventory;
public EventModule(ArcadeManager manager, JavaPlugin plugin)
{
super("EventModule", plugin);
@ -159,7 +167,6 @@ public class EventModule extends MiniPlugin
UtilPlayer.message(player, F.value("/e doublejump", "Toggles Double Jump"));
UtilPlayer.message(player, F.value("/e bc", "Broadcast a message with colorcodes"));
UtilPlayer.message(player, F.value("/e tempgadget", "Activates gadget for all player"));
UtilPlayer.message(player, F.value("/e playerdamage", "Toggles damage fpr player"));
UtilPlayer.message(player, F.value("/e stacker [Player]", "toggles stacker global or for Players"));
UtilPlayer.message(player, F.value("/e kick", "Remove a player from the event"));
UtilPlayer.message(player, F.value("/e area PVP|ALL|PVE|EVP|Gadget|Effect / add", "Create and edit areas"));
@ -175,6 +182,18 @@ public class EventModule extends MiniPlugin
UtilPlayer.message(player, F.value("/e effect <player> <type> <mult> <seconds>", ""));
UtilPlayer.message(player, F.value("/e effect <player> clear", ""));
UtilPlayer.message(player, F.value("/e announce <text>", "Broadcasts a 1.8 announcement"));
UtilPlayer.message(player, F.value("/e clear <player>", "Clears players inventory"));
UtilPlayer.message(player, F.value("/e clear all", "Clears all inventories"));
UtilPlayer.message(player, F.value("/e bridge", "Forces Bridges countdown to 10 seconds"));
UtilPlayer.message(player, F.value("/e revive", "Revive a Player"));
UtilPlayer.message(player, F.value("/e keepinventory", ""));
UtilPlayer.message(player, F.value("/e gamekit", "Change kit of a Player"));
UtilPlayer.message(player, F.value("/e smash", "spawn smash Crystal in Smash"));
UtilPlayer.message(player, F.value("/e dm", "start dm in SG"));
UtilPlayer.message(player, F.value("/e supplydrop", "spawn supply Drop in SG"));
UtilPlayer.message(player, F.value("/ea", "Talk in event chat"));
}
public void commandHelpSettings(Player player)
@ -199,9 +218,6 @@ public class EventModule extends MiniPlugin
UtilPlayer.message(player, F.value("/e blockbreak whitelist <add/remove/list/clear> <id>", ""));
UtilPlayer.message(player, F.value("/e blockbreak blacklist <add/remove/list/clear> <id>", ""));
UtilPlayer.message(player, F.value("/e time <-1 to 24000>", "Sets World Time"));
//UtilPlayer.message(player, F.value("/e joiningame", "toggles Join In Process for games"));
//UtilPlayer.message(player, F.value("/e deathout", "toggles Deathout in games"));
//UtilPlayer.message(player, F.value("/e quitout", "toggles Quitout in games"));
UtilPlayer.message(player, F.value("/e mobgriefing", "toggles mobgriefing in games"));
}
@ -209,24 +225,30 @@ public class EventModule extends MiniPlugin
@EventHandler(priority = EventPriority.LOWEST)
public void commandHandler(PlayerCommandPreprocessEvent event)
{
if (Manager.GetGame() == null || !Manager.GetGame().InProgress())
return;
if (!event.getMessage().toLowerCase().startsWith("/e "))
if (Manager.GetGame() == null)
return;
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
if(!Manager.GetGameHostManager().isEventServer() && !eventTestServer)
return;
//Trim off /e and split to args
String[] args = event.getMessage().substring(3, event.getMessage().length()).split(" ");
if (event.getMessage().toLowerCase().startsWith("/ea"))
{
commandEventChat(event.getPlayer(), args);
event.setCancelled(true);
}
event.setCancelled(true);
if (!event.getMessage().toLowerCase().startsWith("/e "))
return;
if (!Manager.GetGameHostManager().isAdmin(event.getPlayer(), false))
return;
//Trim off /e and split to args
String[] args = event.getMessage().substring(3, event.getMessage().length()).split(" ");
event.setCancelled(true);
if (args.length == 0 || args[0].equalsIgnoreCase("help"))
{
@ -240,7 +262,6 @@ public class EventModule extends MiniPlugin
commandHelpSettings(event.getPlayer());
}
//XXX Commands
else if (args[0].equalsIgnoreCase("tp"))
{
commandTeleport(event.getPlayer(), args);
@ -257,9 +278,90 @@ public class EventModule extends MiniPlugin
{
commandAdmin(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("whitelist"))
{
commandWhitelist(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("give"))
{
commandGive(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("effect"))
{
commandEffect(event.getPlayer(), args, null);
}
else if (args[0].equalsIgnoreCase("mob"))
{
if (args.length >= 2 && args[1].equalsIgnoreCase("kill"))
commandMobKill(event.getPlayer(), args);
else
commandMob(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("bc"))
{
commandBC(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("kick"))
{
if(Bukkit.getPlayer(args[1]) == null)
{
UtilPlayer.message(event.getPlayer(), "No matches for: " + C.cYellow + args[1]);
return;
}
if (Manager.GetGameHostManager().getBlacklist().contains(Bukkit.getPlayer(args[1]).getName()))
{
Manager.GetGameHostManager().getBlacklist().remove(Bukkit.getPlayer(args[1]).getName());
}
else
{
Manager.GetGameHostManager().getBlacklist().add(Bukkit.getPlayer(args[1]).getName());
UtilPlayer.message(event.getPlayer(), F.main("Event", "You removed " + C.cYellow + Bukkit.getPlayer(args[1]).getName()));
}
}
else if(args[0].equalsIgnoreCase("tempgadget"))
{
String gadget = args[1];
for(int e = 2; e < args.length; e++)
gadget+= " " + args[e];
try
{
for(Player target : UtilServer.getPlayers())
Manager.GetDonation().Get(target).addOwnedUnknownSalesPackage(gadget);
}
catch (Exception e)
{
UtilPlayer.message(event.getPlayer(), F.main("Event", "Gadget is not vallid"));
}
UtilPlayer.message(event.getPlayer(), F.main("Event", "You gave the gadget " + F.item(gadget) + " to all Players!"));
}
else if (args[0].equalsIgnoreCase("announce"))
{
String text = args[1];
for (int i = 2; i < args.length; i++)
{
text += " " + args[i];
}
UtilTextMiddle.display(C.cDGreenB + "Announcement", text);
UtilServer.broadcast(F.main("Event Announcement", text));
}
if (!Manager.GetGame().InProgress())
return;
//XXX Commands
else if (args[0].equalsIgnoreCase("gm"))
{
commandGamemode(event.getPlayer(), args);
}else if (args[0].equalsIgnoreCase("gamekit"))
{
commandGameKit(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("keepinventory"))
{
commandKeepInventory(event.getPlayer());
}
else if (args[0].equalsIgnoreCase("radius"))
{
@ -273,28 +375,13 @@ public class EventModule extends MiniPlugin
{
commandScoreboard(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("whitelist"))
{
commandWhitelist(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("give"))
{
commandGive(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("effect"))
{
commandEffect(event.getPlayer(), args, null);
}
else if (args[0].equalsIgnoreCase("kit"))
{
commandKit(event.getPlayer(), args);
}
else if (args[0].equalsIgnoreCase("mob"))
else if (args[0].equalsIgnoreCase("revive"))
{
if (args.length >= 2 && args[1].equalsIgnoreCase("kill"))
commandMobKill(event.getPlayer(), args);
else
commandMob(event.getPlayer(), args);
commandRevive(event.getPlayer(), args);
}
@ -366,22 +453,14 @@ public class EventModule extends MiniPlugin
{
commandTime(event.getPlayer(), args);
}
/*else if(args[0].equalsIgnoreCase("joiningame"))
{
commandSpectators(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("deathout"))
{
commandDeathout(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("quitout"))
{
commandQuitOut(event.getPlayer(), args);
}*/
else if(args[0].equalsIgnoreCase("blockplacecreative"))
{
commandBlockPlaceInCreative(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("blockbreakcreative"))
{
commandBlockBreakInCreative(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("stacker"))
{
commandStacker(event.getPlayer(), args);
@ -405,10 +484,6 @@ public class EventModule extends MiniPlugin
else
_damage.add(Bukkit.getPlayer(args[1]));
}
else if(args[0].equalsIgnoreCase("bc"))
{
commandBC(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("area"))
{
if(!(Manager.GetGame() instanceof EventGame)) {
@ -422,46 +497,6 @@ public class EventModule extends MiniPlugin
{
commandMobGriefing(event.getPlayer(), args);
}
else if(args[0].equalsIgnoreCase("kick"))
{
if(Bukkit.getPlayer(args[1]) == null)
{
UtilPlayer.message(event.getPlayer(), "No matches for: " + C.cYellow + args[1]);
return;
}
//Bukkit.getPlayer(args[1]).kickPlayer("You where kicked from the event, probably you didn't stick to the Event Rules.");
Manager.GetGameHostManager().getBlacklist().add(Bukkit.getPlayer(args[1]).getName());
UtilPlayer.message(event.getPlayer(), F.main("Event", "You removed " + C.cYellow + Bukkit.getPlayer(args[1]).getName()));
}
else if(args[0].equalsIgnoreCase("tempgadget"))
{
String gadget = args[1];
for(int e = 2; e < args.length; e++)
gadget+= " " + args[e];
try
{
for(Player target : UtilServer.getPlayers())
Manager.GetDonation().Get(target).addOwnedUnknownSalesPackage(gadget);
}
catch (Exception e)
{
UtilPlayer.message(event.getPlayer(), F.main("Event", "Gadget is not vallid"));
}
UtilPlayer.message(event.getPlayer(), F.main("Event", "You gave the gadget " + F.item(gadget) + " to all Players!"));
}
else if (args[0].equalsIgnoreCase("announce"))
{
String text = args[1];
for (int i = 2; i < args.length; i++)
{
text += " " + args[i];
}
UtilTextMiddle.display(C.cDGreenB + "Announcement", text);
UtilServer.broadcast(F.main("Event Announcement", text));
}
else if (args[0].equalsIgnoreCase("clear"))
{
String playerName = args[1];
@ -528,6 +563,50 @@ public class EventModule extends MiniPlugin
((Bridge) Manager.GetGame()).setBridgeTime((int) ((System.currentTimeMillis() - Manager.GetGame().GetStateTime()) + seconds * 1000));
UtilPlayer.message(event.getPlayer(), F.main("Event", "Bridges will drop in " + F.elem(seconds + " Seconds") + "!"));
}
else if (args[0].equalsIgnoreCase("dm"))
{
if (!(Manager.GetGame() instanceof SurvivalGames))
{
UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only start the deathmatch in SG!"));
return;
}
if (((SurvivalGames) Manager.GetGame()).isDeathMatchTeleported())
{
UtilPlayer.message(event.getPlayer(), F.main("Event", "The Deathmatch has already began!"));
return;
}
Manager.GetGame().Announce(C.cGreen + C.Bold + event.getPlayer().getName()
+ " has initiated Deathmatch!");
Manager.GetGame().Announce(C.cGreen + C.Bold + "Deathmatch starting in 60 seconds...");
((SurvivalGames) Manager.GetGame()).setDeathMatchTime(60);
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f,
1f);
}
else if (args[0].equalsIgnoreCase("supplydrop"))
{
if (!(Manager.GetGame() instanceof SurvivalGames))
{
UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only start the Supply Srop in SG!"));
return;
}
Manager.GetGame().WorldData.World.setTime(18000);
}
else if (args[0].equalsIgnoreCase("smash"))
{
if (!(Manager.GetGame() instanceof SuperSmash))
{
UtilPlayer.message(event.getPlayer(), F.main("Event", "You can only add a Smash Crystal in Smash!"));
return;
}
((SuperSmash) Manager.GetGame()).setNextPowerupTime(100);
}
}
public void listSettings(Player player)
@ -560,6 +639,80 @@ public class EventModule extends MiniPlugin
UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(Manager.GetGame().BlockBreakCreative)));
}
public void commandKeepInventory(Player player)
{
_keepInventory = !_keepInventory;
UtilPlayer.message(player, F.main("Settings", "BlockBreakCreative: " + F.tf(_keepInventory)));
}
public void commandGameKit(Player player, String[] args)
{
Player target = player;
String kitString = "";
if (args.length >= 3)
{
Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
if (newTarget != null)
{
target = newTarget;
kitString = args[2];
}
else
return;
}
else
return;
Kit[] kits = Manager.GetGame().GetKits();
Kit kit = null;
for (Kit otherKit : kits)
if (otherKit.GetName().replace(" ", "").equalsIgnoreCase(kitString))
kit = otherKit;
if (kit == null)
{
UtilPlayer.message(player, F.main("Event", "No Kit found"));
return;
}
Manager.GetGame().SetKit(target, kit, true, true);
UtilPlayer.message(player, F.main("Event", "Kit [" + kit.GetName() + "] applied"));
}
public void commandEventChat(Player player, String[] args)
{
String message = ChatColor.BLUE + "[Event Chat] " + ChatColor.GREEN + player.getName() + ": " + F.combine(args, 1, null, false);
UtilPlayer.message(player, message);
for (Player other : UtilServer.getPlayers())
{
if (player == other)
continue;
if (Manager.GetGameHostManager().isAdmin(other, true))
UtilPlayer.message(other, message);
}
}
public void commandRevive(Player player, String[] args)
{
Player target = player;
if (args.length >= 2)
{
Player newTarget = UtilPlayer.searchOnline(player, args[1], true);
if (newTarget != null)
target = newTarget;
else
return;
}
Manager.GetGame().SetPlayerState(target, PlayerState.IN);
Manager.GetGame().RespawnPlayer(target);
UtilPlayer.message(target, F.main("Game", "You have been Respawned!"));
}
public void commandStacker(Player player, String[] args)
{
if(args.length == 1)
@ -861,7 +1014,8 @@ public class EventModule extends MiniPlugin
//Gadget Commands (Global & Individual)
public void commandGadget(Player player, String[] args)
{
if(!(Manager.GetGame() instanceof EventGame)) {
if(!(Manager.GetGame() instanceof EventGame))
{
UtilPlayer.message(player, F.main("Inventory", "You can only enable/disable gadgets in the Event game!"));
return;
}
@ -2003,6 +2157,33 @@ public class EventModule extends MiniPlugin
}
}
@EventHandler(priority=EventPriority.HIGHEST)
public void death(PlayerDeathEvent event)
{
if (Manager.GetGame() == null)
return;
if (!Manager.GetGame().InProgress())
return;
if (!_keepInventory)
return;
ArrayList<ItemStack> stacks = new ArrayList<>();
stacks.addAll(event.getDrops());
event.getDrops().clear();
Manager.runSyncLater(new Runnable()
{
@Override
public void run()
{
for (ItemStack item : stacks)
event.getEntity().getInventory().addItem(item);
}
}, 40);
}
public ArrayList<Player> getDamagePlayers()
{
return _damage;

View File

@ -773,4 +773,9 @@ public abstract class SuperSmash extends Game
_lives.put(player, MAX_LIVES);
}
}
public void setNextPowerupTime(long time)
{
_nextPowerup = time;
}
}

View File

@ -2184,5 +2184,10 @@ public abstract class SurvivalGames extends Game
{
return _spawn;
}
public void setDeathMatchTime(int time)
{
_deathMatchTime = time;
}
}

View File

@ -26,6 +26,9 @@ public class PlayerHeadButton implements IButton
int maxCap = _arcadeManager.GetGameHostManager().getMaxPlayerCap();
if (_arcadeManager.GetGameHostManager().isEventServer())
maxCap = 120;
if (clickType.isLeftClick())
newMax = ++maxPlayers > maxCap ? maxCap : maxPlayers;
else