mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 00:56:39 +01:00
Fix StructureGrowEvent originating from dispensers
This commit is contained in:
parent
452a173807
commit
7c341e9beb
1 changed files with 10 additions and 8 deletions
|
@ -295,7 +295,7 @@
|
||||||
} else {
|
} else {
|
||||||
Block block = world.getType(blockposition).getBlock();
|
Block block = world.getType(blockposition).getBlock();
|
||||||
|
|
||||||
@@ -255,12 +449,55 @@
|
@@ -255,12 +449,57 @@
|
||||||
this.a = true;
|
this.a = true;
|
||||||
World world = isourceblock.getWorld();
|
World world = isourceblock.getWorld();
|
||||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
||||||
|
@ -321,6 +321,8 @@
|
||||||
+ return itemstack;
|
+ return itemstack;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
|
+ world.captureTreeGeneration = true;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
if (!ItemBoneMeal.a(itemstack, world, blockposition) && !ItemBoneMeal.b(itemstack, world, blockposition)) {
|
if (!ItemBoneMeal.a(itemstack, world, blockposition) && !ItemBoneMeal.b(itemstack, world, blockposition)) {
|
||||||
|
@ -351,7 +353,7 @@
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
@@ -269,11 +506,40 @@
|
@@ -269,11 +508,40 @@
|
||||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||||
World world = isourceblock.getWorld();
|
World world = isourceblock.getWorld();
|
||||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
||||||
|
@ -394,7 +396,7 @@
|
||||||
return itemstack;
|
return itemstack;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -295,6 +561,30 @@
|
@@ -295,6 +563,30 @@
|
||||||
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
|
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
|
||||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
|
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
|
||||||
|
|
||||||
|
@ -425,7 +427,7 @@
|
||||||
this.a = true;
|
this.a = true;
|
||||||
if (world.isEmpty(blockposition) && BlockWitherSkull.b(world, blockposition, itemstack)) {
|
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);
|
world.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, Integer.valueOf(enumdirection.opposite().get2DRotationValue() * 4)), 3);
|
||||||
@@ -318,6 +608,30 @@
|
@@ -318,6 +610,30 @@
|
||||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
||||||
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
|
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
|
||||||
|
|
||||||
|
@ -456,7 +458,7 @@
|
||||||
this.a = true;
|
this.a = true;
|
||||||
if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) {
|
if (world.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) world, blockposition)) {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
@@ -379,6 +693,51 @@
|
@@ -379,6 +695,51 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
d();
|
d();
|
||||||
|
@ -508,7 +510,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -387,7 +746,7 @@
|
@@ -387,7 +748,7 @@
|
||||||
LocaleLanguage localelanguage = LocaleLanguage.a();
|
LocaleLanguage localelanguage = LocaleLanguage.a();
|
||||||
|
|
||||||
registrymaterials.iterator().forEachRemaining((object) -> {
|
registrymaterials.iterator().forEachRemaining((object) -> {
|
||||||
|
@ -517,7 +519,7 @@
|
||||||
|
|
||||||
if (!localelanguage.b(s)) {
|
if (!localelanguage.b(s)) {
|
||||||
DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s);
|
DispenserRegistry.c.warn("Missing translation for {}: {} (key: \'{}\')", s1, registrymaterials.b(object), s);
|
||||||
@@ -481,6 +840,30 @@
|
@@ -481,6 +842,30 @@
|
||||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
|
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
|
||||||
EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
|
EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
|
||||||
|
|
||||||
|
@ -548,7 +550,7 @@
|
||||||
this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS;
|
this.a = ((ItemBlock) item).a((BlockActionContext) (new DispenserRegistry.b(isourceblock.getWorld(), blockposition, enumdirection, itemstack, enumdirection1))) == EnumInteractionResult.SUCCESS;
|
||||||
if (this.a) {
|
if (this.a) {
|
||||||
itemstack.subtract(1);
|
itemstack.subtract(1);
|
||||||
@@ -534,12 +917,40 @@
|
@@ -534,12 +919,40 @@
|
||||||
d3 = 0.0D;
|
d3 = 0.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue