diff options
author | md_5 <git@md-5.net> | 2017-05-14 12:00:00 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-05-14 12:00:00 +1000 |
commit | 5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5 (patch) | |
tree | 0314ba59f51141bb5e0e7ff6ca7723d168ac94b9 /nms-patches/Entity.patch | |
parent | 6e3cec8bc78269d72ef7ef49ce82a5eadfb9615a (diff) | |
download | craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.gz craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.lz craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.xz craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.zip |
Update to Minecraft 1.12-pre2
Diffstat (limited to 'nms-patches/Entity.patch')
-rw-r--r-- | nms-patches/Entity.patch | 123 |
1 files changed, 58 insertions, 65 deletions
diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 92e5b892..b91ad4b5 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -49,17 +49,17 @@ 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); -@@ -101,6 +141,9 @@ - private boolean aH; - private double[] aI; - private long aJ; +@@ -102,6 +142,9 @@ + 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 public Entity(World world) { this.id = Entity.entityCount++; -@@ -206,6 +249,33 @@ +@@ -208,6 +251,33 @@ } protected void setYawPitch(float f, float f1) { @@ -93,8 +93,8 @@ this.yaw = f % 360.0F; this.pitch = f1 % 360.0F; } -@@ -228,6 +298,51 @@ - this.U(); +@@ -230,6 +300,51 @@ + this.Y(); } + // CraftBukkit start @@ -107,11 +107,11 @@ + + if (true || minecraftserver.getAllowNether()) { // CraftBukkit + if (!this.isPassenger()) { -+ int i = this.V(); ++ int i = this.Z(); + + if (this.al++ >= i) { + this.al = i; -+ this.portalCooldown = this.aE(); ++ this.portalCooldown = this.aK(); + byte b0; + + if (this.world.worldProvider.getDimensionManager().getDimensionID() == -1) { @@ -120,7 +120,7 @@ + b0 = -1; + } + -+ this.c(b0); ++ this.b(b0); + } + } + @@ -136,16 +136,16 @@ + } + } + -+ this.H(); ++ this.I(); + this.world.methodProfiler.b(); + } + } + // CraftBukkit end + - public void U() { + public void Y() { this.world.methodProfiler.a("entityBaseTick"); - if (this.isPassenger() && this.bB().dead) { -@@ -244,12 +359,14 @@ + if (this.isPassenger() && this.bH().dead) { +@@ -246,6 +361,8 @@ this.lastZ = this.locZ; this.lastPitch = this.pitch; this.lastYaw = this.yaw; @@ -154,22 +154,15 @@ if (!this.world.isClientSide && this.world instanceof WorldServer) { this.world.methodProfiler.a("portal"); if (this.ak) { - MinecraftServer minecraftserver = this.world.getMinecraftServer(); - -- if (minecraftserver.getAllowNether()) { -+ if (true || minecraftserver.getAllowNether()) { // CraftBukkit - if (!this.isPassenger()) { - int i = this.V(); - -@@ -283,6 +400,7 @@ - this.H(); +@@ -285,6 +402,7 @@ + this.I(); this.world.methodProfiler.b(); } + */ - this.am(); - this.ak(); -@@ -334,6 +452,27 @@ + this.as(); + this.aq(); +@@ -336,6 +454,27 @@ protected void burnFromLava() { if (!this.fireProof) { this.damageEntity(DamageSource.LAVA, 4.0F); @@ -197,7 +190,7 @@ this.setOnFire(15); } } -@@ -374,6 +513,22 @@ +@@ -376,6 +515,22 @@ this.a(this.getBoundingBox().d(d0, d1, d2)); this.recalcPosition(); } else { @@ -220,7 +213,7 @@ if (enummovetype == EnumMoveType.PISTON) { long i = this.world.getTime(); -@@ -515,7 +670,7 @@ +@@ -517,7 +672,7 @@ } } @@ -229,7 +222,7 @@ double d11; if (this.P > 0.0F && flag && (d7 != d0 || d9 != d2)) { -@@ -613,7 +768,7 @@ +@@ -615,7 +770,7 @@ this.world.methodProfiler.a("rest"); this.recalcPosition(); this.positionChanged = d7 != d0 || d9 != d2; @@ -238,7 +231,7 @@ this.onGround = this.B && d8 < 0.0D; this.C = this.positionChanged || this.B; l = MathHelper.floor(this.locX); -@@ -648,6 +803,28 @@ +@@ -650,6 +805,28 @@ block1.a(this.world, this); } @@ -267,7 +260,7 @@ if (this.playStepSound() && (!this.onGround || !this.isSneaking() || !(this instanceof EntityHuman)) && !this.isPassenger()) { double d22 = this.locX - d4; double d23 = this.locY - d5; -@@ -681,6 +858,8 @@ +@@ -685,6 +862,8 @@ } } @@ -276,16 +269,16 @@ try { this.checkBlockCollisions(); } catch (Throwable throwable) { -@@ -690,6 +869,8 @@ +@@ -694,6 +873,8 @@ this.appendEntityCrashDetails(crashreportsystemdetails); throw new ReportedException(crashreport); } + */ + // CraftBukkit end - boolean flag1 = this.ai(); + boolean flag1 = this.an(); -@@ -698,7 +879,14 @@ +@@ -702,7 +883,14 @@ if (!flag1) { ++this.fireTicks; if (this.fireTicks == 0) { @@ -301,7 +294,7 @@ } } } else if (this.fireTicks <= 0) { -@@ -819,7 +1007,7 @@ +@@ -834,7 +1022,7 @@ return null; } @@ -310,7 +303,7 @@ if (!this.fireProof) { this.damageEntity(DamageSource.FIRE, (float) i); } -@@ -987,6 +1175,13 @@ +@@ -1008,6 +1196,13 @@ } public void spawnIn(World world) { @@ -324,7 +317,7 @@ this.world = world; } -@@ -1219,6 +1414,18 @@ +@@ -1245,6 +1440,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})); @@ -343,7 +336,7 @@ nbttagcompound.set("Rotation", this.a(new float[] { this.yaw, this.pitch})); nbttagcompound.setFloat("FallDistance", this.fallDistance); nbttagcompound.setShort("Fire", (short) this.fireTicks); -@@ -1228,6 +1435,12 @@ +@@ -1254,6 +1461,12 @@ nbttagcompound.setBoolean("Invulnerable", this.invulnerable); nbttagcompound.setInt("PortalCooldown", this.portalCooldown); nbttagcompound.a("UUID", this.getUniqueID()); @@ -356,24 +349,24 @@ if (this.hasCustomName()) { nbttagcompound.setString("CustomName", this.getCustomName()); } -@@ -1303,6 +1516,8 @@ - this.motX = nbttaglist1.e(0); - this.motY = nbttaglist1.e(1); - this.motZ = nbttaglist1.e(2); +@@ -1329,6 +1542,8 @@ + this.motX = nbttaglist1.f(0); + this.motY = nbttaglist1.f(1); + this.motZ = nbttaglist1.f(2); + + /* CraftBukkit start - Moved section down if (Math.abs(this.motX) > 10.0D) { this.motX = 0.0D; } -@@ -1314,6 +1529,7 @@ +@@ -1340,6 +1555,7 @@ if (Math.abs(this.motZ) > 10.0D) { this.motZ = 0.0D; } + // CraftBukkit end */ - this.locX = nbttaglist.e(0); - this.locY = nbttaglist.e(1); -@@ -1371,6 +1587,58 @@ + this.locX = nbttaglist.f(0); + this.locY = nbttaglist.f(1); +@@ -1397,6 +1613,58 @@ this.setPosition(this.locX, this.locY, this.locZ); } @@ -432,7 +425,7 @@ } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); -@@ -1438,6 +1706,12 @@ +@@ -1464,6 +1732,12 @@ if (itemstack.isEmpty()) { return null; } else { @@ -445,8 +438,8 @@ EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack); entityitem.q(); -@@ -1563,6 +1837,24 @@ - if (entity.bB() != this) { +@@ -1589,6 +1863,24 @@ + if (entity.bH() != this) { throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); } else { + // CraftBukkit start @@ -467,11 +460,11 @@ + } + } + // CraftBukkit end - if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bw() instanceof EntityHuman)) { + if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bC() instanceof EntityHuman)) { this.passengers.add(0, entity); } else { -@@ -1576,6 +1868,22 @@ - if (entity.bB() == this) { +@@ -1602,6 +1894,22 @@ + if (entity.bH() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { + // CraftBukkit start @@ -493,18 +486,18 @@ this.passengers.remove(entity); entity.j = 60; } -@@ -1715,14 +2023,49 @@ +@@ -1741,14 +2049,49 @@ } public void setAirTicks(int i) { -- this.datawatcher.set(Entity.az, Integer.valueOf(i)); +- this.datawatcher.set(Entity.aA, Integer.valueOf(i)); + // CraftBukkit start + EntityAirChangeEvent event = new EntityAirChangeEvent(this.getBukkitEntity(), i); + event.getEntity().getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } -+ this.datawatcher.set(Entity.az, Integer.valueOf(event.getAmount())); ++ this.datawatcher.set(Entity.aA, Integer.valueOf(event.getAmount())); + // CraftBukkit end } @@ -546,10 +539,10 @@ } } -@@ -1867,19 +2210,70 @@ +@@ -1893,19 +2236,70 @@ if (!this.world.isClientSide && !this.dead) { this.world.methodProfiler.a("changeDimension"); - MinecraftServer minecraftserver = this.B_(); + MinecraftServer minecraftserver = this.C_(); - int j = this.dimension; - WorldServer worldserver = minecraftserver.getWorldServer(j); - WorldServer worldserver1 = minecraftserver.getWorldServer(i); @@ -620,7 +613,7 @@ BlockPosition blockposition; if (i == 1) { -@@ -1908,12 +2302,18 @@ +@@ -1934,12 +2328,18 @@ blockposition = new BlockPosition(this); } @@ -640,7 +633,7 @@ if (j == 1 && i == 1) { BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn()); -@@ -1921,6 +2321,7 @@ +@@ -1947,6 +2347,7 @@ } else { entity.setPositionRotation(blockposition, entity.yaw, entity.pitch); } @@ -648,7 +641,7 @@ boolean flag = entity.attachedToPlayer; -@@ -1928,13 +2329,21 @@ +@@ -1954,13 +2355,21 @@ worldserver1.addEntity(entity); entity.attachedToPlayer = flag; worldserver1.entityJoinedWorld(entity, false); @@ -671,7 +664,7 @@ return entity; } else { return null; -@@ -2038,6 +2447,11 @@ +@@ -2064,6 +2473,11 @@ } public void setCustomName(String s) { @@ -680,10 +673,10 @@ + s = s.substring(0, 256); + } + // CraftBukkit end - this.datawatcher.set(Entity.aA, s); + this.datawatcher.set(Entity.aB, s); } -@@ -2095,7 +2509,26 @@ +@@ -2121,7 +2535,26 @@ } public void a(AxisAlignedBB axisalignedbb) { @@ -711,8 +704,8 @@ } public float getHeadHeight() { -@@ -2269,7 +2702,7 @@ - for (Iterator iterator = this.bx().iterator(); iterator.hasNext(); entity.a(oclass, set)) { +@@ -2295,7 +2728,7 @@ + for (Iterator iterator = this.bD().iterator(); iterator.hasNext(); entity.a(oclass, set)) { entity = (Entity) iterator.next(); if (oclass.isAssignableFrom(entity.getClass())) { - set.add(entity); |