From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Sun, 21 Jan 2024 11:49:38 +0000 Subject: [PATCH] Piston fixes from molean server diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 589810272fef6fa47076b05c266a20402d7d8f0d..4cdb0e62a3027ae292e1d818e1a06a47496676af 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1438,7 +1438,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (movement.lengthSqr() <= 1.0E-7D) { return movement; } else { - long i = this.level().getGameTime(); + long i = this.level().getRedstoneGameTime(); //Luminol - Piston fixes from molean server if (i != this.pistonDeltasGameTime) { Arrays.fill(this.pistonDeltas, 0.0D); diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java index 1818ab63209017b45a46a80802d500f2d042a208..157255e0fdcd2531ba3635d44bf57a84f454bb9b 100644 --- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java @@ -152,7 +152,7 @@ public class PistonBaseBlock extends DirectionalBlock { if (tileentity instanceof PistonMovingBlockEntity) { PistonMovingBlockEntity tileentitypiston = (PistonMovingBlockEntity) tileentity; - if (tileentitypiston.isExtending() && (tileentitypiston.getProgress(0.0F) < 0.5F || world.getGameTime() == tileentitypiston.getLastTicked() || ((ServerLevel) world).isHandlingTick())) { + if (tileentitypiston.isExtending() && (tileentitypiston.getProgress(0.0F) < 0.5F || world.getRedstoneGameTime() == tileentitypiston.getLastTicked() || ((ServerLevel) world).isHandlingTick())) { //Luminol - Piston fixes from molean server b0 = 2; } } diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java index a595abb43853cd4c3f5886a83527c6cbe4a3e8f7..2284dfcb09d9a7c6f670e5266a3f2856c2d40e8d 100644 --- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java @@ -277,7 +277,7 @@ public class PistonMovingBlockEntity extends BlockEntity { } public static void tick(Level world, BlockPos pos, BlockState state, PistonMovingBlockEntity blockEntity) { - blockEntity.lastTicked = world.getGameTime(); + blockEntity.lastTicked = world.getRedstoneGameTime(); //Luminol - Piston fixes from molean server blockEntity.progressO = blockEntity.progress; if (blockEntity.progressO >= 1.0F) { if (world.isClientSide && blockEntity.deathTicks < 5) {