mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-23 18:07:39 +00:00
Fix a couple of rendering issues
- Fix printouts in item frames being rendered too far foward. - Fix wired modems being flipped.
This commit is contained in:
@@ -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<VariantMutator> 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<VariantMutator> createVerticalFacingDispatch(Property<Direction> property) {
|
||||
var dispatch = PropertyDispatch.modify(property);
|
||||
for (var direction : property.getPossibleValues()) {
|
||||
@@ -457,10 +448,6 @@ public class BlockModelProvider {
|
||||
return dispatch;
|
||||
}
|
||||
|
||||
private static PropertyDispatch<VariantMutator> createFacingDispatch() {
|
||||
return BlockModelGenerators.ROTATION_FACING;
|
||||
}
|
||||
|
||||
private static <T extends Comparable<T>> PropertyDispatch<MultiVariant> createModelDispatch(Property<T> property, Function<T, ResourceLocation> makeModel) {
|
||||
var variant = PropertyDispatch.initial(property);
|
||||
for (var value : property.getPossibleValues()) {
|
||||
|
@@ -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"}
|
||||
}
|
||||
]
|
||||
|
@@ -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() {
|
||||
|
Reference in New Issue
Block a user