mirror of
https://github.com/Samsuik/Sakura.git
synced 2026-01-06 15:41:49 +00:00
36 lines
2.0 KiB
Diff
36 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
|
|
Date: Sat, 25 Nov 2023 21:14:45 +0000
|
|
Subject: [PATCH] Allow explosions to destroy lava
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index cfeacded13f5ebbc3ef66163387c7a40622d7b74..f39507dd7e0890446c9c16e6ae45d96302577253 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -175,6 +175,11 @@ public class Explosion {
|
|
return Optional.of(ZERO_RESISTANCE);
|
|
}
|
|
// Sakura end - destroy water logged blocks
|
|
+ // Sakura start - allow explosions to destroy lava
|
|
+ if (blockState.is(Blocks.LAVA) && this.level.sakuraConfig().cannons.explosion.explodeLava) {
|
|
+ return Optional.of(ZERO_RESISTANCE);
|
|
+ }
|
|
+ // Sakura end - allow explosions to destroy lava
|
|
}
|
|
|
|
return this.damageCalculator.getBlockExplosionResistance((Explosion)(Object)this, this.level, pos, blockState, fluidState);
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
|
index d0109633e8bdf109cfc9178963d7b6cf92f8b189..61d1e3b9033a00da7cccadfcab92f0b211c28b00 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
|
@@ -195,7 +195,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
|
});
|
|
}
|
|
|
|
- world.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
|
|
+ world.setBlock(pos, Blocks.AIR.defaultBlockState(), world.sakuraConfig().cannons.explosion.explodeLava && state.is(Blocks.LAVA) ? 2 : 3); // Sakura - allow explosions to destroy lava
|
|
block.wasExploded(world, pos, explosion);
|
|
}
|
|
}
|