Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
SPIGOT-3637: Adjust yaw yet again
Dieser Commit ist enthalten in:
Ursprung
53fccdf958
Commit
2fae23c251
@ -49,17 +49,23 @@
|
|||||||
private static final Logger a = LogManager.getLogger();
|
private static final Logger a = LogManager.getLogger();
|
||||||
private static final List<ItemStack> b = Collections.emptyList();
|
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);
|
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 boolean aI;
|
||||||
private final double[] aJ;
|
private final double[] aJ;
|
||||||
private long aK;
|
private long aK;
|
||||||
+ public boolean valid; // CraftBukkit
|
+ // CraftBukkit start
|
||||||
+ public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
|
+ public boolean valid;
|
||||||
+ public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
|
+ 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) {
|
public Entity(World world) {
|
||||||
this.id = Entity.entityCount++;
|
this.id = Entity.entityCount++;
|
||||||
@@ -208,6 +251,33 @@
|
@@ -208,6 +257,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setYawPitch(float f, float f1) {
|
protected void setYawPitch(float f, float f1) {
|
||||||
@ -93,7 +99,7 @@
|
|||||||
this.yaw = f % 360.0F;
|
this.yaw = f % 360.0F;
|
||||||
this.pitch = f1 % 360.0F;
|
this.pitch = f1 % 360.0F;
|
||||||
}
|
}
|
||||||
@@ -230,6 +300,51 @@
|
@@ -230,6 +306,51 @@
|
||||||
this.Y();
|
this.Y();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +151,7 @@
|
|||||||
public void Y() {
|
public void Y() {
|
||||||
this.world.methodProfiler.a("entityBaseTick");
|
this.world.methodProfiler.a("entityBaseTick");
|
||||||
if (this.isPassenger() && this.bJ().dead) {
|
if (this.isPassenger() && this.bJ().dead) {
|
||||||
@@ -246,6 +361,8 @@
|
@@ -246,6 +367,8 @@
|
||||||
this.lastZ = this.locZ;
|
this.lastZ = this.locZ;
|
||||||
this.lastPitch = this.pitch;
|
this.lastPitch = this.pitch;
|
||||||
this.lastYaw = this.yaw;
|
this.lastYaw = this.yaw;
|
||||||
@ -154,7 +160,7 @@
|
|||||||
if (!this.world.isClientSide && this.world instanceof WorldServer) {
|
if (!this.world.isClientSide && this.world instanceof WorldServer) {
|
||||||
this.world.methodProfiler.a("portal");
|
this.world.methodProfiler.a("portal");
|
||||||
if (this.ak) {
|
if (this.ak) {
|
||||||
@@ -285,6 +402,7 @@
|
@@ -285,6 +408,7 @@
|
||||||
this.I();
|
this.I();
|
||||||
this.world.methodProfiler.b();
|
this.world.methodProfiler.b();
|
||||||
}
|
}
|
||||||
@ -162,7 +168,7 @@
|
|||||||
|
|
||||||
this.as();
|
this.as();
|
||||||
this.aq();
|
this.aq();
|
||||||
@@ -336,6 +454,27 @@
|
@@ -336,6 +460,27 @@
|
||||||
protected void burnFromLava() {
|
protected void burnFromLava() {
|
||||||
if (!this.fireProof) {
|
if (!this.fireProof) {
|
||||||
this.damageEntity(DamageSource.LAVA, 4.0F);
|
this.damageEntity(DamageSource.LAVA, 4.0F);
|
||||||
@ -190,7 +196,7 @@
|
|||||||
this.setOnFire(15);
|
this.setOnFire(15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -376,6 +515,22 @@
|
@@ -376,6 +521,22 @@
|
||||||
this.a(this.getBoundingBox().d(d0, d1, d2));
|
this.a(this.getBoundingBox().d(d0, d1, d2));
|
||||||
this.recalcPosition();
|
this.recalcPosition();
|
||||||
} else {
|
} else {
|
||||||
@ -213,7 +219,7 @@
|
|||||||
if (enummovetype == EnumMoveType.PISTON) {
|
if (enummovetype == EnumMoveType.PISTON) {
|
||||||
long i = this.world.getTime();
|
long i = this.world.getTime();
|
||||||
|
|
||||||
@@ -517,7 +672,7 @@
|
@@ -517,7 +678,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +228,7 @@
|
|||||||
double d11;
|
double d11;
|
||||||
|
|
||||||
if (this.P > 0.0F && flag && (d7 != d0 || d9 != d2)) {
|
if (this.P > 0.0F && flag && (d7 != d0 || d9 != d2)) {
|
||||||
@@ -615,7 +770,7 @@
|
@@ -615,7 +776,7 @@
|
||||||
this.world.methodProfiler.a("rest");
|
this.world.methodProfiler.a("rest");
|
||||||
this.recalcPosition();
|
this.recalcPosition();
|
||||||
this.positionChanged = d7 != d0 || d9 != d2;
|
this.positionChanged = d7 != d0 || d9 != d2;
|
||||||
@ -231,7 +237,7 @@
|
|||||||
this.onGround = this.B && d8 < 0.0D;
|
this.onGround = this.B && d8 < 0.0D;
|
||||||
this.C = this.positionChanged || this.B;
|
this.C = this.positionChanged || this.B;
|
||||||
l = MathHelper.floor(this.locX);
|
l = MathHelper.floor(this.locX);
|
||||||
@@ -650,6 +805,28 @@
|
@@ -650,6 +811,28 @@
|
||||||
block1.a(this.world, this);
|
block1.a(this.world, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +266,7 @@
|
|||||||
if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) {
|
if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) {
|
||||||
double d22 = this.locX - d4;
|
double d22 = this.locX - d4;
|
||||||
double d23 = this.locY - d5;
|
double d23 = this.locY - d5;
|
||||||
@@ -685,6 +862,8 @@
|
@@ -685,6 +868,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +275,7 @@
|
|||||||
try {
|
try {
|
||||||
this.checkBlockCollisions();
|
this.checkBlockCollisions();
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
@@ -694,6 +873,8 @@
|
@@ -694,6 +879,8 @@
|
||||||
this.appendEntityCrashDetails(crashreportsystemdetails);
|
this.appendEntityCrashDetails(crashreportsystemdetails);
|
||||||
throw new ReportedException(crashreport);
|
throw new ReportedException(crashreport);
|
||||||
}
|
}
|
||||||
@ -278,7 +284,7 @@
|
|||||||
|
|
||||||
boolean flag1 = this.an();
|
boolean flag1 = this.an();
|
||||||
|
|
||||||
@@ -702,7 +883,14 @@
|
@@ -702,7 +889,14 @@
|
||||||
if (!flag1) {
|
if (!flag1) {
|
||||||
++this.fireTicks;
|
++this.fireTicks;
|
||||||
if (this.fireTicks == 0) {
|
if (this.fireTicks == 0) {
|
||||||
@ -294,7 +300,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.fireTicks <= 0) {
|
} else if (this.fireTicks <= 0) {
|
||||||
@@ -834,7 +1022,7 @@
|
@@ -834,7 +1028,7 @@
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,7 +309,7 @@
|
|||||||
if (!this.fireProof) {
|
if (!this.fireProof) {
|
||||||
this.damageEntity(DamageSource.FIRE, (float) i);
|
this.damageEntity(DamageSource.FIRE, (float) i);
|
||||||
}
|
}
|
||||||
@@ -1008,6 +1196,13 @@
|
@@ -1008,6 +1202,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void spawnIn(World world) {
|
public void spawnIn(World world) {
|
||||||
@ -317,7 +323,7 @@
|
|||||||
this.world = world;
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1245,6 +1440,18 @@
|
@@ -1245,6 +1446,18 @@
|
||||||
try {
|
try {
|
||||||
nbttagcompound.set("Pos", this.a(new double[] { this.locX, this.locY, this.locZ}));
|
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}));
|
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.set("Rotation", this.a(new float[] { this.yaw, this.pitch}));
|
||||||
nbttagcompound.setFloat("FallDistance", this.fallDistance);
|
nbttagcompound.setFloat("FallDistance", this.fallDistance);
|
||||||
nbttagcompound.setShort("Fire", (short) this.fireTicks);
|
nbttagcompound.setShort("Fire", (short) this.fireTicks);
|
||||||
@@ -1254,6 +1461,12 @@
|
@@ -1254,6 +1467,12 @@
|
||||||
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
|
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
|
||||||
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
|
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
|
||||||
nbttagcompound.a("UUID", this.getUniqueID());
|
nbttagcompound.a("UUID", this.getUniqueID());
|
||||||
@ -349,7 +355,7 @@
|
|||||||
if (this.hasCustomName()) {
|
if (this.hasCustomName()) {
|
||||||
nbttagcompound.setString("CustomName", this.getCustomName());
|
nbttagcompound.setString("CustomName", this.getCustomName());
|
||||||
}
|
}
|
||||||
@@ -1329,6 +1542,8 @@
|
@@ -1329,6 +1548,8 @@
|
||||||
this.motX = nbttaglist1.f(0);
|
this.motX = nbttaglist1.f(0);
|
||||||
this.motY = nbttaglist1.f(1);
|
this.motY = nbttaglist1.f(1);
|
||||||
this.motZ = nbttaglist1.f(2);
|
this.motZ = nbttaglist1.f(2);
|
||||||
@ -358,7 +364,7 @@
|
|||||||
if (Math.abs(this.motX) > 10.0D) {
|
if (Math.abs(this.motX) > 10.0D) {
|
||||||
this.motX = 0.0D;
|
this.motX = 0.0D;
|
||||||
}
|
}
|
||||||
@@ -1340,6 +1555,7 @@
|
@@ -1340,6 +1561,7 @@
|
||||||
if (Math.abs(this.motZ) > 10.0D) {
|
if (Math.abs(this.motZ) > 10.0D) {
|
||||||
this.motZ = 0.0D;
|
this.motZ = 0.0D;
|
||||||
}
|
}
|
||||||
@ -366,7 +372,7 @@
|
|||||||
|
|
||||||
this.locX = nbttaglist.f(0);
|
this.locX = nbttaglist.f(0);
|
||||||
this.locY = nbttaglist.f(1);
|
this.locY = nbttaglist.f(1);
|
||||||
@@ -1397,6 +1613,58 @@
|
@@ -1397,6 +1619,58 @@
|
||||||
this.setPosition(this.locX, this.locY, this.locZ);
|
this.setPosition(this.locX, this.locY, this.locZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,7 +431,7 @@
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
|
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
|
||||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
||||||
@@ -1464,6 +1732,12 @@
|
@@ -1464,6 +1738,12 @@
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
@ -438,7 +444,7 @@
|
|||||||
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
|
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
|
||||||
|
|
||||||
entityitem.q();
|
entityitem.q();
|
||||||
@@ -1589,6 +1863,24 @@
|
@@ -1589,6 +1869,24 @@
|
||||||
if (entity.bJ() != this) {
|
if (entity.bJ() != this) {
|
||||||
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
|
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
|
||||||
} else {
|
} else {
|
||||||
@ -463,7 +469,7 @@
|
|||||||
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bE() instanceof EntityHuman)) {
|
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bE() instanceof EntityHuman)) {
|
||||||
this.passengers.add(0, entity);
|
this.passengers.add(0, entity);
|
||||||
} else {
|
} else {
|
||||||
@@ -1602,6 +1894,22 @@
|
@@ -1602,6 +1900,22 @@
|
||||||
if (entity.bJ() == this) {
|
if (entity.bJ() == this) {
|
||||||
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
||||||
} else {
|
} else {
|
||||||
@ -486,7 +492,7 @@
|
|||||||
this.passengers.remove(entity);
|
this.passengers.remove(entity);
|
||||||
entity.j = 60;
|
entity.j = 60;
|
||||||
}
|
}
|
||||||
@@ -1741,14 +2049,49 @@
|
@@ -1741,14 +2055,49 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAirTicks(int i) {
|
public void setAirTicks(int i) {
|
||||||
@ -539,7 +545,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1893,19 +2236,76 @@
|
@@ -1893,19 +2242,76 @@
|
||||||
if (!this.world.isClientSide && !this.dead) {
|
if (!this.world.isClientSide && !this.dead) {
|
||||||
this.world.methodProfiler.a("changeDimension");
|
this.world.methodProfiler.a("changeDimension");
|
||||||
MinecraftServer minecraftserver = this.C_();
|
MinecraftServer minecraftserver = this.C_();
|
||||||
@ -619,7 +625,7 @@
|
|||||||
BlockPosition blockposition;
|
BlockPosition blockposition;
|
||||||
|
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
@@ -1934,12 +2334,18 @@
|
@@ -1934,12 +2340,18 @@
|
||||||
blockposition = new BlockPosition(this);
|
blockposition = new BlockPosition(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -639,7 +645,7 @@
|
|||||||
if (j == 1 && i == 1) {
|
if (j == 1 && i == 1) {
|
||||||
BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn());
|
BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn());
|
||||||
|
|
||||||
@@ -1947,6 +2353,7 @@
|
@@ -1947,6 +2359,7 @@
|
||||||
} else {
|
} else {
|
||||||
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
|
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
|
||||||
}
|
}
|
||||||
@ -647,7 +653,7 @@
|
|||||||
|
|
||||||
boolean flag = entity.attachedToPlayer;
|
boolean flag = entity.attachedToPlayer;
|
||||||
|
|
||||||
@@ -1954,13 +2361,21 @@
|
@@ -1954,13 +2367,21 @@
|
||||||
worldserver1.addEntity(entity);
|
worldserver1.addEntity(entity);
|
||||||
entity.attachedToPlayer = flag;
|
entity.attachedToPlayer = flag;
|
||||||
worldserver1.entityJoinedWorld(entity, false);
|
worldserver1.entityJoinedWorld(entity, false);
|
||||||
@ -670,7 +676,7 @@
|
|||||||
return entity;
|
return entity;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
@@ -2064,6 +2479,11 @@
|
@@ -2064,6 +2485,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCustomName(String s) {
|
public void setCustomName(String s) {
|
||||||
@ -682,7 +688,7 @@
|
|||||||
this.datawatcher.set(Entity.aB, s);
|
this.datawatcher.set(Entity.aB, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2121,7 +2541,26 @@
|
@@ -2121,7 +2547,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void a(AxisAlignedBB axisalignedbb) {
|
public void a(AxisAlignedBB axisalignedbb) {
|
||||||
@ -710,7 +716,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float getHeadHeight() {
|
public float getHeadHeight() {
|
||||||
@@ -2295,7 +2734,7 @@
|
@@ -2295,7 +2740,7 @@
|
||||||
for (Iterator iterator = this.bF().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
|
for (Iterator iterator = this.bF().iterator(); iterator.hasNext(); entity.a(oclass, set)) {
|
||||||
entity = (Entity) iterator.next();
|
entity = (Entity) iterator.next();
|
||||||
if (oclass.isAssignableFrom(entity.getClass())) {
|
if (oclass.isAssignableFrom(entity.getClass())) {
|
||||||
|
@ -16,7 +16,21 @@
|
|||||||
public class EntityArmorStand extends EntityLiving {
|
public class EntityArmorStand extends EntityLiving {
|
||||||
|
|
||||||
private static final Vector3f br = new Vector3f(0.0F, 0.0F, 0.0F);
|
private static final Vector3f br = new Vector3f(0.0F, 0.0F, 0.0F);
|
||||||
@@ -364,6 +373,21 @@
|
@@ -61,6 +70,13 @@
|
||||||
|
this.setPosition(d0, d1, d2);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // CraftBukkit start - SPIGOT-3607, SPIGOT-3637
|
||||||
|
+ @Override
|
||||||
|
+ public float getBukkitYaw() {
|
||||||
|
+ return this.yaw;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
|
public final void setSize(float f, float f1) {
|
||||||
|
double d0 = this.locX;
|
||||||
|
double d1 = this.locY;
|
||||||
|
@@ -364,6 +380,21 @@
|
||||||
if (itemstack1.isEmpty() || (this.bB & 1 << enumitemslot.c() + 8) == 0) {
|
if (itemstack1.isEmpty() || (this.bB & 1 << enumitemslot.c() + 8) == 0) {
|
||||||
if (!itemstack1.isEmpty() || (this.bB & 1 << enumitemslot.c() + 16) == 0) {
|
if (!itemstack1.isEmpty() || (this.bB & 1 << enumitemslot.c() + 16) == 0) {
|
||||||
ItemStack itemstack2;
|
ItemStack itemstack2;
|
||||||
@ -38,7 +52,7 @@
|
|||||||
|
|
||||||
if (entityhuman.abilities.canInstantlyBuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
|
if (entityhuman.abilities.canInstantlyBuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
|
||||||
itemstack2 = itemstack.cloneItemStack();
|
itemstack2 = itemstack.cloneItemStack();
|
||||||
@@ -385,14 +409,19 @@
|
@@ -385,14 +416,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||||
@ -60,7 +74,7 @@
|
|||||||
return false;
|
return false;
|
||||||
} else if (DamageSource.FIRE.equals(damagesource)) {
|
} else if (DamageSource.FIRE.equals(damagesource)) {
|
||||||
if (this.isBurning()) {
|
if (this.isBurning()) {
|
||||||
@@ -421,7 +450,7 @@
|
@@ -421,7 +457,7 @@
|
||||||
} else if (damagesource.u()) {
|
} else if (damagesource.u()) {
|
||||||
this.H();
|
this.H();
|
||||||
this.D();
|
this.D();
|
||||||
@ -69,7 +83,7 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
long i = this.world.getTime();
|
long i = this.world.getTime();
|
||||||
@@ -432,7 +461,7 @@
|
@@ -432,7 +468,7 @@
|
||||||
} else {
|
} else {
|
||||||
this.E();
|
this.E();
|
||||||
this.D();
|
this.D();
|
||||||
@ -78,7 +92,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -460,7 +489,7 @@
|
@@ -460,7 +496,7 @@
|
||||||
f1 -= f;
|
f1 -= f;
|
||||||
if (f1 <= 0.5F) {
|
if (f1 <= 0.5F) {
|
||||||
this.F();
|
this.F();
|
||||||
@ -87,7 +101,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.setHealth(f1);
|
this.setHealth(f1);
|
||||||
}
|
}
|
||||||
@@ -468,7 +497,7 @@
|
@@ -468,7 +504,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private void E() {
|
private void E() {
|
||||||
@ -96,7 +110,7 @@
|
|||||||
this.F();
|
this.F();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,7 +510,7 @@
|
@@ -481,7 +517,7 @@
|
||||||
for (i = 0; i < this.by.size(); ++i) {
|
for (i = 0; i < this.by.size(); ++i) {
|
||||||
itemstack = (ItemStack) this.by.get(i);
|
itemstack = (ItemStack) this.by.get(i);
|
||||||
if (!itemstack.isEmpty()) {
|
if (!itemstack.isEmpty()) {
|
||||||
@ -105,7 +119,7 @@
|
|||||||
this.by.set(i, ItemStack.a);
|
this.by.set(i, ItemStack.a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -489,7 +518,7 @@
|
@@ -489,7 +525,7 @@
|
||||||
for (i = 0; i < this.bz.size(); ++i) {
|
for (i = 0; i < this.bz.size(); ++i) {
|
||||||
itemstack = (ItemStack) this.bz.get(i);
|
itemstack = (ItemStack) this.bz.get(i);
|
||||||
if (!itemstack.isEmpty()) {
|
if (!itemstack.isEmpty()) {
|
||||||
@ -114,7 +128,7 @@
|
|||||||
this.bz.set(i, ItemStack.a);
|
this.bz.set(i, ItemStack.a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -601,6 +630,7 @@
|
@@ -601,6 +637,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void killEntity() {
|
public void killEntity() {
|
||||||
@ -122,15 +136,3 @@
|
|||||||
this.die();
|
this.die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -733,4 +763,11 @@
|
|
||||||
public boolean cS() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // CraftBukkit start - SPIGOT-3607
|
|
||||||
+ @Override
|
|
||||||
+ public float getHeadRotation() {
|
|
||||||
+ return this.yaw;
|
|
||||||
+ }
|
|
||||||
+ // CraftBukkit end
|
|
||||||
}
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
public abstract class EntityLiving extends Entity {
|
public abstract class EntityLiving extends Entity {
|
||||||
|
|
||||||
private static final Logger a = LogManager.getLogger();
|
private static final Logger a = LogManager.getLogger();
|
||||||
@@ -88,6 +106,15 @@
|
@@ -88,6 +106,20 @@
|
||||||
private BlockPosition bF;
|
private BlockPosition bF;
|
||||||
private DamageSource bG;
|
private DamageSource bG;
|
||||||
private long bH;
|
private long bH;
|
||||||
@ -37,11 +37,16 @@
|
|||||||
+ public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
+ public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||||
+ public boolean collides = true;
|
+ public boolean collides = true;
|
||||||
+ public boolean canPickUpLoot;
|
+ public boolean canPickUpLoot;
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public float getBukkitYaw() {
|
||||||
|
+ return getHeadRotation();
|
||||||
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
|
||||||
public void killEntity() {
|
public void killEntity() {
|
||||||
this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE);
|
this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE);
|
||||||
@@ -102,7 +129,8 @@
|
@@ -102,7 +134,8 @@
|
||||||
this.updateEffects = true;
|
this.updateEffects = true;
|
||||||
this.activeItem = ItemStack.a;
|
this.activeItem = ItemStack.a;
|
||||||
this.initAttributes();
|
this.initAttributes();
|
||||||
@ -51,7 +56,7 @@
|
|||||||
this.i = true;
|
this.i = true;
|
||||||
this.aM = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
this.aM = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
||||||
this.setPosition(this.locX, this.locY, this.locZ);
|
this.setPosition(this.locX, this.locY, this.locZ);
|
||||||
@@ -140,7 +168,13 @@
|
@@ -140,7 +173,13 @@
|
||||||
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||||
int i = (int) (150.0D * d1);
|
int i = (int) (150.0D * d1);
|
||||||
|
|
||||||
@ -66,7 +71,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +236,11 @@
|
@@ -202,7 +241,11 @@
|
||||||
this.stopRiding();
|
this.stopRiding();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -79,7 +84,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isClientSide) {
|
if (!this.world.isClientSide) {
|
||||||
@@ -259,6 +297,18 @@
|
@@ -259,6 +302,18 @@
|
||||||
this.world.methodProfiler.b();
|
this.world.methodProfiler.b();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +103,7 @@
|
|||||||
protected void b(BlockPosition blockposition) {
|
protected void b(BlockPosition blockposition) {
|
||||||
int i = EnchantmentManager.a(Enchantments.j, this);
|
int i = EnchantmentManager.a(Enchantments.j, this);
|
||||||
|
|
||||||
@@ -274,19 +324,19 @@
|
@@ -274,19 +329,19 @@
|
||||||
|
|
||||||
protected void bO() {
|
protected void bO() {
|
||||||
++this.deathTicks;
|
++this.deathTicks;
|
||||||
@ -127,7 +132,7 @@
|
|||||||
|
|
||||||
this.die();
|
this.die();
|
||||||
|
|
||||||
@@ -442,6 +492,17 @@
|
@@ -442,6 +497,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +150,7 @@
|
|||||||
if (nbttagcompound.hasKeyOfType("Health", 99)) {
|
if (nbttagcompound.hasKeyOfType("Health", 99)) {
|
||||||
this.setHealth(nbttagcompound.getFloat("Health"));
|
this.setHealth(nbttagcompound.getFloat("Health"));
|
||||||
}
|
}
|
||||||
@@ -464,9 +525,15 @@
|
@@ -464,9 +530,15 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +166,7 @@
|
|||||||
try {
|
try {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
|
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
|
||||||
@@ -484,6 +551,17 @@
|
@@ -484,6 +556,17 @@
|
||||||
} catch (ConcurrentModificationException concurrentmodificationexception) {
|
} catch (ConcurrentModificationException concurrentmodificationexception) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -179,7 +184,7 @@
|
|||||||
|
|
||||||
if (this.updateEffects) {
|
if (this.updateEffects) {
|
||||||
if (!this.world.isClientSide) {
|
if (!this.world.isClientSide) {
|
||||||
@@ -585,6 +663,12 @@
|
@@ -585,6 +668,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEffect(MobEffect mobeffect) {
|
public void addEffect(MobEffect mobeffect) {
|
||||||
@ -192,7 +197,7 @@
|
|||||||
if (this.d(mobeffect)) {
|
if (this.d(mobeffect)) {
|
||||||
MobEffect mobeffect1 = (MobEffect) this.effects.get(mobeffect.getMobEffect());
|
MobEffect mobeffect1 = (MobEffect) this.effects.get(mobeffect.getMobEffect());
|
||||||
|
|
||||||
@@ -617,6 +701,12 @@
|
@@ -617,6 +706,12 @@
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public MobEffect c(@Nullable MobEffectList mobeffectlist) {
|
public MobEffect c(@Nullable MobEffectList mobeffectlist) {
|
||||||
@ -205,7 +210,7 @@
|
|||||||
return (MobEffect) this.effects.remove(mobeffectlist);
|
return (MobEffect) this.effects.remove(mobeffectlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,20 +746,52 @@
|
@@ -656,20 +751,52 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +264,7 @@
|
|||||||
this.datawatcher.set(EntityLiving.HEALTH, Float.valueOf(MathHelper.a(f, 0.0F, this.getMaxHealth())));
|
this.datawatcher.set(EntityLiving.HEALTH, Float.valueOf(MathHelper.a(f, 0.0F, this.getMaxHealth())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,14 +809,16 @@
|
@@ -687,14 +814,16 @@
|
||||||
} else {
|
} else {
|
||||||
float f1 = f;
|
float f1 = f;
|
||||||
|
|
||||||
@ -279,7 +284,7 @@
|
|||||||
this.damageShield(f);
|
this.damageShield(f);
|
||||||
f = 0.0F;
|
f = 0.0F;
|
||||||
if (!damagesource.a()) {
|
if (!damagesource.a()) {
|
||||||
@@ -713,20 +837,39 @@
|
@@ -713,20 +842,39 @@
|
||||||
|
|
||||||
if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) {
|
if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) {
|
||||||
if (f <= this.lastDamage) {
|
if (f <= this.lastDamage) {
|
||||||
@ -321,7 +326,7 @@
|
|||||||
this.aA = 0.0F;
|
this.aA = 0.0F;
|
||||||
Entity entity1 = damagesource.getEntity();
|
Entity entity1 = damagesource.getEntity();
|
||||||
|
|
||||||
@@ -833,18 +976,26 @@
|
@@ -833,18 +981,26 @@
|
||||||
EnumHand[] aenumhand = EnumHand.values();
|
EnumHand[] aenumhand = EnumHand.values();
|
||||||
int i = aenumhand.length;
|
int i = aenumhand.length;
|
||||||
|
|
||||||
@ -351,7 +356,7 @@
|
|||||||
if (this instanceof EntityPlayer) {
|
if (this instanceof EntityPlayer) {
|
||||||
EntityPlayer entityplayer = (EntityPlayer) this;
|
EntityPlayer entityplayer = (EntityPlayer) this;
|
||||||
|
|
||||||
@@ -859,7 +1010,7 @@
|
@@ -859,7 +1015,7 @@
|
||||||
this.world.broadcastEntityEffect(this, (byte) 35);
|
this.world.broadcastEntityEffect(this, (byte) 35);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +365,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,6 +1095,12 @@
|
@@ -944,6 +1100,12 @@
|
||||||
boolean flag = this.lastDamageByPlayerTime > 0;
|
boolean flag = this.lastDamageByPlayerTime > 0;
|
||||||
|
|
||||||
this.a(flag, i, damagesource);
|
this.a(flag, i, damagesource);
|
||||||
@ -373,7 +378,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1033,8 +1190,13 @@
|
@@ -1033,8 +1195,13 @@
|
||||||
int i = MathHelper.f((f - 3.0F - f2) * f1);
|
int i = MathHelper.f((f - 3.0F - f2) * f1);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -388,7 +393,7 @@
|
|||||||
int j = MathHelper.floor(this.locX);
|
int j = MathHelper.floor(this.locX);
|
||||||
int k = MathHelper.floor(this.locY - 0.20000000298023224D);
|
int k = MathHelper.floor(this.locY - 0.20000000298023224D);
|
||||||
int l = MathHelper.floor(this.locZ);
|
int l = MathHelper.floor(this.locZ);
|
||||||
@@ -1061,7 +1223,7 @@
|
@@ -1061,7 +1228,7 @@
|
||||||
|
|
||||||
protected float applyArmorModifier(DamageSource damagesource, float f) {
|
protected float applyArmorModifier(DamageSource damagesource, float f) {
|
||||||
if (!damagesource.ignoresArmor()) {
|
if (!damagesource.ignoresArmor()) {
|
||||||
@ -397,7 +402,7 @@
|
|||||||
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.getAttributeInstance(GenericAttributes.i).getValue());
|
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.getAttributeInstance(GenericAttributes.i).getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1074,7 +1236,8 @@
|
@@ -1074,7 +1241,8 @@
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -407,7 +412,7 @@
|
|||||||
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
|
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
|
||||||
int j = 25 - i;
|
int j = 25 - i;
|
||||||
float f1 = f * (float) j;
|
float f1 = f * (float) j;
|
||||||
@@ -1095,22 +1258,142 @@
|
@@ -1095,22 +1263,142 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,7 +565,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CombatTracker getCombatTracker() {
|
public CombatTracker getCombatTracker() {
|
||||||
@@ -1177,6 +1460,7 @@
|
@@ -1177,6 +1465,7 @@
|
||||||
public AttributeMapBase getAttributeMap() {
|
public AttributeMapBase getAttributeMap() {
|
||||||
if (this.attributeMap == null) {
|
if (this.attributeMap == null) {
|
||||||
this.attributeMap = new AttributeMapServer();
|
this.attributeMap = new AttributeMapServer();
|
||||||
@ -568,7 +573,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this.attributeMap;
|
return this.attributeMap;
|
||||||
@@ -1469,6 +1753,7 @@
|
@@ -1469,6 +1758,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.onGround && !this.world.isClientSide) {
|
if (this.onGround && !this.world.isClientSide) {
|
||||||
@ -576,7 +581,7 @@
|
|||||||
this.setFlag(7, false);
|
this.setFlag(7, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1838,6 +2123,7 @@
|
@@ -1838,6 +2128,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isClientSide) {
|
if (!this.world.isClientSide) {
|
||||||
@ -584,7 +589,7 @@
|
|||||||
this.setFlag(7, flag);
|
this.setFlag(7, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1931,11 +2217,11 @@
|
@@ -1931,11 +2222,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInteractable() {
|
public boolean isInteractable() {
|
||||||
@ -598,7 +603,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void ax() {
|
protected void ax() {
|
||||||
@@ -2072,7 +2358,27 @@
|
@@ -2072,7 +2363,27 @@
|
||||||
protected void v() {
|
protected void v() {
|
||||||
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
|
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
|
||||||
this.b(this.activeItem, 16);
|
this.b(this.activeItem, 16);
|
||||||
@ -627,7 +632,7 @@
|
|||||||
this.cN();
|
this.cN();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2151,10 +2457,18 @@
|
@@ -2151,10 +2462,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
|
@ -226,7 +226,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||||||
loc.setX(entity.locX);
|
loc.setX(entity.locX);
|
||||||
loc.setY(entity.locY);
|
loc.setY(entity.locY);
|
||||||
loc.setZ(entity.locZ);
|
loc.setZ(entity.locZ);
|
||||||
loc.setYaw(entity instanceof EntityLiving ? entity.getHeadRotation() : entity.yaw);
|
loc.setYaw(entity.getBukkitYaw());
|
||||||
loc.setPitch(entity.pitch);
|
loc.setPitch(entity.pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren