SPIGOT-296: Fix stack overflow when a dispense event is set to bonemeal

This commit is contained in:
Thinkofdeath 2015-01-04 20:42:31 +00:00
parent d4eaf226f9
commit c051558691

View File

@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/DispenseBehaviorItem.java 2014-11-28 17:43:43.049707436 +0000 --- ../work/decompile-8eb82bde//net/minecraft/server/DispenseBehaviorItem.java 2015-01-04 20:42:23.769644196 +0000
+++ src/main/java/net/minecraft/server/DispenseBehaviorItem.java 2014-11-28 17:38:20.000000000 +0000 +++ src/main/java/net/minecraft/server/DispenseBehaviorItem.java 2015-01-04 20:42:23.769644196 +0000
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
package net.minecraft.server; package net.minecraft.server;
@ -55,7 +55,7 @@
+ entityitem.motY = event.getVelocity().getY(); + entityitem.motY = event.getVelocity().getY();
+ entityitem.motZ = event.getVelocity().getZ(); + entityitem.motZ = event.getVelocity().getZ();
+ +
+ if (!event.getItem().equals(craftItem)) { + if (!event.getItem().getType().equals(craftItem.getType())) {
+ // Chain to handler for new item + // Chain to handler for new item
+ ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
+ IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.M.get(eventStack.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.M.get(eventStack.getItem());