mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Add back Pufferfish patches
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
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 86d765cd40cda9c8b7f4f7898d604ba2fdefa8fd..37360b896edecf3f2e09f0f7da6a37d6c769c630 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
|
||||
@@ -79,7 +79,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 Material material; // Purpur - protected -> public
|
||||
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 4cb6041f42610ffca2204308c02b4169e7d15343..4503779a9216b78864817dfb04cb24d7a7784da8 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -571,4 +571,19 @@ public class PurpurConfig {
|
||||
private static void fixProjectileLootingTransfer() {
|
||||
fixProjectileLootingTransfer = getBoolean("settings.fix-projectile-looting-transfer", fixProjectileLootingTransfer);
|
||||
}
|
||||
+
|
||||
+ private static void blastResistanceSettings() {
|
||||
+ getMap("settings.blast-resistance-overrides", Collections.emptyMap()).forEach((blockId, value) -> {
|
||||
+ Block block = BuiltInRegistries.BLOCK.get(new ResourceLocation(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();
|
||||
+ });
|
||||
+ }
|
||||
}
|
||||
Reference in New Issue
Block a user