diff options
Diffstat (limited to 'nms-patches/DispenserRegistry.patch')
-rw-r--r-- | nms-patches/DispenserRegistry.patch | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/nms-patches/DispenserRegistry.patch b/nms-patches/DispenserRegistry.patch index 47b0478d..5c389cc5 100644 --- a/nms-patches/DispenserRegistry.patch +++ b/nms-patches/DispenserRegistry.patch @@ -241,7 +241,7 @@ itemstack.subtract(1); if (itemstack.isEmpty()) { return new ItemStack(item); -@@ -227,14 +387,42 @@ +@@ -227,11 +387,39 @@ protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { World world = isourceblock.getWorld(); @@ -274,20 +274,15 @@ if (ItemFlintAndSteel.a((GeneratorAccess) world, blockposition)) { - world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData()); -- if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) { -- itemstack.setCount(0); + // CraftBukkit start - Ignition by dispensing flint and steel + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, isourceblock.getBlockPosition()).isCancelled()) { + world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData()); -+ if (itemstack.isDamaged(1, world.random, (EntityPlayer) null)) { -+ itemstack.setCount(0); -+ } - } ++ } + // CraftBukkit end } else { Block block = world.getType(blockposition).getBlock(); -@@ -254,12 +442,55 @@ +@@ -255,12 +443,55 @@ this.a = true; World world = isourceblock.getWorld(); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); @@ -343,7 +338,7 @@ return itemstack; } -@@ -268,11 +499,40 @@ +@@ -269,11 +500,40 @@ protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { World world = isourceblock.getWorld(); BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); @@ -386,7 +381,7 @@ return itemstack; } })); -@@ -294,6 +554,30 @@ +@@ -295,6 +555,30 @@ EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING); BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); @@ -417,7 +412,7 @@ this.a = true; if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) { world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(enumdirection.opposite().get2DRotationValue() * 4)), 3); -@@ -317,6 +601,30 @@ +@@ -318,6 +602,30 @@ BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING)); BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN; @@ -448,7 +443,7 @@ this.a = true; if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) { if (!world.isClientSide) { -@@ -378,6 +686,51 @@ +@@ -379,6 +687,51 @@ } d(); @@ -500,7 +495,7 @@ } } } -@@ -386,7 +739,7 @@ +@@ -387,7 +740,7 @@ LocaleLanguage localelanguage = LocaleLanguage.a(); registrymaterials.iterator().forEachRemaining((object) -> { @@ -509,7 +504,7 @@ if (!localelanguage.b(s)) { DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s); -@@ -480,6 +833,30 @@ +@@ -481,6 +834,30 @@ BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection); EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP; @@ -540,7 +535,7 @@ this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS; if (this.a) { itemstack.subtract(1); -@@ -533,12 +910,40 @@ +@@ -534,12 +911,40 @@ d3 = 0.0D; } |