fix ATs getting stuck in file patches

This commit is contained in:
granny
2025-06-29 23:23:53 -07:00
parent 9cd2f31887
commit a1bdc94600
6 changed files with 4 additions and 59 deletions

View File

@@ -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

View File

@@ -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<String> 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);
}

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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<Item> values;
+ private final Object2IntSortedMap<Item> values;
FuelValues(Object2IntSortedMap<Item> values) {
this.values = values;

View File

@@ -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;