Refactored custom cactus JoCode
@@ -36,7 +36,7 @@ import net.minecraftforge.registries.IForgeRegistry;
public class TreeCactus extends DynamicTree {
- // TODO: Seeds, sapling, remove vanilla cactus world generation, add more JoCodes to the file, tweak growth pattern
+ // TODO: Seeds, sapling, add more JoCodes to the file, tweak growth pattern if necessary
// This is still WIP, just committing it now to sync up with other changes.
public class SpeciesCactus extends Species {
@@ -52,12 +52,11 @@ public class TreeCactus extends DynamicTree {
envFactor(Type.SANDY, 1.05f);
addAcceptableSoil(Blocks.SAND, Blocks.HARDENED_CLAY); //TODO: remove dirt and grass and add rooty sand or something
+ }
- // TODO: Clean up this mess (maybe make JoCode use an interface like ITreeGenerator for easier custom tree generation)
- joCodeStore = new TreeCodeStore(this) {
@Override
- public void addCode(Species species, int radius, String code) {
- JoCode joCode = new JoCode(code) {
+ public JoCode getJoCode(String joCodeString) {
+ return new JoCode(joCodeString) {
@Override
public void generate(World world, Species species, BlockPos rootPos, Biome biome, EnumFacing facing, int radius) {
IBlockState initialState = world.getBlockState(rootPos); // Save the initial state of the dirt in case this fails
@@ -121,12 +120,7 @@ public class TreeCactus extends DynamicTree {
return codePos;
}
- }.setCareful(false);
- getListForRadius(radius).add(joCode);
- }
};
- addJoCodes();
-
}
@Override
