Fix NullPointerException in speed builders

This commit is contained in:
cnr 2016-12-28 13:50:04 -07:00
parent 3a6cef32a4
commit c7d5e149f8

View File

@ -64,6 +64,7 @@ import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockFormEvent;
@ -1724,6 +1725,11 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true);
return;
}
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.LEFT_CLICK_BLOCK)
{
return;
}
Block block = event.getClickedBlock().getRelative(event.getBlockFace());