From 972a196d65b0f1116f014e74231354c887827721 Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Wed, 21 Jan 2026 19:50:52 +0100 Subject: [PATCH 1/9] feat: add generic MetadataModifier --- .../core/api/modifiers/MetadataModifier.java | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/main/java/minevalley/core/api/modifiers/MetadataModifier.java diff --git a/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java new file mode 100644 index 00000000..d2775e2f --- /dev/null +++ b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java @@ -0,0 +1,94 @@ +package minevalley.core.api.modifiers; + +import org.jetbrains.annotations.Contract; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +@SuppressWarnings("unused") +public interface MetadataModifier> { + + /** + * Sets if object is glowing + * + * @param glowing true if the object should be glowing + * @return this + */ + @Nonnull + @Contract("_ -> this") + T setGlowing(boolean glowing); + + /** + * Checks if the object is affected by gravity + * + * @return true if the object is affected by gravity + */ + boolean hasGravity(); + + /** + * Sets if the object is affected by gravity + * + * @param gravity true if the object should be affected by gravity + * @return this + */ + @Nonnull + @Contract("_ -> this") + T setGravity(boolean gravity); + + /** + * Gets the custom name of the object, if existing + * + * @return custom name of the object + */ + @Nullable + String getCustomName(); + + /** + * Sets the custom name of the object + * + * @param customName object of the armor stand + * @return this + */ + @Nonnull + @Contract("_ -> this") + T setCustomName(@Nullable String customName); + + /** + * Checks if the custom name is visible + * + * @return true if the custom name is visible + */ + boolean isCustomNameVisible(); + + /** + * Sets if the custom name is visible + * + * @param customNameVisible true if the custom name should be visible + * @return this + */ + @Nonnull + @Contract("_ -> this") + T setCustomNameVisible(boolean customNameVisible); + + /** + * Checks if the object is silent + * + * @return true if the armor stand is silent + */ + boolean isSilent(); + + /** + * Sets if the object is silent + * + * @param silent true if the object should be silent + * @return this + */ + @Nonnull + @Contract("_ -> this") + T setSilent(boolean silent); + + /** + * Updates the metadata of the object + */ + void updateMetadata(); +} From 915c65f842fe2e95a1b52bf4fd940a3c1a5bb3a5 Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Wed, 21 Jan 2026 19:51:50 +0100 Subject: [PATCH 2/9] feat(ArmorStand MetadataModifier): implement generic MetadataModifier --- .../modifiers/MetadataModifier.java | 77 +------------------ 1 file changed, 1 insertion(+), 76 deletions(-) diff --git a/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java b/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java index 3fbf1fca..60317e74 100644 --- a/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java +++ b/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java @@ -4,10 +4,9 @@ import org.jetbrains.annotations.Contract; import javax.annotation.Nonnull; -import javax.annotation.Nullable; @SuppressWarnings("unused") -public interface MetadataModifier> { +public interface MetadataModifier> extends minevalley.core.api.modifiers.MetadataModifier { /** * Checks if the armor stand has a baseplate @@ -145,78 +144,4 @@ public interface MetadataModifier> { @Nonnull @Contract("_ -> this") T setGlowing(boolean glowing); - - /** - * Checks if the armor stand is affected by gravity - * - * @return true if the armor stand is affected by gravity - */ - boolean hasGravity(); - - /** - * Sets if the armor stand is affected by gravity - * - * @param gravity true if the armor stand should be affected by gravity - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setGravity(boolean gravity); - - /** - * Gets the custom name of the armor stand, if existing - * - * @return custom name of the armor stand - */ - @Nullable - String getCustomName(); - - /** - * Sets the custom name of the armor stand - * - * @param customName custom name of the armor stand - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setCustomName(@Nullable String customName); - - /** - * Checks if the custom name is visible - * - * @return true if the custom name is visible - */ - boolean isCustomNameVisible(); - - /** - * Sets if the custom name is visible - * - * @param customNameVisible true if the custom name should be visible - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setCustomNameVisible(boolean customNameVisible); - - /** - * Checks if the armor stand is silent - * - * @return true if the armor stand is silent - */ - boolean isSilent(); - - /** - * Sets if the armor stand is silent - * - * @param silent true if the armor stand should be silent - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setSilent(boolean silent); - - /** - * Updates the metadata of the armor stand - */ - void updateMetadata(); } From c1e0c8832b81c9d3b3ccc0ef13dd43cad7d27a84 Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Wed, 21 Jan 2026 19:52:04 +0100 Subject: [PATCH 3/9] chore(FakeArmorStand): optimize imports --- .../java/minevalley/core/api/armorstand/FakeArmorStand.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java index 207d68f6..a3695d57 100644 --- a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java +++ b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java @@ -1,13 +1,9 @@ package minevalley.core.api.armorstand; import minevalley.core.api.armorstand.modifiers.MetadataModifier; -import minevalley.core.api.modifiers.PassengerModifier; import minevalley.core.api.armorstand.modifiers.PoseModifier; import minevalley.core.api.armorstand.modifiers.RotationModifier; -import minevalley.core.api.modifiers.EquipmentModifier; -import minevalley.core.api.modifiers.InteractionModifier; -import minevalley.core.api.modifiers.LocationModifier; -import minevalley.core.api.modifiers.VisibilityModifier; +import minevalley.core.api.modifiers.*; import org.jetbrains.annotations.Contract; import javax.annotation.Nonnegative; From 36878b7b3e34f31c96cc2dcf2e69cc7f9d33a134 Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Wed, 21 Jan 2026 19:55:14 +0100 Subject: [PATCH 4/9] feat(Display): add MetadataModifier --- src/main/java/minevalley/core/api/displays/Display.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/minevalley/core/api/displays/Display.java b/src/main/java/minevalley/core/api/displays/Display.java index 67d56022..f3543c0c 100644 --- a/src/main/java/minevalley/core/api/displays/Display.java +++ b/src/main/java/minevalley/core/api/displays/Display.java @@ -6,8 +6,9 @@ import javax.annotation.Nonnull; -public interface Display> extends InteractionModifier, LocationModifier, PassengerModifier, RotationModifier, - ScaleModifier, TranslationModifier, VisibilityModifier { +public interface Display> extends + InteractionModifier, LocationModifier, MetadataModifier, PassengerModifier, + RotationModifier, ScaleModifier, TranslationModifier, VisibilityModifier { /** * Set the location of the display From e77b325b7e6bb5e8d3a6c68320f6396f61a703bf Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Wed, 21 Jan 2026 20:33:08 +0100 Subject: [PATCH 5/9] feat(MetadataModifier): change custom name type --- .../java/minevalley/core/api/modifiers/MetadataModifier.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java index d2775e2f..d1ad2a97 100644 --- a/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java +++ b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java @@ -1,5 +1,6 @@ package minevalley.core.api.modifiers; +import net.kyori.adventure.text.Component; import org.jetbrains.annotations.Contract; import javax.annotation.Nonnull; @@ -41,7 +42,7 @@ public interface MetadataModifier> { * @return custom name of the object */ @Nullable - String getCustomName(); + Component getCustomName(); /** * Sets the custom name of the object @@ -51,7 +52,7 @@ public interface MetadataModifier> { */ @Nonnull @Contract("_ -> this") - T setCustomName(@Nullable String customName); + T setCustomName(@Nullable Component customName); /** * Checks if the custom name is visible From d33fc8919c096e2ecd26f9a8c708efec9eb43d6e Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Wed, 21 Jan 2026 20:52:54 +0100 Subject: [PATCH 6/9] feat(MetadataModifier): remove glow --- .../core/api/modifiers/MetadataModifier.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java index d1ad2a97..05d4223a 100644 --- a/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java +++ b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java @@ -9,16 +9,6 @@ @SuppressWarnings("unused") public interface MetadataModifier> { - /** - * Sets if object is glowing - * - * @param glowing true if the object should be glowing - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setGlowing(boolean glowing); - /** * Checks if the object is affected by gravity * From 52303f105544c28e69655466cd51bd3469873bdd Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Sun, 25 Jan 2026 21:28:07 +0100 Subject: [PATCH 7/9] refactor: move armor stand metadata modifying into FakeArmorStand --- .../core/api/armorstand/FakeArmorStand.java | 138 +++++++++++++++- .../modifiers/MetadataModifier.java | 147 ------------------ 2 files changed, 137 insertions(+), 148 deletions(-) delete mode 100644 src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java diff --git a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java index a3695d57..e3ef3cf6 100644 --- a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java +++ b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java @@ -1,6 +1,5 @@ package minevalley.core.api.armorstand; -import minevalley.core.api.armorstand.modifiers.MetadataModifier; import minevalley.core.api.armorstand.modifiers.PoseModifier; import minevalley.core.api.armorstand.modifiers.RotationModifier; import minevalley.core.api.modifiers.*; @@ -53,4 +52,141 @@ public interface FakeArmorStand extends MetadataModifier, Passen @Nonnull @Contract("_ -> this") FakeArmorStand setVisibilityRange(int visibilityRange); + + /** + * Checks if the armor stand has a baseplate + * + * @return true if the armor stand has a baseplate + * @see #hasBaseplate() + */ + @Deprecated + @Contract(pure = true) + boolean hasBasePlate(); + + /** + * Checks if the armor stand has a baseplate + * + * @return true if the armor stand has a baseplate + */ + @Contract(pure = true) + boolean hasBaseplate(); + + /** + * Sets if the armor stand has a baseplate + * + * @param baseplate true if the armor stand has a baseplate + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setBasePlate(boolean baseplate); + + /** + * Checks if the armor stand is small + * + * @return true if the armor stand is small + */ + @Contract(pure = true) + boolean isSmall(); + + /** + * Sets if the armor stand is small + * + * @param small true if the armor stand should be small + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setSmall(boolean small); + + /** + * Checks if the armor stand has arms + * + * @return true if the armor stand has arms + */ + @Contract(pure = true) + boolean hasArms(); + + /** + * @param arms true if the armor stand should have arms + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setArms(boolean arms); + + /** + * Checks if the armor stand is a marker + * + * @return true if the armor stand is a marker + */ + boolean isMarker(); + + /** + * Sets if the armor stand is a marker + * + * @param marker true if the armor stand should be a marker + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setMarker(boolean marker); + + /** + * Checks if the armor stand is on fire + *

+ * Note: This only affects the visual effect, not actual fire damage. This can only be changed via {@link #setOnFire(boolean)} not by setting the 'entity' on fire. + * + * @return true if the armor stand is on fire + */ + @Contract(pure = true) + boolean isOnFire(); + + /** + * Sets if the armor stand is on fire + * + * @param onFire true if the armor stand should be on fire + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setOnFire(boolean onFire); + + /** + * Checks if the armor stand is visible + *

+ * Note: This only affects the visual effect, not actual visibility to players as in {@link VisibilityModifier} + * + * @return true if the armor stand is visible + */ + boolean isVisible(); + + /** + * Sets if the armor stand is visible + *

+ * Note: This only affects the visual effect, not actual visibility to players as in {@link VisibilityModifier} + * + * @param visible true if the armor stand should be visible + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setVisible(boolean visible); + + /** + * Checks if the armor stand is glowing + * + * @return true if the armor stand is glowing + */ + boolean isGlowing(); + + /** + * Sets if the armor stand is glowing + * + * @param glowing true if the armor stand should be glowing + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setGlowing(boolean glowing); } diff --git a/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java b/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java deleted file mode 100644 index 60317e74..00000000 --- a/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java +++ /dev/null @@ -1,147 +0,0 @@ -package minevalley.core.api.armorstand.modifiers; - -import minevalley.core.api.modifiers.VisibilityModifier; -import org.jetbrains.annotations.Contract; - -import javax.annotation.Nonnull; - -@SuppressWarnings("unused") -public interface MetadataModifier> extends minevalley.core.api.modifiers.MetadataModifier { - - /** - * Checks if the armor stand has a baseplate - * - * @return true if the armor stand has a baseplate - * @see #hasBaseplate() - */ - @Deprecated - @Contract(pure = true) - boolean hasBasePlate(); - - /** - * Checks if the armor stand has a baseplate - * - * @return true if the armor stand has a baseplate - */ - @Contract(pure = true) - boolean hasBaseplate(); - - /** - * Sets if the armor stand has a baseplate - * - * @param baseplate true if the armor stand has a baseplate - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setBasePlate(boolean baseplate); - - /** - * Checks if the armor stand is small - * - * @return true if the armor stand is small - */ - @Contract(pure = true) - boolean isSmall(); - - /** - * Sets if the armor stand is small - * - * @param small true if the armor stand should be small - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setSmall(boolean small); - - /** - * Checks if the armor stand has arms - * - * @return true if the armor stand has arms - */ - @Contract(pure = true) - boolean hasArms(); - - /** - * @param arms true if the armor stand should have arms - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setArms(boolean arms); - - /** - * Checks if the armor stand is a marker - * - * @return true if the armor stand is a marker - */ - boolean isMarker(); - - /** - * Sets if the armor stand is a marker - * - * @param marker true if the armor stand should be a marker - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setMarker(boolean marker); - - /** - * Checks if the armor stand is on fire - *

- * Note: This only affects the visual effect, not actual fire damage. This can only be changed via {@link #setOnFire(boolean)} not by setting the 'entity' on fire. - * - * @return true if the armor stand is on fire - */ - @Contract(pure = true) - boolean isOnFire(); - - /** - * Sets if the armor stand is on fire - * - * @param onFire true if the armor stand should be on fire - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setOnFire(boolean onFire); - - /** - * Checks if the armor stand is visible - *

- * Note: This only affects the visual effect, not actual visibility to players as in {@link VisibilityModifier} - * - * @return true if the armor stand is visible - */ - boolean isVisible(); - - /** - * Sets if the armor stand is visible - *

- * Note: This only affects the visual effect, not actual visibility to players as in {@link VisibilityModifier} - * - * @param visible true if the armor stand should be visible - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setVisible(boolean visible); - - /** - * Checks if the armor stand is glowing - * - * @return true if the armor stand is glowing - */ - boolean isGlowing(); - - /** - * Sets if the armor stand is glowing - * - * @param glowing true if the armor stand should be glowing - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setGlowing(boolean glowing); -} From afe02e6135d176580e38e4cff1fa021352a62644 Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Sun, 25 Jan 2026 21:41:00 +0100 Subject: [PATCH 8/9] refactor: move armor stand rotation modifying into FakeArmorStand --- .../core/api/armorstand/FakeArmorStand.java | 26 +++++++++++++-- .../modifiers/RotationModifier.java | 32 ------------------- 2 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 src/main/java/minevalley/core/api/armorstand/modifiers/RotationModifier.java diff --git a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java index e3ef3cf6..abb8eab1 100644 --- a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java +++ b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java @@ -1,7 +1,6 @@ package minevalley.core.api.armorstand; import minevalley.core.api.armorstand.modifiers.PoseModifier; -import minevalley.core.api.armorstand.modifiers.RotationModifier; import minevalley.core.api.modifiers.*; import org.jetbrains.annotations.Contract; @@ -10,7 +9,7 @@ @SuppressWarnings("unused") public interface FakeArmorStand extends MetadataModifier, PassengerModifier, - PoseModifier, RotationModifier, EquipmentModifier, + PoseModifier, EquipmentModifier, InteractionModifier, LocationModifier, VisibilityModifier { /** @@ -189,4 +188,27 @@ public interface FakeArmorStand extends MetadataModifier, Passen @Nonnull @Contract("_ -> this") FakeArmorStand setGlowing(boolean glowing); + + /** + * Sets the rotation of the armor stand + * + * @param rotation rotation in degrees + * @return this + */ + @Nonnull + @Contract("_ -> this") + FakeArmorStand setRotation(float rotation); + + /** + * Gets the rotation of the armor stand in degrees + * + * @return the rotation of the armor stand + */ + @Contract(pure = true) + float getRotation(); + + /** + * Updates the rotation of the armor stand + */ + void updateRotation(); } diff --git a/src/main/java/minevalley/core/api/armorstand/modifiers/RotationModifier.java b/src/main/java/minevalley/core/api/armorstand/modifiers/RotationModifier.java deleted file mode 100644 index fff8b72a..00000000 --- a/src/main/java/minevalley/core/api/armorstand/modifiers/RotationModifier.java +++ /dev/null @@ -1,32 +0,0 @@ -package minevalley.core.api.armorstand.modifiers; - -import org.jetbrains.annotations.Contract; - -import javax.annotation.Nonnull; - -@SuppressWarnings("unused") -public interface RotationModifier> { - - /** - * Sets the rotation of the armor stand - * - * @param rotation rotation in degrees - * @return this - */ - @Nonnull - @Contract("_ -> this") - T setRotation(float rotation); - - /** - * Gets the rotation of the armor stand in degrees - * - * @return the rotation of the armor stand - */ - @Contract(pure = true) - float getRotation(); - - /** - * Updates the rotation of the armor stand - */ - void updateRotation(); -} From 351d49f614bd199babb0aa9e2bf4d16faaca580c Mon Sep 17 00:00:00 2001 From: thorbenbuenger Date: Sun, 25 Jan 2026 21:41:59 +0100 Subject: [PATCH 9/9] refactor: move PoseModifier --- .../java/minevalley/core/api/armorstand/FakeArmorStand.java | 2 +- .../core/api/{armorstand => }/modifiers/PoseModifier.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/main/java/minevalley/core/api/{armorstand => }/modifiers/PoseModifier.java (98%) diff --git a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java index abb8eab1..76562121 100644 --- a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java +++ b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java @@ -1,6 +1,6 @@ package minevalley.core.api.armorstand; -import minevalley.core.api.armorstand.modifiers.PoseModifier; +import minevalley.core.api.modifiers.PoseModifier; import minevalley.core.api.modifiers.*; import org.jetbrains.annotations.Contract; diff --git a/src/main/java/minevalley/core/api/armorstand/modifiers/PoseModifier.java b/src/main/java/minevalley/core/api/modifiers/PoseModifier.java similarity index 98% rename from src/main/java/minevalley/core/api/armorstand/modifiers/PoseModifier.java rename to src/main/java/minevalley/core/api/modifiers/PoseModifier.java index 02b79c6a..41e726c0 100644 --- a/src/main/java/minevalley/core/api/armorstand/modifiers/PoseModifier.java +++ b/src/main/java/minevalley/core/api/modifiers/PoseModifier.java @@ -1,4 +1,4 @@ -package minevalley.core.api.armorstand.modifiers; +package minevalley.core.api.modifiers; import org.bukkit.util.EulerAngle; import org.jetbrains.annotations.Contract;