More Core Class Conversion

This commit is contained in:
Kam committed 2026-03-13 16:59:00 -04:00
1 parent 27a9e4c808
commit 79b63efa19
36 files changed
+420 -102

No files matched your search

@@ -0,0 +1,29 @@
package noppes.npcs.api.handler;
/**
* Tracks which dialogs a player has read.
*/
public interface IPlayerDialogData {
/**
* Checks if the player has read the dialog with the given ID.
*
* @param id the dialog ID.
* @return true if the dialog has been read; false otherwise.
*/
boolean hasReadDialog(int id);
/**
* Marks the dialog with the given ID as read.
*
* @param id the dialog ID.
*/
void readDialog(int id);
/**
* Marks the dialog with the given ID as unread.
*
* @param id the dialog ID.
*/
void unreadDialog(int id);
}
@@ -0,0 +1,51 @@
package noppes.npcs.api.handler;
import noppes.npcs.api.handler.data.ITransportLocation;
/**
* Tracks which transport locations a player has unlocked.
*/
public interface IPlayerTransportData {
/**
* @param id the transport location ID.
* @return true if the player has unlocked this transport.
*/
boolean hasTransport(int id);
/**
* Unlocks a transport location by ID.
*
* @param id the transport location ID.
*/
void addTransport(int id);
/**
* Unlocks the given transport location.
*
* @param location the transport location.
*/
void addTransport(ITransportLocation location);
/**
* Returns the transport location with the given ID.
*
* @param id the transport location ID.
* @return the transport location, or null if not found.
*/
ITransportLocation getTransport(int id);
/**
* Returns all unlocked transport locations for the player.
*
* @return an array of transport locations.
*/
ITransportLocation[] getTransports();
/**
* Removes an unlocked transport location by ID.
*
* @param id the transport location ID.
*/
void removeTransport(int id);
}
@@ -0,0 +1,39 @@
package noppes.npcs.api.handler.data;
/**
* Defines the blueprint for an attribute.
* <p>
* An attribute definition contains identifying information such as a unique key,
* a human-readable display name, a translation key for localization, and a color code.
* </p>
*/
public interface IAttributeDefinition {
/**
* Returns the unique key that identifies this attribute.
*
* @return a String representing the attribute key
*/
String getKey();
/**
* Returns the human-readable display name for this attribute.
*
* @return a String representing the display name
*/
String getDisplayName();
/**
* Returns the translation key used for localizing this attribute.
*
* @return a String representing the translation key
*/
String getTranslationKey();
/**
* Returns the color code associated with this attribute.
*
* @return a char representing the color code
*/
char getColorCode();
}
@@ -0,0 +1,25 @@
package noppes.npcs.api.handler.data;
/**
* Represents an instance of a custom attribute.
* <p>
* A custom attribute instance encapsulates an {@link IAttributeDefinition}
* along with its current calculated value (which may be affected by modifiers).
* </p>
*/
public interface ICustomAttribute {
/**
* Returns the attribute definition associated with this custom attribute.
*
* @return the {@link IAttributeDefinition} instance defining this attribute
*/
IAttributeDefinition getAttribute();
/**
* Returns the current value of this attribute.
*
* @return the float value representing the attribute's current state
*/
float getValue();
}
@@ -0,0 +1,84 @@
package noppes.npcs.api.handler.data;
public interface IFrame {
/**
* @return An array of all frame parts in this frame
*/
IFramePart[] getParts();
/**
* Adds a frame part to this frame.
* @param partConfig The frame part to add
* @return This frame for chaining
*/
IFrame addPart(IFramePart partConfig);
/**
* Removes a frame part by its name.
* @param partName The animation part name (e.g. HEAD, BODY, RIGHT_ARM, LEFT_ARM, RIGHT_LEG, LEFT_LEG, FULL_MODEL)
* @return This frame for chaining
*/
IFrame removePart(String partName);
/**
* Removes a frame part by its ordinal ID.
* @param partId The animation part ordinal ID
* @return This frame for chaining
*/
IFrame removePart(int partId);
/**
* Removes all frame parts from this frame.
* @return This frame for chaining
*/
IFrame clearParts();
/**
* @return The duration of this frame in ticks
*/
int getDuration();
/**
* Sets the duration of this frame.
* @param duration The duration in ticks
* @return This frame for chaining
*/
IFrame setDuration(int duration);
/**
* @return Whether this frame has custom speed and smooth settings that override the parent animation
*/
boolean isCustomized();
/**
* Sets whether this frame uses custom speed and smooth settings.
* @param customized True to use frame-level settings instead of the parent animation's
* @return This frame for chaining
*/
IFrame setCustomized(boolean customized);
/**
* @return The interpolation speed of this frame
*/
float getSpeed();
/**
* Sets the interpolation speed of this frame.
* @param speed The speed value
* @return This frame for chaining
*/
IFrame setSpeed(float speed);
/**
* @return The smooth interpolation type: 0 = Interpolated, 1 = Linear, 2 = None
*/
byte smoothType();
/**
* Sets the smooth interpolation type.
* @param smooth The smooth type: 0 = Interpolated, 1 = Linear, 2 = None
* @return This frame for chaining
*/
IFrame setSmooth(byte smooth);
}
@@ -0,0 +1,88 @@
package noppes.npcs.api.handler.data;
public interface IFramePart {
/**
* @return The name of the animation part (e.g. HEAD, BODY, RIGHT_ARM, LEFT_ARM, RIGHT_LEG, LEFT_LEG, FULL_MODEL)
*/
String getName();
/**
* @return The ordinal ID of the animation part
*/
int getPartId();
/**
* Sets the animation part by name.
* @param name The part name (e.g. HEAD, BODY, RIGHT_ARM, LEFT_ARM, RIGHT_LEG, LEFT_LEG, FULL_MODEL)
* @return This frame part for chaining
*/
IFramePart setPart(String name);
/**
* Sets the animation part by ordinal ID.
* @param partId The part ordinal ID
* @return This frame part for chaining
*/
IFramePart setPart(int partId);
/**
* @return The rotation angles as a float array [x, y, z] in degrees
*/
float[] getRotations();
/**
* Sets the rotation angles.
* @param rotation A float array [x, y, z] in degrees
* @return This frame part for chaining
*/
IFramePart setRotations(float[] rotation);
/**
* @return The pivot offsets as a float array [x, y, z]
*/
float[] getPivots();
/**
* Sets the pivot offsets.
* @param pivot A float array [x, y, z]
* @return This frame part for chaining
*/
IFramePart setPivots(float[] pivot);
/**
* @return Whether this part has custom speed and smooth settings that override the parent frame
*/
boolean isCustomized();
/**
* Sets whether this part uses custom speed and smooth settings.
* @param customized True to use part-level settings instead of the parent frame's
* @return This frame part for chaining
*/
IFramePart setCustomized(boolean customized);
/**
* @return The interpolation speed of this part
*/
float getSpeed();
/**
* Sets the interpolation speed of this part.
* @param speed The speed value
* @return This frame part for chaining
*/
IFramePart setSpeed(float speed);
/**
* @return The smooth interpolation type: 0 = Interpolated, 1 = Linear, 2 = None
*/
byte isSmooth();
/**
* Sets the smooth interpolation type.
* @param smooth The smooth type: 0 = Interpolated, 1 = Linear, 2 = None
* @return This frame part for chaining
*/
IFramePart setSmooth(byte smooth);
}