9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-19 14:59:30 +00:00
Files
SakuraMC/sakura-server/minecraft-patches/features/0022-Protect-scaffolding-from-creepers.patch

23 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Mon, 17 Jun 2024 14:04:12 +0100
Subject: [PATCH] Protect scaffolding from creepers
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
index 5d8d59fa34c9070d27e3ff38922eee465f03e663..95fecb0338bc9c7b6c2ca484994f2f72370c5822 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -412,6 +412,11 @@ public class ServerExplosion implements Explosion {
return Optional.of(ZERO_RESISTANCE);
}
// Sakura end - allow explosions to destroy lava
+ // Sakura start - protect scaffolding from creepers
+ if (this.level.sakuraConfig().cannons.explosion.protectScaffoldingFromCreepers && blockState.is(Blocks.SCAFFOLDING) && this.source instanceof net.minecraft.world.entity.monster.Creeper) {
+ return Optional.of(Blocks.BARRIER.getExplosionResistance());
+ }
+ // Sakura end - protect scaffolding from creepers
}
return this.damageCalculator.getBlockExplosionResistance(this, this.level, pos, blockState, fluidState);