mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
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
This commit is contained in:
committed by
granny
parent
137ef963b1
commit
03b4271d72
@@ -13,6 +13,7 @@ import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.properties.Tilt;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.World;
|
||||
@@ -785,6 +786,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