mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-24 09:19:18 +00:00
Add option for protecting scaffolding from creepers
This commit is contained in:
@@ -647,10 +647,10 @@ index 0000000000000000000000000000000000000000..dd5a70f70c2e7bdc30b8f5655b0b7a08
|
||||
+}
|
||||
diff --git a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..fab064ae6b3b79e884ff5a6d46a65a7c4093da3f
|
||||
index 0000000000000000000000000000000000000000..2ed95ba385e3937fde99d4ee3e7845e77591aa89
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java
|
||||
@@ -0,0 +1,218 @@
|
||||
@@ -0,0 +1,219 @@
|
||||
+package me.samsuik.sakura.configuration;
|
||||
+
|
||||
+import com.mojang.logging.LogUtils;
|
||||
@@ -738,6 +738,7 @@ index 0000000000000000000000000000000000000000..fab064ae6b3b79e884ff5a6d46a65a7c
|
||||
+ map.put(Blocks.CHIPPED_ANVIL, new DurableMaterial(3, Blocks.END_STONE.getExplosionResistance()));
|
||||
+ map.put(Blocks.DAMAGED_ANVIL, new DurableMaterial(3, Blocks.END_STONE.getExplosionResistance()));
|
||||
+ });
|
||||
+ public boolean protectScaffoldingFromCreepers = false;
|
||||
+ public boolean allowNonTntBreakingDurableBlocks = false;
|
||||
+ public boolean destroyWaterloggedBlocks = false;
|
||||
+ public boolean explodeLava = false;
|
||||
|
||||
22
patches/server/0078-Protect-scaffolding-from-creepers.patch
Normal file
22
patches/server/0078-Protect-scaffolding-from-creepers.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
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 22007aa4c85befa80938adf3126bda12b8ff58c9..bf3a05d9787eb64f384b67261ab9e04d7adf343f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -285,6 +285,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
|
||||
Reference in New Issue
Block a user