re-added 1.14 optimizations and removed WIP status

This commit is contained in:
gnembon committed 2019-07-03 12:56:20 -03:00
1 parent cba23ff310
commit 16443a2cd6
2 files changed
+3 -27

No files matched your search

@@ -83,19 +83,10 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
private BlockState updateLogic(World world_1, BlockPos blockPos_1, BlockState blockState_1) { private BlockState updateLogic(World world_1, BlockPos blockPos_1, BlockState blockState_1) {
BlockState blockState_2 = blockState_1; BlockState blockState_2 = blockState_1;
int int_1 = (Integer)blockState_1.get(POWER); // i int int_1 = (Integer)blockState_1.get(POWER); // i
int int_4 = increasePower(0, blockState_2); // j
this.wiresGivePower = false; this.wiresGivePower = false;
int int_2 = world_1.getReceivedRedstonePower(blockPos_1); // k int int_2 = world_1.getReceivedRedstonePower(blockPos_1); // k
this.wiresGivePower = true; this.wiresGivePower = true;
int int_3 = 0; // l int int_3 = 0; // l
// [CM] fastRedstoneDust -- if statement around unnecessary check
if (!CarpetSettings.fastRedstoneDust) {
if (int_2 > 0 && int_2 > int_4 - 1) {
int_4 = int_2;
}
}
if (!CarpetSettings.fastRedstoneDust || int_2 < 15) { if (!CarpetSettings.fastRedstoneDust || int_2 < 15) {
Iterator var8 = Direction.Type.HORIZONTAL.iterator(); Iterator var8 = Direction.Type.HORIZONTAL.iterator();
@@ -120,23 +111,9 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
} }
} }
// [CM] fastRedstoneDust -- if statement around unnecessary check int int_4 = int_3 - 1;
if (!CarpetSettings.fastRedstoneDust) { if (int_2 > int_4) int_4 = int_2;
if (int_3 > int_4) {
int_4 = int_3 - 1;
} else if (int_4 > 0) {
--int_4;
} else {
int_4 = 0;
}
if (int_2 > int_4 - 1) {
int_4 = int_2;
}
} else {
int_4 = int_3 - 1;
if (int_2 > int_4) int_4 = int_2;
}
if (int_1 != int_4) { if (int_1 != int_4) {
blockState_1 = (BlockState)blockState_1.with(POWER, int_4); blockState_1 = (BlockState)blockState_1.with(POWER, int_4);
@@ -92,8 +92,7 @@ public class CarpetSettings
@Rule( @Rule(
desc = "Lag optimizations for redstone dust", desc = "Lag optimizations for redstone dust",
extra = "by Theosib", extra = "by Theosib",
category = {EXPERIMENTAL, OPTIMIZATION}, category = {EXPERIMENTAL, OPTIMIZATION}
validate = Validator.WIP.class
) )
public static boolean fastRedstoneDust = false; public static boolean fastRedstoneDust = false;