Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fakearmorstand): add some new modifiers for fakearmorstands and introduce queue system #119

Merged
merged 12 commits into from
Jan 16, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,27 @@ public interface EquipmentModifier {

ItemStack getLeftHand();

void setLeftHand(ItemStack itemStack);
EquipmentModifier setLeftHand(ItemStack itemStack);

ItemStack getRightHand();

void setRightHand(ItemStack itemStack);
EquipmentModifier setRightHand(ItemStack itemStack);

ItemStack getHelmet();

void setHelmet(ItemStack helmet);
EquipmentModifier setHelmet(ItemStack helmet);

ItemStack getChestplate();

void setChestplate(ItemStack chestplate);
EquipmentModifier setChestplate(ItemStack chestplate);

ItemStack getLeggings();

void setLeggings(ItemStack leggings);
EquipmentModifier setLeggings(ItemStack leggings);

ItemStack getBoots();

void setBoots(ItemStack boots);
EquipmentModifier setBoots(ItemStack boots);

void updateEquipment();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.util.List;

public interface FakeArmorStand extends VisibilityModifier, PoseModifier, EquipmentModifier {
public interface FakeArmorStand extends EquipmentModifier, MetadataModifier, PoseModifier, VisibilityModifier {

/**
* get the custom id from the armorstand
Expand All @@ -14,11 +14,6 @@ public interface FakeArmorStand extends VisibilityModifier, PoseModifier, Equipm
*/
int getId();

/**
* Refreshed the Armorstand with its configuration
*/
void update();

/**
* Spawns the armorstand
*/
Expand Down Expand Up @@ -48,40 +43,6 @@ public interface FakeArmorStand extends VisibilityModifier, PoseModifier, Equipm
*/
void setLocation(Location location);

/**
* Get the pitch from the armorstand facing
*
* @return float
*/
float getPitch();

void setPitch(float pitch);

/**
* Get the yaw from the armorstand facing
*
* @return float
*/
float getYaw();

void setYaw(float yaw);

boolean hasBasePlate();

void setBasePlate(boolean basePlate);

boolean isSmall();

void setSmall(boolean small);

boolean hasArms();

void setArms(boolean arms);

boolean isMarker();

void setMarker(boolean marker);

/**
* get the current passenger list
*
Expand All @@ -102,4 +63,34 @@ public interface FakeArmorStand extends VisibilityModifier, PoseModifier, Equipm
* @param entity the entity to be removed
*/
void removePassenger(Entity entity);

void setOnFire(boolean onFire);

boolean isOnFire();

void setVisible(boolean visible);

boolean isVisible();

void setGlowing(boolean glowing);

boolean isGlowing();

void setGravity(boolean gravity);

boolean hasGravity();

void setCustomName(String customName);

String getCustomName();

void setCustomNameVisible(boolean customNameVisible);

boolean isCustomNameVisible();

void setSilent(boolean silent);

boolean isSilent();

void updateModifier();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package minevalley.core.api.utils.armorstand;

public interface MetadataModifier {

boolean hasBasePlate();

MetadataModifier setBasePlate(boolean basePlate);

boolean isSmall();

MetadataModifier setSmall(boolean small);

boolean hasArms();

MetadataModifier setArms(boolean arms);

boolean isMarker();

MetadataModifier setMarker(boolean marker);

void updateModifier();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

public interface PoseModifier {

void setLeftArmPose(EulerAngle leftArmPose);
PoseModifier queueHeadPose(float yaw, float pitch);

void setRightArmPose(EulerAngle rightArmPose);
PoseModifier queueHeadPose(EulerAngle headPose);

void setLeftLegPose(EulerAngle leftLegPose);
PoseModifier queueLeftArmPose(EulerAngle leftArmPose);

void setRightLegPose(EulerAngle rightLegPose);
PoseModifier queueRightArmPose(EulerAngle rightArmPose);

void setBodyPose(EulerAngle bodyPose);
PoseModifier queueBodyPose(EulerAngle bodyPose);

PoseModifier queueLeftLegPose(EulerAngle leftLegPose);

PoseModifier queueRightLegPose(EulerAngle rightLegPose);

void updatePose();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public interface VisibilityModifier {
*/
List<OnlineUser> getViewersList();

void addToViewersList(OnlineUser... onlineUsers);
VisibilityModifier addToViewersList(OnlineUser... onlineUsers);

void removeFromViewersList(OnlineUser... onlineUsers);
VisibilityModifier removeFromViewersList(OnlineUser... onlineUsers);

/**
* <b>Emptying this list results in everyone seeing the armorstand (If not part of hide list)</b>
*/
void emptyViewersList();
VisibilityModifier emptyViewersList();

/**
* The armorstand will explicitly hide from the players in this list, even if the viewers list contains them (or is empty)!
Expand All @@ -33,10 +33,11 @@ public interface VisibilityModifier {
*/
List<OnlineUser> getHideList();

void addToHideList(OnlineUser... onlineUsers);
VisibilityModifier addToHideList(OnlineUser... onlineUsers);

void removeFromHideList(OnlineUser... onlineUsers);
VisibilityModifier removeFromHideList(OnlineUser... onlineUsers);

void emptyHideList();
VisibilityModifier emptyHideList();

void updateVisibility();
}