Fix Null Pointers in the ender chest blocker and regular chest blocker for incognito staff.

This commit is contained in:
Ben 2016-04-10 12:36:31 +01:00
parent 8ee2c02dd9
commit 3ee1f86841

View File

@ -59,6 +59,7 @@ import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.common.weight.Weight;
import mineplex.core.common.weight.WeightSet;
import mineplex.core.itemstack.ItemStackFactory;
@ -307,6 +308,16 @@ public class Gameplay extends MiniPlugin
@EventHandler
public void disableEnderChest(PlayerInteractEvent event)
{
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
if (event.getClickedBlock() == null)
{
return;
}
if (event.getClickedBlock().getType().equals(Material.ENDER_CHEST))
{
UtilPlayer.message(event.getPlayer(), F.main("Clans", "You are not permitted to use Ender Chests."));
@ -322,6 +333,16 @@ public class Gameplay extends MiniPlugin
return;
}
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
if (event.getClickedBlock() == null)
{
return;
}
if (!event.getClickedBlock().getType().equals(Material.CHEST)
&& !event.getClickedBlock().getType().equals(Material.TRAPPED_CHEST))
{