geforkt von Mirrors/Paper
SPIGOT-7613: Don't respect mobGriefing gamerule in World#createExplosion() without source entity
By: 2008Choco <hawkeboyz2@hotmail.com>
Dieser Commit ist enthalten in:
Ursprung
f127f9030d
Commit
e6730f6daf
@ -270,7 +270,19 @@
|
||||
if (this.isOutsideBuildHeight(blockposition)) {
|
||||
return Blocks.VOID_AIR.defaultBlockState();
|
||||
} else {
|
||||
@@ -543,6 +733,16 @@
|
||||
@@ -507,6 +697,11 @@
|
||||
Explosion.Effect explosion_effect;
|
||||
|
||||
switch (world_a) {
|
||||
+ // CraftBukkit start - handle custom explosion type
|
||||
+ case STANDARD:
|
||||
+ explosion_effect = Explosion.Effect.DESTROY;
|
||||
+ break;
|
||||
+ // CraftBukkit end
|
||||
case NONE:
|
||||
explosion_effect = Explosion.Effect.KEEP;
|
||||
break;
|
||||
@@ -543,6 +738,16 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public TileEntity getBlockEntity(BlockPosition blockposition) {
|
||||
@ -287,7 +299,7 @@
|
||||
return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE));
|
||||
}
|
||||
|
||||
@@ -550,6 +750,12 @@
|
||||
@@ -550,6 +755,12 @@
|
||||
BlockPosition blockposition = tileentity.getBlockPos();
|
||||
|
||||
if (!this.isOutsideBuildHeight(blockposition)) {
|
||||
@ -300,7 +312,7 @@
|
||||
this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity);
|
||||
}
|
||||
}
|
||||
@@ -680,7 +886,7 @@
|
||||
@@ -680,7 +891,7 @@
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EntityComplexPart entitycomplexpart = aentitycomplexpart[k];
|
||||
@ -309,3 +321,12 @@
|
||||
|
||||
if (t0 != null && predicate.test(t0)) {
|
||||
list.add(t0);
|
||||
@@ -960,7 +1171,7 @@
|
||||
|
||||
public static enum a {
|
||||
|
||||
- NONE, BLOCK, MOB, TNT, BLOW;
|
||||
+ NONE, BLOCK, MOB, TNT, BLOW, STANDARD; // CraftBukkit - Add STANDARD which will always use Explosion.Effect.DESTROY
|
||||
|
||||
private a() {}
|
||||
}
|
||||
|
@ -703,7 +703,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) {
|
||||
return !world.explode(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? net.minecraft.world.level.World.a.MOB : net.minecraft.world.level.World.a.NONE).wasCanceled;
|
||||
net.minecraft.world.level.World.a explosionType;
|
||||
if (!breakBlocks) {
|
||||
explosionType = net.minecraft.world.level.World.a.NONE; // Don't break blocks
|
||||
} else if (source == null) {
|
||||
explosionType = net.minecraft.world.level.World.a.STANDARD; // Break blocks, don't decay drops
|
||||
} else {
|
||||
explosionType = net.minecraft.world.level.World.a.MOB; // Respect mobGriefing gamerule
|
||||
}
|
||||
|
||||
return !world.explode(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, explosionType).wasCanceled;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren