Update to Minecraft 1.14-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-04-23 12:00:00 +10:00
parent 0e98365784
commit a0f2b74c8d
560 changed files with 10642 additions and 10867 deletions

View File

@@ -5,39 +5,39 @@
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
public class EntityLargeFireball extends EntityFireball {
public class EntityLargeFireball extends EntityFireballFireball {
public int yield = 1;
public EntityLargeFireball(World world) {
super(EntityTypes.FIREBALL, world, 1.0F, 1.0F);
public EntityLargeFireball(EntityTypes<? extends EntityLargeFireball> entitytypes, World world) {
super(entitytypes, world);
+ isIncendiary = this.world.getGameRules().getBoolean("mobGriefing"); // CraftBukkit
}
public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world, 1.0F, 1.0F);
super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world);
+ isIncendiary = this.world.getGameRules().getBoolean("mobGriefing"); // CraftBukkit
}
protected void a(MovingObjectPosition movingobjectposition) {
@@ -21,7 +25,15 @@
@Override
@@ -24,7 +28,15 @@
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
- this.world.createExplosion((Entity) null, this.locX, this.locY, this.locZ, (float) this.yield, flag, flag);
- this.world.createExplosion((Entity) null, this.locX, this.locY, this.locZ, (float) this.yield, flag, flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE);
+ // CraftBukkit start - fire ExplosionPrimeEvent
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
+ this.world.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ // give 'this' instead of (Entity) null so we know what causes the damage
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), isIncendiary);
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE);
+ }
+ // CraftBukkit end
this.die();
}
@@ -35,7 +47,8 @@
@@ -40,7 +52,8 @@
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);
if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) {