Disable gadgets if the game is in progress
This commit is contained in:
parent
e51487a949
commit
f72c2d4ec0
@ -75,6 +75,7 @@ import mineplex.core.events.EnableArcadeSpawnEvent;
|
|||||||
import mineplex.core.explosion.Explosion;
|
import mineplex.core.explosion.Explosion;
|
||||||
import mineplex.core.explosion.ExplosionEvent;
|
import mineplex.core.explosion.ExplosionEvent;
|
||||||
import mineplex.core.facebook.FacebookManager;
|
import mineplex.core.facebook.FacebookManager;
|
||||||
|
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||||
import mineplex.core.gadget.event.ToggleMobsEvent;
|
import mineplex.core.gadget.event.ToggleMobsEvent;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
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));
|
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)
|
/*public void saveBasicStats(final Game game)
|
||||||
{
|
{
|
||||||
if (!IsTournamentServer())
|
if (!IsTournamentServer())
|
||||||
|
Loading…
Reference in New Issue
Block a user