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

@@ -9,19 +9,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityTurtle.java
+++ b/src/main/java/net/minecraft/server/EntityTurtle.java
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
this.G = 1.0F;
}
+ public final void setHome(BlockPosition pos) { setHomePos(pos); } // Paper - OBFHELPER
public void setHomePos(BlockPosition blockposition) {
this.datawatcher.set(EntityTurtle.bw, blockposition);
}
-
+ // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them
+ public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER
private BlockPosition getHomePos() {
- private BlockPosition getHomePos() {
+ public BlockPosition getHomePos() { // Paper - public
return (BlockPosition) this.datawatcher.get(EntityTurtle.bw);
}
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
return (Boolean) this.datawatcher.get(EntityTurtle.bx);
}
@@ -112,12 +108,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ @Override
+ public Location getHome() {
+ return MCUtil.toLocation(getHandle().world, getHandle().getHome());
+ return MCUtil.toLocation(getHandle().world, getHandle().getHomePos());
+ }
+
+ @Override
+ public void setHome(Location location) {
+ getHandle().setHome(MCUtil.toBlockPosition(location));
+ getHandle().setHomePos(MCUtil.toBlockPosition(location));
+ }
+
+ @Override