Update to Minecraft 1.16.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-06-25 10:00:00 +10:00
parent 3862d2811e
commit 50503fd516
424 changed files with 5960 additions and 5636 deletions

View File

@@ -43,8 +43,8 @@
+ d0 -= (double) direction.getAdjacentX() * 0.46875D;
+ d2 -= (double) direction.getAdjacentZ() * 0.46875D;
d1 += d5;
- EnumDirection enumdirection = this.direction.g();
+ EnumDirection enumdirection = direction.g();
- EnumDirection enumdirection = this.direction.h();
+ EnumDirection enumdirection = direction.h();
d0 += d4 * (double) enumdirection.getAdjacentX();
d2 += d4 * (double) enumdirection.getAdjacentZ();
@@ -59,8 +59,8 @@
+ double d7 = (double) height;
+ double d8 = (double) width;
- if (this.direction.m() == EnumDirection.EnumAxis.Z) {
+ if (direction.m() == EnumDirection.EnumAxis.Z) {
- if (this.direction.n() == EnumDirection.EnumAxis.Z) {
+ if (direction.n() == EnumDirection.EnumAxis.Z) {
d8 = 1.0D;
} else {
d6 = 1.0D;
@@ -79,32 +79,32 @@
return i % 32 == 0 ? 0.5D : 0.0D;
}
@@ -78,6 +96,24 @@
if (this.e++ == 100 && !this.world.isClientSide) {
this.e = 0;
if (!this.dead && !this.survives()) {
+ // CraftBukkit start - fire break events
+ Material material = this.world.getType(new BlockPosition(this)).getMaterial();
+ HangingBreakEvent.RemoveCause cause;
@@ -83,6 +101,24 @@
if (this.e++ == 100) {
this.e = 0;
if (!this.dead && !this.survives()) {
+ // CraftBukkit start - fire break events
+ Material material = this.world.getType(this.getChunkCoordinates()).getMaterial();
+ HangingBreakEvent.RemoveCause cause;
+
+ if (!material.equals(Material.AIR)) {
+ // TODO: This feels insufficient to catch 100% of suffocation cases
+ cause = HangingBreakEvent.RemoveCause.OBSTRUCTION;
+ } else {
+ cause = HangingBreakEvent.RemoveCause.PHYSICS;
+ }
+ if (!material.equals(Material.AIR)) {
+ // TODO: This feels insufficient to catch 100% of suffocation cases
+ cause = HangingBreakEvent.RemoveCause.OBSTRUCTION;
+ } else {
+ cause = HangingBreakEvent.RemoveCause.PHYSICS;
+ }
+
+ HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), cause);
+ this.world.getServer().getPluginManager().callEvent(event);
+ HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), cause);
+ this.world.getServer().getPluginManager().callEvent(event);
+
+ if (dead || event.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.die();
this.a((Entity) null);
}
@@ -140,6 +176,22 @@
+ if (dead || event.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.die();
this.a((Entity) null);
}
@@ -146,6 +182,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {
@@ -127,7 +127,7 @@
this.die();
this.velocityChanged();
this.a(damagesource.getEntity());
@@ -152,6 +204,18 @@
@@ -158,6 +210,18 @@
@Override
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
if (!this.world.isClientSide && !this.dead && vec3d.g() > 0.0D) {
@@ -146,7 +146,7 @@
this.die();
this.a((Entity) null);
}
@@ -160,7 +224,7 @@
@@ -166,7 +230,7 @@
@Override
public void h(double d0, double d1, double d2) {