From 9c9037e6d3af42afe61f620cd9c1bcf6fa36298d Mon Sep 17 00:00:00 2001 From: Adubbz Date: Fri, 10 Apr 2015 21:27:21 +1000 Subject: [PATCH] Fixed pick block on leaves, fixed an error reading config files on second run (stages weren't being added to wrapped generators) --- .../api/biome/generation/GeneratorWeighted.java | 1 + .../java/biomesoplenty/common/block/BlockBOPLeaves.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/biomesoplenty/api/biome/generation/GeneratorWeighted.java b/src/main/java/biomesoplenty/api/biome/generation/GeneratorWeighted.java index 819f8c573..8bd1e8e0a 100644 --- a/src/main/java/biomesoplenty/api/biome/generation/GeneratorWeighted.java +++ b/src/main/java/biomesoplenty/api/biome/generation/GeneratorWeighted.java @@ -29,6 +29,7 @@ public class GeneratorWeighted extends GeneratorCustomizable public void add(int weight, IGenerator entry) { + entry.setStage(GeneratorStage.PARENT); this.weightedEntries.add(new GeneratorWeightedEntry(weight, entry)); } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java index 15696a83f..58c1a9fff 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java @@ -126,7 +126,6 @@ public abstract class BlockBOPLeaves extends BlockLeaves implements IBOPBlock return i; } - @Override protected int getSaplingDropChance(IBlockState state) { @@ -148,8 +147,10 @@ public abstract class BlockBOPLeaves extends BlockLeaves implements IBOPBlock @Override public int damageDropped(IBlockState state) { - AllTrees tree = ((AllTrees) state.getValue(getMyVariantProperty())); - return tree.ordinal() % 8; + //Ignore all other properties, only the variant is important to ensure different variants use different stacks + PropertyEnum property = getMyVariantProperty(); + AllTrees tree = ((AllTrees) state.getValue(property)); + return this.getMetaFromState(this.getDefaultState().withProperty(property, tree)); } // TODO: different fruits for different trees?