9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-20 07:19:33 +00:00

Add redstone cache to api

This commit is contained in:
Samsuik
2024-06-11 14:20:36 +01:00
parent 4f8b7caddb
commit 2bbc853a9a
6 changed files with 68 additions and 28 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add redstone implementation API
diff --git a/src/main/java/me/samsuik/sakura/local/LocalValueKey.java b/src/main/java/me/samsuik/sakura/local/LocalValueKey.java
index 4735e5d8dcea4835061b5cada9d601794efdf390..4d8c83f48d8ef739a00ea1b8a17ac8cdf10ac396 100644
index 4735e5d8dcea4835061b5cada9d601794efdf390..098ce4d0356fb1dddbd4e34c02f77848da1fb546 100644
--- a/src/main/java/me/samsuik/sakura/local/LocalValueKey.java
+++ b/src/main/java/me/samsuik/sakura/local/LocalValueKey.java
@@ -1,6 +1,7 @@
@@ -16,17 +16,13 @@ index 4735e5d8dcea4835061b5cada9d601794efdf390..4d8c83f48d8ef739a00ea1b8a17ac8cd
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
@@ -20,6 +21,14 @@ public record LocalValueKey<T>(NamespacedKey key, Supplier<T> defaultSupplier) {
@@ -20,6 +21,10 @@ public record LocalValueKey<T>(NamespacedKey key, Supplier<T> defaultSupplier) {
new NamespacedKey("sakura", "durable-materials"), HashMap::new
);
+ public static final LocalValueKey<RedstoneImplementation> REDSTONE_IMPLEMENTATION = new LocalValueKey<>(
+ new NamespacedKey("sakura", "redstone-implementation"), () -> RedstoneImplementation.VANILLA
+ );
+
+ public static final LocalValueKey<Boolean> CONSISTENT_EXPLOSION_RADIUS = new LocalValueKey<>(
+ new NamespacedKey("saskua", "consistent-radius"), () -> false
+ );
+
@Override
public boolean equals(Object o) {