diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7c47b9a7a..1b31d621a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -58,7 +58,7 @@ junitPlatform = "1.11.4" jmh = "1.37" # Build tools -cctJavadoc = "1.8.4" +cctJavadoc = "1.8.5" checkstyle = "10.21.4" errorProne-core = "2.37.0" errorProne-plugin = "4.1.0" diff --git a/projects/common/src/datagen/java/dan200/computercraft/data/client/BlockModelProvider.java b/projects/common/src/datagen/java/dan200/computercraft/data/client/BlockModelProvider.java index 27a264770..3cab0be55 100644 --- a/projects/common/src/datagen/java/dan200/computercraft/data/client/BlockModelProvider.java +++ b/projects/common/src/datagen/java/dan200/computercraft/data/client/BlockModelProvider.java @@ -123,7 +123,7 @@ public class BlockModelProvider { generators.blockStateOutput.accept( createSimpleBlock(ModRegistry.Blocks.LECTERN.get(), plainVariant(getModelLocation(Blocks.LECTERN))) - .with(createHorizontalFacingDispatch()) + .with(ROTATION_HORIZONTAL_FACING) ); } @@ -142,7 +142,7 @@ public class BlockModelProvider { generators.modelOutput ); })) - .with(createHorizontalFacingDispatch()) + .with(ROTATION_HORIZONTAL_FACING) ); generators.registerSimpleItemModel(diskDrive, getModelLocation(diskDrive, "_empty")); } @@ -170,7 +170,7 @@ public class BlockModelProvider { generators.modelOutput ); })) - .with(createHorizontalFacingDispatch()) + .with(ROTATION_HORIZONTAL_FACING) ); generators.registerSimpleItemModel(printer, getModelLocation(printer, "_empty")); } @@ -189,7 +189,7 @@ public class BlockModelProvider { generators.modelOutput ); })) - .with(createHorizontalFacingDispatch()) + .with(ROTATION_HORIZONTAL_FACING) ); generators.registerSimpleItemModel(block, getModelLocation(block, "_blinking")); } @@ -234,7 +234,7 @@ public class BlockModelProvider { .with(createModelDispatch(WirelessModemBlock.ON, on -> modemModel(generators, getModelLocation(block, on ? "_on" : "_off"), getBlockTexture(block, "_face" + (on ? "_on" : ""))) )) - .with(createFacingDispatch())); + .with(ROTATION_FACING)); generators.registerSimpleItemModel(block, getModelLocation(block, "_off")); } @@ -289,7 +289,7 @@ public class BlockModelProvider { generators.blockStateOutput.accept(MultiVariantGenerator.dispatch(block) .with(createModelDispatch(MonitorBlock.STATE, edge -> getModelLocation(block, edge == MonitorEdgeState.NONE ? "" : "_" + edge.getSerializedName()))) - .with(createHorizontalFacingDispatch()) + .with(ROTATION_HORIZONTAL_FACING) .with(createVerticalFacingDispatch(MonitorBlock.ORIENTATION)) ); generators.registerSimpleItemModel(block, monitorModel(generators, block, "_item", 15, 4, 0, 32)); @@ -373,8 +373,8 @@ public class BlockModelProvider { generator.with( condition().term(CableBlock.MODEM, CableModemVariant.from(direction, on, peripheral)), plainVariant(ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "block/wired_modem" + suffix)) - .with(VariantMutator.X_ROT.withValue(toXAngle(direction.getOpposite()))) - .with(VariantMutator.Y_ROT.withValue(toYAngle(direction.getOpposite()))) + .with(VariantMutator.X_ROT.withValue(toXAngle(direction))) + .with(VariantMutator.Y_ROT.withValue(toYAngle(direction))) ); } } @@ -440,15 +440,6 @@ public class BlockModelProvider { }; } - private static PropertyDispatch createHorizontalFacingDispatch() { - /*var dispatch = PropertyDispatch.modify(BlockStateProperties.HORIZONTAL_FACING); - for (var direction : BlockStateProperties.HORIZONTAL_FACING.getPossibleValues()) { - dispatch.select(direction, Variant.variant().with(VariantProperties.Y_ROT, toYAngle(direction))); - } - return dispatch;*/ - return BlockModelGenerators.ROTATION_HORIZONTAL_FACING; - } - private static PropertyDispatch createVerticalFacingDispatch(Property property) { var dispatch = PropertyDispatch.modify(property); for (var direction : property.getPossibleValues()) { @@ -457,10 +448,6 @@ public class BlockModelProvider { return dispatch; } - private static PropertyDispatch createFacingDispatch() { - return BlockModelGenerators.ROTATION_FACING; - } - private static > PropertyDispatch createModelDispatch(Property property, Function makeModel) { var variant = PropertyDispatch.initial(property); for (var value : property.getPossibleValues()) { diff --git a/projects/common/src/generated/resources/assets/computercraft/blockstates/cable.json b/projects/common/src/generated/resources/assets/computercraft/blockstates/cable.json index 2c00e3b80..7a6b97069 100644 --- a/projects/common/src/generated/resources/assets/computercraft/blockstates/cable.json +++ b/projects/common/src/generated/resources/assets/computercraft/blockstates/cable.json @@ -61,64 +61,64 @@ {"apply": {"model": "computercraft:block/cable_arm"}, "when": {"south": "true"}}, {"apply": {"model": "computercraft:block/cable_arm", "y": 90}, "when": {"west": "true"}}, {"apply": {"model": "computercraft:block/cable_arm", "y": 270}, "when": {"east": "true"}}, - {"apply": {"model": "computercraft:block/wired_modem_off", "x": 270}, "when": {"modem": "down_off"}}, - { - "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 270}, - "when": {"modem": "down_off_peripheral"} - }, - {"apply": {"model": "computercraft:block/wired_modem_on", "x": 270}, "when": {"modem": "down_on"}}, - { - "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 270}, - "when": {"modem": "down_on_peripheral"} - }, - {"apply": {"model": "computercraft:block/wired_modem_off", "x": 90}, "when": {"modem": "up_off"}}, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 90}, "when": {"modem": "down_off"}}, { "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 90}, - "when": {"modem": "up_off_peripheral"} + "when": {"modem": "down_off_peripheral"} }, - {"apply": {"model": "computercraft:block/wired_modem_on", "x": 90}, "when": {"modem": "up_on"}}, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 90}, "when": {"modem": "down_on"}}, { "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 90}, + "when": {"modem": "down_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 270}, "when": {"modem": "up_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 270}, + "when": {"modem": "up_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 270}, "when": {"modem": "up_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 270}, "when": {"modem": "up_on_peripheral"} }, - {"apply": {"model": "computercraft:block/wired_modem_off", "y": 180}, "when": {"modem": "north_off"}}, - { - "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "y": 180}, - "when": {"modem": "north_off_peripheral"} - }, - {"apply": {"model": "computercraft:block/wired_modem_on", "y": 180}, "when": {"modem": "north_on"}}, - { - "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "y": 180}, - "when": {"modem": "north_on_peripheral"} - }, - {"apply": {"model": "computercraft:block/wired_modem_off"}, "when": {"modem": "south_off"}}, + {"apply": {"model": "computercraft:block/wired_modem_off"}, "when": {"modem": "north_off"}}, { "apply": {"model": "computercraft:block/wired_modem_off_peripheral"}, - "when": {"modem": "south_off_peripheral"} + "when": {"modem": "north_off_peripheral"} }, - {"apply": {"model": "computercraft:block/wired_modem_on"}, "when": {"modem": "south_on"}}, + {"apply": {"model": "computercraft:block/wired_modem_on"}, "when": {"modem": "north_on"}}, { "apply": {"model": "computercraft:block/wired_modem_on_peripheral"}, + "when": {"modem": "north_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "y": 180}, "when": {"modem": "south_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "y": 180}, + "when": {"modem": "south_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "y": 180}, "when": {"modem": "south_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "y": 180}, "when": {"modem": "south_on_peripheral"} }, - {"apply": {"model": "computercraft:block/wired_modem_off", "y": 90}, "when": {"modem": "west_off"}}, - { - "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "y": 90}, - "when": {"modem": "west_off_peripheral"} - }, - {"apply": {"model": "computercraft:block/wired_modem_on", "y": 90}, "when": {"modem": "west_on"}}, - { - "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "y": 90}, - "when": {"modem": "west_on_peripheral"} - }, - {"apply": {"model": "computercraft:block/wired_modem_off", "y": 270}, "when": {"modem": "east_off"}}, + {"apply": {"model": "computercraft:block/wired_modem_off", "y": 270}, "when": {"modem": "west_off"}}, { "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "y": 270}, - "when": {"modem": "east_off_peripheral"} + "when": {"modem": "west_off_peripheral"} }, - {"apply": {"model": "computercraft:block/wired_modem_on", "y": 270}, "when": {"modem": "east_on"}}, + {"apply": {"model": "computercraft:block/wired_modem_on", "y": 270}, "when": {"modem": "west_on"}}, { "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "y": 270}, + "when": {"modem": "west_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "y": 90}, "when": {"modem": "east_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "y": 90}, + "when": {"modem": "east_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "y": 90}, "when": {"modem": "east_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "y": 90}, "when": {"modem": "east_on_peripheral"} } ] diff --git a/projects/common/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java b/projects/common/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java index 43f2f367f..ade832c73 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/pocket/apis/PocketAPI.java @@ -75,6 +75,7 @@ public class PocketAPI implements ILuaAPI { * @return The result of equipping. * @cc.treturn boolean If an item was equipped. * @cc.treturn string|nil The reason an item was not equipped. + * @since 1.116.0 */ @LuaFunction(mainThread = true) public final Object[] equipBottom() { @@ -125,6 +126,7 @@ public class PocketAPI implements ILuaAPI { * @return The result of unequipping. * @cc.treturn boolean If the upgrade was unequipped. * @cc.treturn string|nil The reason an upgrade was not unequipped. + * @since 1.116.0 */ @LuaFunction(mainThread = true) public final Object[] unequipBottom() { diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java index 38c25a967..63f8a02f2 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java @@ -22,7 +22,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; class ItemFrameRendererMixin { @Inject( method = "render(Lnet/minecraft/client/renderer/entity/state/ItemFrameRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", - at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/entity/state/ItemFrameRenderState;mapId:Lnet/minecraft/world/level/saveddata/maps/MapId;", opcode = Opcodes.GETFIELD), + at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/entity/state/ItemFrameRenderState;mapId:Lnet/minecraft/world/level/saveddata/maps/MapId;", opcode = Opcodes.GETFIELD, ordinal = 1), cancellable = true ) @SuppressWarnings("unused")