mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-20 07:19:33 +00:00
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
|
|
Date: Wed, 29 Nov 2023 22:18:17 +0000
|
|
Subject: [PATCH] Add durable material API
|
|
|
|
|
|
diff --git a/src/main/java/me/samsuik/sakura/local/LocalValueKey.java b/src/main/java/me/samsuik/sakura/local/LocalValueKey.java
|
|
index 58f220a3f48a8cc1a25249d4a56cf356dc2c9c99..4735e5d8dcea4835061b5cada9d601794efdf390 100644
|
|
--- a/src/main/java/me/samsuik/sakura/local/LocalValueKey.java
|
|
+++ b/src/main/java/me/samsuik/sakura/local/LocalValueKey.java
|
|
@@ -1,8 +1,11 @@
|
|
package me.samsuik.sakura.local;
|
|
|
|
import me.samsuik.sakura.physics.PhysicsVersion;
|
|
+import org.bukkit.Material;
|
|
import org.bukkit.NamespacedKey;
|
|
|
|
+import java.util.HashMap;
|
|
+import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.function.Supplier;
|
|
|
|
@@ -13,6 +16,10 @@ public record LocalValueKey<T>(NamespacedKey key, Supplier<T> defaultSupplier) {
|
|
new NamespacedKey("sakura", "physics-version"), () -> PhysicsVersion.LATEST
|
|
);
|
|
|
|
+ public static final LocalValueKey<Map<Material, Map.Entry<Integer, Float>>> DURABLE_MATERIALS = new LocalValueKey<>(
|
|
+ new NamespacedKey("sakura", "durable-materials"), HashMap::new
|
|
+ );
|
|
+
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|