mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Fix #1959 Forestry leaves causing server crash
This commit is contained in:
1 parent
eea193aa83
commit
34be92d462
1 file changed
+6
-1
@@ -2,13 +2,14 @@ package forestry.arboriculture;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.arboriculture.blocks.BlockAbstractLeaves;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLeaves;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.arboriculture.blocks.BlockAbstractLeaves;
|
||||
|
||||
/**
|
||||
* Based on vanilla leaf decay in {@link BlockLeaves#updateTick(World, BlockPos, IBlockState, Random)}
|
||||
* but accepts leaves that are connected further from a trunk
|
||||
@@ -30,6 +31,10 @@ public class LeafDecayHelper {
|
||||
}
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
|
||||
if(!state.getProperties().containsKey(BlockLeaves.DECAYABLE)){
|
||||
return;
|
||||
}
|
||||
|
||||
// Fix a bug where Forestry leaves were not decayable.
|
||||
// The non-decayable Forestry leaves are all BlockDecorativeLeaves.
|
||||
if (!state.getValue(BlockLeaves.DECAYABLE)) {
|
||||
|
||||
Reference in new issue
Block a user