mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
SPIGOT-3637: Adjust yaw yet again
This commit is contained in:
@@ -49,17 +49,23 @@
|
||||
private static final Logger a = LogManager.getLogger();
|
||||
private static final List<ItemStack> b = Collections.emptyList();
|
||||
private static final AxisAlignedBB c = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
@@ -102,6 +142,9 @@
|
||||
@@ -102,6 +142,15 @@
|
||||
private boolean aI;
|
||||
private final double[] aJ;
|
||||
private long aK;
|
||||
+ public boolean valid; // CraftBukkit
|
||||
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
|
||||
+ public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
|
||||
+ // CraftBukkit start
|
||||
+ public boolean valid;
|
||||
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only
|
||||
+ public boolean forceExplosionKnockback; // SPIGOT-949
|
||||
+
|
||||
+ public float getBukkitYaw() {
|
||||
+ return this.yaw;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
public Entity(World world) {
|
||||
this.id = Entity.entityCount++;
|
||||
@@ -208,6 +251,33 @@
|
||||
@@ -208,6 +257,33 @@
|
||||
}
|
||||
|
||||
protected void setYawPitch(float f, float f1) {
|
||||
@@ -93,7 +99,7 @@
|
||||
this.yaw = f % 360.0F;
|
||||
this.pitch = f1 % 360.0F;
|
||||
}
|
||||
@@ -230,6 +300,51 @@
|
||||
@@ -230,6 +306,51 @@
|
||||
this.Y();
|
||||
}
|
||||
|
||||
@@ -145,7 +151,7 @@
|
||||
public void Y() {
|
||||
this.world.methodProfiler.a("entityBaseTick");
|
||||
if (this.isPassenger() && this.bJ().dead) {
|
||||
@@ -246,6 +361,8 @@
|
||||
@@ -246,6 +367,8 @@
|
||||
this.lastZ = this.locZ;
|
||||
this.lastPitch = this.pitch;
|
||||
this.lastYaw = this.yaw;
|
||||
@@ -154,7 +160,7 @@
|
||||
if (!this.world.isClientSide && this.world instanceof WorldServer) {
|
||||
this.world.methodProfiler.a("portal");
|
||||
if (this.ak) {
|
||||
@@ -285,6 +402,7 @@
|
||||
@@ -285,6 +408,7 @@
|
||||
this.I();
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
@@ -162,7 +168,7 @@
|
||||
|
||||
this.as();
|
||||
this.aq();
|
||||
@@ -336,6 +454,27 @@
|
||||
@@ -336,6 +460,27 @@
|
||||
protected void burnFromLava() {
|
||||
if (!this.fireProof) {
|
||||
this.damageEntity(DamageSource.LAVA, 4.0F);
|
||||
@@ -190,7 +196,7 @@
|
||||
this.setOnFire(15);
|
||||
}
|
||||
}
|
||||
@@ -376,6 +515,22 @@
|
||||
@@ -376,6 +521,22 @@
|
||||
this.a(this.getBoundingBox().d(d0, d1, d2));
|
||||
this.recalcPosition();
|
||||
} else {
|
||||
@@ -213,7 +219,7 @@
|
||||
if (enummovetype == EnumMoveType.PISTON) {
|
||||
long i = this.world.getTime();
|
||||
|
||||
@@ -517,7 +672,7 @@
|
||||
@@ -517,7 +678,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +228,7 @@
|
||||
double d11;
|
||||
|
||||
if (this.P > 0.0F && flag && (d7 != d0 || d9 != d2)) {
|
||||
@@ -615,7 +770,7 @@
|
||||
@@ -615,7 +776,7 @@
|
||||
this.world.methodProfiler.a("rest");
|
||||
this.recalcPosition();
|
||||
this.positionChanged = d7 != d0 || d9 != d2;
|
||||
@@ -231,7 +237,7 @@
|
||||
this.onGround = this.B && d8 < 0.0D;
|
||||
this.C = this.positionChanged || this.B;
|
||||
l = MathHelper.floor(this.locX);
|
||||
@@ -650,6 +805,28 @@
|
||||
@@ -650,6 +811,28 @@
|
||||
block1.a(this.world, this);
|
||||
}
|
||||
|
||||
@@ -260,7 +266,7 @@
|
||||
if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) {
|
||||
double d22 = this.locX - d4;
|
||||
double d23 = this.locY - d5;
|
||||
@@ -685,6 +862,8 @@
|
||||
@@ -685,6 +868,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +275,7 @@
|
||||
try {
|
||||
this.checkBlockCollisions();
|
||||
} catch (Throwable throwable) {
|
||||
@@ -694,6 +873,8 @@
|
||||
@@ -694,6 +879,8 @@
|
||||
this.appendEntityCrashDetails(crashreportsystemdetails);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@@ -278,7 +284,7 @@
|
||||
|
||||
boolean flag1 = this.an();
|
||||
|
||||
@@ -702,7 +883,14 @@
|
||||
@@ -702,7 +889,14 @@
|
||||
if (!flag1) {
|
||||
++this.fireTicks;
|
||||
if (this.fireTicks == 0) {
|
||||
@@ -294,7 +300,7 @@
|
||||
}
|
||||
}
|
||||
} else if (this.fireTicks <= 0) {
|
||||
@@ -834,7 +1022,7 @@
|
||||
@@ -834,7 +1028,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -303,7 +309,7 @@
|
||||
if (!this.fireProof) {
|
||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||
}
|
||||
@@ -1008,6 +1196,13 @@
|
||||
@@ -1008,6 +1202,13 @@
|
||||
}
|
||||
|
||||
public void spawnIn(World world) {
|
||||
@@ -317,7 +323,7 @@
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@@ -1245,6 +1440,18 @@
|
||||
@@ -1245,6 +1446,18 @@
|
||||
try {
|
||||
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ}));
|
||||
nbttagcompound.set("Motion", this.a(new double[] { this.motX, this.motY, this.motZ}));
|
||||
@@ -336,7 +342,7 @@
|
||||
nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
|
||||
nbttagcompound.setFloat("FallDistance", this.fallDistance);
|
||||
nbttagcompound.setShort("Fire", (short) this.fireTicks);
|
||||
@@ -1254,6 +1461,12 @@
|
||||
@@ -1254,6 +1467,12 @@
|
||||
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
|
||||
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
|
||||
nbttagcompound.a("UUID", this.getUniqueID());
|
||||
@@ -349,7 +355,7 @@
|
||||
if (this.hasCustomName()) {
|
||||
nbttagcompound.setString("CustomName", this.getCustomName());
|
||||
}
|
||||
@@ -1329,6 +1542,8 @@
|
||||
@@ -1329,6 +1548,8 @@
|
||||
this.motX = nbttaglist1.f(0);
|
||||
this.motY = nbttaglist1.f(1);
|
||||
this.motZ = nbttaglist1.f(2);
|
||||
@@ -358,7 +364,7 @@
|
||||
if (Math.abs(this.motX) > 10.0D) {
|
||||
this.motX = 0.0D;
|
||||
}
|
||||
@@ -1340,6 +1555,7 @@
|
||||
@@ -1340,6 +1561,7 @@
|
||||
if (Math.abs(this.motZ) > 10.0D) {
|
||||
this.motZ = 0.0D;
|
||||
}
|
||||
@@ -366,7 +372,7 @@
|
||||
|
||||
this.locX = nbttaglist.f(0);
|
||||
this.locY = nbttaglist.f(1);
|
||||
@@ -1397,6 +1613,58 @@
|
||||
@@ -1397,6 +1619,58 @@
|
||||
this.setPosition(this.locX, this.locY, this.locZ);
|
||||
}
|
||||
|
||||
@@ -425,7 +431,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
||||
@@ -1464,6 +1732,12 @@
|
||||
@@ -1464,6 +1738,12 @@
|
||||
if (itemstack.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -438,7 +444,7 @@
|
||||
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
|
||||
|
||||
entityitem.q();
|
||||
@@ -1589,6 +1863,24 @@
|
||||
@@ -1589,6 +1869,24 @@
|
||||
if (entity.bJ() != this) {
|
||||
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
|
||||
} else {
|
||||
@@ -463,7 +469,7 @@
|
||||
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bE() instanceof EntityHuman)) {
|
||||
this.passengers.add(0, entity);
|
||||
} else {
|
||||
@@ -1602,6 +1894,22 @@
|
||||
@@ -1602,6 +1900,22 @@
|
||||
if (entity.bJ() == this) {
|
||||
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
||||
} else {
|
||||
@@ -486,7 +492,7 @@
|
||||
this.passengers.remove(entity);
|
||||
entity.j = 60;
|
||||
}
|
||||
@@ -1741,14 +2049,49 @@
|
||||
@@ -1741,14 +2055,49 @@
|
||||
}
|
||||
|
||||
public void setAirTicks(int i) {
|
||||
@@ -539,7 +545,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1893,19 +2236,76 @@
|
||||
@@ -1893,19 +2242,76 @@
|
||||
if (!this.world.isClientSide && !this.dead) {
|
||||
this.world.methodProfiler.a("changeDimension");
|
||||
MinecraftServer minecraftserver = this.C_();
|
||||
@@ -619,7 +625,7 @@
|
||||
BlockPosition blockposition;
|
||||
|
||||
if (i == 1) {
|
||||
@@ -1934,12 +2334,18 @@
|
||||
@@ -1934,12 +2340,18 @@
|
||||
blockposition = new BlockPosition(this);
|
||||
}
|
||||
|
||||
@@ -639,7 +645,7 @@
|
||||
if (j == 1 && i == 1) {
|
||||
BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn());
|
||||
|
||||
@@ -1947,6 +2353,7 @@
|
||||
@@ -1947,6 +2359,7 @@
|
||||
} else {
|
||||
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
|
||||
}
|
||||
@@ -647,7 +653,7 @@
|
||||
|
||||
boolean flag = entity.attachedToPlayer;
|
||||
|
||||
@@ -1954,13 +2361,21 @@
|
||||
@@ -1954,13 +2367,21 @@
|
||||
worldserver1.addEntity(entity);
|
||||
entity.attachedToPlayer = flag;
|
||||
worldserver1.entityJoinedWorld(entity, false);
|
||||
@@ -670,7 +676,7 @@
|
||||
return entity;
|
||||
} else {
|
||||
return null;
|
||||
@@ -2064,6 +2479,11 @@
|
||||
@@ -2064,6 +2485,11 @@
|
||||
}
|
||||
|
||||
public void setCustomName(String s) {
|
||||
@@ -682,7 +688,7 @@
|
||||
this.datawatcher.set(Entity.aB, s);
|
||||
}
|
||||
|
||||
@@ -2121,7 +2541,26 @@
|
||||
@@ -2121,7 +2547,26 @@
|
||||
}
|
||||
|
||||
public void a(AxisAlignedBB axisalignedbb) {
|
||||
@@ -710,7 +716,7 @@
|
||||
}
|
||||
|
||||
public float getHeadHeight() {
|
||||
@@ -2295,7 +2734,7 @@
|
||||
@@ -2295,7 +2740,7 @@
|
||||
for (Iterator iterator = this.bF().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
|
||||
entity = (Entity) iterator.next();
|
||||
if (oclass.isAssignableFrom(entity.getClass())) {
|
||||
|
Reference in New Issue
Block a user