mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Fix #1681 Worldgen leaves are not decaying
This commit is contained in:
1 parent
f7cc35d949
commit
828dd63acd
2 files changed
+14
-4
No files matched your search
@@ -2,6 +2,7 @@ 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;
|
||||
@@ -23,12 +24,19 @@ public class LeafDecayHelper {
|
||||
leafDecayValues = new byte[ARRAY_SIZE][ARRAY_SIZE][ARRAY_SIZE];
|
||||
}
|
||||
|
||||
public static void leafDecay(BlockLeaves leaves, World world, BlockPos pos) {
|
||||
public static void leafDecay(BlockAbstractLeaves leaves, World world, BlockPos pos) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
|
||||
// Fix a bug where Forestry leaves were not decayable.
|
||||
// The non-decayable Forestry leaves are all BlockDecorativeLeaves.
|
||||
if (!state.getValue(BlockLeaves.DECAYABLE)) {
|
||||
state = state.withProperty(BlockLeaves.DECAYABLE, true);
|
||||
world.setBlockState(pos, state);
|
||||
}
|
||||
|
||||
if (state.getValue(BlockLeaves.CHECK_DECAY) && state.getValue(BlockLeaves.DECAYABLE)) {
|
||||
byte radius = 4;
|
||||
int arrayOffset = ARRAY_SIZE / 2;
|
||||
|
||||
Reference in new issue
Block a user