Entity API Documentation

This commit is contained in:
Kam committed 2025-03-06 01:48:39 -05:00
1 parent 3593a09d1d
commit 8c2c226d34
21 files changed
+2778 -1142

No files matched your search

+50 -21
View File
@@ -1,21 +1,50 @@
package noppes.npcs.api.entity.data;
import noppes.npcs.api.handler.data.IAvailability;
public interface IMark {
public IAvailability getAvailability();
public int getColor();
public void setColor(int color);
public int getType();
public void setType(int type);
/**
* Calling this will send the changes you've made to the clients
*/
public void update();
}
package noppes.npcs.api.entity.data;
import noppes.npcs.api.handler.data.IAvailability;
/**
* Represents a mark that can be applied to an entity.
* A mark holds a type, a color, and availability conditions.
*/
public interface IMark {
/**
* Returns the availability conditions associated with this mark.
*
* @return the availability.
*/
IAvailability getAvailability();
/**
* Returns the color value of this mark.
*
* @return the color as an integer.
*/
int getColor();
/**
* Sets the color value of this mark.
*
* @param color the new color.
*/
void setColor(int color);
/**
* Returns the type of this mark.
*
* @return the mark type as an integer.
*/
int getType();
/**
* Sets the type of this mark.
*
* @param type the new type.
*/
void setType(int type);
/**
* Calling this will send the changes you've made to the clients.
*/
void update();
}
+163 -49
View File
@@ -1,49 +1,163 @@
package noppes.npcs.api.entity.data;
public interface IModelData {
void headWear(byte config);
byte headWear();
void bodyWear(byte config);
byte bodyWear();
void rightArmWear(byte config);
byte rightArmWear();
void leftArmWear(byte config);
byte leftArmWear();
void rightLegWear(byte config);
byte rightLegWear();
void leftLegWear(byte config);
byte leftLegWear();
/**
* Hide Body Parts
* part: [0: Head, 1: Body, 2: Arms, 3: Legs]
* hide: [0: None, 1: Both, 2: Right, 3: Left], only values 0 and 1 used for head & body.
*/
void hidePart(int part, byte hide);
int hidden(int part);
void enableRotation(boolean enableRotation);
boolean enableRotation();
IModelRotate getRotation();
IModelScale getScale();
void setEntity(String string);
String getEntity();
}
package noppes.npcs.api.entity.data;
/**
* Provides configuration data for a model including wearable settings,
* hidden parts, rotation, and scale.
* <p>
* This interface allows controlling the appearance of an entity's model
* such as headwear, bodywear, arm and leg configurations, and the ability
* to hide parts. It also manages model rotation and scaling settings as well
* as the association with an entity type.
*/
public interface IModelData {
/**
* Sets the headwear configuration.
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
*
* @param config the headwear configuration.
*/
void headWear(byte config);
/**
* Gets the current headwear configuration.
*
* @return the headwear configuration.
*/
byte headWear();
/**
* Sets the bodywear configuration.
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
*
* @param config the bodywear configuration.
*/
void bodyWear(byte config);
/**
* Gets the current bodywear configuration.
*
* @return the bodywear configuration.
*/
byte bodyWear();
/**
* Sets the right arm wear configuration.
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
*
* @param config the right arm configuration.
*/
void rightArmWear(byte config);
/**
* Gets the current right arm wear configuration.
*
* @return the right arm configuration.
*/
byte rightArmWear();
/**
* Sets the left arm wear configuration.
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
*
* @param config the left arm configuration.
*/
void leftArmWear(byte config);
/**
* Gets the current left arm wear configuration.
*
* @return the left arm configuration.
*/
byte leftArmWear();
/**
* Sets the right leg wear configuration.
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
*
* @param config the right leg configuration.
*/
void rightLegWear(byte config);
/**
* Gets the current right leg wear configuration.
*
* @return the right leg configuration.
*/
byte rightLegWear();
/**
* Sets the left leg wear configuration.
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
*
* @param config the left leg configuration.
*/
void leftLegWear(byte config);
/**
* Gets the current left leg wear configuration.
*
* @return the left leg configuration.
*/
byte leftLegWear();
/**
* Hide Body Parts
* part: [0: Head, 1: Body, 2: Arms, 3: Legs]
* hide: [0: None, 1: Both, 2: Right, 3: Left], only values 0 and 1 used for head & body.
*
* @param part the part index.
* @param hide the hide configuration.
*/
void hidePart(int part, byte hide);
/**
* Returns the hide configuration for the specified part.
*
* @param part the part index.
* @return the current hide configuration.
*/
int hidden(int part);
/**
* Enables or disables rotation for the model.
*
* @param enableRotation true to enable rotation; false to disable.
*/
void enableRotation(boolean enableRotation);
/**
* Checks whether rotation is enabled for the model.
*
* @return true if rotation is enabled; false otherwise.
*/
boolean enableRotation();
/**
* Returns the model rotation configuration.
*
* @return the rotation settings.
*/
IModelRotate getRotation();
/**
* Returns the model scaling configuration.
*
* @return the scale settings.
*/
IModelScale getScale();
/**
* Associates this model data with an entity using its class name.
*
* @param string the fully qualified class name of the entity.
*/
void setEntity(String string);
/**
* Gets the entity class name associated with this model data.
*
* @return the entity class name, or null if not set.
*/
String getEntity();
}
@@ -1,18 +1,59 @@
package noppes.npcs.api.entity.data;
public interface IModelRotate {
boolean whileStanding();
void whileStanding(boolean whileStanding);
boolean whileAttacking();
void whileAttacking(boolean whileAttacking);
boolean whileMoving();
void whileMoving(boolean whileMoving);
IModelRotatePart getPart(int part);
}
package noppes.npcs.api.entity.data;
/**
* Represents the rotation configuration for a model.
* It controls how different parts of a model rotate under various conditions.
*/
public interface IModelRotate {
/**
* Checks if rotation is applied while the entity is standing.
*
* @return true if rotation while standing is enabled; false otherwise.
*/
boolean whileStanding();
/**
* Sets whether rotation should be applied while the entity is standing.
*
* @param whileStanding true to enable; false to disable.
*/
void whileStanding(boolean whileStanding);
/**
* Checks if rotation is applied while the entity is attacking.
*
* @return true if rotation while attacking is enabled; false otherwise.
*/
boolean whileAttacking();
/**
* Sets whether rotation should be applied while the entity is attacking.
*
* @param whileAttacking true to enable; false to disable.
*/
void whileAttacking(boolean whileAttacking);
/**
* Checks if rotation is applied while the entity is moving.
*
* @return true if rotation while moving is enabled; false otherwise.
*/
boolean whileMoving();
/**
* Sets whether rotation should be applied while the entity is moving.
*
* @param whileMoving true to enable; false to disable.
*/
void whileMoving(boolean whileMoving);
/**
* Retrieves the rotation settings for a specific part of the model.
* Parts are indexed as follows: 0 - head, 1 - body, 2 - left arm, 3 - right arm, 4 - left leg, 5 - right leg.
*
* @param part the index of the model part.
* @return the rotation settings for the specified part.
*/
IModelRotatePart getPart(int part);
}
@@ -1,16 +1,53 @@
package noppes.npcs.api.entity.data;
public interface IModelRotatePart {
void setRotation(float x, float y, float z);
float getRotateX();
float getRotateY();
float getRotateZ();
void disabled(boolean enabled);
boolean disabled();
}
package noppes.npcs.api.entity.data;
/**
* Represents the rotation settings for a specific part of a model.
* Allows configuring the rotation angles along the X, Y, and Z axes
* as well as enabling/disabling the rotation.
*/
public interface IModelRotatePart {
/**
* Sets the rotation angles for this model part.
*
* @param x the rotation angle around the X-axis.
* @param y the rotation angle around the Y-axis.
* @param z the rotation angle around the Z-axis.
*/
void setRotation(float x, float y, float z);
/**
* Returns the rotation angle around the X-axis.
*
* @return the X-axis rotation.
*/
float getRotateX();
/**
* Returns the rotation angle around the Y-axis.
*
* @return the Y-axis rotation.
*/
float getRotateY();
/**
* Returns the rotation angle around the Z-axis.
*
* @return the Z-axis rotation.
*/
float getRotateZ();
/**
* Enables or disables rotation for this part.
*
* @param enabled true to disable rotation; false to enable.
*/
void disabled(boolean enabled);
/**
* Checks whether rotation is disabled for this part.
*
* @return true if rotation is disabled; false otherwise.
*/
boolean disabled();
}
@@ -1,5 +1,17 @@
package noppes.npcs.api.entity.data;
public interface IModelScale {
IModelScalePart getPart(int part);
}
package noppes.npcs.api.entity.data;
/**
* Represents the scaling configuration for a model.
* Provides access to scaling data for individual parts of a model.
*/
public interface IModelScale {
/**
* Retrieves the scaling settings for a specified model part.
* Parts are indexed as follows: 0 - head, 1 - body, 2 - arms, 3 - legs.
*
* @param part the index of the model part.
* @return the scale configuration for that part.
*/
IModelScalePart getPart(int part);
}
@@ -1,12 +1,38 @@
package noppes.npcs.api.entity.data;
public interface IModelScalePart {
void setScale(float x, float y, float z);
float getScaleX();
float getScaleY();
float getScaleZ();
}
package noppes.npcs.api.entity.data;
/**
* Represents the scale configuration for a specific part of a model.
* Allows setting and retrieving scale factors along the X, Y, and Z axes.
*/
public interface IModelScalePart {
/**
* Sets the scale factors for this model part.
*
* @param x the scale factor along the X-axis.
* @param y the scale factor along the Y-axis.
* @param z the scale factor along the Z-axis.
*/
void setScale(float x, float y, float z);
/**
* Returns the scale factor along the X-axis.
*
* @return the X-axis scale.
*/
float getScaleX();
/**
* Returns the scale factor along the Y-axis.
*
* @return the Y-axis scale.
*/
float getScaleY();
/**
* Returns the scale factor along the Z-axis.
*
* @return the Z-axis scale.
*/
float getScaleZ();
}