mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-23 16:59:16 +00:00
23 lines
1.5 KiB
Diff
23 lines
1.5 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/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index a7d7ccd8277f1e710808710faf06ebe37ee71dc4..0ad8a54f6f3cabc8d5dc5891339a49401e1e4605 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -166,6 +166,11 @@ public class Explosion {
|
|
Block block = blockState.getBlock();
|
|
me.samsuik.sakura.explosion.durable.DurableMaterial material = this.level.localConfig().config(pos).durableMaterials.get(block);
|
|
|
|
+ // 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
|
|
if (material != null && material.resistance() >= 0.0f && (this.level.sakuraConfig().cannons.explosion.allowNonTntBreakingDurableBlocks || this.source instanceof net.minecraft.world.entity.item.PrimedTnt)) {
|
|
return Optional.of(material.resistance());
|
|
// Sakura start - destroy water logged blocks
|