diff options
Diffstat (limited to 'src')
8 files changed, 27 insertions, 29 deletions
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java b/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java index 2cb9e3d0..dfaf09ed 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorBoat.java @@ -56,9 +56,10 @@ public class DispenseBehaviorBoat extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { itemstack.count++; // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java index 6e29c260..31348bd6 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java @@ -51,9 +51,10 @@ public class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java b/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java index 28bedc9a..8f1d9a84 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorFilledBucket.java @@ -42,9 +42,10 @@ public class DispenseBehaviorFilledBucket extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java b/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java index 0824fc4f..cc0bf8bb 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorFireball.java @@ -45,9 +45,10 @@ public class DispenseBehaviorFireball extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { itemstack.count++; // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java index 9cf23dd9..1337fefe 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java @@ -65,30 +65,21 @@ public class DispenseBehaviorItem implements IDispenseBehavior { entityitem.motX = event.getVelocity().getX(); entityitem.motY = event.getVelocity().getY(); entityitem.motZ = event.getVelocity().getZ(); - // CraftBukkit end - - world.addEntity(entityitem); - // CraftBukkit start if (!event.getItem().equals(bukkitItem)) { - if (event.getItem().getTypeId() == Item.BUCKET.id) { - int x = isourceblock.getBlockX() + enumfacing.c(); - int y = isourceblock.getBlockY(); - int z = isourceblock.getBlockZ() + enumfacing.e(); - Material material = world.getMaterial(x, y, z); - int data = world.getData(x, y, z); - if (!(Material.WATER.equals(material) || Material.LAVA.equals(material)) || data != 0) { - return true; - } - } // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior.getClass() != DispenseBehaviorItem.class) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); + } else { + world.addEntity(entityitem); } return false; } + world.addEntity(entityitem); + return true; // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java b/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java index c429abe9..cc92846e 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorMinecart.java @@ -56,9 +56,10 @@ public class DispenseBehaviorMinecart extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { itemstack.count++; // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java index 4895b81c..25e21d25 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java @@ -38,9 +38,10 @@ public class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { itemstack.count++; // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { - idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); + idispensebehavior.a(isourceblock, eventStack); return itemstack; } } diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java index ce801b10..3968dd0c 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorProjectile.java @@ -33,7 +33,8 @@ public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem { if (!event.getItem().equals(bukkitItem)) { itemstack.count++; // Chain to handler for new item - IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(itemstack.getItem()); + ItemStack eventStack = CraftItemStack.createNMSItemStack(event.getItem()); + IDispenseBehavior idispensebehavior = (IDispenseBehavior) BlockDispenser.a.a(eventStack.getItem()); if (idispensebehavior != IDispenseBehavior.a && idispensebehavior != this) { idispensebehavior.a(isourceblock, CraftItemStack.createNMSItemStack(event.getItem())); return itemstack; |