From a1bdc94600bc921c949ec3709e9617532ec75177 Mon Sep 17 00:00:00 2001 From: granny Date: Sun, 29 Jun 2025 23:23:53 -0700 Subject: [PATCH] fix ATs getting stuck in file patches --- .../ServerCommonPacketListenerImpl.java.patch | 6 +++--- .../minecraft/world/entity/Entity.java.patch | 17 +---------------- .../world/entity/monster/Shulker.java.patch | 9 --------- .../world/entity/player/Player.java.patch | 9 --------- .../level/block/entity/FuelValues.java.patch | 11 ----------- .../level/block/state/BlockBehaviour.java.patch | 11 ----------- 6 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch delete mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch index 5b4381b51..b1d3290dd 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch @@ -48,10 +48,10 @@ + if (org.purpurmc.purpur.PurpurConfig.useAlternateKeepAlive) { + if (this.checkIfClosed(millis) && !this.processedDisconnect) { + long currTime = System.nanoTime(); -+ if ((currTime - this.player.lastKeepAliveTx) >= java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)) { // 1 second -+ this.player.lastKeepAliveTx = currTime; ++ if ((currTime - this.keepAlive.lastKeepAliveTx) >= java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)) { // 1 second ++ this.keepAlive.lastKeepAliveTx = currTime; + if (this.keepAlivePending && !this.processedDisconnect && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) { -+ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); ++ this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, io.papermc.paper.connection.DisconnectionReason.TIMEOUT); + } else if (this.checkIfClosed(millis)) { + this.keepAlivePending = true; + this.keepAlives.add(millis); // currentTime is ID diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch index 331145e19..ef0282cc6 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch @@ -19,7 +19,7 @@ public int tickCount; private int remainingFireTicks; public boolean wasTouchingWater; -@@ -315,13 +_,13 @@ +@@ -315,8 +_,8 @@ public PortalProcessor portalProcess; public int portalCooldown; private boolean invulnerable; @@ -30,12 +30,6 @@ private boolean hasGlowingTag; private final Set tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0}; - private long pistonDeltasGameTime; -- protected EntityDimensions dimensions; -+ private EntityDimensions dimensions; - private float eyeHeight; - public boolean isInPowderSnow; - public boolean wasInPowderSnow; @@ -371,6 +_,7 @@ public long activatedTick = Integer.MIN_VALUE; public boolean isTemporarilyActive; @@ -83,15 +77,6 @@ } public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) { -@@ -1964,7 +_,7 @@ - return this.isInWater() || flag; - } - -- public void updateInWaterStateAndDoWaterCurrentPushing() { -+ void updateInWaterStateAndDoWaterCurrentPushing() { - if (this.getVehicle() instanceof AbstractBoat abstractBoat && !abstractBoat.isUnderWater()) { - this.wasTouchingWater = false; - } else if (this.updateFluidHeightAndDoFluidPushing(FluidTags.WATER, 0.014)) { @@ -2585,6 +_,11 @@ output.putBoolean("Paper.FreezeLock", true); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch index e98033505..a64e3c08d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch @@ -1,14 +1,5 @@ --- a/net/minecraft/world/entity/monster/Shulker.java +++ b/net/minecraft/world/entity/monster/Shulker.java -@@ -80,7 +_,7 @@ - Vec3i unitVec3i = Direction.SOUTH.getUnitVec3i(); - return new Vector3f(unitVec3i.getX(), unitVec3i.getY(), unitVec3i.getZ()); - }); -- public static final float MAX_SCALE = 3.0F; -+ private static final float MAX_SCALE = 3.0F; - private float currentPeekAmountO; - private float currentPeekAmount; - @Nullable @@ -94,6 +_,21 @@ this.lookControl = new Shulker.ShulkerLookControl(this); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index bce3db5c3..787982d42 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -70,15 +70,6 @@ } float f2 = f + f1; -@@ -1579,7 +_,7 @@ - } - - @Override -- public boolean canGlide() { -+ protected boolean canGlide() { - return !this.abilities.flying && super.canGlide(); - } - @@ -1823,7 +_,23 @@ @Override diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch deleted file mode 100644 index c43d411ee..000000000 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/level/block/entity/FuelValues.java -+++ b/net/minecraft/world/level/block/entity/FuelValues.java -@@ -17,7 +_,7 @@ - import net.minecraft.world.level.block.Blocks; - - public class FuelValues { -- public final Object2IntSortedMap values; -+ private final Object2IntSortedMap values; - - FuelValues(Object2IntSortedMap values) { - this.values = values; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch deleted file mode 100644 index db63daffb..000000000 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/world/level/block/state/BlockBehaviour.java -+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -90,7 +_,7 @@ - Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP - }; - public final boolean hasCollision; -- public float explosionResistance; -+ protected final float explosionResistance; - protected final boolean isRandomlyTicking; - protected final SoundType soundType; - protected final float friction;