From f2c7d37d6a72016803ffec1be49916981c1c2768 Mon Sep 17 00:00:00 2001 From: Max Hyper Date: Mon, 1 May 2023 13:45:59 -0300 Subject: [PATCH] fixed crashes in latest version --- gradle.properties | 6 ++-- .../dtbop/tree/CypressSpecies.java | 35 +++---------------- .../dtbop/tree/TwigletSpecies.java | 2 +- .../trees/dtbop/species/cypress_willow.json | 2 +- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/gradle.properties b/gradle.properties index e20330ce..f6b44ffb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ modName=DynamicTreesBOP modId=dtbop -modVersion=3.0.0-Beta3 +modVersion=3.0.0-Beta4 group=therealeststu.dtbop mcVersion=1.18.2 forgeVersion=40.1.84 mappingsVersion=2022.09.04 -dynamicTreesVersion=0.11.0-Beta6 -dynamicTreesPlusVersion=0.1.0-Beta2 +dynamicTreesVersion=0.11.0-Beta10.1 +dynamicTreesPlusVersion=0.2.0-Beta4 jeiVersion=9.7.1.255 ccVersion=1.100.10 suggestionProviderFixVersion=1.0.0 diff --git a/src/main/java/therealeststu/dtbop/tree/CypressSpecies.java b/src/main/java/therealeststu/dtbop/tree/CypressSpecies.java index 5d0ee2ab..127e610f 100644 --- a/src/main/java/therealeststu/dtbop/tree/CypressSpecies.java +++ b/src/main/java/therealeststu/dtbop/tree/CypressSpecies.java @@ -42,8 +42,7 @@ public boolean isAcceptableSoilForWorldgen(LevelAccessor level, BlockPos pos, Bl } @Override - public BlockPos preGeneration(LevelAccessor level, BlockPos rootPosition, int radius, Direction facing, SafeChunkBounds safeBounds, JoCode joCode) { - BlockPos root = rootPosition; + public BlockPos preGeneration(LevelAccessor level, BlockPos.MutableBlockPos rootPosition, int radius, Direction facing, SafeChunkBounds safeBounds, JoCode joCode) { if (this.isWater(level.getBlockState(rootPosition))) { int i = 1; for (; i <= maxDepth; i++) { @@ -53,39 +52,13 @@ public BlockPos preGeneration(LevelAccessor level, BlockPos rootPosition, int ra if (!isWater(downState) && isAcceptableSoilUnderWater(downState)) break; } - root = root.below(i); + rootPosition.move(Direction.DOWN, i); } - return super.preGeneration(level, root, radius, facing, safeBounds, joCode); + return super.preGeneration(level, rootPosition, radius, facing, safeBounds, joCode); } public boolean isAcceptableSoilUnderWater(BlockState soilBlockState) { - return SoilHelper.isSoilAcceptable(soilBlockState, this.soilTypeFlags | SoilHelper.getSoilFlags("sand_like", "mud_like"), true); + return SoilHelper.isSoilAcceptable(soilBlockState, this.soilTypeFlags | SoilHelper.getSoilFlags("sand_like", "mud_like")); } - // @Override -// public boolean placeRootyDirtBlock(IWorld world, BlockPos rootPos, int fertility) { -// if (this.isWater(world.getBlockState(rootPos))) -// return world.setBlock(rootPos, (DTBOPRegistries.largeRootyWater.defaultBlockState().setValue(RootyBlock.FERTILITY, fertility)).setValue(RootyBlock.IS_VARIANT, this.doesRequireTileEntity(world, rootPos)), 3); -// else -// return super.placeRootyDirtBlock(world, rootPos, fertility); -// } - -// @Override -// public boolean postGrow(World world, BlockPos rootPos, BlockPos treePos, int fertility, boolean natural) { -// if (world.getBlockState(rootPos).getBlock() == RootyBlockHelper.getRootyBlock(Blocks.WATER)){ -// if (TreeHelper.isBranch(world.getBlockState(rootPos.above()))){ -// int radius = TreeHelper.getRadius(world, rootPos.above()); -// if (radius >= 8){ -// TileEntity rootTE = world.getBlockEntity(rootPos); -// world.setBlockAndUpdate(rootPos, DTBOPRegistries.largeRootyWater.defaultBlockState() -// .setValue(RootyBlock.FERTILITY, fertility) -// .setValue(RootyBlock.IS_VARIANT, world.getBlockState(rootPos).getValue(RootyBlock.IS_VARIANT))); -// if (rootTE != null) -// world.setBlockEntity(rootPos, rootTE); -// } -// } -// } -// return super.postGrow(world, rootPos, treePos, fertility, natural); -// } - } diff --git a/src/main/java/therealeststu/dtbop/tree/TwigletSpecies.java b/src/main/java/therealeststu/dtbop/tree/TwigletSpecies.java index 8f0b84b3..f74f841f 100644 --- a/src/main/java/therealeststu/dtbop/tree/TwigletSpecies.java +++ b/src/main/java/therealeststu/dtbop/tree/TwigletSpecies.java @@ -17,7 +17,7 @@ public TwigletSpecies(ResourceLocation name, Family family, LeavesProperties lea } @Override - protected void processVolume(NetVolumeNode.Volume volume) { + public void processVolume(NetVolumeNode.Volume volume) { volume.addVolume(NetVolumeNode.Volume.VOXELSPERLOG); super.processVolume(volume); } diff --git a/src/main/resources/trees/dtbop/species/cypress_willow.json b/src/main/resources/trees/dtbop/species/cypress_willow.json index 99ea1aef..b5ccd749 100644 --- a/src/main/resources/trees/dtbop/species/cypress_willow.json +++ b/src/main/resources/trees/dtbop/species/cypress_willow.json @@ -15,7 +15,7 @@ "dry": 0.5 }, "perfect_biomes": { "types": [ "swamp", "overworld" ] }, - "acceptable_soils": [ "water_like", "dirt_like" ], + "acceptable_soils": [ "water_like", "dirt_like", "mud_like" ], "features": [ { "name": "vines",