mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-28 07:55:45 +00:00
Fixed crash with invalid PlayerInteractEvent calls. *looks at cauldron*
This commit is contained in:
1 parent
1495e69b79
commit
5e42204963
1 file changed
+3
@@ -24,6 +24,9 @@ public final class SpawnerChangingHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onInteract(PlayerInteractEvent event) {
|
||||
if(event.entityPlayer == null || event.entityPlayer.capabilities == null || event.world == null)
|
||||
return; // Cauldron breaks stuff
|
||||
|
||||
if(event.entityPlayer.capabilities.isCreativeMode && !event.world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK && !event.entityPlayer.isSneaking()) {
|
||||
ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() == Items.spawn_egg) {
|
||||
|
||||
Reference in new issue
Block a user