re-add removing curse of binding with weakness patch

This commit is contained in:
granny
2024-06-16 00:34:15 -07:00
parent dedcdd053d
commit 00126e86ea
99 changed files with 293 additions and 293 deletions

View File

@@ -1,43 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MelnCat <melncatuwu@gmail.com>
Date: Sat, 1 Oct 2022 13:29:17 -0700
Subject: [PATCH] Configurable block blast resistance
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 1b825b9012e24b12f83883f2056839c102802e4b..155a099eb9b0196385947f5765fad4e5c5b74b44 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
@@ -85,7 +85,7 @@ public abstract class BlockBehaviour implements FeatureElement {
protected static final Direction[] UPDATE_SHAPE_ORDER = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP};
public final boolean hasCollision;
- protected final float explosionResistance;
+ public float explosionResistance; // Purpur - protected final -> public
protected final boolean isRandomlyTicking;
protected final SoundType soundType;
protected final float friction;
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 0278beb0746db9a8b25eefeacbb4f8f4e5e6d38b..7d33bdb2592f7977aff21804c837c9eff5827f5f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -488,4 +488,19 @@ public class PurpurConfig {
String setPattern = getString("settings.username-valid-characters", defaultPattern);
usernameValidCharactersPattern = java.util.regex.Pattern.compile(setPattern == null || setPattern.isBlank() ? defaultPattern : setPattern);
}
+
+ private static void blastResistanceSettings() {
+ getMap("settings.blast-resistance-overrides", Collections.emptyMap()).forEach((blockId, value) -> {
+ Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.withDefaultNamespace(blockId));
+ if (block == Blocks.AIR) {
+ log(Level.SEVERE, "Invalid block for `settings.blast-resistance-overrides`: " + blockId);
+ return;
+ }
+ if (!(value instanceof Number blastResistance)) {
+ log(Level.SEVERE, "Invalid blast resistance for `settings.blast-resistance-overrides." + blockId + "`: " + value);
+ return;
+ }
+ block.explosionResistance = blastResistance.floatValue();
+ });
+ }
}