mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
add back pufferfish patches
This commit is contained in:
52
patches/server/0197-Big-dripleaf-tilt-delay.patch
Normal file
52
patches/server/0197-Big-dripleaf-tilt-delay.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 16 Jul 2021 22:47:29 -0500
|
||||
Subject: [PATCH] Big dripleaf tilt delay
|
||||
|
||||
Makes the tilt delays configurable. There are only 3 types of tilts used by this setting. When an entity steps on a
|
||||
big_dripleaf with no tilt it will immediately change to an UNSTABLE tilt. Each change after that is on a tick timer:
|
||||
|
||||
UNSTABLE: big_dripleaf with UNSTABLE tilt will change to PARTIAL tilt after 10 ticks
|
||||
PARTIAL: big_dripleaf with PARTIAL tilt will change to FULL tilt after 10 ticks
|
||||
UNSTABLE: big_dripleaf with FULL tilt will change back to no tilt after 100 ticks
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java b/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
index 7455847cf8a05ed237d2df84ae2d9b1d2f2d7176..2960f5e35012665939c2d670d212aa4d6cb228db 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java
|
||||
@@ -236,7 +236,7 @@ public class BigDripleafBlock extends HorizontalDirectionalBlock implements Bone
|
||||
BigDripleafBlock.playTiltSound(world, blockposition, soundeffect);
|
||||
}
|
||||
|
||||
- int i = BigDripleafBlock.DELAY_UNTIL_NEXT_TILT_STATE.getInt(tilt);
|
||||
+ int i = world.purpurConfig.bigDripleafTiltDelay.getOrDefault(tilt, -1); // Purpur
|
||||
|
||||
if (i != -1) {
|
||||
world.scheduleTick(blockposition, (Block) this, i);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index b5b9cbfacffd9c7068390196fc5faee7ccdb0da7..42ffb010eec6d5946f7da99296ac44b5d785aedc 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -730,6 +730,22 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public Map<Tilt, Integer> bigDripleafTiltDelay = new HashMap<>();
|
||||
+ private void bigDripleafSettings() {
|
||||
+ bigDripleafTiltDelay.clear();
|
||||
+ getMap("blocks.big_dripleaf.tilt-delay", Map.ofEntries(
|
||||
+ Map.entry("UNSTABLE", 10),
|
||||
+ Map.entry("PARTIAL", 10),
|
||||
+ Map.entry("FULL", 100))
|
||||
+ ).forEach((tilt, delay) -> {
|
||||
+ try {
|
||||
+ bigDripleafTiltDelay.put(Tilt.valueOf(tilt), (int) delay);
|
||||
+ } catch (IllegalArgumentException e) {
|
||||
+ PurpurConfig.log(Level.SEVERE, "Invalid big_dripleaf tilt key: " + tilt);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
public boolean chestOpenWithBlockOnTop = false;
|
||||
private void chestSettings() {
|
||||
chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
||||
Reference in New Issue
Block a user