Artix's changes

This commit is contained in:
Sam 2018-07-08 00:20:09 +01:00 committed by Alexander Meech
parent e675567ed7
commit 42865efcc7

View File

@ -49,6 +49,11 @@ public class HubClockManager implements Listener
player.getInventory().setItem(HUB_CLOCK_SLOT, HUB_CLOCK_ITEM); player.getInventory().setItem(HUB_CLOCK_SLOT, HUB_CLOCK_ITEM);
} }
public void giveClockToAll()
{
UtilServer.getPlayersCollection().forEach(this::giveClock);
}
public void removeClock(Player player) public void removeClock(Player player)
{ {
player.getInventory().remove(HUB_CLOCK_ITEM); player.getInventory().remove(HUB_CLOCK_ITEM);
@ -68,13 +73,13 @@ public class HubClockManager implements Listener
return; return;
} }
UtilServer.getPlayersCollection().forEach(this::giveClock); giveClockToAll();
} }
@EventHandler @EventHandler
public void giveOnVote(VoteStartEvent event) public void giveOnVote(VoteStartEvent event)
{ {
UtilServer.getPlayersCollection().forEach(this::giveClock); giveClockToAll();
} }
@EventHandler @EventHandler
@ -125,13 +130,13 @@ public class HubClockManager implements Listener
} }
// Don't allow spamming so we don't make too many send requests // Don't allow spamming so we don't make too many send requests
if (!Recharge.Instance.usable(event.getPlayer(), "Return to Hub")) if (!Recharge.Instance.usable(player, "Return to Hub"))
{ {
return; return;
} }
// Send to server // Send to server
_manager.GetPortal().sendPlayerToGenericServer(event.getPlayer(), GenericServer.HUB, Intent.PLAYER_REQUEST); _manager.GetPortal().sendPlayerToGenericServer(player, GenericServer.HUB, Intent.PLAYER_REQUEST);
} }
private boolean canGiveClock() private boolean canGiveClock()