even even even more work

This commit is contained in:
MiniDigger | Martin
2020-06-25 16:09:55 +02:00
parent 4aa7955818
commit e943ece469
125 changed files with 857 additions and 3512 deletions

View File

@@ -9,76 +9,60 @@ 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.H = 1.0F;
this.G = 1.0F;
}
+ public final void setHome(BlockPosition pos) { g(pos); } // Paper - OBFHELPER
public void g(BlockPosition blockposition) {
this.datawatcher.set(EntityTurtle.bx, blockposition);
+ 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() {
return (BlockPosition) this.datawatcher.get(EntityTurtle.bw);
}
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
this.datawatcher.set(EntityTurtle.bx, flag);
}
+ public final BlockPosition getHome() { return this.es(); } // Paper - OBFHELPER
private BlockPosition es() {
return (BlockPosition) this.datawatcher.get(EntityTurtle.bx);
}
+ public final void setTravelPos(BlockPosition pos) { this.h(pos); } // Paper - OBFHELPER
private void h(BlockPosition blockposition) {
this.datawatcher.set(EntityTurtle.bA, blockposition);
}
+ public final BlockPosition getTravelPos() { return this.et(); } // Paper - OBFHELPER
private BlockPosition et() {
return (BlockPosition) this.datawatcher.get(EntityTurtle.bA);
}
+ public final boolean hasEgg() { return this.eq(); } // Paper - OBFHELPER
public boolean eq() {
+ public final boolean isDigging() { return this.eM(); } // Paper - OBFHELPER
public boolean eM() {
return (Boolean) this.datawatcher.get(EntityTurtle.by);
}
+ public final void setHasEgg(boolean hasEgg) { this.r(hasEgg); } // Paper - OBFHELPER
private void r(boolean flag) {
+ public final void setDigging(boolean digging) { this.u(digging); } // Paper - OBFHELPER
private void u(boolean flag) {
this.bC = flag ? 1 : 0;
this.datawatcher.set(EntityTurtle.by, flag);
}
+ public final boolean isDigging() { return this.er(); } // Paper - OBFHELPER
public boolean er() {
return (Boolean) this.datawatcher.get(EntityTurtle.bz);
+ public final boolean isGoingHome() { return this.eV(); } // Paper - OBFHELPER
private boolean eV() {
return (Boolean) this.datawatcher.get(EntityTurtle.bA);
}
+ public final void setDigging(boolean digging) { this.s(digging); } // Paper - OBFHELPER
private void s(boolean flag) {
this.bD = flag ? 1 : 0;
this.datawatcher.set(EntityTurtle.bz, flag);
+ public final void setGoingHome(boolean goingHome) { this.v(goingHome); } // Paper - OBFHELPER
private void v(boolean flag) {
this.datawatcher.set(EntityTurtle.bA, flag);
}
+ public final boolean isGoingHome() { return this.eu(); } // Paper - OBFHELPER
private boolean eu() {
+ public final boolean isTravelling() { return this.eW(); } // Paper - OBFHELPER
private boolean eW() {
return (Boolean) this.datawatcher.get(EntityTurtle.bB);
}
+ public final void setGoingHome(boolean goingHome) { this.t(goingHome); } // Paper - OBFHELPER
private void t(boolean flag) {
+ public final void setTravelling(boolean travelling) { this.w(travelling); } // Paper - OBFHELPER
private void w(boolean flag) {
this.datawatcher.set(EntityTurtle.bB, flag);
}
+ public final boolean isTravelling() { return this.ez(); } // Paper - OBFHELPER
private boolean ez() {
return (Boolean) this.datawatcher.get(EntityTurtle.bC);
}
+ public final void setTravelling(boolean travelling) { this.u(travelling); } // Paper - OBFHELPER
private void u(boolean flag) {
this.datawatcher.set(EntityTurtle.bC, flag);
}
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
if (!this.g.isInWater() && this.k()) {
if (this.g.bD < 1) {
- this.g.s(true);
if (this.g.bC < 1) {
- this.g.u(true);
+ this.g.setDigging(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.e)).callEvent()); // Paper
} else if (this.g.bD > 200) {
} else if (this.g.bC > 200) {
World world = this.g.world;
// CraftBukkit start
@@ -92,13 +76,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, layEggEvent.getEggCount()), 3);
}
// CraftBukkit end
this.g.r(false);
this.g.setHasEgg(false);
@@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal {
@Override
public boolean a() {
- return this.a.isBaby() ? false : (this.a.eq() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.es().a((IPosition) this.a.getPositionVector(), 64.0D)));
+ return this.a.isBaby() ? false : (this.a.eq() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.es().a((IPosition) this.a.getPositionVector(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper
- return this.a.isBaby() ? false : (this.a.hasEgg() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.getHomePos().a((IPosition) this.a.getPositionVector(), 64.0D)));
+ return this.a.isBaby() ? false : (this.a.hasEgg() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.getHomePos().a((IPosition) this.a.getPositionVector(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.a.getBukkitEntity()).callEvent(); // Paper
}
@Override