Skip to content

Commit

Permalink
fix: Redstone Wire Dot Block State from previous DataVersions
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Jul 5, 2024
1 parent 7a39879 commit 47d9a9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author = masa
mod_file_name = litematica-fabric

# Current mod version
mod_version = 0.18.999-sakura.13
mod_version = 0.18.999-sakura.14

# Required malilib version
malilib_version = 0.19.999-sakura.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@
public class SchematicConversionFixers
{
private static final BooleanProperty[] HORIZONTAL_CONNECTING_BLOCK_PROPS = new BooleanProperty[] { null, null, HorizontalConnectingBlock.NORTH, HorizontalConnectingBlock.SOUTH, HorizontalConnectingBlock.WEST, HorizontalConnectingBlock.EAST };
private static final BlockState REDSTONE_WIRE_DOT = Blocks.REDSTONE_WIRE.getDefaultState();
private static final BlockState REDSTONE_WIRE_DOT_OLD = Blocks.REDSTONE_WIRE.getDefaultState();
private static final BlockState REDSTONE_WIRE_DOT = Blocks.REDSTONE_WIRE.getDefaultState()
.with(RedstoneWireBlock.POWER, 0)
.with(RedstoneWireBlock.WIRE_CONNECTION_NORTH, WireConnection.NONE)
.with(RedstoneWireBlock.WIRE_CONNECTION_EAST, WireConnection.NONE)
.with(RedstoneWireBlock.WIRE_CONNECTION_SOUTH, WireConnection.NONE)
.with(RedstoneWireBlock.WIRE_CONNECTION_WEST, WireConnection.NONE);
private static final BlockState REDSTONE_WIRE_CROSS = Blocks.REDSTONE_WIRE.getDefaultState()
.with(RedstoneWireBlock.WIRE_CONNECTION_NORTH, WireConnection.SIDE)
.with(RedstoneWireBlock.WIRE_CONNECTION_EAST, WireConnection.SIDE)
Expand Down Expand Up @@ -342,7 +348,7 @@ public class SchematicConversionFixers
state = ((IMixinRedstoneWireBlock) wire).litematicaGetPlacementState(reader, state, pos);

// Turn all old dots into crosses, while keeping the power level
if (state.with(RedstoneWireBlock.POWER, 0) == REDSTONE_WIRE_DOT)
if (state.equals(REDSTONE_WIRE_DOT) == false && state.with(RedstoneWireBlock.POWER, 0) == REDSTONE_WIRE_DOT_OLD)
{
state = REDSTONE_WIRE_CROSS.with(RedstoneWireBlock.POWER, state.get(RedstoneWireBlock.POWER));
}
Expand Down

0 comments on commit 47d9a9f

Please sign in to comment.