Revert "Revert "Disable gadgets if the game is in progress""
This reverts commit d3ae579317cc8db79e65468c0a5f85979d82ba37.
This commit is contained in:
parent
fba7997549
commit
134039bf79
@ -75,6 +75,7 @@ import mineplex.core.events.EnableArcadeSpawnEvent;
|
||||
import mineplex.core.explosion.Explosion;
|
||||
import mineplex.core.explosion.ExplosionEvent;
|
||||
import mineplex.core.facebook.FacebookManager;
|
||||
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||
import mineplex.core.gadget.event.ToggleMobsEvent;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
@ -1696,6 +1697,16 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
getCosmeticManager().getGadgetManager().setGadgetEnabled(playerCount <= (GetGameHostManager().isEventServer() ? 120 : 40));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void disableGadgetsInGame(GadgetEnableEvent event)
|
||||
{
|
||||
if (_game != null && _game.InProgress() && _game.GadgetsDisabled)
|
||||
{
|
||||
event.setShowMessage(false);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/*public void saveBasicStats(final Game game)
|
||||
{
|
||||
if (!IsTournamentServer())
|
||||
|
Loading…
Reference in New Issue
Block a user