Skip to content

Commit

Permalink
fix blast resistence config not accepting namespaced values
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Jun 28, 2024
1 parent 39617d5 commit 7d59f25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions patches/server/0259-Configurable-block-blast-resistance.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ index 1b825b9012e24b12f83883f2056839c102802e4b..155a099eb9b0196385947f5765fad4e5
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 78234e8369e478800a4dc81084c8e1084c3bbd20..f3bd0ee46effea1cd8aec953107565bfe95cbf7b 100644
index 78234e8369e478800a4dc81084c8e1084c3bbd20..f07429836c7cdd6016b919740c2926e395641623 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -492,4 +492,19 @@ public class PurpurConfig {
Expand All @@ -28,7 +28,7 @@ index 78234e8369e478800a4dc81084c8e1084c3bbd20..f3bd0ee46effea1cd8aec953107565bf
+
+ private static void blastResistanceSettings() {
+ getMap("settings.blast-resistance-overrides", Collections.emptyMap()).forEach((blockId, value) -> {
+ Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.withDefaultNamespace(blockId));
+ Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(blockId));
+ if (block == Blocks.AIR) {
+ log(Level.SEVERE, "Invalid block for `settings.blast-resistance-overrides`: " + blockId);
+ return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ index d86189bd446c7cd7215cfbcef72b2125a064e3d1..53608b9dbb81c58819b9ae6bc676ffb3
return stack;
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 72e918ad137dbfe8cde8b179f352224c8b2a1dad..2f05f9c7f86a30b75b4fcaff8a95d0563ed8c9ad 100644
index a47dbe37e940e55dbf7378df299abb7f3367de83..a0fc3450a88ccb9143b1b2045aa7b5a997c5e44b 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -496,6 +496,11 @@ public class PurpurConfig {
Expand All @@ -86,4 +86,4 @@ index 72e918ad137dbfe8cde8b179f352224c8b2a1dad..2f05f9c7f86a30b75b4fcaff8a95d056
+
private static void blastResistanceSettings() {
getMap("settings.blast-resistance-overrides", Collections.emptyMap()).forEach((blockId, value) -> {
Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.withDefaultNamespace(blockId));
Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(blockId));
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ index f0703302e7dbbda88de8c648d20d87c55ed9b1e0..a913ebabaa5f443afa987b972355a8f8
}
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 2f05f9c7f86a30b75b4fcaff8a95d0563ed8c9ad..111250146a1db4d0e2497c0dce0d9f0f1f298ab6 100644
index a0fc3450a88ccb9143b1b2045aa7b5a997c5e44b..ee62c418162f96f276c3c09db66d2df46e173a63 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -501,6 +501,16 @@ public class PurpurConfig {
Expand All @@ -58,4 +58,4 @@ index 2f05f9c7f86a30b75b4fcaff8a95d0563ed8c9ad..111250146a1db4d0e2497c0dce0d9f0f
+
private static void blastResistanceSettings() {
getMap("settings.blast-resistance-overrides", Collections.emptyMap()).forEach((blockId, value) -> {
Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.withDefaultNamespace(blockId));
Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(blockId));

0 comments on commit 7d59f25

Please sign in to comment.