Skip to content

Commit 0ca2288

Browse files
Fix bonsai pot crash
1 parent aeefe55 commit 0ca2288

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/main/java/com/ferreusveritas/dynamictrees/blocks/BlockBonsaiPot.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import javax.annotation.Nullable;
99

10-
import com.ferreusveritas.dynamictrees.ModTrees;
1110
import com.ferreusveritas.dynamictrees.trees.DynamicTree;
1211
import com.ferreusveritas.dynamictrees.trees.Species;
1312
import com.ferreusveritas.dynamictrees.util.CompatHelper;
@@ -52,13 +51,10 @@ public BlockBonsaiPot(String name) {
5251
setDefaultState(this.blockState.getBaseState().withProperty(BlockSapling.TYPE, BlockPlanks.EnumType.OAK));
5352
setUnlocalizedName(name);
5453
setRegistryName(name);
55-
mapTrees();
5654
}
5755

58-
private void mapTrees() {
59-
for(DynamicTree tree: ModTrees.baseTrees) {
60-
trees.put(tree.getPrimitiveSapling().getValue(BlockSapling.TYPE).ordinal(), tree);
61-
}
56+
public void setupVanillaTree(DynamicTree tree) {
57+
trees.put(tree.getPrimitiveSapling().getValue(BlockSapling.TYPE).ordinal(), tree);
6258
}
6359

6460
//////////////////////////////

src/main/java/com/ferreusveritas/dynamictrees/trees/DynamicTree.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ private void simpleVanillaSetup(BlockPlanks.EnumType wood) {
153153
}
154154

155155
setPrimitiveSapling(Blocks.SAPLING.getDefaultState().withProperty(BlockSapling.TYPE, wood));
156+
ModBlocks.blockBonsaiPot.setupVanillaTree(this);//Setup the bonsai pot to receive this type of tree
156157

157158
simpleVanillaCommonSpecies(wood);
158159
}

0 commit comments

Comments
 (0)