diff --git a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java index 207d68f6..76562121 100644 --- a/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java +++ b/src/main/java/minevalley/core/api/armorstand/FakeArmorStand.java @@ -1,13 +1,7 @@ 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.PoseModifier; +import minevalley.core.api.modifiers.*; import org.jetbrains.annotations.Contract; import javax.annotation.Nonnegative; @@ -15,7 +9,7 @@ @SuppressWarnings("unused") public interface FakeArmorStand extends MetadataModifier, PassengerModifier, - PoseModifier, RotationModifier, EquipmentModifier, + PoseModifier, EquipmentModifier, InteractionModifier, LocationModifier, VisibilityModifier { /** @@ -57,4 +51,164 @@ 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); + + /** + * 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/MetadataModifier.java b/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java deleted file mode 100644 index 3fbf1fca..00000000 --- a/src/main/java/minevalley/core/api/armorstand/modifiers/MetadataModifier.java +++ /dev/null @@ -1,222 +0,0 @@ -package minevalley.core.api.armorstand.modifiers; - -import minevalley.core.api.modifiers.VisibilityModifier; -import org.jetbrains.annotations.Contract; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -@SuppressWarnings("unused") -public interface 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); - - /** - * 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(); -} 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(); -} 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 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..05d4223a --- /dev/null +++ b/src/main/java/minevalley/core/api/modifiers/MetadataModifier.java @@ -0,0 +1,85 @@ +package minevalley.core.api.modifiers; + +import net.kyori.adventure.text.Component; +import org.jetbrains.annotations.Contract; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +@SuppressWarnings("unused") +public interface MetadataModifier> { + + /** + * 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 + Component getCustomName(); + + /** + * Sets the custom name of the object + * + * @param customName object of the armor stand + * @return this + */ + @Nonnull + @Contract("_ -> this") + T setCustomName(@Nullable Component 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(); +} 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;