Clean up a lot of obfuscation helpers and impls

This fixes a bug with obfuscation helpers for attack cooldown
But every other change should stay the same.

Cleaning up a lot of helpers that pointed to already unobfuscated items.
Also adds final to many of the obfhelpers to assist with inlining.

This is pretty much a patch maintenance
This commit is contained in:
Aikar
2020-08-02 01:39:36 -04:00
parent e5c86b8f4f
commit 305390ec83
48 changed files with 174 additions and 270 deletions

View File

@@ -17,6 +17,15 @@ diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public boolean ac;
public boolean impulse;
public int portalCooldown;
- protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER
+ public boolean inPortal; // Paper - public
protected int portalTicks;
protected BlockPosition ah;
protected Vec3D ai;
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
@@ -51,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.al;
}
+ public boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it!
+ public final boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it!
public boolean bU() {
// Paper start
return this.pushedByWater();
@@ -681,7 +690,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // Paper start - special case always immunities
+ // immunize brand new entities, dead entities, and portal scenarios
+ if (entity.defaultActivationState || entity.ticksLived < 20*10 || !entity.isAlive() || entity.inPortal() || entity.portalCooldown > 0) {
+ if (entity.defaultActivationState || entity.ticksLived < 20*10 || !entity.isAlive() || entity.inPortal || entity.portalCooldown > 0) {
+ return true;
+ }
+ // immunize leashed entities