From 7e49954aa5d747f3f1278ce03699c7c9298eaa2d Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Thu, 27 Feb 2025 21:26:46 -0800 Subject: [PATCH 1/7] Fledgling wheel - Bump flywheel and ponder versions - Fix renamed model builder reference --- build.gradle | 2 +- gradle.properties | 5 +++-- .../content/contraptions/render/ContraptionVisual.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 4c91bd6031..b547eb9d5f 100644 --- a/build.gradle +++ b/build.gradle @@ -175,7 +175,7 @@ dependencies { modCompileOnly("dev.engine-room.flywheel:flywheel-forge-api-${flywheel_minecraft_version}:${flywheel_version}") modRuntimeOnly("dev.engine-room.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") - modRuntimeOnly("dev.engine-room.vanillin:vanillin-forge-${flywheel_minecraft_version}:${flywheel_version}") + modRuntimeOnly("dev.engine-room.vanillin:vanillin-forge-${flywheel_minecraft_version}:${vanillin_version}") if (ponderInWorkspace) { implementation project(":ponder:Common") diff --git a/gradle.properties b/gradle.properties index a32e86b568..b991b2eb0b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,12 +20,13 @@ use_parchment = true # dependency versions registrate_version = MC1.20-1.3.3 flywheel_minecraft_version = 1.20.1 -flywheel_version = 1.0.0-beta-212 +flywheel_version = 1.0.0-215 +vanillin_version = 1.0.0-beta-215 jei_minecraft_version = 1.20.1 jei_version = 15.19.0.85 curios_minecraft_version = 1.20.1 curios_version = 5.3.1 -ponder_version = 1.0.34 +ponder_version = 1.0.36 mixin_extras_version = 0.4.1 cc_tweaked_enable = true diff --git a/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java b/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java index a1c401e310..1c1548e3d6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java +++ b/src/main/java/com/simibubi/create/content/contraptions/render/ContraptionVisual.java @@ -30,7 +30,7 @@ import dev.engine_room.flywheel.lib.instance.InstanceTypes; import dev.engine_room.flywheel.lib.instance.TransformedInstance; import dev.engine_room.flywheel.lib.material.SimpleMaterial; import dev.engine_room.flywheel.lib.model.ModelUtil; -import dev.engine_room.flywheel.lib.model.baked.ForgeMultiBlockModelBuilder; +import dev.engine_room.flywheel.lib.model.baked.ForgeBlockModelBuilder; import dev.engine_room.flywheel.lib.task.ForEachPlan; import dev.engine_room.flywheel.lib.task.NestedPlan; import dev.engine_room.flywheel.lib.task.PlanMap; @@ -97,7 +97,7 @@ public class ContraptionVisual extends Abst } }; - model = new ForgeMultiBlockModelBuilder(modelWorld, blocks.positions()) + model = new ForgeBlockModelBuilder(modelWorld, blocks.positions()) .modelDataLookup(pos -> contraption.modelData.getOrDefault(pos, ModelData.EMPTY)) .materialFunc((renderType, aBoolean) -> SimpleMaterial.builderOf(ModelUtil.getMaterial(renderType, aBoolean)) .cardinalLightingMode(CardinalLightingMode.CHUNK)) From b67842105d402e9ace38823eda7bc280dd9f26dc Mon Sep 17 00:00:00 2001 From: TropheusJ Date: Fri, 28 Feb 2025 01:09:07 -0500 Subject: [PATCH 2/7] move default BlockSpoutingBehaviours out of API --- .../create/AllBlockSpoutingBehaviours.java | 49 +++++++++++++++++++ src/main/java/com/simibubi/create/Create.java | 3 +- .../spouting/BlockSpoutingBehaviour.java | 39 --------------- 3 files changed, 50 insertions(+), 41 deletions(-) create mode 100644 src/main/java/com/simibubi/create/AllBlockSpoutingBehaviours.java diff --git a/src/main/java/com/simibubi/create/AllBlockSpoutingBehaviours.java b/src/main/java/com/simibubi/create/AllBlockSpoutingBehaviours.java new file mode 100644 index 0000000000..13ce541b17 --- /dev/null +++ b/src/main/java/com/simibubi/create/AllBlockSpoutingBehaviours.java @@ -0,0 +1,49 @@ +package com.simibubi.create; + +import java.util.List; +import java.util.function.Predicate; + +import com.simibubi.create.api.behaviour.spouting.BlockSpoutingBehaviour; +import com.simibubi.create.api.behaviour.spouting.CauldronSpoutingBehavior; +import com.simibubi.create.api.behaviour.spouting.StateChangingBehavior; +import com.simibubi.create.compat.Mods; +import com.simibubi.create.compat.tconstruct.SpoutCasting; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.FarmBlock; +import net.minecraft.world.level.block.LayeredCauldronBlock; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.Fluids; + +import net.minecraftforge.registries.ForgeRegistries; + +public class AllBlockSpoutingBehaviours { + static void registerDefaults() { + Predicate isWater = fluid -> fluid.isSame(Fluids.WATER); + BlockSpoutingBehaviour toMud = StateChangingBehavior.setTo(250, isWater, Blocks.MUD); + + for (Block dirt : List.of(Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.ROOTED_DIRT)) { + BlockSpoutingBehaviour.BY_BLOCK.register(dirt, toMud); + } + + BlockSpoutingBehaviour.BY_BLOCK.register(Blocks.FARMLAND, StateChangingBehavior.incrementingState(100, isWater, FarmBlock.MOISTURE)); + BlockSpoutingBehaviour.BY_BLOCK.register(Blocks.WATER_CAULDRON, StateChangingBehavior.incrementingState(250, isWater, LayeredCauldronBlock.LEVEL)); + BlockSpoutingBehaviour.BY_BLOCK.register(Blocks.CAULDRON, CauldronSpoutingBehavior.INSTANCE); + + if (!Mods.TCONSTRUCT.isLoaded()) + return; + + for (String name : List.of("table", "basin")) { + ResourceLocation id = Mods.TCONSTRUCT.rl(name); + if (ForgeRegistries.BLOCK_ENTITY_TYPES.containsKey(id)) { + BlockEntityType table = ForgeRegistries.BLOCK_ENTITY_TYPES.getValue(id); + BlockSpoutingBehaviour.BY_BLOCK_ENTITY.register(table, SpoutCasting.INSTANCE); + } else { + Create.LOGGER.warn("Block entity {} wasn't found. Outdated compat?", id); + } + } + } +} diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index c34e4ce306..0037fc9960 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -7,7 +7,6 @@ import org.slf4j.Logger; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mojang.logging.LogUtils; -import com.simibubi.create.api.behaviour.spouting.BlockSpoutingBehaviour; import com.simibubi.create.compat.Mods; import com.simibubi.create.compat.computercraft.ComputerCraftProxy; import com.simibubi.create.compat.curios.Curios; @@ -169,7 +168,7 @@ public class Create { // These registrations use Create's registered objects directly so they must run after registration has finished. BoilerHeaters.registerDefaults(); AllPortalTracks.registerDefaults(); - BlockSpoutingBehaviour.registerDefaults(); + AllBlockSpoutingBehaviours.registerDefaults(); AllMovementBehaviours.registerDefaults(); AllInteractionBehaviours.registerDefaults(); AllContraptionMovementSettings.registerDefaults(); diff --git a/src/main/java/com/simibubi/create/api/behaviour/spouting/BlockSpoutingBehaviour.java b/src/main/java/com/simibubi/create/api/behaviour/spouting/BlockSpoutingBehaviour.java index f1d9ebe32f..588c82c9d9 100644 --- a/src/main/java/com/simibubi/create/api/behaviour/spouting/BlockSpoutingBehaviour.java +++ b/src/main/java/com/simibubi/create/api/behaviour/spouting/BlockSpoutingBehaviour.java @@ -1,31 +1,18 @@ package com.simibubi.create.api.behaviour.spouting; -import java.util.List; -import java.util.function.Predicate; - import org.jetbrains.annotations.Nullable; -import com.simibubi.create.Create; import com.simibubi.create.api.registry.SimpleRegistry; -import com.simibubi.create.compat.Mods; -import com.simibubi.create.compat.tconstruct.SpoutCasting; import com.simibubi.create.content.fluids.spout.SpoutBlockEntity; import net.minecraft.core.BlockPos; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.FarmBlock; -import net.minecraft.world.level.block.LayeredCauldronBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.registries.ForgeRegistries; /** * Interface for custom block-filling behavior for spouts. @@ -58,32 +45,6 @@ public interface BlockSpoutingBehaviour { return BY_BLOCK_ENTITY.get(be.getType()); } - static void registerDefaults() { - Predicate isWater = fluid -> fluid.isSame(Fluids.WATER); - BlockSpoutingBehaviour toMud = StateChangingBehavior.setTo(250, isWater, Blocks.MUD); - - for (Block dirt : List.of(Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.ROOTED_DIRT)) { - BY_BLOCK.register(dirt, toMud); - } - - BY_BLOCK.register(Blocks.FARMLAND, StateChangingBehavior.incrementingState(100, isWater, FarmBlock.MOISTURE)); - BY_BLOCK.register(Blocks.WATER_CAULDRON, StateChangingBehavior.incrementingState(250, isWater, LayeredCauldronBlock.LEVEL)); - BY_BLOCK.register(Blocks.CAULDRON, CauldronSpoutingBehavior.INSTANCE); - - if (!Mods.TCONSTRUCT.isLoaded()) - return; - - for (String name : List.of("table", "basin")) { - ResourceLocation id = Mods.TCONSTRUCT.rl(name); - if (ForgeRegistries.BLOCK_ENTITY_TYPES.containsKey(id)) { - BlockEntityType table = ForgeRegistries.BLOCK_ENTITY_TYPES.getValue(id); - BY_BLOCK_ENTITY.register(table, SpoutCasting.INSTANCE); - } else { - Create.LOGGER.warn("Block entity {} wasn't found. Outdated compat?", id); - } - } - } - /** * While idle, spouts will query the behavior provided by the block below it. * If one is present, this method will be called every tick with simulate == true. From a8a160c666a002d10ce30f678ceec7e60726f9bb Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 28 Feb 2025 10:57:08 +0100 Subject: [PATCH 3/7] Frame perfect - Re-enable AO on fluid pipes to restore smooth lighting on them - Boost sounds in stock keeper screen - Tweak item frame transforms of creates components --- .../java/com/simibubi/create/AllBlocks.java | 10 +++++----- .../stockTicker/StockKeeperRequestScreen.java | 20 +++++++++---------- .../blockEntity/behaviour/ValueBox.java | 3 +-- .../behaviour/ValueBoxRenderer.java | 3 +-- .../models/block/chain_conveyor/item.json | 4 ++-- .../create/models/block/clutch/item.json | 6 ++++++ .../create/models/block/diodes/latch_off.json | 2 +- .../create/models/block/diodes/latch_on.json | 2 +- .../models/block/diodes/pulse_extender.json | 2 +- .../models/block/diodes/pulse_repeater.json | 2 +- .../models/block/diodes/pulse_timer.json | 2 +- .../models/block/display_link/block.json | 2 ++ .../models/block/elevator_pulley/item.json | 6 ++++++ .../block/encased_chain_drive/item.json | 6 ++++++ .../models/block/factory_gauge/item.json | 4 +++- .../create/models/block/fluid_valve/item.json | 1 + .../create/models/block/flywheel/item.json | 4 ++-- .../create/models/block/gearshift/item.json | 6 ++++++ .../create/models/block/haunted_bell.json | 9 ++++++++- .../models/block/mechanical_arm/item.json | 2 +- .../create/models/block/nixie_tube/block.json | 6 ++++++ .../create/models/block/peculiar_bell.json | 9 ++++++++- .../block/portable_fluid_interface/item.json | 2 +- .../portable_storage_interface/item.json | 2 +- .../block/redstone_link/transmitter.json | 2 ++ .../block/sequenced_gearshift/item.json | 6 ++++++ .../models/block/smart_fluid_pipe/item.json | 1 + .../block/stock_link/block_vertical.json | 2 ++ .../create/models/block/table_cloth/item.json | 3 ++- .../block/threshold_switch/block_wall.json | 4 ++++ .../create/models/block/valve_handle.json | 19 ++++++++++++++++++ .../models/item/wand_of_symmetry/item.json | 3 ++- .../create/models/item/wrench/item.json | 4 ++-- 33 files changed, 121 insertions(+), 38 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index bc286d0d13..215badde06 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -876,7 +876,7 @@ public class AllBlocks { .properties(p -> p.forceSolidOff()) .transform(pickaxeOnly()) .blockstate(BlockStateGen.pipe()) - .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withoutAO)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withAO)) .item() .transform(customItemModel()) .register(); @@ -915,7 +915,7 @@ public class AllBlocks { .build(); }, BlockStateProperties.WATERLOGGED); }) - .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withoutAO)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withAO)) .loot((p, b) -> p.dropOther(b, FLUID_PIPE.get())) .register(); @@ -924,7 +924,7 @@ public class AllBlocks { .properties(p -> p.mapColor(MapColor.STONE)) .transform(pickaxeOnly()) .blockstate(BlockStateGen.directionalBlockProviderIgnoresWaterlogged(true)) - .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withoutAO)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withAO)) .transform(CStress.setImpact(4.0)) .item() .transform(customItemModel()) @@ -936,7 +936,7 @@ public class AllBlocks { .properties(p -> p.mapColor(MapColor.TERRACOTTA_YELLOW)) .transform(pickaxeOnly()) .blockstate(new SmartFluidPipeGenerator()::generate) - .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withoutAO)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withAO)) .item() .transform(customItemModel()) .register(); @@ -948,7 +948,7 @@ public class AllBlocks { .blockstate((c, p) -> BlockStateGen.directionalAxisBlock(c, p, (state, vertical) -> AssetLookup.partialBaseModel(c, p, vertical ? "vertical" : "horizontal", state.getValue(FluidValveBlock.ENABLED) ? "open" : "closed"))) - .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withoutAO)) + .onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::withAO)) .item() .transform(customItemModel()) .register(); diff --git a/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperRequestScreen.java b/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperRequestScreen.java index cc2c205d1b..8bf3ba00df 100644 --- a/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperRequestScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperRequestScreen.java @@ -1080,12 +1080,12 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen= cols || rmb) return true; itemsToOrder.add(existingOrder = new BigItemStack(itemStack.copyWithCount(1), 0)); - playUiSound(SoundEvents.WOOL_STEP, 0.5f, 1.2f); - playUiSound(SoundEvents.BAMBOO_WOOD_STEP, 0.5f, 0.8f); + playUiSound(SoundEvents.WOOL_STEP, 0.75f, 1.2f); + playUiSound(SoundEvents.BAMBOO_WOOD_STEP, 0.75f, 0.8f); } int current = existingOrder.count; @@ -1132,8 +1132,8 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen= cols || remove) return true; itemsToOrder.add(existingOrder = new BigItemStack(entry.stack.copyWithCount(1), 0)); - playUiSound(SoundEvents.WOOL_STEP, 0.5f, 1.2f); - playUiSound(SoundEvents.BAMBOO_WOOD_STEP, 0.5f, 0.8f); + playUiSound(SoundEvents.WOOL_STEP, 0.75f, 1.2f); + playUiSound(SoundEvents.BAMBOO_WOOD_STEP, 0.75f, 0.8f); } int current = existingOrder.count; @@ -1199,8 +1199,8 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen Date: Fri, 28 Feb 2025 11:12:36 +0100 Subject: [PATCH 4/7] Third wheels - Fix bogey wheels rendering twice --- .../create/content/contraptions/Contraption.java | 2 +- .../content/trains/entity/CarriageContraption.java | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java index 8e5c1df2f4..d3a8d748f7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java @@ -992,7 +992,7 @@ public abstract class Contraption { } @Nullable - private static BlockEntity readBlockEntity(Level level, StructureBlockInfo info, CompoundTag tag) { + protected BlockEntity readBlockEntity(Level level, StructureBlockInfo info, CompoundTag tag) { BlockState state = info.state(); BlockPos pos = info.pos(); CompoundTag nbt = info.nbt(); diff --git a/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java b/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java index 32b525c417..d9976c5368 100644 --- a/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java +++ b/src/main/java/com/simibubi/create/content/trains/entity/CarriageContraption.java @@ -157,13 +157,10 @@ public class CarriageContraption extends Contraption { .getStep(), toLocalPos(pos)); } - if (blockState.getBlock() instanceof AbstractBogeyBlock bogey) { - boolean captureBE = bogey.captureBlockEntityForTrain(); + if (blockState.getBlock() instanceof AbstractBogeyBlock) { bogeys++; if (bogeys == 2) secondBogeyPos = pos; - return Pair.of(new StructureBlockInfo(pos, blockState, captureBE ? getBlockEntityNBT(world, pos) : null), - captureBE ? world.getBlockEntity(pos) : null); } MovingInteractionBehaviour behaviour = MovingInteractionBehaviour.REGISTRY.get(blockState); @@ -186,6 +183,14 @@ public class CarriageContraption extends Contraption { return super.capture(world, pos); } + + @Override + protected BlockEntity readBlockEntity(Level level, StructureBlockInfo info, CompoundTag tag) { + if (info.state().getBlock() instanceof AbstractBogeyBlock bogey && !bogey.captureBlockEntityForTrain()) + return null; // Bogeys are typically rendered by the carriage contraption, not the BE + + return super.readBlockEntity(level, info, tag); + } @Override public CompoundTag writeNBT(boolean spawnPacket) { From 447c8f0a36767ca0a761bbbe8fc3f5d478a173ec Mon Sep 17 00:00:00 2001 From: IThundxr Date: Fri, 28 Feb 2025 11:15:01 -0500 Subject: [PATCH 5/7] Comment out cf publishing --- build.gradle | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 38ea4dbd00..ebb549eb43 100644 --- a/build.gradle +++ b/build.gradle @@ -328,11 +328,12 @@ publishMods { modLoaders.add("forge") modLoaders.add("neoforge") - curseforge { - accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") - projectId = "328085" - minecraftVersions.add(minecraft_version) - } + // TODO - Uncomment post update 6 +// curseforge { +// accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") +// projectId = "328085" +// minecraftVersions.add(minecraft_version) +// } modrinth { accessToken = providers.environmentVariable("MODRINTH_TOKEN") From 9a41f8991ffc216657f6afd25c5d88c645064cf5 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Fri, 28 Feb 2025 11:19:45 -0500 Subject: [PATCH 6/7] Update displayName --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b96531c760..0622912d46 100644 --- a/build.gradle +++ b/build.gradle @@ -336,7 +336,7 @@ publishMods { file = jar.archiveFile changelog = ChangelogText.getChangelogText(project).toString() type = STABLE - displayName = "$mod_name $minecraft_version $mod_version" + displayName = "$mod_name $mod_version for mc$minecraft_version" modLoaders.add("forge") modLoaders.add("neoforge") From 50ab1221c3791a7f5f4fc1efe60c22a721d39fcf Mon Sep 17 00:00:00 2001 From: TropheusJ Date: Fri, 28 Feb 2025 17:25:36 -0500 Subject: [PATCH 7/7] replace all uses of holder.get() with holder.value() --- .../bearing/BearingContraption.java | 2 +- .../bearing/ClockworkContraption.java | 2 +- .../bearing/StabilizedContraption.java | 2 +- .../elevator/ElevatorContraption.java | 2 +- .../gantry/GantryContraption.java | 2 +- .../mounted/MountedContraption.java | 2 +- .../piston/PistonContraption.java | 2 +- .../pulley/PulleyContraption.java | 2 +- .../decoration/steamWhistle/WhistleBlock.java | 2 +- .../AllPotatoProjectileBlockHitActions.java | 12 +++++------ .../potatoCannon/PotatoCannonItem.java | 2 +- .../fluids/potion/PotionMixingRecipes.java | 9 ++++---- .../clock/CuckooClockBlockEntity.java | 16 +++++++------- .../factoryBoard/FactoryPanelScreen.java | 17 ++++++++------- .../StockKeeperCategoryScreen.java | 12 +++++------ .../stockTicker/StockKeeperRequestScreen.java | 21 ++++++++++--------- .../trains/entity/ArrivalSoundQueue.java | 5 ++--- .../trains/entity/CarriageContraption.java | 6 +++--- .../behaviour/ValueSettingsBehaviour.java | 8 +++---- 19 files changed, 64 insertions(+), 62 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/bearing/BearingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/bearing/BearingContraption.java index 40a3dd1d93..9ea3c3b0d0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/bearing/BearingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/bearing/BearingContraption.java @@ -49,7 +49,7 @@ public class BearingContraption extends Contraption { @Override public ContraptionType getType() { - return AllContraptionTypes.BEARING.get(); + return AllContraptionTypes.BEARING.value(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/bearing/ClockworkContraption.java b/src/main/java/com/simibubi/create/content/contraptions/bearing/ClockworkContraption.java index ff5572f501..0b1da18ec1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/bearing/ClockworkContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/bearing/ClockworkContraption.java @@ -26,7 +26,7 @@ public class ClockworkContraption extends Contraption { @Override public ContraptionType getType() { - return AllContraptionTypes.CLOCKWORK.get(); + return AllContraptionTypes.CLOCKWORK.value(); } private void ignoreBlocks(Set blocks, BlockPos anchor) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/bearing/StabilizedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/bearing/StabilizedContraption.java index 7ec9b44c7b..4a51822129 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/bearing/StabilizedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/bearing/StabilizedContraption.java @@ -38,7 +38,7 @@ public class StabilizedContraption extends Contraption { @Override public ContraptionType getType() { - return AllContraptionTypes.STABILIZED.get(); + return AllContraptionTypes.STABILIZED.value(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java index 6ff637e28c..f997d3a118 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java @@ -174,7 +174,7 @@ public class ElevatorContraption extends PulleyContraption { @Override public ContraptionType getType() { - return AllContraptionTypes.ELEVATOR.get(); + return AllContraptionTypes.ELEVATOR.value(); } public void setClientYTarget(int clientYTarget) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/gantry/GantryContraption.java b/src/main/java/com/simibubi/create/content/contraptions/gantry/GantryContraption.java index 3dc6adcbfe..825ae9e51b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/gantry/GantryContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/gantry/GantryContraption.java @@ -50,7 +50,7 @@ public class GantryContraption extends TranslatingContraption { @Override public ContraptionType getType() { - return AllContraptionTypes.GANTRY.get(); + return AllContraptionTypes.GANTRY.value(); } public Direction getFacing() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/mounted/MountedContraption.java index 213cfa77a1..e602bb42e9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/mounted/MountedContraption.java @@ -49,7 +49,7 @@ public class MountedContraption extends Contraption { @Override public ContraptionType getType() { - return AllContraptionTypes.MOUNTED.get(); + return AllContraptionTypes.MOUNTED.value(); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/piston/PistonContraption.java b/src/main/java/com/simibubi/create/content/contraptions/piston/PistonContraption.java index 9f90f524a5..dd1f43a3e6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/piston/PistonContraption.java @@ -48,7 +48,7 @@ public class PistonContraption extends TranslatingContraption { @Override public ContraptionType getType() { - return AllContraptionTypes.PISTON.get(); + return AllContraptionTypes.PISTON.value(); } public PistonContraption() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyContraption.java b/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyContraption.java index 267c8b6d0c..f318cb7d09 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyContraption.java @@ -15,7 +15,7 @@ public class PulleyContraption extends TranslatingContraption { @Override public ContraptionType getType() { - return AllContraptionTypes.PULLEY.get(); + return AllContraptionTypes.PULLEY.value(); } public PulleyContraption() {} diff --git a/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlock.java b/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlock.java index 934ceb33e9..10d87f2c1a 100644 --- a/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlock.java +++ b/src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlock.java @@ -138,7 +138,7 @@ public class WhistleBlock extends Block implements IBE, IWre for (int i = 1; i <= 6; i++) { BlockState blockState = pLevel.getBlockState(currentPos); float pVolume = (soundtype.getVolume() + 1.0F) / 2.0F; - SoundEvent growSound = SoundEvents.NOTE_BLOCK_XYLOPHONE.get(); + SoundEvent growSound = SoundEvents.NOTE_BLOCK_XYLOPHONE.value(); SoundEvent hitSound = soundtype.getHitSound(); if (AllBlocks.STEAM_WHISTLE_EXTENSION.has(blockState)) { diff --git a/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java b/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java index cb6045e082..4758b32532 100644 --- a/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java +++ b/src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java @@ -24,12 +24,12 @@ import net.minecraftforge.common.IPlantable; import net.minecraftforge.registries.ForgeRegistries; public class AllPotatoProjectileBlockHitActions { - + static { register("plant_crop", PlantCrop.CODEC); register("place_block_on_ground", PlaceBlockOnGround.CODEC); } - + public static void init() { } @@ -61,12 +61,12 @@ public class AllPotatoProjectileBlockHitActions { if (!level.getBlockState(placePos) .canBeReplaced()) return false; - if (!(cropBlock.get() instanceof IPlantable)) + if (!(cropBlock.value() instanceof IPlantable)) return false; BlockState blockState = level.getBlockState(hitPos); - if (!blockState.canSustainPlant(level, hitPos, face, (IPlantable) cropBlock.get())) + if (!blockState.canSustainPlant(level, hitPos, face, (IPlantable) cropBlock.value())) return false; - level.setBlock(placePos, cropBlock.get() + level.setBlock(placePos, cropBlock.value() .defaultBlockState(), 3); return true; } @@ -111,7 +111,7 @@ public class AllPotatoProjectileBlockHitActions { y = Math.max(y, placePos.getY()); FallingBlockEntity falling = FallingBlockEntityAccessor.create$callInit(level, placePos.getX() + 0.5, y, - placePos.getZ() + 0.5, block.get().defaultBlockState()); + placePos.getZ() + 0.5, block.value().defaultBlockState()); falling.time = 1; level.addFreshEntity(falling); } diff --git a/src/main/java/com/simibubi/create/content/equipment/potatoCannon/PotatoCannonItem.java b/src/main/java/com/simibubi/create/content/equipment/potatoCannon/PotatoCannonItem.java index 312c717f39..4cd1817ddb 100644 --- a/src/main/java/com/simibubi/create/content/equipment/potatoCannon/PotatoCannonItem.java +++ b/src/main/java/com/simibubi/create/content/equipment/potatoCannon/PotatoCannonItem.java @@ -72,7 +72,7 @@ public class PotatoCannonItem extends ProjectileWeaponItem implements CustomArmP return null; } - return new Ammo(ammoStack, optionalType.get().get()); + return new Ammo(ammoStack, optionalType.get().value()); } @Override diff --git a/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java b/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java index cc8f4f353b..9433c0aa61 100644 --- a/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java +++ b/src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java @@ -21,6 +21,7 @@ import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.alchemy.PotionBrewing; import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.item.crafting.Ingredient; + import net.minecraftforge.common.brewing.BrewingRecipe; import net.minecraftforge.common.brewing.BrewingRecipeRegistry; import net.minecraftforge.common.brewing.IBrewingRecipe; @@ -52,19 +53,19 @@ public class PotionMixingRecipes { for (Item container : allowedSupportedContainers) { BottleType bottleType = PotionFluidHandler.bottleTypeFromItem(container); for (PotionBrewing.Mix mix : PotionBrewing.POTION_MIXES) { - FluidStack fromFluid = PotionFluidHandler.getFluidFromPotion(mix.from.get(), bottleType, 1000); - FluidStack toFluid = PotionFluidHandler.getFluidFromPotion(mix.to.get(), bottleType, 1000); + FluidStack fromFluid = PotionFluidHandler.getFluidFromPotion(mix.from.value(), bottleType, 1000); + FluidStack toFluid = PotionFluidHandler.getFluidFromPotion(mix.to.value(), bottleType, 1000); mixingRecipes.add(createRecipe("potion_mixing_vanilla_" + recipeIndex++, mix.ingredient, fromFluid, toFluid)); } } for (PotionBrewing.Mix mix : PotionBrewing.CONTAINER_MIXES) { - Item from = mix.from.get(); + Item from = mix.from.value(); if (!allowedSupportedContainers.contains(from)) { continue; } - Item to = mix.to.get(); + Item to = mix.to.value(); if (!allowedSupportedContainers.contains(to)) { continue; } diff --git a/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java b/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java index 35f308e42a..d37a33f94b 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java +++ b/src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java @@ -8,10 +8,10 @@ import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour import com.simibubi.create.foundation.damageTypes.CreateDamageSources; import net.createmod.catnip.animation.AnimationTickHolder; -import net.createmod.catnip.nbt.NBTHelper; -import net.createmod.catnip.math.VecHelper; import net.createmod.catnip.animation.LerpedFloat; import net.createmod.catnip.animation.LerpedFloat.Chaser; +import net.createmod.catnip.math.VecHelper; +import net.createmod.catnip.nbt.NBTHelper; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; @@ -82,9 +82,9 @@ public class CuckooClockBlockEntity extends KineticBlockEntity { moveHands(hours, minutes); if (AnimationTickHolder.getTicks() % 6 == 0) - playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 2f); + playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 2f); else if (AnimationTickHolder.getTicks() % 3 == 0) - playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 1.5f); + playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 1.5f); } return; } @@ -117,9 +117,9 @@ public class CuckooClockBlockEntity extends KineticBlockEntity { if (animationType == Animation.NONE) { if (AnimationTickHolder.getTicks() % 32 == 0) - playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 2f); + playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 2f); else if (AnimationTickHolder.getTicks() % 16 == 0) - playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 1.5f); + playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 1.5f); } else { boolean isSurprise = animationType == Animation.SURPRISE; @@ -131,9 +131,9 @@ public class CuckooClockBlockEntity extends KineticBlockEntity { // sounds if (value == 1) - playSound(SoundEvents.NOTE_BLOCK_CHIME.get(), 2, .5f); + playSound(SoundEvents.NOTE_BLOCK_CHIME.value(), 2, .5f); if (value == 21) - playSound(SoundEvents.NOTE_BLOCK_CHIME.get(), 2, 0.793701f); + playSound(SoundEvents.NOTE_BLOCK_CHIME.value(), 2, 0.793701f); if (value > 30 && isSurprise) { Vec3 pos = VecHelper.offsetRandomly(VecHelper.getCenterOf(this.worldPosition), level.random, .5f); diff --git a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java index eb39a2148c..0a8022dfa8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java @@ -46,6 +46,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeType; + import net.minecraftforge.common.crafting.IShapedRecipe; import net.minecraftforge.items.ItemHandlerHelper; @@ -128,7 +129,7 @@ public class FactoryPanelScreen extends AbstractSimiScreen { if (ingredient.test(bigItemStack.stack)) craftingIngredient = new BigItemStack(bigItemStack.stack, 1); craftingIngredients.add(craftingIngredient); - + if (width < 3 && (i + 1) % width == 0) for (int j = 0; j < 3 - width; j++) craftingIngredients.add(emptyIngredient); @@ -136,7 +137,7 @@ public class FactoryPanelScreen extends AbstractSimiScreen { while (craftingIngredients.size() < 9) craftingIngredients.add(emptyIngredient); - + return craftingIngredients; } @@ -191,7 +192,7 @@ public class FactoryPanelScreen extends AbstractSimiScreen { }); newInputButton.setToolTip(CreateLang.translate("gui.factory_panel.connect_input") .component()); - + relocateButton = new IconButton(x + 31, y + 67, AllIcons.I_MOVE_GAUGE); relocateButton.withCallback(() -> { FactoryPanelConnectionHandler.startRelocating(behaviour); @@ -199,7 +200,7 @@ public class FactoryPanelScreen extends AbstractSimiScreen { }); relocateButton.setToolTip(CreateLang.translate("gui.factory_panel.relocate") .component()); - + if (!restocker) { addRenderableWidget(newInputButton); addRenderableWidget(relocateButton); @@ -440,7 +441,7 @@ public class FactoryPanelScreen extends AbstractSimiScreen { mouseX, mouseY); return; } - + if (itemStack.stack.isEmpty()) { graphics.renderComponentTooltip(font, List.of(CreateLang.translate("gui.factory_panel.empty_panel") .color(ScrollInput.HEADER_RGB) @@ -566,7 +567,7 @@ public class FactoryPanelScreen extends AbstractSimiScreen { playButtonSound(); return true; } - + // remove redstone connections itemX = x + 9; itemY = y + windowHeight - 24; @@ -583,14 +584,14 @@ public class FactoryPanelScreen extends AbstractSimiScreen { public void playButtonSound() { Minecraft.getInstance() .getSoundManager() - .play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK.get(), 1.0f, 0.25f)); + .play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK.value(), 1.0f, 0.25f)); } @Override public boolean mouseScrolled(double mouseX, double mouseY, double pDelta) { int x = guiLeft; int y = guiTop; - + if (addressBox.mouseScrolled(mouseX, mouseY, pDelta)) return true; diff --git a/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java b/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java index 2c5e351ff2..a54327388e 100644 --- a/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java @@ -119,7 +119,7 @@ public class StockKeeperCategoryScreen extends AbstractSimiContainerScreen= blockEntity.categories.size()) continue; - + if (!entry.hidden) { hiddenCategories.add(indexOf); playUiSound(SoundEvents.ITEM_FRAME_ROTATE_ITEM, 1f, 1.5f); } - + else { hiddenCategories.remove(indexOf); playUiSound(SoundEvents.ITEM_FRAME_ROTATE_ITEM, 1f, 0.675f); } - + refreshSearchNextTick = true; moveToTopNextTick = false; return true; @@ -1157,7 +1158,7 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen hoveredSlot = getHoveredSlot((int) mouseX, (int) mouseY); boolean noHover = hoveredSlot == noneHovered; @@ -1335,7 +1336,7 @@ public class StockKeeperRequestScreen extends AbstractSimiContainerScreen bogey && !bogey.captureBlockEntityForTrain()) return null; // Bogeys are typically rendered by the carriage contraption, not the BE - + return super.readBlockEntity(level, info, tag); } @@ -236,7 +236,7 @@ public class CarriageContraption extends Contraption { @Override public ContraptionType getType() { - return AllContraptionTypes.CARRIAGE.get(); + return AllContraptionTypes.CARRIAGE.value(); } public Direction getAssemblyDirection() { diff --git a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java index 782df92539..a3efe92110 100644 --- a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsBehaviour.java @@ -78,7 +78,7 @@ public interface ValueSettingsBehaviour extends ClipboardCloneable { origin.getWorld() .playSound(null, origin.getPos(), SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 0.25f, 2f); origin.getWorld() - .playSound(null, origin.getPos(), SoundEvents.NOTE_BLOCK_IRON_XYLOPHONE.get(), SoundSource.BLOCKS, 0.03f, + .playSound(null, origin.getPos(), SoundEvents.NOTE_BLOCK_IRON_XYLOPHONE.value(), SoundSource.BLOCKS, 0.03f, 1.125f); } @@ -87,13 +87,13 @@ public interface ValueSettingsBehaviour extends ClipboardCloneable { default boolean bypassesInput(ItemStack mainhandItem) { return false; } - + default boolean mayInteract(Player player) { return true; } - + default int netId() { return 0; } - + }