Skip to content

Commit

Permalink
New Rule: reIntroduceReverseRailUpdateOrder
Browse files Browse the repository at this point in the history
Requires Rule `optimizedPoweredRails` to be enabled
  • Loading branch information
FxMorin committed Mar 20, 2022
1 parent 144c7a1 commit df6a7b1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
7 changes: 7 additions & 0 deletions src/main/java/carpetfixes/CFSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,13 @@ other bugs, except they deserve a category of their own (for sorting purposes...
)
public static boolean reIntroduceInstantBlockUpdates = false;

//By FX - PR0CESS
@Rule(
desc = "Re-introduces reverse rail update order which changed in 22w11a. Requires optimizedPoweredRails",
category = REINTRODUCE
)
public static boolean reIntroduceReverseRailUpdateOrder = false;


/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,37 +356,43 @@ private void updateRails(boolean eastWest, World world, BlockPos pos, BlockState
if (i == 1 && countAmt == 0) continue;
Direction dir = EAST_WEST_DIR[i];
Block block = mainState.getBlock();
for (int c = i; c <= countAmt; c++) {
updateRailsSectionEastWestNeighbor(world, pos, c, block, dir, count, countAmt);
}
for (int c = i; c <= countAmt; c++) {
updateRailsSectionEastWestShape(world, pos, c, mainState, dir, count, countAmt);
}
/*for (int c = countAmt; c >= i; c--) {
updateRailsSectionEastWestNeighbor(world, pos, c, block, dir, count, countAmt);
if (CFSettings.reIntroduceReverseRailUpdateOrder) {
for (int c = countAmt; c >= i; c--) {
updateRailsSectionEastWestNeighbor(world, pos, c, block, dir, count, countAmt);
}
for (int c = countAmt; c >= i; c--) {
updateRailsSectionEastWestShape(world, pos, c, mainState, dir, count, countAmt);
}
} else {
for (int c = i; c <= countAmt; c++) {
updateRailsSectionEastWestNeighbor(world, pos, c, block, dir, count, countAmt);
}
for (int c = i; c <= countAmt; c++) {
updateRailsSectionEastWestShape(world, pos, c, mainState, dir, count, countAmt);
}
}
for (int c = countAmt; c >= i; c--) {
updateRailsSectionEastWestShape(world, pos, c, mainState, dir, count, countAmt);
}*/
}
} else {
for(int i = 0; i < NORTH_SOUTH_DIR.length; ++i) {
int countAmt = count[i];
if (i == 1 && countAmt == 0) continue;
Direction dir = NORTH_SOUTH_DIR[i];
Block block = mainState.getBlock();
for (int c = i; c <= countAmt; c++) {
updateRailsSectionNorthSouthNeighbor(world, pos, c, block, dir, count, countAmt);
}
for (int c = i; c <= countAmt; c++) {
updateRailsSectionNorthSouthShape(world, pos, c, mainState, dir, count, countAmt);
}
/*for (int c = countAmt; c >= i; c--) {
updateRailsSectionNorthSouthNeighbor(world, pos, c, block, dir, count, countAmt);
if (CFSettings.reIntroduceReverseRailUpdateOrder) {
for (int c = countAmt; c >= i; c--) {
updateRailsSectionNorthSouthNeighbor(world, pos, c, block, dir, count, countAmt);
}
for (int c = countAmt; c >= i; c--) {
updateRailsSectionNorthSouthShape(world, pos, c, mainState, dir, count, countAmt);
}
} else {
for (int c = i; c <= countAmt; c++) {
updateRailsSectionNorthSouthNeighbor(world, pos, c, block, dir, count, countAmt);
}
for (int c = i; c <= countAmt; c++) {
updateRailsSectionNorthSouthShape(world, pos, c, mainState, dir, count, countAmt);
}
}
for (int c = countAmt; c >= i; c--) {
updateRailsSectionNorthSouthShape(world, pos, c, mainState, dir, count, countAmt);
}*/
}
}
}
Expand Down

0 comments on commit df6a7b1

Please sign in to comment.