mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-10 22:05:10 +01:00
SPIGOT-7137: StructureGrowEvent isFromBonemeal and getPlayer have incorrect values
By: md_5 <git@md-5.net>
This commit is contained in:
parent
5fa8a6d631
commit
8b2749a446
@ -21,15 +21,17 @@
|
|||||||
|
|
||||||
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) {
|
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) {
|
||||||
super(blockbase_info);
|
super(blockbase_info);
|
||||||
@@ -44,7 +52,30 @@
|
@@ -44,7 +52,32 @@
|
||||||
if ((Integer) iblockdata.getValue(BlockSapling.STAGE) == 0) {
|
if ((Integer) iblockdata.getValue(BlockSapling.STAGE) == 0) {
|
||||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.cycle(BlockSapling.STAGE), 4);
|
worldserver.setBlock(blockposition, (IBlockData) iblockdata.cycle(BlockSapling.STAGE), 4);
|
||||||
} else {
|
} else {
|
||||||
|
- this.treeGrower.growTree(worldserver, worldserver.getChunkSource().getGenerator(), blockposition, iblockdata, randomsource);
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
|
+ if (worldserver.captureTreeGeneration) {
|
||||||
|
+ this.treeGrower.growTree(worldserver, worldserver.getChunkSource().getGenerator(), blockposition, iblockdata, randomsource);
|
||||||
|
+ } else {
|
||||||
+ worldserver.captureTreeGeneration = true;
|
+ worldserver.captureTreeGeneration = true;
|
||||||
+ // CraftBukkit end
|
+ this.treeGrower.growTree(worldserver, worldserver.getChunkSource().getGenerator(), blockposition, iblockdata, randomsource);
|
||||||
this.treeGrower.growTree(worldserver, worldserver.getChunkSource().getGenerator(), blockposition, iblockdata, randomsource);
|
|
||||||
+ // CraftBukkit start
|
|
||||||
+ worldserver.captureTreeGeneration = false;
|
+ worldserver.captureTreeGeneration = false;
|
||||||
+ if (worldserver.capturedBlockStates.size() > 0) {
|
+ if (worldserver.capturedBlockStates.size() > 0) {
|
||||||
+ TreeType treeType = BlockSapling.treeType;
|
+ TreeType treeType = BlockSapling.treeType;
|
||||||
@ -48,6 +50,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user