Update to Minecraft 1.13-pre7

This commit is contained in:
md_5
2018-07-15 10:00:00 +10:00
parent 57ab4cfc6f
commit 421c1728c8
608 changed files with 17788 additions and 9378 deletions

View File

@@ -14,13 +14,13 @@
public class Explosion {
private final boolean a;
@@ -23,11 +30,12 @@
private final float size;
@@ -24,11 +31,12 @@
private DamageSource j;
private final List<BlockPosition> blocks = Lists.newArrayList();
private final Map<EntityHuman, Vec3D> k = Maps.newHashMap();
private final Map<EntityHuman, Vec3D> l = Maps.newHashMap();
+ public boolean wasCanceled = false; // CraftBukkit - add field
public Explosion(World world, Entity entity, double d0, double d1, double d2, float f, boolean flag, boolean flag1) {
public Explosion(World world, @Nullable Entity entity, double d0, double d1, double d2, float f, boolean flag, boolean flag1) {
this.world = world;
this.source = entity;
- this.size = f;
@@ -28,7 +28,7 @@
this.posX = d0;
this.posY = d1;
this.posZ = d2;
@@ -36,6 +44,11 @@
@@ -38,6 +46,11 @@
}
public void a() {
@@ -40,7 +40,7 @@
HashSet hashset = Sets.newHashSet();
boolean flag = true;
@@ -69,7 +82,7 @@
@@ -75,7 +88,7 @@
f -= (f2 + 0.3F) * 0.3F;
}
@@ -49,16 +49,16 @@
hashset.add(blockposition);
}
@@ -113,7 +126,16 @@
@@ -119,7 +132,16 @@
double d12 = (double) this.world.a(vec3d, entity.getBoundingBox());
double d13 = (1.0D - d7) * d12;
- entity.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f3 + 1.0D)));
- entity.damageEntity(this.b(), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f3 + 1.0D)));
+ // CraftBukkit start
+ // entity.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f3 + 1.0D)));
+ // entity.damageEntity(this.b(), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f3 + 1.0D)));
+ CraftEventFactory.entityDamage = source;
+ entity.forceExplosionKnockback = false;
+ boolean wasDamaged = entity.damageEntity(DamageSource.explosion(this), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f3 + 1.0D)));
+ boolean wasDamaged = entity.damageEntity(this.b(), (float) ((int) ((d13 * d13 + d13) / 2.0D * 7.0D * (double) f3 + 1.0D)));
+ CraftEventFactory.entityDamage = null;
+ if (!wasDamaged && !(entity instanceof EntityTNTPrimed || entity instanceof EntityFallingBlock) && !entity.forceExplosionKnockback) {
+ continue;
@@ -67,7 +67,7 @@
double d14 = d13;
if (entity instanceof EntityLiving) {
@@ -149,6 +171,50 @@
@@ -155,6 +177,50 @@
BlockPosition blockposition;
if (this.b) {
@@ -118,20 +118,20 @@
iterator = this.blocks.iterator();
while (iterator.hasNext()) {
@@ -180,7 +246,8 @@
@@ -186,7 +252,8 @@
if (iblockdata.getMaterial() != Material.AIR) {
if (!iblockdata.isAir()) {
if (block.a(this)) {
- block.dropNaturally(this.world, blockposition, this.world.getType(blockposition), 1.0F / this.size, 0);
- iblockdata.dropNaturally(this.world, blockposition, 1.0F / this.size, 0);
+ // CraftBukkit - add yield
+ block.dropNaturally(this.world, blockposition, this.world.getType(blockposition), yield, 0);
+ iblockdata.dropNaturally(this.world, blockposition, yield, 0);
}
this.world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
@@ -195,7 +262,11 @@
@@ -201,7 +268,11 @@
while (iterator.hasNext()) {
blockposition = (BlockPosition) iterator.next();
if (this.world.getType(blockposition).getMaterial() == Material.AIR && this.world.getType(blockposition.down()).b() && this.c.nextInt(3) == 0) {
if (this.world.getType(blockposition).isAir() && this.world.getType(blockposition.down()).f(this.world, blockposition.down()) && this.c.nextInt(3) == 0) {
- this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
+ // CraftBukkit start - Ignition by explosion
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(this.world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this).isCancelled()) {
@@ -141,7 +141,7 @@
}
}
}
@@ -208,7 +279,9 @@
@@ -222,7 +293,9 @@
@Nullable
public EntityLiving getSource() {