Skip to content

Commit

Permalink
Mark internal Material classes as internal
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnMuijsers committed Feb 18, 2024
1 parent b6d7227 commit 903e950
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,29 @@ Fiddle - https://fiddlemc.org

diff --git a/src/main/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterial.java b/src/main/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterial.java
new file mode 100644
index 0000000000000000000000000000000000000000..1f399711d91de87bf40e06536fdd2fcf9ff25450
index 0000000000000000000000000000000000000000..71aa6c5362964634c6b27f088146ed5380f38685
--- /dev/null
+++ b/src/main/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterial.java
@@ -0,0 +1,1937 @@
@@ -0,0 +1,1943 @@
+// Fiddle start - modifiable Bukkit enums - Material - remember original order
+
+package org.fiddlemc.fiddle.material;
+
+import org.bukkit.Material;
+
+/**
+ * This is an enum with the same order of names as the original {@link Material} source file.
+ * This can be used at runtime to make sure the runtime {@link Material} version has the same order of values
+ * as the original source file.
+ * @deprecated For internal use only.
+ * Do not use for any reason.
+ * This enum is for internal purposes only:
+ * use {@link Material} instead.
+ * <p>
+ * An enum with the same order of names as the original {@link Material} source file.
+ * This can be used at runtime to make sure the runtime {@link Material} version has the same order of values
+ * as the original source file.
+ * </p>
+ *
+ * @apiNote Internal Use Only
+ */
+@Deprecated(forRemoval = true)
+@org.jetbrains.annotations.ApiStatus.Internal
+public enum OrderedEmptyMaterial {
+ AIR,
+ STONE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Fiddle - https://fiddlemc.org

diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 9040e27277889ca6075380d5dbf2201db508ac39..3efa6eda0dda5928d74376a68083f34839c1fb20 100644
index 4c3591ac2badab50fee81afe4db2f5ca4e736ea2..80190abd184dddb08df8502adeb667d1809f8de0 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -122,7 +122,7 @@ import org.jetbrains.annotations.Nullable;
Expand All @@ -32,10 +32,10 @@ index 9040e27277889ca6075380d5dbf2201db508ac39..3efa6eda0dda5928d74376a68083f348
STONE(22948),
diff --git a/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java b/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java
new file mode 100644
index 0000000000000000000000000000000000000000..c5232856b5537b21751f93d3b5d48c17c3fe9e83
index 0000000000000000000000000000000000000000..5e427faae4728a91c59e937cac3ceb5c1629722d
--- /dev/null
+++ b/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java
@@ -0,0 +1,21 @@
@@ -0,0 +1,29 @@
+// Fiddle - modifiable Bukkit enums - create corresponding interfaces - Material
+
+package org.fiddlemc.fiddle.material;
Expand All @@ -46,10 +46,18 @@ index 0000000000000000000000000000000000000000..c5232856b5537b21751f93d3b5d48c17
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * An interface that provides default implementations for most {@link Material} methods.
+ * This interface, while it itself reference the {@link Material} class, can be loaded by a ClassLoader
+ * without the {@link Material} class being loaded.
+ * Do not use for any reason.
+ * This interface is for internal purposes only:
+ * use {@link Material} instead.
+ * <p>
+ * An interface that provides default implementations for most {@link Material} methods.
+ * This interface, while it itself reference the {@link Material} class, can be loaded by a ClassLoader
+ * without the {@link Material} class being loaded.
+ * </p>
+ *
+ * @apiNote Internal Use Only
+ */
+@org.jetbrains.annotations.ApiStatus.Internal
+public interface AbstractMaterial extends Keyed, Translatable, net.kyori.adventure.translation.Translatable {
+
+ int ordinal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,30 +657,10 @@ index 80190abd184dddb08df8502adeb667d1809f8de0..297a9c95040b0d4f300b324a010cd3dc
// Fiddle end - flags for vanilla content - API - item

diff --git a/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java b/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java
index c5232856b5537b21751f93d3b5d48c17c3fe9e83..f9fbb353553027e47e355b2a7742df1eac4aed19 100644
index 5e427faae4728a91c59e937cac3ceb5c1629722d..5a087e947af45a21ec27fb2e37c7f27351712981 100644
--- a/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java
+++ b/src/main/java/org/fiddlemc/fiddle/material/AbstractMaterial.java
@@ -8,9 +8,16 @@ import org.bukkit.Translatable;
import org.jetbrains.annotations.NotNull;

/**
- * An interface that provides default implementations for most {@link Material} methods.
- * This interface, while it itself reference the {@link Material} class, can be loaded by a ClassLoader
- * without the {@link Material} class being loaded.
+ * Do not use for any reason.
+ * This interface is for internal purposes only:
+ * use {@link Material} instead.
+ * <p>
+ * An interface that provides default implementations for most {@link Material} methods.
+ * This interface, while it itself reference the {@link Material} class, can be loaded by a ClassLoader
+ * without the {@link Material} class being loaded.
+ * </p>
+ *
+ * @apiNote Internal Use Only
*/
public interface AbstractMaterial extends Keyed, Translatable, net.kyori.adventure.translation.Translatable {

@@ -18,4 +25,253 @@ public interface AbstractMaterial extends Keyed, Translatable, net.kyori.adventu
@@ -26,4 +26,253 @@ public interface AbstractMaterial extends Keyed, Translatable, net.kyori.adventu

@NotNull String name();

Expand Down

0 comments on commit 903e950

Please sign in to comment.