Working loadouts.
This commit is contained in:
parent
b255c58653
commit
08b5e7b4db
@ -186,6 +186,9 @@ public class Gladiators extends SoloGame
|
|||||||
if (e.getType() != UpdateType.FASTEST)
|
if (e.getType() != UpdateType.FASTEST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
if (GetState() != GameState.Prepare)
|
if (GetState() != GameState.Prepare)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -749,10 +752,10 @@ public class Gladiators extends SoloGame
|
|||||||
p.getInventory().clear();
|
p.getInventory().clear();
|
||||||
p.getInventory().setArmorContents(null);
|
p.getInventory().setArmorContents(null);
|
||||||
|
|
||||||
p.getInventory().setItem(layout.getSword() - 1, UtilItem.makeUnbreakable(type.getLoadout().getSword()));
|
p.getInventory().setItem(layout.getSword(), UtilItem.makeUnbreakable(type.getLoadout().getSword()));
|
||||||
p.getInventory().setItem(layout.getRod() - 1, UtilItem.makeUnbreakable(type.getLoadout().getRod()));
|
p.getInventory().setItem(layout.getRod(), UtilItem.makeUnbreakable(type.getLoadout().getRod()));
|
||||||
p.getInventory().setItem(layout.getBow() - 1, type.getLoadout().getBow());
|
p.getInventory().setItem(layout.getBow(), type.getLoadout().getBow());
|
||||||
p.getInventory().setItem(layout.getArrows() - 1, type.getLoadout().getArrows());
|
p.getInventory().setItem(layout.getArrows(), type.getLoadout().getArrows());
|
||||||
|
|
||||||
p.getInventory().setHelmet(type.getLoadout().getHelmet());
|
p.getInventory().setHelmet(type.getLoadout().getHelmet());
|
||||||
p.getInventory().setChestplate(type.getLoadout().getChestplate());
|
p.getInventory().setChestplate(type.getLoadout().getChestplate());
|
||||||
|
@ -52,6 +52,9 @@ public class HotbarEditor extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent event)
|
public void onJoin(PlayerJoinEvent event)
|
||||||
{
|
{
|
||||||
|
if (_host.Manager.GetGame() != _host)
|
||||||
|
return;
|
||||||
|
|
||||||
if (_host.GetState() == Game.GameState.Recruit || _host.GetState() == Game.GameState.Live)
|
if (_host.GetState() == Game.GameState.Recruit || _host.GetState() == Game.GameState.Live)
|
||||||
{
|
{
|
||||||
event.getPlayer().getInventory().setItem(0, _item);
|
event.getPlayer().getInventory().setItem(0, _item);
|
||||||
@ -89,6 +92,9 @@ public class HotbarEditor extends MiniPlugin
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(GameStateChangeEvent event)
|
public void onJoin(GameStateChangeEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.GetGame() != _host)
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.GetState() == Game.GameState.Recruit)
|
if (event.GetState() == Game.GameState.Recruit)
|
||||||
{
|
{
|
||||||
for (Player player : Bukkit.getOnlinePlayers())
|
for (Player player : Bukkit.getOnlinePlayers())
|
||||||
|
Loading…
Reference in New Issue
Block a user