From 4a2e81550fc110d82597904e41e43935bacf2956 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Tue, 16 Nov 2021 22:38:31 +0000 Subject: [PATCH] Port to 1.18-pre2 without worldgen --- .../java/reborncore/client/RenderUtil.java | 8 +-- .../common/BaseBlockEntityProvider.java | 2 +- .../blockentity/MachineBaseBlockEntity.java | 8 +-- .../multiblock/MultiblockBlockEntityBase.java | 5 +- .../multiblock/MultiblockControllerBase.java | 2 +- .../common/network/ClientBoundPackets.java | 2 +- .../powerSystem/PowerAcceptorBlockEntity.java | 3 +- build.gradle | 12 ++-- gradle.properties | 6 +- .../test/machine/GrinderTest.groovy | 2 +- src/main/java/techreborn/TechReborn.java | 2 +- .../blockentity/cable/CableBlockEntity.java | 7 +- .../blockentity/cable/CableTickManager.java | 2 +- .../BaseFluidGeneratorBlockEntity.java | 3 +- .../basic/SolidFuelGeneratorBlockEntity.java | 3 +- .../iron/AbstractIronMachineBlockEntity.java | 3 +- .../machine/iron/IronFurnaceBlockEntity.java | 3 +- .../machine/misc/AlarmBlockEntity.java | 3 +- .../FluidReplicatorBlockEntity.java | 3 +- .../FusionControlComputerBlockEntity.java | 3 +- .../IndustrialGrinderBlockEntity.java | 3 +- .../IndustrialSawmillBlockEntity.java | 3 +- .../tier1/AutoCraftingTableBlockEntity.java | 3 +- .../tier1/PlayerDetectorBlockEntity.java | 3 +- .../machine/tier1/ResinBasinBlockEntity.java | 4 +- .../tier1/RollingMachineBlockEntity.java | 3 +- .../machine/tier3/ChunkLoaderBlockEntity.java | 3 +- .../energy/AdjustableSUBlockEntity.java | 3 +- .../idsu/InterdimensionalSUBlockEntity.java | 5 +- .../fluid/TankUnitBaseBlockEntity.java | 3 +- .../item/StorageUnitBaseBlockEntity.java | 3 +- .../techreborn/blocks/cable/CableBlock.java | 2 +- .../render/entitys/StorageUnitRenderer.java | 4 +- .../techreborn/world/DataDrivenFeature.java | 36 +++++----- .../techreborn/world/DefaultWorldGen.java | 70 +++++++++---------- .../world/RubberSaplingGenerator.java | 11 ++- .../techreborn/world/RubberTreeDecorator.java | 43 ++++++------ .../java/techreborn/world/WorldGenerator.java | 6 +- 38 files changed, 132 insertions(+), 158 deletions(-) diff --git a/RebornCore/src/main/java/reborncore/client/RenderUtil.java b/RebornCore/src/main/java/reborncore/client/RenderUtil.java index 81f0e0f6e..c4e19b79d 100644 --- a/RebornCore/src/main/java/reborncore/client/RenderUtil.java +++ b/RebornCore/src/main/java/reborncore/client/RenderUtil.java @@ -145,10 +145,10 @@ public class RenderUtil { float l = (endColor >> 8 & 0xFF) / 255.0F; float m = (endColor & 0xFF) / 255.0F; - bufferBuilder.vertex(matrices.peek().getModel(), right, top, zLevel).color(g, h, i, f).next(); - bufferBuilder.vertex(matrices.peek().getModel(), left, top, zLevel).color(g, h, i, f).next(); - bufferBuilder.vertex(matrices.peek().getModel(), left, bottom, zLevel).color(k, l, m, j).next(); - bufferBuilder.vertex(matrices.peek().getModel(), right, bottom, zLevel).color(k, l, m, j).next(); + bufferBuilder.vertex(matrices.peek().getPositionMatrix(), right, top, zLevel).color(g, h, i, f).next(); + bufferBuilder.vertex(matrices.peek().getPositionMatrix(), left, top, zLevel).color(g, h, i, f).next(); + bufferBuilder.vertex(matrices.peek().getPositionMatrix(), left, bottom, zLevel).color(k, l, m, j).next(); + bufferBuilder.vertex(matrices.peek().getPositionMatrix(), right, bottom, zLevel).color(k, l, m, j).next(); tessellator.draw(); RenderSystem.disableBlend(); diff --git a/RebornCore/src/main/java/reborncore/common/BaseBlockEntityProvider.java b/RebornCore/src/main/java/reborncore/common/BaseBlockEntityProvider.java index cb18145f4..ec3e0b60a 100644 --- a/RebornCore/src/main/java/reborncore/common/BaseBlockEntityProvider.java +++ b/RebornCore/src/main/java/reborncore/common/BaseBlockEntityProvider.java @@ -50,7 +50,7 @@ public abstract class BaseBlockEntityProvider extends Block implements BlockEnti return Optional.empty(); } ItemStack newStack = stack.copy(); - NbtCompound blockEntityData = blockEntity.writeNbt(new NbtCompound()); + NbtCompound blockEntityData = blockEntity.createNbt(); stripLocationData(blockEntityData); if (!newStack.hasNbt()) { newStack.setNbt(new NbtCompound()); diff --git a/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java b/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java index b71049088..d94c19e30 100644 --- a/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java +++ b/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java @@ -126,12 +126,13 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi @Nullable @Override public BlockEntityUpdateS2CPacket toUpdatePacket() { - return new BlockEntityUpdateS2CPacket(getPos(), 0, toInitialChunkDataNbt()); + return BlockEntityUpdateS2CPacket.create(this); } @Override public NbtCompound toInitialChunkDataNbt() { - NbtCompound compound = super.writeNbt(new NbtCompound()); + NbtCompound compound = new NbtCompound(); + super.writeNbt(compound); writeNbt(compound); return compound; } @@ -257,7 +258,7 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } @Override - public NbtCompound writeNbt(NbtCompound tagCompound) { + public void writeNbt(NbtCompound tagCompound) { super.writeNbt(tagCompound); if (getOptionalInventory().isPresent()) { getOptionalInventory().get().write(tagCompound); @@ -273,7 +274,6 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } upgradeInventory.write(tagCompound, "Upgrades"); tagCompound.put("redstoneConfig", redstoneConfiguration.write()); - return tagCompound; } private boolean isItemValidForSlot(int index, ItemStack stack) { diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java index 80bd4b80a..7bfb7ddc0 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java @@ -125,7 +125,7 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen } @Override - public NbtCompound writeNbt(NbtCompound data) { + public void writeNbt(NbtCompound data) { super.writeNbt(data); if (isMultiblockSaveDelegate() && isConnected()) { @@ -133,7 +133,6 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen this.controller.write(multiblockData); data.put("multiblockData", multiblockData); } - return data; } @Override @@ -175,7 +174,7 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen public BlockEntityUpdateS2CPacket toUpdatePacket() { NbtCompound packetData = new NbtCompound(); encodeDescriptionPacket(packetData); - return new BlockEntityUpdateS2CPacket(getPos(), 0, packetData); + return BlockEntityUpdateS2CPacket.create(this); } // /// Things to override in most implementations (IMultiblockPart) diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java index ea96e7184..18c4cbd3b 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java @@ -556,7 +556,7 @@ public abstract class MultiblockControllerBase { // Ensure that we save our data, even if the our save // delegate is in has no TEs. WorldChunk chunkToSave = this.worldObj.getChunk(x, z); - chunkToSave.markDirty(); + chunkToSave.needsSaving(); } } } diff --git a/RebornCore/src/main/java/reborncore/common/network/ClientBoundPackets.java b/RebornCore/src/main/java/reborncore/common/network/ClientBoundPackets.java index eebad58fd..b2a7dd0de 100644 --- a/RebornCore/src/main/java/reborncore/common/network/ClientBoundPackets.java +++ b/RebornCore/src/main/java/reborncore/common/network/ClientBoundPackets.java @@ -39,7 +39,7 @@ import java.util.List; public class ClientBoundPackets { public static IdentifiedPacket createCustomDescriptionPacket(BlockEntity blockEntity) { - return createCustomDescriptionPacket(blockEntity.getPos(), blockEntity.writeNbt(new NbtCompound())); + return createCustomDescriptionPacket(blockEntity.getPos(), blockEntity.createNbt()); } public static IdentifiedPacket createCustomDescriptionPacket(BlockPos blockPos, NbtCompound nbt) { diff --git a/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java b/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java index c21d755d2..817a07900 100644 --- a/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java +++ b/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java @@ -352,12 +352,11 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im } @Override - public NbtCompound writeNbt(NbtCompound tag) { + public void writeNbt(NbtCompound tag) { super.writeNbt(tag); NbtCompound data = new NbtCompound(); data.putLong("energy", getStored()); tag.put("PowerAcceptor", data); - return tag; } @Override diff --git a/build.gradle b/build.gradle index 1cad75704..3284e65a6 100644 --- a/build.gradle +++ b/build.gradle @@ -79,8 +79,8 @@ allprojects { apply plugin: "fabric-loom" apply plugin: "maven-publish" - sourceCompatibility = JavaVersion.VERSION_16 - targetCompatibility = JavaVersion.VERSION_16 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 // Shared deps between TR and RC dependencies { @@ -91,7 +91,9 @@ allprojects { //Fabric api modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" - include(modApi("teamreborn:energy:${project.energy_version}")) + include(modApi("teamreborn:energy:${project.energy_version}")) { + transitive = false + } } processResources { @@ -104,7 +106,7 @@ allprojects { tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" - it.options.release = 16 + it.options.release = 17 } java { @@ -149,7 +151,7 @@ dependencies { api project(path: ":RebornCore", configuration: "namedElements") include project(":RebornCore") - optionalDependency "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" + disabledOptionalDependency "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" disabledOptionalDependency "com.github.emilyploszaj:trinkets:${project.trinkets_version}" disabledOptionalDependency "com.github.dexman545:autoswitch-api:${project.autoswitch_version}" disabledOptionalDependency "net.oskarstrom:DashLoader:${project.dashloader_version}" diff --git a/gradle.properties b/gradle.properties index 674febe4d..a6bb3f218 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,10 +6,10 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties # check these on https://modmuss50.me/fabric.html - minecraft_version=1.17.1 - yarn_version=1.17.1+build.63:v2 + minecraft_version=1.18-pre2 + yarn_version=1.18-pre2+build.1:v2 loader_version=0.12.5 - fapi_version=0.42.1+1.17 + fapi_version=0.42.4+1.18 # Dependencies energy_version=2.0.0-beta1 diff --git a/src/gametest/groovy/techreborn/test/machine/GrinderTest.groovy b/src/gametest/groovy/techreborn/test/machine/GrinderTest.groovy index 83b4fe9c5..fc03e74ba 100644 --- a/src/gametest/groovy/techreborn/test/machine/GrinderTest.groovy +++ b/src/gametest/groovy/techreborn/test/machine/GrinderTest.groovy @@ -32,7 +32,7 @@ import techreborn.test.TRGameTest import techreborn.test.TRTestContext class GrinderTest extends TRGameTest { - @GameTest(structureName = EMPTY_STRUCTURE, tickLimit = 150) + @GameTest(structureName = "fabric-gametest-api-v1:empty", tickLimit = 150) def testGrind2OCs(TRTestContext context) { /** * Test that grinder with 2 overclocker upgrades grinds coal into coal dust in 116 ticks diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index 233f72deb..6ec4971e9 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -85,7 +85,7 @@ public class TechReborn implements ModInitializer { RecipeCrafter.soundHanlder = new ModSounds.SoundHandler(); } ModLoot.init(); - WorldGenerator.initWorldGen(); +// WorldGenerator.initWorldGen(); FluidGeneratorRecipes.init(); //Force loads the block entities at the right time //noinspection ResultOfMethodCallIgnored diff --git a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java index bc360e0cd..9b299bdc9 100644 --- a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java @@ -199,14 +199,14 @@ public class CableBlockEntity extends BlockEntity // BlockEntity @Override public NbtCompound toInitialChunkDataNbt() { - return writeNbt(new NbtCompound()); + return createNbt(); } @Override public BlockEntityUpdateS2CPacket toUpdatePacket() { NbtCompound nbtTag = new NbtCompound(); writeNbt(nbtTag); - return new BlockEntityUpdateS2CPacket(getPos(), 1, nbtTag); + return BlockEntityUpdateS2CPacket.create(this); } @Override @@ -223,13 +223,12 @@ public class CableBlockEntity extends BlockEntity } @Override - public NbtCompound writeNbt(NbtCompound compound) { + public void writeNbt(NbtCompound compound) { super.writeNbt(compound); compound.putLong("energy", energyContainer.amount); if (cover != null) { compound.put("cover", NbtHelper.fromBlockState(cover)); } - return compound; } public void neighborUpdate() { diff --git a/src/main/java/techreborn/blockentity/cable/CableTickManager.java b/src/main/java/techreborn/blockentity/cable/CableTickManager.java index 81b4b9c55..10bf2df24 100644 --- a/src/main/java/techreborn/blockentity/cable/CableTickManager.java +++ b/src/main/java/techreborn/blockentity/cable/CableTickManager.java @@ -75,7 +75,7 @@ class CableTickManager { // Make sure we only gather and tick each cable once per tick. if (current.lastTick == tickCounter) return false; // Make sure we ignore cables in non-ticking chunks. - if (!(current.getWorld() instanceof ServerWorld sw) || !sw.method_37117(current.getPos())) return false; + if (!(current.getWorld() instanceof ServerWorld sw) || !sw.isChunkLoaded(current.getPos())) return false; return true; } diff --git a/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java index e09983833..6e98ee517 100644 --- a/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java @@ -173,10 +173,9 @@ public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEn } @Override - public NbtCompound writeNbt(NbtCompound tagCompound) { + public void writeNbt(NbtCompound tagCompound) { super.writeNbt(tagCompound); tank.write(tagCompound); - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java index f083bd001..c302a913a 100644 --- a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java @@ -159,11 +159,10 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl } @Override - public NbtCompound writeNbt(NbtCompound tag) { + public void writeNbt(NbtCompound tag) { super.writeNbt(tag); tag.putInt("BurnTime", burnTime); tag.putInt("TotalBurnTime", totalBurnTime); - return tag; } // MachineBaseBlockEntity diff --git a/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java index 2613fd0ae..9617de7c7 100644 --- a/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java @@ -141,12 +141,11 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt } @Override - public NbtCompound writeNbt(NbtCompound compoundTag) { + public void writeNbt(NbtCompound compoundTag) { super.writeNbt(compoundTag); compoundTag.putInt("BurnTime", burnTime); compoundTag.putInt("TotalBurnTime", totalBurnTime); compoundTag.putInt("Progress", progress); - return compoundTag; } @Override diff --git a/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java index 437ecdb84..3819103ca 100644 --- a/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java @@ -149,10 +149,9 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple } @Override - public NbtCompound writeNbt(NbtCompound compoundTag) { + public void writeNbt(NbtCompound compoundTag) { super.writeNbt(compoundTag); compoundTag.putFloat("Experience", experience); - return compoundTag; } // IContainerProvider diff --git a/src/main/java/techreborn/blockentity/machine/misc/AlarmBlockEntity.java b/src/main/java/techreborn/blockentity/machine/misc/AlarmBlockEntity.java index 70773fa56..14e701eaa 100644 --- a/src/main/java/techreborn/blockentity/machine/misc/AlarmBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/misc/AlarmBlockEntity.java @@ -68,12 +68,11 @@ public class AlarmBlockEntity extends BlockEntity // BlockEntity @Override - public NbtCompound writeNbt(NbtCompound compound) { + public void writeNbt(NbtCompound compound) { if (compound == null) { compound = new NbtCompound(); } compound.putInt("selectedSound", this.selectedSound); - return super.writeNbt(compound); } @Override diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java index c7ee6ed06..7e86075b7 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java @@ -107,10 +107,9 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem } @Override - public NbtCompound writeNbt(final NbtCompound tagCompound) { + public void writeNbt(final NbtCompound tagCompound) { super.writeNbt(tagCompound); tank.write(tagCompound); - return tagCompound; } private static IInventoryAccess getInventoryAccess() { diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java index 3d80a13c0..271acb6b9 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java @@ -371,14 +371,13 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity } @Override - public NbtCompound writeNbt(final NbtCompound tagCompound) { + public void writeNbt(final NbtCompound tagCompound) { super.writeNbt(tagCompound); tagCompound.putInt("craftingTickTime", this.craftingTickTime); tagCompound.putInt("neededPower", this.neededPower); tagCompound.putBoolean("hasStartedCrafting", this.hasStartedCrafting); tagCompound.putBoolean("hasActiveRecipe", this.currentRecipe != null); tagCompound.putInt("size", size); - return tagCompound; } //MachineBaseBlockEntity diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java index f5f6232ca..1834502c4 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java @@ -101,10 +101,9 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl } @Override - public NbtCompound writeNbt(final NbtCompound tagCompound) { + public void writeNbt(final NbtCompound tagCompound) { super.writeNbt(tagCompound); tank.write(tagCompound); - return tagCompound; } // TileMachineBase diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java index 92c614102..1fb3a772f 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java @@ -102,10 +102,9 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl } @Override - public NbtCompound writeNbt(final NbtCompound tagCompound) { + public void writeNbt(final NbtCompound tagCompound) { super.writeNbt(tagCompound); tank.write(tagCompound); - return tagCompound; } // TileMachineBase diff --git a/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java index 00842a09e..fb01ce78d 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java @@ -407,9 +407,8 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity } @Override - public NbtCompound writeNbt(NbtCompound tag) { + public void writeNbt(NbtCompound tag) { tag.putBoolean("locked", locked); - return super.writeNbt(tag); } @Override diff --git a/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java index bf135c10d..59e1088e7 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java @@ -141,11 +141,10 @@ public class PlayerDetectorBlockEntity extends PowerAcceptorBlockEntity implemen } @Override - public NbtCompound writeNbt(NbtCompound tag) { + public void writeNbt(NbtCompound tag) { super.writeNbt(tag); tag.putString("ownerID", ownerUdid); tag.putInt("radius", radius); - return tag; } // MachineBaseBlockEntity diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java index 9901cf293..245823a50 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java @@ -148,10 +148,8 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity { } @Override - public NbtCompound writeNbt(NbtCompound tagCompound) { + public void writeNbt(NbtCompound tagCompound) { super.writeNbt(tagCompound); - - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java index 1f2486877..38d5e386b 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java @@ -354,12 +354,11 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity } @Override - public NbtCompound writeNbt(final NbtCompound tagCompound) { + public void writeNbt(final NbtCompound tagCompound) { super.writeNbt(tagCompound); tagCompound.putBoolean("isRunning", this.isRunning); tagCompound.putInt("tickTime", this.tickTime); tagCompound.putBoolean("locked", locked); - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java index 731439012..055a82d46 100644 --- a/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java @@ -123,14 +123,13 @@ public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IT } @Override - public NbtCompound writeNbt(NbtCompound tagCompound) { + public void writeNbt(NbtCompound tagCompound) { super.writeNbt(tagCompound); tagCompound.putInt("radius", radius); if (ownerUdid != null && !ownerUdid.isEmpty()){ tagCompound.putString("ownerUdid", ownerUdid); } inventory.write(tagCompound); - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java index a130b36ed..9718d1b93 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java @@ -141,10 +141,9 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements } @Override - public NbtCompound writeNbt(NbtCompound tagCompound) { + public void writeNbt(NbtCompound tagCompound) { super.writeNbt(tagCompound); tagCompound.putInt("output", OUTPUT); - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java index 5230fa236..80567a518 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java @@ -129,13 +129,12 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl } @Override - public NbtCompound writeNbt(NbtCompound nbttagcompound) { + public void writeNbt(NbtCompound nbttagcompound) { super.writeNbt(nbttagcompound); if (ownerUdid == null || StringUtils.isEmpty(ownerUdid)) { - return nbttagcompound; + return; } nbttagcompound.putString("ownerUdid", this.ownerUdid); - return nbttagcompound; } @Override diff --git a/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java b/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java index faad1fffa..090711787 100644 --- a/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java @@ -128,11 +128,10 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I } @Override - public NbtCompound writeNbt(final NbtCompound tagCompound) { + public void writeNbt(final NbtCompound tagCompound) { super.writeNbt(tagCompound); tagCompound.putString("unitType", this.type.name()); tank.write(tagCompound); - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java b/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java index cbcb83587..b3f9d478a 100644 --- a/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java @@ -318,7 +318,7 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement } @Override - public NbtCompound writeNbt(NbtCompound tagCompound) { + public void writeNbt(NbtCompound tagCompound) { super.writeNbt(tagCompound); tagCompound.putString("unitType", this.type.name()); @@ -342,7 +342,6 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement } inventory.write(tagCompound); - return tagCompound; } @Override diff --git a/src/main/java/techreborn/blocks/cable/CableBlock.java b/src/main/java/techreborn/blocks/cable/CableBlock.java index ed7330885..2223ba765 100644 --- a/src/main/java/techreborn/blocks/cable/CableBlock.java +++ b/src/main/java/techreborn/blocks/cable/CableBlock.java @@ -179,7 +179,7 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { public BlockState getStateForNeighborUpdate(BlockState ourState, Direction direction, BlockState otherState, WorldAccess worldIn, BlockPos ourPos, BlockPos otherPos) { if (ourState.get(WATERLOGGED)) { - worldIn.getFluidTickScheduler().schedule(ourPos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn)); + worldIn.createAndScheduleFluidTick(ourPos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn)); } return ourState; } diff --git a/src/main/java/techreborn/client/render/entitys/StorageUnitRenderer.java b/src/main/java/techreborn/client/render/entitys/StorageUnitRenderer.java index 3c1f6e7b9..015caab54 100644 --- a/src/main/java/techreborn/client/render/entitys/StorageUnitRenderer.java +++ b/src/main/java/techreborn/client/render/entitys/StorageUnitRenderer.java @@ -89,12 +89,12 @@ public class StorageUnitRenderer implements BlockEntityRenderer biomeSelector; - private final ConfiguredFeature configuredFeature; - private final GenerationStep.Feature generationStep; - private final Identifier identifier; + private Predicate biomeSelector; + private ConfiguredFeature configuredFeature; + private GenerationStep.Feature generationStep; + private Identifier identifier; - public DataDrivenFeature(Identifier identifier, Predicate biomeSelector, ConfiguredFeature configuredFeature, GenerationStep.Feature generationStep) { - this.identifier = identifier; - this.biomeSelector = biomeSelector; - this.configuredFeature = configuredFeature; - this.generationStep = generationStep; - } +// public DataDrivenFeature(Identifier identifier, Predicate biomeSelector, ConfiguredFeature configuredFeature, GenerationStep.Feature generationStep) { +// this.identifier = identifier; +// this.biomeSelector = biomeSelector; +// this.configuredFeature = configuredFeature; +// this.generationStep = generationStep; +// } @Deprecated public DataDrivenFeature(Identifier identifier, Predicate biomeSelector, RuleTest ruleTest, BlockState blockState, int maxY, int veinSize, int veinCount) { - this(identifier, biomeSelector, Feature.ORE.configure( - new OreFeatureConfig(ruleTest, blockState, veinSize) - ) - .uniformRange(YOffset.getBottom(), YOffset.fixed(maxY)) - .spreadHorizontally() - .repeat(veinCount), GenerationStep.Feature.UNDERGROUND_ORES); +// this(identifier, biomeSelector, Feature.ORE.configure( +// new OreFeatureConfig(ruleTest, blockState, veinSize) +// )); + // TODO 1.18 +// .uniformRange(YOffset.getBottom(), YOffset.fixed(maxY)) +// .spreadHorizontally() +// .repeat(veinCount), GenerationStep.Feature.UNDERGROUND_ORES); } public static DataDrivenFeature deserialise(Identifier identifier, JsonObject jsonObject) { @@ -97,7 +98,8 @@ public class DataDrivenFeature { throw new JsonParseException(s); }).getFeature(); - return new DataDrivenFeature(identifier, biomeSelector, configuredFeature, generationStep); + return null; +// return new DataDrivenFeature(identifier, biomeSelector, configuredFeature, generationStep); } public JsonObject serialise() { diff --git a/src/main/java/techreborn/world/DefaultWorldGen.java b/src/main/java/techreborn/world/DefaultWorldGen.java index 160e49d47..15b17dc75 100644 --- a/src/main/java/techreborn/world/DefaultWorldGen.java +++ b/src/main/java/techreborn/world/DefaultWorldGen.java @@ -34,19 +34,13 @@ import net.minecraft.structure.rule.RuleTest; import net.minecraft.util.Identifier; import net.minecraft.util.collection.DataPool; import net.minecraft.util.math.Direction; -import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.registry.Registry; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.decorator.ChanceDecoratorConfig; import net.minecraft.world.gen.feature.ConfiguredFeature; -import net.minecraft.world.gen.feature.OreFeatureConfig; -import net.minecraft.world.gen.feature.TreeFeatureConfig; -import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; +import net.minecraft.world.gen.feature.OreConfiguredFeatures; import net.minecraft.world.gen.stateprovider.BlockStateProvider; -import net.minecraft.world.gen.stateprovider.SimpleBlockStateProvider; import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; -import net.minecraft.world.gen.trunk.StraightTrunkPlacer; import org.apache.logging.log4j.util.TriConsumer; import techreborn.blocks.misc.BlockRubberLog; import techreborn.init.TRContent; @@ -79,19 +73,21 @@ public class DefaultWorldGen { BlockStateProvider logProvider = new WeightedBlockStateProvider(logPoolBuilder.build()); - TreeFeatureConfig treeFeatureConfig = new TreeFeatureConfig.Builder( - logProvider, - new StraightTrunkPlacer(6, 3, 0), - new SimpleBlockStateProvider(TRContent.RUBBER_LEAVES.getDefaultState()), - new SimpleBlockStateProvider(TRContent.RUBBER_SAPLING.getDefaultState()), - new RubberTreeFeature.FoliagePlacer(ConstantIntProvider.create(2), ConstantIntProvider.create(0), 3, 3, TRContent.RUBBER_LEAVES.getDefaultState()), - new TwoLayersFeatureSize(1, 0, 1) - ).build(); +// TreeFeatureConfig treeFeatureConfig = new TreeFeatureConfig.Builder( +// logProvider, +// new StraightTrunkPlacer(6, 3, 0), +// BlockStateProvider.of(TRContent.RUBBER_LEAVES.getDefaultState()), +// BlockStateProvider.of(TRContent.RUBBER_SAPLING.getDefaultState()), +// new RubberTreeFeature.FoliagePlacer(ConstantIntProvider.create(2), ConstantIntProvider.create(0), 3, 3, TRContent.RUBBER_LEAVES.getDefaultState()), +// new TwoLayersFeatureSize(1, 0, 1) +// ).build(); - return WorldGenerator.RUBBER_TREE_FEATURE.configure(treeFeatureConfig) - .decorate(WorldGenerator.RUBBER_TREE_DECORATOR - .configure(new ChanceDecoratorConfig(50) - )); + return null; // TODO 1.18 + +// return WorldGenerator.RUBBER_TREE_FEATURE.configure(treeFeatureConfig) +// .decorate(WorldGenerator.RUBBER_TREE_DECORATOR +// .configure(new ChanceDecoratorConfig(50) +// )); } public static List getDefaultFeatures() { @@ -99,31 +95,31 @@ public class DefaultWorldGen { TriConsumer, RuleTest, TRContent.Ores> addOre = (worldTargetType, ruleTest, ore) -> features.add(ore.asNewOres(new Identifier("techreborn", Registry.BLOCK.getId(ore.block).getPath()), worldTargetType, ruleTest)); - addOre.accept(BiomeSelectors.foundInTheNether(), OreFeatureConfig.Rules.BASE_STONE_NETHER, TRContent.Ores.CINNABAR); - addOre.accept(BiomeSelectors.foundInTheNether(), OreFeatureConfig.Rules.BASE_STONE_NETHER, TRContent.Ores.PYRITE); - addOre.accept(BiomeSelectors.foundInTheNether(), OreFeatureConfig.Rules.BASE_STONE_NETHER, TRContent.Ores.SPHALERITE); + addOre.accept(BiomeSelectors.foundInTheNether(), OreConfiguredFeatures.BASE_STONE_NETHER, TRContent.Ores.CINNABAR); + addOre.accept(BiomeSelectors.foundInTheNether(), OreConfiguredFeatures.BASE_STONE_NETHER, TRContent.Ores.PYRITE); + addOre.accept(BiomeSelectors.foundInTheNether(), OreConfiguredFeatures.BASE_STONE_NETHER, TRContent.Ores.SPHALERITE); addOre.accept(BiomeSelectors.foundInTheEnd(), END_STONE, TRContent.Ores.PERIDOT); addOre.accept(BiomeSelectors.foundInTheEnd(), END_STONE, TRContent.Ores.SHELDONITE); addOre.accept(BiomeSelectors.foundInTheEnd(), END_STONE, TRContent.Ores.SODALITE); addOre.accept(BiomeSelectors.foundInTheEnd(), END_STONE, TRContent.Ores.TUNGSTEN); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.BAUXITE); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.GALENA); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.IRIDIUM); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.LEAD); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.RUBY); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.SAPPHIRE); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.SILVER); - addOre.accept(BiomeSelectors.foundInOverworld(), OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, TRContent.Ores.TIN); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.BAUXITE); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.GALENA); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.IRIDIUM); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.LEAD); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.RUBY); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.SAPPHIRE); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.SILVER); + addOre.accept(BiomeSelectors.foundInOverworld(), OreConfiguredFeatures.BASE_STONE_OVERWORLD, TRContent.Ores.TIN); - - features.add(new DataDrivenFeature( - RubberSaplingGenerator.IDENTIFIER, - BiomeSelectors.categories(Biome.Category.FOREST, Biome.Category.TAIGA, Biome.Category.SWAMP), - getRubberTree(), - GenerationStep.Feature.VEGETAL_DECORATION - )); +// +// features.add(new DataDrivenFeature( +// RubberSaplingGenerator.IDENTIFIER, +// BiomeSelectors.categories(Biome.Category.FOREST, Biome.Category.TAIGA, Biome.Category.SWAMP), +// getRubberTree(), +// GenerationStep.Feature.VEGETAL_DECORATION +// )); return features; } diff --git a/src/main/java/techreborn/world/RubberSaplingGenerator.java b/src/main/java/techreborn/world/RubberSaplingGenerator.java index 81b9649d5..f1dbf8886 100644 --- a/src/main/java/techreborn/world/RubberSaplingGenerator.java +++ b/src/main/java/techreborn/world/RubberSaplingGenerator.java @@ -27,24 +27,21 @@ package techreborn.world; import net.minecraft.block.sapling.SaplingGenerator; import net.minecraft.util.Identifier; import net.minecraft.util.registry.BuiltinRegistries; -import net.minecraft.util.registry.MutableRegistry; import net.minecraft.world.gen.feature.ConfiguredFeature; -import net.minecraft.world.gen.feature.DecoratedFeatureConfig; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; import java.util.Random; -import static techreborn.TechReborn.LOGGER; - public class RubberSaplingGenerator extends SaplingGenerator { public static final Identifier IDENTIFIER = new Identifier("techreborn", "techreborn/features/rubber_tree.json"); @Nullable @Override protected ConfiguredFeature getTreeFeature(Random random, boolean bl) { - DecoratedFeatureConfig decoratedFeatureConfig = (DecoratedFeatureConfig) BuiltinRegistries.CONFIGURED_FEATURE.get(IDENTIFIER).getConfig(); - //noinspection unchecked - return (ConfiguredFeature) decoratedFeatureConfig.feature.get(); +// DecoratedFeatureConfig decoratedFeatureConfig = (DecoratedFeatureConfig) BuiltinRegistries.CONFIGURED_FEATURE.get(IDENTIFIER).getConfig(); +// //noinspection unchecked +// return (ConfiguredFeature) decoratedFeatureConfig.feature.get(); + return null; // TODO 1.18 } } diff --git a/src/main/java/techreborn/world/RubberTreeDecorator.java b/src/main/java/techreborn/world/RubberTreeDecorator.java index 96c8739f5..491c0a6ea 100644 --- a/src/main/java/techreborn/world/RubberTreeDecorator.java +++ b/src/main/java/techreborn/world/RubberTreeDecorator.java @@ -24,11 +24,8 @@ package techreborn.world; -import com.mojang.serialization.Codec; import net.minecraft.util.math.BlockPos; import net.minecraft.world.Heightmap; -import net.minecraft.world.gen.decorator.ChanceDecoratorConfig; -import net.minecraft.world.gen.decorator.Decorator; import net.minecraft.world.gen.decorator.DecoratorContext; import java.util.Random; @@ -36,25 +33,27 @@ import java.util.stream.IntStream; import java.util.stream.Stream; // Big thanks to SuperCoder7979 for this -public class RubberTreeDecorator extends Decorator { +public class RubberTreeDecorator { // extends Decorator { - public RubberTreeDecorator(Codec codec) { - super(codec); - } + // TODO 1.18 - @Override - public Stream getPositions(DecoratorContext context, Random random, ChanceDecoratorConfig config, BlockPos pos) { - // Generate tree clusters randomly - if (random.nextInt(config.chance) == 0) { - // Generate 4 - 8 trees - int treeCount = 4 + random.nextInt(5); - return IntStream.range(0, treeCount).mapToObj((i) -> { - int x = random.nextInt(16) + pos.getX(); - int z = random.nextInt(16) + pos.getZ(); - int y = context.getTopY(Heightmap.Type.MOTION_BLOCKING, x, z); - return new BlockPos(x, y, z); - }); - } - return Stream.empty(); - } +// public RubberTreeDecorator(Codec codec) { +// super(codec); +// } +// +// @Override +// public Stream getPositions(DecoratorContext context, Random random, ChanceDecoratorConfig config, BlockPos pos) { +// // Generate tree clusters randomly +// if (random.nextInt(config.chance) == 0) { +// // Generate 4 - 8 trees +// int treeCount = 4 + random.nextInt(5); +// return IntStream.range(0, treeCount).mapToObj((i) -> { +// int x = random.nextInt(16) + pos.getX(); +// int z = random.nextInt(16) + pos.getZ(); +// int y = context.getTopY(Heightmap.Type.MOTION_BLOCKING, x, z); +// return new BlockPos(x, y, z); +// }); +// } +// return Stream.empty(); +// } } \ No newline at end of file diff --git a/src/main/java/techreborn/world/WorldGenerator.java b/src/main/java/techreborn/world/WorldGenerator.java index fe343a995..a87721d7e 100644 --- a/src/main/java/techreborn/world/WorldGenerator.java +++ b/src/main/java/techreborn/world/WorldGenerator.java @@ -30,7 +30,6 @@ import net.fabricmc.fabric.api.biome.v1.ModificationPhase; import net.minecraft.util.Identifier; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; -import net.minecraft.world.gen.decorator.ChanceDecoratorConfig; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import net.minecraft.world.gen.foliage.FoliagePlacerType; @@ -38,6 +37,7 @@ import reborncore.mixin.common.AccessorFoliagePlacerType; import java.util.List; +// TODO 1.18 public class WorldGenerator { public static Feature RUBBER_TREE_FEATURE; public static RubberTreeDecorator RUBBER_TREE_DECORATOR; @@ -57,7 +57,7 @@ public class WorldGenerator { (biomeSelectionContext, biomeModificationContext) -> { for (DataDrivenFeature feature : features) { if (feature.getBiomeSelector().test(biomeSelectionContext)) { - biomeModificationContext.getGenerationSettings().addFeature(feature.getGenerationStep(), feature.getRegistryKey()); +// biomeModificationContext.getGenerationSettings().addFeature(feature.getGenerationStep(), feature.getRegistryKey()); } } }); @@ -65,7 +65,7 @@ public class WorldGenerator { private static void registerTreeDecorators() { RUBBER_TREE_FEATURE = Registry.register(Registry.FEATURE, new Identifier("techreborn:rubber_tree"), new RubberTreeFeature(TreeFeatureConfig.CODEC)); - RUBBER_TREE_DECORATOR = Registry.register(Registry.DECORATOR, new Identifier("techreborn:rubber_tree"), new RubberTreeDecorator(ChanceDecoratorConfig.CODEC)); +// RUBBER_TREE_DECORATOR = Registry.register(Registry.DECORATOR, new Identifier("techreborn:rubber_tree"), new RubberTreeDecorator(ChanceDecoratorConfig.CODEC)); RUBBER_TREE_FOLIAGE_PLACER_TYPE = AccessorFoliagePlacerType.register("techreborn:rubber_tree", RubberTreeFeature.FoliagePlacer.CODEC); } } \ No newline at end of file