From 903e95043d116c4884b4eca9a89ab43aec331688 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Sun, 18 Feb 2024 16:38:01 +0100 Subject: [PATCH] Mark internal Material classes as internal --- ...Bukkit-enums-Remember-original-order.patch | 20 ++++++++++------ ...t-enums-Extract-enum-implementation-.patch | 20 +++++++++++----- ...t-enums-Extract-enum-implementation-.patch | 24 ++----------------- 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/patches/api/0027-Modifiable-Bukkit-enums-Remember-original-order.patch b/patches/api/0027-Modifiable-Bukkit-enums-Remember-original-order.patch index e1d579a..a776fd6 100644 --- a/patches/api/0027-Modifiable-Bukkit-enums-Remember-original-order.patch +++ b/patches/api/0027-Modifiable-Bukkit-enums-Remember-original-order.patch @@ -16,10 +16,10 @@ 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; @@ -27,12 +27,18 @@ index 0000000000000000000000000000000000000000..1f399711d91de87bf40e06536fdd2fcf +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. ++ *

++ * 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. ++ *

++ * ++ * @apiNote Internal Use Only + */ -+@Deprecated(forRemoval = true) ++@org.jetbrains.annotations.ApiStatus.Internal +public enum OrderedEmptyMaterial { + AIR, + STONE, diff --git a/patches/api/0030-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch b/patches/api/0030-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch index de15c28..10a8d94 100644 --- a/patches/api/0030-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch +++ b/patches/api/0030-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch @@ -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; @@ -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; @@ -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. ++ *

++ * 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. ++ *

++ * ++ * @apiNote Internal Use Only + */ ++@org.jetbrains.annotations.ApiStatus.Internal +public interface AbstractMaterial extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { + + int ordinal(); diff --git a/patches/api/0031-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch b/patches/api/0031-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch index 5d6b4ae..ebefeb6 100644 --- a/patches/api/0031-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch +++ b/patches/api/0031-Modifiable-Bukkit-enums-Extract-enum-implementation-.patch @@ -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. -+ *

-+ * 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. -+ *

-+ * -+ * @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();