mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-22 15:53:49 -07:00
Houston, we got a patch (#2731)
* Houston, we got a patch * is this the end of the beginning or the beginning of the end
This commit is contained in:
@@ -5,80 +5,80 @@ Subject: [PATCH] Turtle API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
|
||||
index 594cc70def..0bd80e5623 100644
|
||||
index 76296119a..dd02cb348 100644
|
||||
--- 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.K = 1.0F;
|
||||
this.H = 1.0F;
|
||||
}
|
||||
|
||||
+ public final void setHome(BlockPosition pos) { g(pos); } // Paper - OBFHELPER
|
||||
public void g(BlockPosition blockposition) {
|
||||
this.datawatcher.set(EntityTurtle.bA, blockposition);
|
||||
this.datawatcher.set(EntityTurtle.bx, blockposition);
|
||||
}
|
||||
|
||||
+ public final BlockPosition getHome() { return this.dX(); } // Paper - OBFHELPER
|
||||
private BlockPosition dX() {
|
||||
return (BlockPosition) this.datawatcher.get(EntityTurtle.bA);
|
||||
+ 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.bD, blockposition);
|
||||
this.datawatcher.set(EntityTurtle.bA, blockposition);
|
||||
}
|
||||
|
||||
+ public final BlockPosition getTravelPos() { return this.dY(); } // Paper - OBFHELPER
|
||||
private BlockPosition dY() {
|
||||
return (BlockPosition) this.datawatcher.get(EntityTurtle.bD);
|
||||
+ 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.dV(); } // Paper - OBFHELPER
|
||||
public boolean dV() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bB);
|
||||
+ public final boolean hasEgg() { return this.eq(); } // Paper - OBFHELPER
|
||||
public boolean eq() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.by);
|
||||
}
|
||||
|
||||
+ public final void setHasEgg(boolean hasEgg) { this.r(hasEgg); } // Paper - OBFHELPER
|
||||
private void r(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bB, flag);
|
||||
this.datawatcher.set(EntityTurtle.by, flag);
|
||||
}
|
||||
|
||||
+ public final boolean isDigging() { return this.dW(); } // Paper - OBFHELPER
|
||||
public boolean dW() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bC);
|
||||
+ public final boolean isDigging() { return this.er(); } // Paper - OBFHELPER
|
||||
public boolean er() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bz);
|
||||
}
|
||||
|
||||
+ public final void setDigging(boolean digging) { this.s(digging); } // Paper - OBFHELPER
|
||||
private void s(boolean flag) {
|
||||
this.bG = flag ? 1 : 0;
|
||||
this.datawatcher.set(EntityTurtle.bC, flag);
|
||||
this.bD = flag ? 1 : 0;
|
||||
this.datawatcher.set(EntityTurtle.bz, flag);
|
||||
}
|
||||
|
||||
+ public final boolean isGoingHome() { return this.dZ(); } // Paper - OBFHELPER
|
||||
private boolean dZ() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bE);
|
||||
+ public final boolean isGoingHome() { return this.eu(); } // Paper - OBFHELPER
|
||||
private boolean eu() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bB);
|
||||
}
|
||||
|
||||
+ public final void setGoingHome(boolean goingHome) { this.t(goingHome); } // Paper - OBFHELPER
|
||||
private void t(boolean flag) {
|
||||
this.datawatcher.set(EntityTurtle.bE, flag);
|
||||
this.datawatcher.set(EntityTurtle.bB, flag);
|
||||
}
|
||||
|
||||
+ public final boolean isTravelling() { return this.ee(); } // Paper - OBFHELPER
|
||||
private boolean ee() {
|
||||
return (Boolean) this.datawatcher.get(EntityTurtle.bF);
|
||||
+ 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.bF, 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.bG < 1) {
|
||||
if (this.g.bD < 1) {
|
||||
- this.g.s(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.bG > 200) {
|
||||
} else if (this.g.bD > 200) {
|
||||
World world = this.g.world;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -97,13 +97,13 @@ index 594cc70def..0bd80e5623 100644
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
- return this.a.isBaby() ? false : (this.a.dV() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.dX().a((IPosition) this.a.getPositionVector(), 64.0D)));
|
||||
+ return this.a.isBaby() ? false : (this.a.dW() ? true : (this.a.getRandom().nextInt(700) != 0 ? false : !this.a.dY().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.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
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
|
||||
index 123a2c75ca..8edcf7af65 100644
|
||||
index 123a2c75c..8edcf7af6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
Reference in New Issue
Block a user