diff --git a/build.gradle b/build.gradle index af3d0dfae..fbfd96823 100644 --- a/build.gradle +++ b/build.gradle @@ -73,12 +73,6 @@ minecraft { create { source sourceSets.main } - - if (inWorkspace) { - flywheel { - source project(":Flywheel").sourceSets.main - } - } } } diff --git a/gradle.properties b/gradle.properties index 43789406d..b162ae818 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,11 +15,11 @@ mixin_version = 0.8.5 librarian_version = 1.+ shadow_version = 7.1.0 cursegradle_version = 1.4.0 -parchment_version = 2021.12.19 +parchment_version = 2022.01.23 # dependency versions registrate_version = MC1.18-1.0.21 -flywheel_version = 1.18-0.6.0.48 +flywheel_version = 1.18-0.6.0.50 jei_minecraft_version = 1.18.1 jei_version = 9.2.1.69 diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java index de23bb2c9..8181db747 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java @@ -12,6 +12,6 @@ public class BackHalfShaftInstance extends HalfShaftInstance { @Override protected Direction getShaftDirection() { - return blockEntity.getBlockState().getValue(BlockStateProperties.FACING).getOpposite(); + return blockState.getValue(BlockStateProperties.FACING).getOpposite(); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java index 4af84f819..6e0fb2f1b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java @@ -48,6 +48,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; @@ -379,6 +381,7 @@ public class DeployerTileEntity extends KineticTileEntity { sendData(); } + @OnlyIn(Dist.CLIENT) public PartialModel getHandPose() { return mode == Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING : heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING; @@ -424,6 +427,7 @@ public class DeployerTileEntity extends KineticTileEntity { return true; } + @OnlyIn(Dist.CLIENT) public float getHandOffset(float partialTicks) { if (isVirtual()) return animatedOffset.getValue(partialTicks); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java index 52ae1031a..a470f3de7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/engine/FurnaceEngineBlock.java @@ -19,6 +19,8 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock; import net.minecraftforge.eventbus.api.Event.Result; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -42,6 +44,7 @@ public class FurnaceEngineBlock extends EngineBlock implements ITE makeLighter() { + // TODO: move lighters to registry return new EmptyLighter(this); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java index 9772c5686..aa81ef4a4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java @@ -16,6 +16,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class ClockworkContraption extends Contraption { @@ -81,7 +83,7 @@ public class ClockworkContraption extends Contraption { } return Pair.of(hourArm, minuteArm); } - + @Override public boolean assemble(Level world, BlockPos pos) throws AssemblyException { return searchMovedStructure(world, pos, facing); @@ -125,12 +127,13 @@ public class ClockworkContraption extends Contraption { return false; return facing.getAxis() == this.facing.getAxis(); } - + public static enum HandType { HOUR, MINUTE } @Override + @OnlyIn(Dist.CLIENT) public ContraptionLighter makeLighter() { return new AnchoredLighter(this); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingInstance.java index 8860950ff..88d9b7998 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedBearingInstance.java @@ -7,8 +7,10 @@ import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.mojang.math.Quaternion; import com.mojang.math.Vector3f; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; +import com.simibubi.create.foundation.render.AllMaterialSpecs; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.core.Direction; @@ -18,6 +20,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; public class StabilizedBearingInstance extends ActorInstance { final OrientedData topInstance; + final RotatingData shaft; final Direction facing; final Vector3f rotationAxis; @@ -35,11 +38,22 @@ public class StabilizedBearingInstance extends ActorInstance { topInstance = materialManager.defaultSolid() .material(Materials.ORIENTED) - .getModel(AllBlockPartials.BEARING_TOP, blockState).createInstance(); + .getModel(AllBlockPartials.BEARING_TOP, blockState) + .createInstance(); + int blockLight = localBlockLight(); topInstance.setPosition(context.localPos) .setRotation(blockOrientation) - .setBlockLight(localBlockLight()); + .setBlockLight(blockLight); + + shaft = materialManager.defaultSolid() + .material(AllMaterialSpecs.ROTATING) + .getModel(AllBlockPartials.SHAFT_HALF, blockState, blockState.getValue(BlockStateProperties.FACING).getOpposite()) + .createInstance(); + + // not rotating so no need to set speed, axis, etc. + shaft.setPosition(context.localPos) + .setBlockLight(blockLight); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java index d48007b0b..5bb86310e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java @@ -10,6 +10,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class StabilizedContraption extends Contraption { @@ -41,7 +43,7 @@ public class StabilizedContraption extends Contraption { protected ContraptionType getType() { return ContraptionType.STABILIZED; } - + @Override public CompoundTag writeNBT(boolean spawnPacket) { CompoundTag tag = super.writeNBT(spawnPacket); @@ -54,17 +56,18 @@ public class StabilizedContraption extends Contraption { facing = Direction.from3DDataValue(tag.getInt("Facing")); super.readNBT(world, tag, spawnData); } - + @Override public boolean canBeStabilized(Direction facing, BlockPos localPos) { return false; } - + public Direction getFacing() { return facing; } @Override + @OnlyIn(Dist.CLIENT) public ContraptionLighter makeLighter() { return new NonStationaryLighter<>(this); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java index ed9053aa1..e3f3be3ef 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java @@ -12,6 +12,8 @@ import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class GantryContraption extends TranslatingContraption { @@ -64,6 +66,7 @@ public class GantryContraption extends TranslatingContraption { } @Override + @OnlyIn(Dist.CLIENT) public ContraptionLighter makeLighter() { return new NonStationaryLighter<>(this); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java index 11140278c..2b06c5df6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java @@ -32,6 +32,8 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.RailShape; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraft.world.phys.AABB; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.wrapper.InvWrapper; @@ -163,6 +165,7 @@ public class MountedContraption extends Contraption { } @Override + @OnlyIn(Dist.CLIENT) public ContraptionLighter makeLighter() { return new NonStationaryLighter<>(this); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java index 2206578ad..46463cff2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java @@ -8,6 +8,8 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Tra import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class PulleyContraption extends TranslatingContraption { @@ -56,6 +58,7 @@ public class PulleyContraption extends TranslatingContraption { } @Override + @OnlyIn(Dist.CLIENT) public ContraptionLighter makeLighter() { return new PulleyLighter(this); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/bell/AbstractBellTileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/bell/AbstractBellTileEntity.java index 9caecfc8d..a6ceab29b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/bell/AbstractBellTileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/bell/AbstractBellTileEntity.java @@ -11,6 +11,8 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public abstract class AbstractBellTileEntity extends SmartTileEntity { @@ -48,6 +50,7 @@ public abstract class AbstractBellTileEntity extends SmartTileEntity { } } + @OnlyIn(Dist.CLIENT) public abstract PartialModel getBellModel(); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/bell/HauntedBellTileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/bell/HauntedBellTileEntity.java index d794c5d2b..a81aaa2f1 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/bell/HauntedBellTileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/bell/HauntedBellTileEntity.java @@ -14,6 +14,8 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class HauntedBellTileEntity extends AbstractBellTileEntity { @@ -28,6 +30,7 @@ public class HauntedBellTileEntity extends AbstractBellTileEntity { } @Override + @OnlyIn(Dist.CLIENT) public PartialModel getBellModel() { return AllBlockPartials.HAUNTED_BELL; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/bell/PeculiarBellTileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/bell/PeculiarBellTileEntity.java index ce837d514..07c521de9 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/bell/PeculiarBellTileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/bell/PeculiarBellTileEntity.java @@ -6,6 +6,8 @@ import com.simibubi.create.AllBlockPartials; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class PeculiarBellTileEntity extends AbstractBellTileEntity { @@ -14,6 +16,7 @@ public class PeculiarBellTileEntity extends AbstractBellTileEntity { } @Override + @OnlyIn(Dist.CLIENT) public PartialModel getBellModel() { return AllBlockPartials.PECULIAR_BELL; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java index e38ce05c5..e3072bbf9 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/CrossPlaneMirror.java @@ -16,6 +16,8 @@ import net.minecraft.network.chat.Component; import net.minecraft.util.StringRepresentable; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class CrossPlaneMirror extends SymmetryMirror { @@ -87,6 +89,7 @@ public class CrossPlaneMirror extends SymmetryMirror { } @Override + @OnlyIn(Dist.CLIENT) public PartialModel getModel() { return AllBlockPartials.SYMMETRY_CROSSPLANE; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java index 079f42a25..56103a1ee 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/EmptyMirror.java @@ -12,6 +12,8 @@ import net.minecraft.network.chat.Component; import net.minecraft.util.StringRepresentable; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class EmptyMirror extends SymmetryMirror { @@ -50,6 +52,7 @@ public class EmptyMirror extends SymmetryMirror { } @Override + @OnlyIn(Dist.CLIENT) public PartialModel getModel() { return null; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java index beff9d8f4..44ee529d3 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/PlaneMirror.java @@ -16,6 +16,8 @@ import net.minecraft.network.chat.Component; import net.minecraft.util.StringRepresentable; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class PlaneMirror extends SymmetryMirror { @@ -83,6 +85,7 @@ public class PlaneMirror extends SymmetryMirror { } @Override + @OnlyIn(Dist.CLIENT) public PartialModel getModel() { return AllBlockPartials.SYMMETRY_PLANE; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java index 2dd3d6aeb..7c85700aa 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java @@ -23,6 +23,8 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.level.block.state.properties.Property; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public abstract class SymmetryMirror { @@ -80,6 +82,7 @@ public abstract class SymmetryMirror { public abstract String typeName(); + @OnlyIn(Dist.CLIENT) public abstract PartialModel getModel(); public void applyModelTransform(PoseStack ms) {} diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java index 4775e29ad..07c7adf63 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/TriplePlaneMirror.java @@ -14,6 +14,8 @@ import net.minecraft.network.chat.Component; import net.minecraft.util.StringRepresentable; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public class TriplePlaneMirror extends SymmetryMirror { @@ -44,6 +46,7 @@ public class TriplePlaneMirror extends SymmetryMirror { } @Override + @OnlyIn(Dist.CLIENT) public PartialModel getModel() { return AllBlockPartials.SYMMETRY_TRIPLEPLANE; } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index f71cc4edb..a09543314 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -18,14 +18,14 @@ Technology that empowers the player.''' [[dependencies.create]] modId="forge" mandatory=true - versionRange="[38.0.46,)" + versionRange="[39.0.46,)" ordering="NONE" side="BOTH" [[dependencies.create]] modId="minecraft" mandatory=true - versionRange="[1.18,1.19)" + versionRange="[1.18.1,1.19)" ordering="NONE" side="BOTH" @@ -34,4 +34,4 @@ Technology that empowers the player.''' mandatory=true versionRange="[1.18-0.6.0,1.18-0.6.1)" ordering="AFTER" - side="BOTH" + side="CLIENT"