Update to Minecraft 1.16.1

This commit is contained in:
md_5
2020-06-25 10:00:00 +10:00
parent be6aaf046e
commit 7ea3c040bc
424 changed files with 5960 additions and 5636 deletions

View File

@@ -1,14 +1,14 @@
--- a/net/minecraft/server/EntityFireworks.java
+++ b/net/minecraft/server/EntityFireworks.java
@@ -3,6 +3,7 @@
import java.util.Iterator;
@@ -4,6 +4,7 @@
import java.util.List;
import java.util.OptionalInt;
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntityFireworks extends Entity implements IProjectile {
public class EntityFireworks extends IProjectile {
@@ -130,7 +131,11 @@
@@ -119,7 +120,11 @@
}
if (!this.world.isClientSide && this.ticksFlown > this.expectedLifespan) {
@@ -21,48 +21,48 @@
}
}
@@ -143,7 +148,11 @@
protected void a(MovingObjectPosition movingobjectposition) {
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY && !this.world.isClientSide) {
@@ -134,7 +139,11 @@
protected void a(MovingObjectPositionEntity movingobjectpositionentity) {
super.a(movingobjectpositionentity);
if (!this.world.isClientSide) {
- this.explode();
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) {
+ this.explode();
+ }
+ // CraftBukkit end
} else if (this.w) {
BlockPosition blockposition;
}
}
@@ -155,7 +164,11 @@
@@ -144,7 +153,11 @@
this.world.getType(blockposition).a(this.world, blockposition, (Entity) this);
if (this.hasExplosions()) {
- this.explode();
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) {
+ this.explode();
+ }
+ // CraftBukkit end
}
this.world.getType(blockposition).a(this.world, blockposition, (Entity) this);
if (!this.world.s_() && this.hasExplosions()) {
- this.explode();
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callFireworkExplodeEvent(this).isCancelled()) {
+ this.explode();
+ }
+ // CraftBukkit end
}
@@ -181,7 +194,9 @@
super.a(movingobjectpositionblock);
@@ -170,7 +183,9 @@
if (f > 0.0F) {
if (this.ridingEntity != null) {
+ CraftEventFactory.entityDamage = this; // CraftBukkit
this.ridingEntity.damageEntity(DamageSource.FIREWORKS, 5.0F + (float) (nbttaglist.size() * 2));
this.ridingEntity.damageEntity(DamageSource.a(this, this.getShooter()), 5.0F + (float) (nbttaglist.size() * 2));
+ CraftEventFactory.entityDamage = null; // CraftBukkit
}
double d0 = 5.0D;
@@ -208,7 +223,9 @@
@@ -197,7 +212,9 @@
if (flag) {
float f1 = f * (float) Math.sqrt((5.0D - (double) this.g(entityliving)) / 5.0D);
+ CraftEventFactory.entityDamage = this; // CraftBukkit
entityliving.damageEntity(DamageSource.FIREWORKS, f1);
entityliving.damageEntity(DamageSource.a(this, this.getShooter()), f1);
+ CraftEventFactory.entityDamage = null; // CraftBukkit
}
}