mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
More Core Class Conversion
This commit is contained in:
1 parent
43a52ad407
commit
89f81f96bc
51 files changed
+744
-189
No files matched your search
@@ -0,0 +1,70 @@
|
||||
package noppes.npcs.api;
|
||||
|
||||
public interface IPos {
|
||||
|
||||
int getX();
|
||||
|
||||
int getY();
|
||||
|
||||
int getZ();
|
||||
|
||||
double getXD();
|
||||
|
||||
double getYD();
|
||||
|
||||
double getZD();
|
||||
|
||||
IPos up();
|
||||
|
||||
IPos up(double n);
|
||||
|
||||
IPos down();
|
||||
|
||||
IPos down(double n);
|
||||
|
||||
IPos north();
|
||||
|
||||
IPos north(double n);
|
||||
|
||||
IPos east();
|
||||
|
||||
IPos east(double n);
|
||||
|
||||
IPos south();
|
||||
|
||||
IPos south(double n);
|
||||
|
||||
IPos west();
|
||||
|
||||
IPos west(double n);
|
||||
|
||||
IPos add(double x, double y, double z);
|
||||
|
||||
IPos add(IPos pos);
|
||||
|
||||
IPos subtract(double x, double y, double z);
|
||||
|
||||
IPos subtract(IPos pos);
|
||||
|
||||
IPos normalize();
|
||||
|
||||
double[] normalizeDouble();
|
||||
|
||||
IPos offset(int direction);
|
||||
|
||||
IPos offset(int direction, double n);
|
||||
|
||||
IPos crossProduct(double x, double y, double z);
|
||||
|
||||
IPos crossProduct(IPos pos);
|
||||
|
||||
IPos divide(double scalar);
|
||||
|
||||
long toLong();
|
||||
|
||||
IPos fromLong(long serialized);
|
||||
|
||||
double distanceTo(IPos pos);
|
||||
|
||||
double distanceTo(double x, double y, double z);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package noppes.npcs.api;
|
||||
|
||||
/**
|
||||
* A skin overlay object for both NPCs and players. Several skin overlays at a time can be layered on top of each other.
|
||||
* In an NPC's case, the old overlay texture is now the skin overlay with ID 0.
|
||||
* <p>
|
||||
* Modifying these attributes, an overlay can be made to look like a powered creeper effect, just a new skin, or both!
|
||||
*/
|
||||
public interface ISkinOverlay {
|
||||
/**
|
||||
* Sets the directory texture of the overlay. Does not support URLs.
|
||||
* @param texture the texture path
|
||||
*/
|
||||
void setTexture(String texture);
|
||||
|
||||
String getTexture();
|
||||
|
||||
/**
|
||||
* Sets whether this overlay glows in the dark or not.
|
||||
* @param glow whether to glow
|
||||
*/
|
||||
void setGlow(boolean glow);
|
||||
|
||||
boolean getGlow();
|
||||
|
||||
/**
|
||||
* Sets whether this overlay blends on top of bottom textures at any alpha value.
|
||||
* @param blend whether to blend
|
||||
*/
|
||||
void setBlend(boolean blend);
|
||||
|
||||
boolean getBlend();
|
||||
|
||||
/**
|
||||
* Sets the transparency of the overlay, from 0 to 1.
|
||||
* @param alpha the alpha value
|
||||
*/
|
||||
void setAlpha(float alpha);
|
||||
|
||||
float getAlpha();
|
||||
|
||||
/**
|
||||
* Sets the size of the entire overlay when rendered on the entity. By default, overlays render slightly on top of
|
||||
* the entity's model.
|
||||
* @param size the overlay size
|
||||
*/
|
||||
void setSize(float size);
|
||||
|
||||
float getSize();
|
||||
|
||||
void setColor(int color);
|
||||
|
||||
int getColor();
|
||||
|
||||
/**
|
||||
* Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more.
|
||||
* @param scaleX horizontal scale
|
||||
* @param scaleY vertical scale
|
||||
*/
|
||||
void setTextureScale(float scaleX, float scaleY);
|
||||
|
||||
float getTextureScaleX();
|
||||
|
||||
float getTextureScaleY();
|
||||
|
||||
/**
|
||||
* Sets the "texture speed" by which the texture shifts on each render tick. Used to create a powered creeper effect!
|
||||
* This does not move the entire overlay, it just moves the position at which the texture begins rendering.
|
||||
* @param speedX horizontal speed
|
||||
* @param speedY vertical speed
|
||||
*/
|
||||
void setSpeed(float speedX, float speedY);
|
||||
|
||||
float getSpeedX();
|
||||
|
||||
float getSpeedY();
|
||||
|
||||
/**
|
||||
* Sets the amount in each direction by which the overlay will be offset from the entity.
|
||||
* @param offsetX horizontal render offset
|
||||
* @param offsetY vertical render offset
|
||||
* @param offsetZ depth render offset
|
||||
*/
|
||||
void setOffset(float offsetX, float offsetY, float offsetZ);
|
||||
|
||||
float getOffsetX();
|
||||
|
||||
float getOffsetY();
|
||||
|
||||
float getOffsetZ();
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
/**
|
||||
* Provides configuration data for an NPC's custom hitbox dimensions.
|
||||
* <p>
|
||||
* When enabled, allows independent scaling of the NPC's collision box
|
||||
* width and height beyond the default model-based sizing.
|
||||
*/
|
||||
public interface IHitboxData {
|
||||
|
||||
/**
|
||||
* Returns whether the custom hitbox is enabled.
|
||||
*
|
||||
* @return true if the custom hitbox is enabled, false otherwise.
|
||||
*/
|
||||
boolean isHitboxEnabled();
|
||||
|
||||
/**
|
||||
* Sets whether the custom hitbox is enabled.
|
||||
*
|
||||
* @param enabled true to enable, false to disable.
|
||||
*/
|
||||
void setHitboxEnabled(boolean enabled);
|
||||
|
||||
/**
|
||||
* Returns the width scale factor for the hitbox.
|
||||
*
|
||||
* @return the width scale factor (1.0 = default).
|
||||
*/
|
||||
float getWidthScale();
|
||||
|
||||
/**
|
||||
* Sets the width scale factor for the hitbox.
|
||||
* Clamped to the server-configured maximum.
|
||||
*
|
||||
* @param widthScale the width scale factor.
|
||||
*/
|
||||
void setWidthScale(float widthScale);
|
||||
|
||||
/**
|
||||
* Returns the height scale factor for the hitbox.
|
||||
*
|
||||
* @return the height scale factor (1.0 = default).
|
||||
*/
|
||||
float getHeightScale();
|
||||
|
||||
/**
|
||||
* Sets the height scale factor for the hitbox.
|
||||
* Clamped to the server-configured maximum.
|
||||
*
|
||||
* @param heightScale the height scale factor.
|
||||
*/
|
||||
void setHeightScale(float heightScale);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
/**
|
||||
* Represents a single NPC dialog line with text, an optional sound, and target formatting.
|
||||
*/
|
||||
public interface ILine {
|
||||
|
||||
/** @return the text content of this line. */
|
||||
String getText();
|
||||
|
||||
/**
|
||||
* Sets the text content of this line.
|
||||
*
|
||||
* @param text the new text.
|
||||
*/
|
||||
void setText(String text);
|
||||
|
||||
/** @return the sound resource to play with this line, or null if none. */
|
||||
String getSound();
|
||||
|
||||
/**
|
||||
* Sets the sound resource to play with this line.
|
||||
*
|
||||
* @param sound the sound resource path, or null for none.
|
||||
*/
|
||||
void setSound(String sound);
|
||||
|
||||
/**
|
||||
* Sets whether the text of this line should be hidden when spoken.
|
||||
*
|
||||
* @param hide true to hide the text; false to show.
|
||||
*/
|
||||
void hideText(boolean hide);
|
||||
|
||||
/** @return true if the text is hidden when this line is spoken. */
|
||||
boolean hideText();
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
/**
|
||||
* A collection of dialog lines, supporting creation, indexed access, and random retrieval.
|
||||
*/
|
||||
public interface ILines {
|
||||
|
||||
/**
|
||||
* Creates and adds a new line with the given text.
|
||||
*
|
||||
* @param text the line text.
|
||||
* @return the created line.
|
||||
*/
|
||||
ILine createLine(String text);
|
||||
|
||||
/**
|
||||
* Returns a line, either randomly or sequentially.
|
||||
*
|
||||
* @param isRandom true to return a random line; false for sequential.
|
||||
* @return the selected line, or null if empty.
|
||||
*/
|
||||
ILine getLine(boolean isRandom);
|
||||
|
||||
/**
|
||||
* Returns the line at the given index.
|
||||
*
|
||||
* @param lineIndex the line index.
|
||||
* @return the line, or null if the index is invalid.
|
||||
*/
|
||||
ILine getLine(int lineIndex);
|
||||
|
||||
/**
|
||||
* Sets the line at the given index.
|
||||
*
|
||||
* @param lineIndex the line index.
|
||||
* @param line the line to set.
|
||||
*/
|
||||
void setLine(int lineIndex, ILine line);
|
||||
|
||||
/**
|
||||
* Removes the line at the given index.
|
||||
*
|
||||
* @param lineIndex the line index.
|
||||
*/
|
||||
void removeLine(int lineIndex);
|
||||
|
||||
/**
|
||||
* Removes all lines.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/** @return true if there are no lines. */
|
||||
boolean isEmpty();
|
||||
|
||||
/** @return the indices of all stored lines. */
|
||||
Integer[] getKeys();
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
/**
|
||||
* Configures party-related options for quests, controlling membership requirements,
|
||||
* reward distribution, completion rules, and party size limits.
|
||||
*/
|
||||
public interface IPartyOptions {
|
||||
|
||||
/** @return true if party participation is allowed. */
|
||||
boolean isAllowParty();
|
||||
|
||||
/** @param allowParty true to allow party participation. */
|
||||
void setAllowParty(boolean allowParty);
|
||||
|
||||
/** @return true if only party members can participate. */
|
||||
boolean isOnlyParty();
|
||||
|
||||
/** @param onlyParty true to require party membership. */
|
||||
void setOnlyParty(boolean onlyParty);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Valid
|
||||
*/
|
||||
public int getPartyRequirements();
|
||||
|
||||
/**
|
||||
* @param partyRequirements 0:Leader, 1:All, 2:Valid
|
||||
*/
|
||||
public void setPartyRequirements(int partyRequirements);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public int getRewardControl();
|
||||
|
||||
/**
|
||||
* @param rewardControl 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public void setRewardControl(int rewardControl);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public int getCompleteFor();
|
||||
|
||||
/**
|
||||
* @param completeFor 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public void setCompleteFor(int completeFor);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
int getExecuteCommandFor();
|
||||
|
||||
/**
|
||||
* @param commandFor 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
void setExecuteCommandFor(int commandFor);
|
||||
|
||||
/**
|
||||
* @return 0:Shard, 1:All, 2:Leader
|
||||
*/
|
||||
public int getObjectiveRequirement();
|
||||
|
||||
/**
|
||||
* @param requirement 0:Shard, 1:All, 2:Leader
|
||||
*/
|
||||
public void setObjectiveRequirement(int requirement);
|
||||
|
||||
/** @return the minimum party size required. */
|
||||
int getMinPartySize();
|
||||
|
||||
/** @param newSize the minimum party size. */
|
||||
void setMinPartySize(int newSize);
|
||||
|
||||
/** @return the maximum party size allowed. */
|
||||
int getMaxPartySize();
|
||||
|
||||
/** @param newSize the maximum party size. */
|
||||
void setMaxPartySize(int newSize);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
/**
|
||||
* Represents a tag that can be applied to NPCs for categorization and filtering.
|
||||
*/
|
||||
public interface ITag {
|
||||
|
||||
/** @return the unique UUID string for this tag. */
|
||||
String getUuid();
|
||||
|
||||
/** @return the tag display name. */
|
||||
String getName();
|
||||
|
||||
/** @param name the tag display name. */
|
||||
void setName(String name);
|
||||
|
||||
/** @param c the tag color as a packed RGB integer. */
|
||||
void setColor(int c);
|
||||
|
||||
/** @return the unique tag ID. */
|
||||
int getId();
|
||||
|
||||
/** @return the tag color as a packed RGB integer. */
|
||||
int getColor();
|
||||
|
||||
/** @return true if this tag is hidden from display. */
|
||||
boolean getIsHidden();
|
||||
|
||||
/** @param hidden true to hide this tag from display. */
|
||||
void setIsHidden(boolean hidden);
|
||||
|
||||
/** Saves this tag to disk. */
|
||||
void save();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
/**
|
||||
* Represents a category that groups transport locations together.
|
||||
*/
|
||||
public interface ITransportCategory {
|
||||
|
||||
/** @return the unique category ID. */
|
||||
int getId();
|
||||
|
||||
/** @param title the category title. */
|
||||
void setTitle(String title);
|
||||
|
||||
/** @return the category title. */
|
||||
String getTitle();
|
||||
|
||||
/**
|
||||
* Adds a new transport location with the given name to this category.
|
||||
*
|
||||
* @param name the location name.
|
||||
*/
|
||||
void addLocation(String name);
|
||||
|
||||
/**
|
||||
* Returns the transport location with the given name.
|
||||
*
|
||||
* @param name the location name.
|
||||
* @return the transport location, or null if not found.
|
||||
*/
|
||||
ITransportLocation getLocation(String name);
|
||||
|
||||
/**
|
||||
* Removes the transport location with the given name.
|
||||
*
|
||||
* @param name the location name.
|
||||
*/
|
||||
void removeLocation(String name);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.IPos;
|
||||
|
||||
/**
|
||||
* Represents a transport destination that players can teleport to.
|
||||
*/
|
||||
public interface ITransportLocation {
|
||||
|
||||
/** @return the unique transport location ID. */
|
||||
int getId();
|
||||
|
||||
/** @param name the location display name. */
|
||||
void setName(String name);
|
||||
|
||||
/** @return the location display name. */
|
||||
String getName();
|
||||
|
||||
/** @param dimension the dimension ID where this transport is located. */
|
||||
void setDimension(int dimension);
|
||||
|
||||
/** @return the dimension ID. */
|
||||
int getDimension();
|
||||
|
||||
/**
|
||||
* Sets the transport type.
|
||||
*
|
||||
* @param type the type ordinal.
|
||||
*/
|
||||
void setType(int type);
|
||||
|
||||
/** @return the transport type ordinal. */
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* Sets the transport destination coordinates.
|
||||
*
|
||||
* @param x the x coordinate.
|
||||
* @param y the y coordinate.
|
||||
* @param z the z coordinate.
|
||||
*/
|
||||
void setPosition(int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Sets the transport destination position.
|
||||
*
|
||||
* @param pos the position.
|
||||
*/
|
||||
void setPosition(IPos pos);
|
||||
|
||||
/** @return the x coordinate. */
|
||||
double getX();
|
||||
|
||||
/** @return the y coordinate. */
|
||||
double getY();
|
||||
|
||||
/** @return the z coordinate. */
|
||||
double getZ();
|
||||
|
||||
/** Saves this transport location to disk. */
|
||||
void save();
|
||||
}
|
||||
Reference in new issue
Block a user