A lot of GOOD API DOCUMENTATION

This commit is contained in:
Kam committed 2026-03-09 16:20:07 -04:00
1 parent a6c55ca331
commit 319e774518
131 files changed
+3363 -175

No files matched your search

+24 -14
View File
@@ -20,13 +20,13 @@ public interface IAction {
/**
* @param queue Schedules action on this queue. If action was scheduled on different queue, transfers it over from that to this.
* @return
* @return this action
*/
IAction setQueue(IActionQueue queue);
/**
* @param task code to execute each time the action fires
* @return
* @return this action
*/
IAction setTask(Consumer<IAction> task);
@@ -49,14 +49,14 @@ public interface IAction {
/**
*
* @param task Fires right after action gets scheduled at duration 0
* @return
* @return this action
*/
IAction onStart(Consumer<IAction> task);
/**
*
* @param task Fires right before a marked done action gets removed from it's IActionQueue
* @return
* @return this action
*/
IAction onDone(Consumer<IAction> task);
@@ -81,7 +81,7 @@ public interface IAction {
/**
* @param ticks max duration
* default: -1, infinite
* @return
* @return this action
*/
IAction setMaxDuration(int ticks);
@@ -93,7 +93,7 @@ public interface IAction {
/**
* @param n max count, task auto marks done after running for n counts
* default: -1, infinite
* @return
* @return this action
*/
IAction times(int n);
@@ -101,7 +101,7 @@ public interface IAction {
* Execute task only once, mark done
* equivalent to times(1)
*
* @return
* @return this action
*/
IAction once();
@@ -135,6 +135,7 @@ public interface IAction {
*
* @param key a string key
* @param value any object to associate with this action
* @return this action
*/
IAction setData(String key, Object value);
@@ -143,7 +144,7 @@ public interface IAction {
/**
*
* @param copyTo copies all of this IAction's data to copyTo
* @return
* @return this action
*/
IAction copyDataTo(IAction copyTo);
@@ -166,20 +167,21 @@ public interface IAction {
* Set how many ticks between each execution of the action task.
*
* @param ticks tick interval (e.g. 1 = every tick, 20 = once per second)
* @return this action
*/
IAction updateEvery(int ticks);
/**
* Executes task every tick (Sets updateEvery to 1)
*
* @return
* @return this action
*/
IAction everyTick();
/**
* Executes task every second (Sets updateEvery to 20)
*
* @return
* @return this action
*/
IAction everySecond();
@@ -192,7 +194,7 @@ public interface IAction {
* @param ticks pauses action for this number of ticks (any subsequent action is paused too)
* If action was threaded using {@link #threadify()}, sleeps the thread.
* Can be forcibly resumed using {@link #resume()}
* @return
* @return this action
*/
IAction pauseFor(int ticks);
@@ -207,6 +209,8 @@ public interface IAction {
/**
* Must call {@link #threadify()} before using, else throws exception.
* Pauses IAction's thread until the supplied condition is satisfied or {@link #resume()} is called.
*
* @param until condition to check each tick
*/
void pauseUntil(Function<IAction, Boolean> until);
@@ -217,7 +221,7 @@ public interface IAction {
void resume();
/**
* @return checks if IAction's getStartAfterTicks > 0, or if IAction's thread is paused if threaded
* @return checks if IAction's getStartAfterTicks &gt; 0, or if IAction's thread is paused if threaded
* Preferably called from a different thread than the IAction one if it's paused.
*/
boolean isPaused();
@@ -230,6 +234,8 @@ public interface IAction {
/**
* Creates a new thread for task to run into. Allows for pausing and sleeping just this IAction's thread.
*
* @return this action
*/
IAction threadify();
@@ -253,6 +259,7 @@ public interface IAction {
* Enqueue another action immediately after this one.
*
* @param after the action to run next
* @return the chained action
*/
IAction after(IAction after);
@@ -260,7 +267,7 @@ public interface IAction {
* Multiple actions chained one after another
* i.e after(act1,act2,act3,...)
*
* @param actions
* @param actions the actions to chain
*/
void after(IAction... actions);
@@ -268,7 +275,7 @@ public interface IAction {
* Multiple tasks chained one after another
* i.e after(task1,task2,task3,...)
*
* @param tasks
* @param tasks the tasks to chain
*/
void after(Consumer<IAction>... tasks);
@@ -286,6 +293,7 @@ public interface IAction {
* Enqueue another action immediately before this one (pausing this one until done).
*
* @param before the action to run prior
* @return the chained action
*/
IAction before(IAction before);
@@ -303,6 +311,7 @@ public interface IAction {
* Enqueue an IConditionalAction on the conditional chain
*
* @param after the scheduled IConditionalAction
* @return the conditional action
*/
IConditionalAction conditional(IConditionalAction after);
@@ -324,6 +333,7 @@ public interface IAction {
* Enqueue another IAction on the parallel chain which starts firing simultaneously as this.
*
* @param after the scheduled parallel action
* @return the parallel action
*/
IAction parallel(IAction after);
@@ -8,7 +8,7 @@ public interface IActionChain {
/**
* @param name of chain
* @return
* @return this IActionChain for method chaining
*/
IActionChain setName(String name);
@@ -23,7 +23,7 @@ public interface IActionChain {
* @param delay ticks between an IAction and another
* @param name name of IAction
* @param task task of IAction
* @return
* @return this IActionChain for method chaining
*/
IActionChain after(int delay, String name, Consumer<IAction> task);
@@ -32,7 +32,7 @@ public interface IActionChain {
/**
* Start IActionManager
*
* @return
* @return this IActionChain for method chaining
*/
IActionChain start();
}
@@ -1,5 +1,9 @@
package noppes.npcs.api.handler.data;
/**
* Listener interface for action hooks.
* Currently a placeholder for future hook-based action firing.
*/
public interface IActionListener {
// IActionListener Comments
// ActionListener.Hook getOrCreateHook(String name);
@@ -36,7 +36,7 @@ public interface IActionQueue {
/**
*
* @param parallel True to turn queue into parallel, false for sequential
* @return
* @return this IActionQueue for method chaining
*/
IActionQueue setParallel(boolean parallel);
@@ -49,7 +49,7 @@ public interface IActionQueue {
/**
*
* @param stopWhenEmpty to auto-stop queue when empty/no active Actions scheduled using {{@link #stop()}}
* @return
* @return this IActionQueue for method chaining
*/
IActionQueue stopWhenEmpty(boolean stopWhenEmpty);
@@ -71,7 +71,7 @@ public interface IActionQueue {
/**
* @param ticks to kill queue after when killWhenEmpty and queue has no active tasks
* If an IAction is scheduled during the kill process, process is aborted
* @return
* @return this IActionQueue for method chaining
*/
IActionQueue killWhenEmptyAfter(int ticks);
@@ -109,7 +109,7 @@ public interface IActionQueue {
/**
*
* @param action
* @param action the action to find in the queue
* @return index of action in {{@link #getQueue()}}
* -1 if not in queue.
*/
@@ -55,6 +55,8 @@ public interface IAnimation {
/**
* Do not use this unless you know what you are changing. Dangerous to change.
*
* @param id the animation ID
*/
void setID(int id);
@@ -5,16 +5,22 @@ import net.minecraft.item.ItemStack;
public interface IAnvilRecipe {
/**
* Returns the unique name of this anvil recipe.
*
* @return the recipe name
*/
String getName();
/**
* The XP cost per repair tick (e.g., 10 levels per tick).
*
* @return the experience level cost
*/
int getXpCost();
/**
* The repair percentage (e.g., 0.1f repairs 10% of max damage per tick).
*
* @return the repair percentage (0.0 to 1.0)
*/
float getRepairPercentage();
@@ -9,21 +9,25 @@ public interface IAuctionClaim {
/**
* Get the unique claim ID.
* @return the unique claim ID
*/
String getId();
/**
* Get the player's UUID who can claim this.
* @return the UUID of the player who can claim this
*/
String getPlayerUUID();
/**
* Get the player's display name.
* @return the name of the player who can claim this
*/
String getPlayerName();
/**
* Get the related listing ID.
* @return the ID of the original auction listing
*/
String getListingId();
@@ -36,16 +40,19 @@ public interface IAuctionClaim {
/**
* Check if this is an item claim.
* @return true if this claim contains an item to collect
*/
boolean isItemClaim();
/**
* Check if this is a currency claim (sale proceeds or refund).
* @return true if this claim contains currency to collect
*/
boolean isCurrencyClaim();
/**
* Check if this is a refund claim (outbid).
* @return true if this is a refund from an outbid or cancelled auction
*/
boolean isRefundClaim();
@@ -58,11 +65,13 @@ public interface IAuctionClaim {
/**
* Get the item display name (for currency/refund claims tooltip).
* @return the display name of the claimed item
*/
String getItemName();
/**
* Get the currency amount (for currency/refund claims).
* @return the currency amount to claim
*/
long getCurrency();
@@ -70,32 +79,38 @@ public interface IAuctionClaim {
* Get the other player's name involved.
* For currency claims: the buyer's name.
* For refund claims: the player who outbid.
* @return the name of the other party in the transaction
*/
String getOtherPlayerName();
/**
* Get when this claim was created (Unix timestamp in ms).
* @return the timestamp when this claim was created
*/
long getCreatedTime();
/**
* Check if this claim has been claimed.
* @return true if this claim has already been collected
*/
boolean isClaimed();
/**
* Check if this is a returned item (expired/cancelled listing) vs won item.
* Only relevant for item claims.
* @return true if this is a returned unsold item
*/
boolean isReturnedItem();
/**
* Get days until this claim expires.
* @return the number of days until this claim expires
*/
long getDaysUntilExpiration();
/**
* Check if this claim has expired.
* @return true if this claim has expired
*/
boolean isExpired();
}
@@ -9,86 +9,103 @@ public interface IAuctionListing {
/**
* Get the unique listing ID.
* @return the unique listing ID
*/
String getId();
/**
* Get the seller's UUID as a string.
* @return the seller's UUID
*/
String getSellerUUID();
/**
* Get the seller's display name.
* @return the seller's display name
*/
String getSellerName();
/**
* Get the item being sold.
* @return the item being auctioned
*/
IItemStack getItem();
/**
* Get the starting price.
* @return the starting bid price in currency
*/
long getStartingPrice();
/**
* Get the buyout price (0 if no buyout).
* @return the instant buyout price in currency
*/
long getBuyoutPrice();
/**
* Check if this listing has a buyout option.
* @return true if this listing has a buyout option
*/
boolean hasBuyout();
/**
* Get the current highest bid.
* @return the current highest bid amount
*/
long getCurrentBid();
/**
* Get the high bidder's UUID as a string (null if no bids).
* @return the UUID of the current highest bidder
*/
String getHighBidderUUID();
/**
* Get the high bidder's display name (null if no bids).
* @return the name of the current highest bidder
*/
String getHighBidderName();
/**
* Check if there are any bids on this listing.
* @return true if any bids have been placed
*/
boolean hasBids();
/**
* Get the total number of bids placed.
* @return the total number of bids placed
*/
int getBidCount();
/**
* Get when the listing was created (Unix timestamp in ms).
* @return the timestamp when this listing was created
*/
long getCreatedTime();
/**
* Get when the auction ends (Unix timestamp in ms).
* @return the timestamp when this listing ends
*/
long getEndTime();
/**
* Get the remaining time in milliseconds.
* @return the remaining time in milliseconds
*/
long getRemainingTime();
/**
* Check if the auction has expired.
* @return true if the listing has ended
*/
boolean isExpired();
/**
* Check if the auction is still active (can be bid on).
* @return true if the listing is still accepting bids
*/
boolean isActive();
@@ -101,21 +118,27 @@ public interface IAuctionListing {
/**
* Get the minimum bid amount (current bid + increment).
* @return the minimum bid amount required
*/
long getMinimumBid();
/**
* Check if a player UUID is the seller.
* @param playerUUID the player UUID to check
* @return true if this player is the seller
*/
boolean isSeller(String playerUUID);
/**
* Check if a player UUID is the current high bidder.
* @param playerUUID the player UUID to check
* @return true if this player is the current highest bidder
*/
boolean isHighBidder(String playerUUID);
/**
* Get the remaining time formatted as a string (e.g., "2h 30m").
* @return the remaining time as a human-readable string
*/
String getRemainingTimeFormatted();
}
@@ -2,46 +2,152 @@ package noppes.npcs.api.handler.data;
public interface ICustomEffect {
/**
* Returns the unique ID of this custom effect.
*
* @return the effect ID, or -1 if not yet assigned
*/
int getID();
/**
* Returns the internal name of this custom effect.
*
* @return the effect name
*/
String getName();
/**
* Sets the display name shown in menus. Supports color codes using '&amp;' (converted to section signs).
*
* @param name the display name to set; ignored if null or empty
*/
void setMenuName(String name);
/**
* Returns the display name shown in menus.
*
* @return the menu display name
*/
String getMenuName();
/**
* Sets the internal name of this custom effect.
*
* @param name the name to set; ignored if null or empty
*/
void setName(String name);
/**
* Returns the resource path of the icon texture.
*
* @return the icon texture path
*/
String getIcon();
/**
* Sets the resource path of the icon texture.
*
* @param icon the icon texture path
*/
void setIcon(String icon);
/**
* Returns the tick interval at which this effect fires its script tick event.
*
* @return the tick interval (always a multiple of 10, minimum 10)
*/
int getEveryXTick();
/**
* Sets the tick interval at which this effect fires its script tick event.
* The value is rounded to the nearest multiple of 10 with a minimum of 10.
*
* @param everyXTick the desired tick interval
*/
void setEveryXTick(int everyXTick);
/**
* Returns the X offset of the icon within the texture.
*
* @return the icon X offset in pixels
*/
int getIconX();
/**
* Sets the X offset of the icon within the texture.
*
* @param iconX the icon X offset in pixels
*/
void setIconX(int iconX);
/**
* Returns the Y offset of the icon within the texture.
*
* @return the icon Y offset in pixels
*/
int getIconY();
/**
* Sets the Y offset of the icon within the texture.
*
* @param iconY the icon Y offset in pixels
*/
void setIconY(int iconY);
/**
* Returns the width of the icon.
*
* @return the icon width in pixels
*/
int getWidth();
/**
* Sets the width of the icon.
*
* @param width the icon width in pixels
*/
void setWidth(int width);
/**
* Returns the height of the icon.
*
* @return the icon height in pixels
*/
int getHeight();
/**
* Sets the height of the icon.
*
* @param height the icon height in pixels
*/
void setHeight(int height);
/**
* Returns whether this effect is removed when the player dies.
*
* @return true if the effect is lost on death
*/
boolean isLossOnDeath();
/**
* Sets whether this effect is removed when the player dies.
*
* @param lossOnDeath true to remove the effect on death
*/
void setLossOnDeath(boolean lossOnDeath);
/**
* Saves this custom effect to the effect controller.
*
* @return the saved effect instance
*/
ICustomEffect save();
/**
* Sets the unique ID of this custom effect.
*
* @param id the effect ID to assign
*/
void setID(int id);
/**
@@ -49,19 +155,53 @@ public interface ICustomEffect {
* which map of Effects to Match to.
* Index: 0 - CNPC+
* Index: 1 - DBC Addon
*
* @return the effect's index in the effect list
*/
int getIndex();
/**
* Returns whether the icon texture is animated.
*
* @return true if the icon is animated
*/
boolean isAnimated();
/**
* Sets whether the icon texture is animated.
*
* @param animated true to enable icon animation
*/
void setAnimated(boolean animated);
/**
* Returns the number of frames in the icon animation.
*
* @return the frame count (minimum 1)
*/
int getFrameCount();
/**
* Sets the number of frames in the icon animation.
* Values less than 1 are clamped to 1.
*
* @param frameCount the number of animation frames
*/
void setFrameCount(int frameCount);
/**
* Returns the duration of each animation frame in ticks.
*
* @return the frame time in ticks (minimum 1)
*/
int getFrameTime();
/**
* Sets the duration of each animation frame in ticks.
* Values less than 1 are clamped to 1.
*
* @param frametime the frame duration in ticks
*/
void setFrameTime(int frametime);
}
@@ -3,137 +3,378 @@ package noppes.npcs.api.handler.data;
import java.util.List;
public interface IDialog {
/**
* @return The unique ID of this dialog
*/
int getId();
/**
* @return The title/name of this dialog
*/
String getName();
/**
* Sets the title/name of this dialog.
* @param var1 The new dialog title
*/
void setName(String var1);
/**
* @return The dialog body text displayed to the player
*/
String getText();
/**
* Sets the dialog body text displayed to the player.
* @param var1 The new dialog text
*/
void setText(String var1);
/**
* @return The quest associated with this dialog, or null if none
*/
IQuest getQuest();
/**
* Sets the quest associated with this dialog.
* @param var1 The quest to associate, or null to remove
*/
void setQuest(IQuest var1);
/**
* @return The command executed when this dialog is shown
*/
String getCommand();
/**
* Sets the command executed when this dialog is shown.
* @param var1 The command string
*/
void setCommand(String var1);
/**
* @return A list of all dialog options
*/
List<IDialogOption> getOptions();
/**
* Gets a dialog option by its slot index.
* @param var1 The option slot index
* @return The dialog option at the given slot
*/
IDialogOption getOption(int var1);
/**
* @return The availability settings for this dialog
*/
IAvailability getAvailability();
/**
* @return The category this dialog belongs to
*/
IDialogCategory getCategory();
/**
* Sets whether the screen darkens when this dialog is displayed.
* @param darkenScreen True to darken the screen
*/
void setDarkenScreen(boolean darkenScreen);
/**
* @return Whether the screen darkens when this dialog is displayed
*/
boolean getDarkenScreen();
/**
* Sets whether the Escape key is disabled while this dialog is open.
* @param disableEsc True to disable the Escape key
*/
void setDisableEsc(boolean disableEsc);
/**
* @return Whether the Escape key is disabled while this dialog is open
*/
boolean getDisableEsc();
/**
* Sets whether the dialog option wheel is shown.
* @param showWheel True to show the option wheel
*/
void setShowWheel(boolean showWheel);
/**
* @return Whether the dialog option wheel is shown
*/
boolean getShowWheel();
/**
* Sets whether the NPC is hidden during this dialog.
* @param hideNPC True to hide the NPC
*/
void setHideNPC(boolean hideNPC);
/**
* @return Whether the NPC is hidden during this dialog
*/
boolean getHideNPC();
/**
* Sets the sound played when this dialog opens.
* @param sound The resource location of the sound
*/
void setSound(String sound);
/**
* @return The resource location of the sound played when this dialog opens
*/
String getSound();
/**
* Saves this dialog to the dialog controller.
*/
void save();
/**
* Sets the text color of the dialog body.
* @param color The color as an integer (e.g. 0xe0e0e0)
*/
void setColor(int color);
/**
* @return The text color of the dialog body
*/
int getColor();
/**
* Sets the color of the dialog title.
* @param titleColor The color as an integer (e.g. 0xe0e0e0)
*/
void setTitleColor(int titleColor);
/**
* @return The color of the dialog title
*/
int getTitleColor();
/**
* Sets whether the dialog text renders character by character.
* @param gradual True to enable gradual text rendering
*/
void renderGradual(boolean gradual);
/**
* @return Whether the dialog text renders character by character
*/
boolean renderGradual();
/**
* Sets whether previous dialog text blocks are shown.
* @param show True to show previous dialog blocks
*/
void showPreviousBlocks(boolean show);
/**
* @return Whether previous dialog text blocks are shown
*/
boolean showPreviousBlocks();
/**
* Sets whether the separator line above dialog options is shown.
* @param show True to show the option line
*/
void showOptionLine(boolean show);
/**
* @return Whether the separator line above dialog options is shown
*/
boolean showOptionLine();
/**
* Sets the sound played per character during gradual text rendering.
* @param textSound The resource location of the text sound
*/
void setTextSound(String textSound);
/**
* @return The resource location of the sound played per character during gradual text rendering
*/
String getTextSound();
/**
* Sets the pitch of the per-character text sound.
* @param textPitch The pitch value (default 1.0)
*/
void setTextPitch(float textPitch);
/**
* @return The pitch of the per-character text sound
*/
float getTextPitch();
/**
* Sets the position of the dialog title.
* @param pos The title position value
*/
void setTitlePos(int pos);
/**
* @return The position of the dialog title
*/
int getTitlePos();
/**
* Sets the render scale of the NPC in the dialog.
* @param scale The NPC scale (default 1.0)
*/
void setNPCScale(float scale);
/**
* @return The render scale of the NPC in the dialog
*/
float getNpcScale();
/**
* Sets the NPC render offset in the dialog.
* @param offsetX The horizontal offset in pixels
* @param offsetY The vertical offset in pixels
*/
void setNpcOffset(int offsetX, int offsetY);
/**
* @return The horizontal offset of the NPC render in pixels
*/
int getNpcOffsetX();
/**
* @return The vertical offset of the NPC render in pixels
*/
int getNpcOffsetY();
/**
* Sets the width and height of the dialog text area.
* @param textWidth The text area width in pixels
* @param textHeight The text area height in pixels
*/
void textWidthHeight(int textWidth, int textHeight);
/**
* @return The width of the dialog text area in pixels
*/
int getTextWidth();
/**
* @return The height of the dialog text area in pixels
*/
int setTextHeight();
/**
* Sets the offset of the dialog text area.
* @param offsetX The horizontal offset in pixels
* @param offsetY The vertical offset in pixels
*/
void setTextOffset(int offsetX, int offsetY);
/**
* @return The horizontal offset of the dialog text area in pixels
*/
int getTextOffsetX();
/**
* @return The vertical offset of the dialog text area in pixels
*/
int getTextOffsetY();
/**
* Sets the offset of the dialog title.
* @param offsetX The horizontal offset in pixels
* @param offsetY The vertical offset in pixels
*/
void setTitleOffset(int offsetX, int offsetY);
/**
* @return The horizontal offset of the dialog title in pixels
*/
int getTitleOffsetX();
/**
* @return The vertical offset of the dialog title in pixels
*/
int getTitleOffsetY();
/**
* Sets the offset of the dialog options area.
* @param offsetX The horizontal offset in pixels
* @param offsetY The vertical offset in pixels
*/
void setOptionOffset(int offsetX, int offsetY);
/**
* @return The horizontal offset of the dialog options area in pixels
*/
int getOptionOffsetX();
/**
* @return The vertical offset of the dialog options area in pixels
*/
int getOptionOffsetY();
/**
* Sets the spacing between dialog options.
* @param spaceX The horizontal spacing in pixels
* @param spaceY The vertical spacing in pixels
*/
void setOptionSpacing(int spaceX, int spaceY);
/**
* @return The horizontal spacing between dialog options in pixels
*/
int getOptionSpaceX();
/**
* @return The vertical spacing between dialog options in pixels
*/
int getOptionSpaceY();
/**
* Adds an image to the dialog at the given ID.
* @param id The image ID
* @param image The dialog image to add
*/
void addImage(int id, IDialogImage image);
/**
* Gets a dialog image by its ID.
* @param id The image ID
* @return The dialog image, or null if not found
*/
IDialogImage getImage(int id);
/**
* Creates a new empty dialog image instance.
* @return A new {@link IDialogImage}
*/
IDialogImage createImage();
/**
* @return An array of all dialog images
*/
IDialogImage[] getImages();
/**
* Checks whether an image with the given ID exists.
* @param id The image ID
* @return True if the image exists
*/
boolean hasImage(int id);
/**
* Removes the image with the given ID.
* @param id The image ID to remove
*/
void removeImage(int id);
/**
* Removes all images from this dialog.
*/
void clearImages();
}
@@ -3,11 +3,24 @@ package noppes.npcs.api.handler.data;
import java.util.List;
public interface IDialogCategory {
/**
* @return A list of all dialogs in this category
*/
List<IDialog> dialogs();
/**
* @return The name of this dialog category
*/
String getName();
/**
* Creates a new empty dialog in this category.
* @return The newly created {@link IDialog}
*/
IDialog create();
/**
* @return The unique ID of this dialog category
*/
int getId();
}
@@ -1,55 +1,147 @@
package noppes.npcs.api.handler.data;
public interface IDialogImage {
/**
* @return The unique ID of this dialog image
*/
int getId();
/**
* Sets the texture resource location for this image.
* @param texture The resource location string
*/
void setTexture(String texture);
/**
* @return The texture resource location for this image
*/
String getTexture();
/**
* Sets the screen position of this image.
* @param x The X position in pixels
* @param y The Y position in pixels
*/
void setPosition(int x, int y);
/**
* @return The X position of this image in pixels
*/
int getX();
/**
* @return The Y position of this image in pixels
*/
int getY();
/**
* Sets the rendered width and height of this image.
* @param width The width in pixels
* @param height The height in pixels
*/
void setWidthHeight(int width, int height);
/**
* @return The rendered width of this image in pixels
*/
int getWidth();
/**
* @return The rendered height of this image in pixels
*/
int getHeight();
/**
* Sets the texture UV offset for this image.
* @param offsetX The horizontal texture offset in pixels
* @param offsetY The vertical texture offset in pixels
*/
void setTextureOffset(int offsetX, int offsetY);
/**
* @return The horizontal texture UV offset in pixels
*/
int getTextureX();
/**
* @return The vertical texture UV offset in pixels
*/
int getTextureY();
/**
* Sets the tint color of this image.
* @param color The color as an integer (e.g. 0xFFFFFF)
*/
void setColor(int color);
/**
* @return The tint color of this image
*/
int getColor();
/**
* Sets the tint color used when this image is selected/hovered.
* @param color The selected color as an integer (e.g. 0xFFFFFF)
*/
void setSelectedColor(int color);
/**
* @return The tint color used when this image is selected/hovered
*/
int getSelectedColor();
/**
* Sets the render scale of this image.
* @param scale The scale factor (default 1.0)
*/
void setScale(float scale);
/**
* @return The render scale of this image
*/
float getScale();
/**
* Sets the alpha transparency of this image.
* @param alpha The alpha value from 0.0 (transparent) to 1.0 (opaque)
*/
void setAlpha(float alpha);
/**
* @return The alpha transparency of this image (0.0 to 1.0)
*/
float getAlpha();
/**
* Sets the rotation angle of this image.
* @param rotation The rotation in degrees
*/
void setRotation(float rotation);
/**
* @return The rotation angle of this image in degrees
*/
float getRotation();
/**
* Sets the image type which determines where the image is rendered.
* @param imageType The image type: 0 = Default, 1 = Text, 2 = Option
*/
void setImageType(int imageType);
/**
* @return The image type: 0 = Default, 1 = Text, 2 = Option
*/
int getImageType();
/**
* Sets the alignment of this image.
* @param alignment The alignment value
*/
void setAlignment(int alignment);
/**
* @return The alignment value of this image
*/
int getAlignment();
}
@@ -1,9 +1,18 @@
package noppes.npcs.api.handler.data;
public interface IDialogOption {
/**
* @return The slot index of this dialog option
*/
int getSlot();
/**
* @return The display name/title of this dialog option
*/
String getName();
/**
* @return The option type ordinal: 0 = QuitOption, 1 = DialogOption, 2 = Disabled, 3 = RoleOption, 4 = CommandBlock
*/
int getType();
}
@@ -4,51 +4,139 @@ import noppes.npcs.api.entity.ICustomNpc;
import noppes.npcs.api.entity.IPlayer;
public interface IFaction {
/**
* @return The faction's unique ID
*/
int getId();
/**
* @return The faction's display name
*/
String getName();
/**
* Sets the faction's display name.
* @param name The new name
*/
void setName(String name);
/**
* Sets the default faction points assigned to new players.
* @param var1 The default point value
*/
void setDefaultPoints(int var1);
/**
* @return The default faction points assigned to new players
*/
int getDefaultPoints();
/**
* Sets the point threshold at or above which a player is considered friendly.
* @param p The friendly point threshold
*/
void setFriendlyPoints(int p);
/**
* @return The point threshold at or above which a player is considered friendly
*/
int getFriendlyPoints();
/**
* Sets the point threshold below which a player is considered an enemy.
* @param p The neutral point threshold
*/
void setNeutralPoints(int p);
/**
* @return The point threshold below which a player is considered an enemy
*/
int getNeutralPoints();
/**
* Sets the faction's display color.
* @param c The color as an RGB integer
*/
void setColor(int c);
/**
* @return The faction's display color as an RGB integer
*/
int getColor();
/**
* Returns the player's standing with this faction.
* @param player The player to check
* @return 1 for friendly, 0 for neutral, -1 for enemy
*/
int playerStatus(IPlayer player);
/**
* Checks whether this faction is hostile toward the given NPC's faction.
* @param npc The NPC to check against
* @return True if this faction is aggressive toward the NPC
*/
boolean isAggressiveToNpc(ICustomNpc npc);
/**
* @return Whether this faction is hidden from the player's faction list
*/
boolean getIsHidden();
/**
* Sets whether this faction is hidden from the player's faction list.
* @param hidden True to hide the faction
*/
void setIsHidden(boolean hidden);
/**
* @return Whether NPCs in this faction are passive and will not attack
*/
boolean isPassive();
/**
* Sets whether NPCs in this faction are passive.
* @param passive True to make faction NPCs passive
*/
void setIsPassive(boolean passive);
/**
* @return Whether NPCs in this faction can be attacked by hostile mobs
*/
boolean attackedByMobs();
/**
* Sets whether NPCs in this faction can be attacked by hostile mobs.
* @param attacked True to allow mobs to attack faction NPCs
*/
void setAttackedByMobs(boolean attacked);
/**
* Checks whether the given faction is an enemy of this faction.
* @param faction The faction to check
* @return True if the given faction is an enemy
*/
boolean isEnemyFaction(IFaction faction);
/**
* @return An array of all factions that are enemies of this faction
*/
IFaction[] getEnemyFactions();
/**
* Adds a faction as an enemy of this faction.
* @param faction The faction to add as an enemy
*/
void addEnemyFaction(IFaction faction);
/**
* Removes a faction from this faction's enemy list.
* @param faction The faction to remove
*/
void removeEnemyFaction(IFaction faction);
/**
* Saves the faction data to the server.
*/
void save();
}
@@ -2,29 +2,83 @@ 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);
}
@@ -2,31 +2,87 @@ 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);
}
@@ -2,19 +2,46 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.entity.IEntityLivingBase;
/**
* Represents a single NPC dialog line with text, an optional sound, and target formatting.
*/
public interface ILine {
/**
* Returns a copy of this line with target-specific placeholders resolved.
*
* @param entityLivingBase the target entity used for placeholder substitution.
* @return the formatted line.
*/
ILine formatTarget(IEntityLivingBase entityLivingBase);
/** @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();
}
@@ -1,20 +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();
}
@@ -2,61 +2,107 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.item.IItemStack;
/**
* Represents a linked item definition. Linked items are custom item templates
* that can be globally updated; all existing instances inherit the new properties.
*/
public interface ILinkedItem {
/**
* Persists this linked item and returns the saved instance.
*
* @return the saved linked item.
*/
ILinkedItem save();
/**
* Creates an ItemStack from this linked item definition.
*
* @return the created item stack.
*/
IItemStack createStack();
/** @return the unique ID of this linked item. */
int getId();
/** @param id the unique ID. */
void setId(int id);
/** @return the version number of this linked item. */
int getVersion();
/** @param version the new version number. */
void setVersion(int version);
/** @return the display name. */
String getName();
/** @param name the display name. */
void setName(String name);
/** @return the durability value (max damage). */
double getDurabilityValue();
/** @param durabilityValue the durability value. */
void setDurabilityValue(double durabilityValue);
/** @return the maximum stack size. */
int getStackSize();
/** @param stackSize the maximum stack size. */
void setStackSize(int stackSize);
/** @return the maximum item use duration in ticks. */
int getMaxItemUseDuration();
/** @param maxItemUseDuration the use duration in ticks. */
void setMaxItemUseDuration(int maxItemUseDuration);
/**
* @return the item use action type.
* @see net.minecraft.item.EnumAction
*/
int getItemUseAction();
/** @param itemUseAction the item use action type ordinal. */
void setItemUseAction(int itemUseAction);
/** @return true if this is a normal (non-tool, non-armor) item. */
boolean isNormalItem();
/** @param normalItem true for a normal item. */
void setNormalItem(boolean normalItem);
/** @return true if this item functions as a tool. */
boolean isTool();
/** @param tool true to mark as a tool. */
void setTool(boolean tool);
/** @return the dig speed for tool items. */
int getDigSpeed();
/** @param digSpeed the dig speed. */
void setDigSpeed(int digSpeed);
/**
* @return the armor type slot.
* 0: helmet, 1: chestplate, 2: leggings, 3: boots, -1: not armor.
*/
int getArmorType();
/** @param armorType the armor type slot. */
void setArmorType(int armorType);
/** @return the enchantability value. */
int getEnchantability();
/** @param enchantability the enchantability value. */
void setEnchantability(int enchantability);
public int getAttackSpeed();
/** @return the attack speed in ticks between attacks. */
int getAttackSpeed();
public void setAttackSpeed(int time);
/** @param time attack speed in ticks. */
void setAttackSpeed(int time);
}
@@ -3,70 +3,125 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.IWorld;
import noppes.npcs.api.entity.IEntity;
/**
* Configures a natural spawn entry for custom NPCs, including entity templates,
* biome restrictions, spawn conditions, and cooldowns.
*/
public interface INaturalSpawn {
/** Despawn mode: force natural despawn behavior. */
int DESPAWN_FORCE_NATURAL = 0;
/** Despawn mode: preserve the entity template's despawn setting. */
int DESPAWN_PRESERVE_TEMPLATE = 1;
/** Despawn mode: force persistent (never despawn). */
int DESPAWN_FORCE_PERSISTENT = 2;
/** @param name the display name for this spawn entry. */
void setName(String name);
/** @return the display name of this spawn entry. */
String getName();
/**
* Sets the entity template for a specific spawn slot.
*
* @param entity the entity template.
* @param slot the slot index.
*/
void setEntity(IEntity entity, int slot);
/**
* Returns the entity for a specific spawn slot.
*
* @param world the world context for entity creation.
* @param slot the slot index.
* @return the entity, or null if the slot is empty.
*/
IEntity getEntity(IWorld world, int slot);
/** @return the populated slot indices. */
Integer[] getSlots();
/** @param weight the spawn weight (higher = more frequent). */
void setWeight(int weight);
/** @return the spawn weight. */
int getWeight();
/** @param height the minimum Y-level for spawning. */
void setMinHeight(int height);
/** @return the minimum Y-level. */
int getMinHeight();
/** @param height the maximum Y-level for spawning. */
void setMaxHeight(int height);
/** @return the maximum Y-level. */
int getMaxHeight();
/** @param spawns whether entities can spawn using animal spawn rules. */
void spawnsLikeAnimal(boolean spawns);
/** @return true if animal spawn rules apply. */
boolean spawnsLikeAnimal();
/** @param spawns whether entities can spawn using monster spawn rules. */
void spawnsLikeMonster(boolean spawns);
/** @return true if monster spawn rules apply. */
boolean spawnsLikeMonster();
/** @param spawns whether entities can spawn in liquid. */
void spawnsInLiquid(boolean spawns);
/** @return true if spawning in liquid is allowed. */
boolean spawnsInLiquid();
/** @param spawns whether entities can spawn in the air. */
void spawnsInAir(boolean spawns);
/** @return true if spawning in air is allowed. */
boolean spawnsInAir();
/** @return the biome names this spawn is restricted to. */
String[] getBiomes();
/** @param biomes the biome names to restrict spawning to. */
void setBiomes(String[] biomes);
/** @param maxAlive the maximum number of alive entities from this spawn at once. */
void setMaxAlive(int maxAlive);
/** @return the maximum alive entity count. */
int getMaxAlive();
/** @param ticks the cooldown in ticks between spawn attempts. */
void setCooldownTicks(int ticks);
/** @return the cooldown in ticks. */
int getCooldownTicks();
/** @param attempts the number of spawn attempts per cycle. */
void setAttemptsPerCycle(int attempts);
/** @return the number of spawn attempts per cycle. */
int getAttemptsPerCycle();
/** @param distance the minimum distance from a player for spawning. */
void setPlayerMinDistance(int distance);
/** @return the minimum distance from a player. */
int getPlayerMinDistance();
/**
* Sets the despawn mode.
*
* @param mode 0: DESPAWN_FORCE_NATURAL, 1: DESPAWN_PRESERVE_TEMPLATE, 2: DESPAWN_FORCE_PERSISTENT.
*/
void setDespawnMode(int mode);
/**
* @return the despawn mode (0: force natural, 1: preserve template, 2: force persistent).
*/
int getDespawnMode();
}
@@ -73,6 +73,7 @@ public interface IParty {
/**
* Check if Player is in Party with IPlayer
*
* @param player the player to check
* @return true/false if player is in party
*/
boolean hasPlayer(IPlayer player);
@@ -80,6 +81,7 @@ public interface IParty {
/**
* Check if Player is in Party with Player Name
*
* @param playerName the player name to check
* @return true/false if player is in party
*/
boolean hasPlayer(String playerName);
@@ -1,15 +1,22 @@
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();
public boolean isAllowParty();
/** @param allowParty true to allow party participation. */
void setAllowParty(boolean allowParty);
public void setAllowParty(boolean allowParty);
/** @return true if only party members can participate. */
boolean isOnlyParty();
public boolean isOnlyParty();
public void setOnlyParty(boolean onlyParty);
/** @param onlyParty true to require party membership. */
void setOnlyParty(boolean onlyParty);
/**
* @return 0:Leader, 1:All, 2:Valid
@@ -61,12 +68,15 @@ public interface IPartyOptions {
*/
public void setObjectiveRequirement(int requirement);
public int getMinPartySize();
/** @return the minimum party size required. */
int getMinPartySize();
public void setMinPartySize(int newSize);
/** @param newSize the minimum party size. */
void setMinPartySize(int newSize);
/** @return the maximum party size allowed. */
int getMaxPartySize();
public int getMaxPartySize();
public void setMaxPartySize(int newSize);
/** @param newSize the maximum party size. */
void setMaxPartySize(int newSize);
}
@@ -13,6 +13,8 @@ public interface IPlayerAttributes {
/**
* Recalulates Item Attributes on a Player
*
* @param player the player whose attributes to recalculate
*/
void recalculate(IPlayer player);
@@ -2,25 +2,42 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.entity.IPlayer;
/**
* Represents an active custom effect instance on a player.
*/
public interface IPlayerEffect {
/** Removes this effect from the player. */
void kill();
/** @return the custom effect ID. */
int getId();
/** @return the remaining duration in seconds (-100 for infinite). */
int getDuration();
/** @param duration the remaining duration in seconds (-100 for infinite). */
void setDuration(int duration);
/** @return the effect level/amplifier. */
byte getLevel();
/** @param level the effect level/amplifier. */
void setLevel(byte level);
/** @return the display name of the effect. */
String getName();
/**
* Applies this effect's tick logic to the given player.
*
* @param player the player to apply the effect to.
*/
void performEffect(IPlayer player);
/** @return the effect source index (0: CNPC+, 1: DBC Addon). */
int getIndex();
/** @param index the effect source index (0: CNPC+, 1: DBC Addon). */
void setIndex(int index);
}
@@ -2,31 +2,52 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.item.IItemStack;
/**
* Represents a mail message sent to a player, containing pages of text,
* sender info, optional quest, and item attachments.
*/
public interface IPlayerMail {
/**
* Sets the page text content.
*
* @param pages an array of strings, one per page.
*/
void setPageText(String[] pages);
/** @return the page text as an array of strings. */
String[] getPageText();
/** @return the number of pages. */
int getPageCount();
/** @param sender the sender name. */
void setSender(String sender);
/** @return the sender name. */
String getSender();
/** @param subject the mail subject line. */
void setSubject(String subject);
/** @return the mail subject line. */
String getSubject();
/** @return milliseconds since the mail was sent. */
long getTimePast();
/** @return the timestamp when the mail was sent. */
long getTimeSent();
/** @return true if this mail has an associated quest. */
boolean hasQuest();
/** @return the quest attached to this mail, or null if none. */
IQuest getQuest();
/** @return the item attachments. */
IItemStack[] getItems();
/** @param items the item attachments. */
void setItems(IItemStack[] items);
}
+51 -7
View File
@@ -3,56 +3,100 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.IContainer;
import noppes.npcs.api.entity.IPlayer;
/**
* Represents a quest with objectives, rewards, repeatability, and party/profile options.
*/
public interface IQuest {
/** @return the unique quest ID. */
int getId();
/** @return the quest display name. */
String getName();
void setName(String var1);
/** @param name the quest display name. */
void setName(String name);
/** @return the quest type ordinal (0: Item, 1: Dialog, 2: Kill, 3: Location, 4: AreaKill, 5: Manual). */
int getType();
void setType(int var1);
/** @param type the quest type ordinal. */
void setType(int type);
/** @return the quest log description text. */
String getLogText();
void setLogText(String var1);
/** @param text the quest log description text. */
void setLogText(String text);
/** @return the text displayed on quest completion. */
String getCompleteText();
void setCompleteText(String var1);
/** @param text the completion text. */
void setCompleteText(String text);
/** @return the next quest in the chain, or null if none. */
IQuest getNextQuest();
void setNextQuest(IQuest var1);
/** @param quest the next quest in the chain, or null to clear. */
void setNextQuest(IQuest quest);
IQuestObjective[] getObjectives(IPlayer var1);
/**
* Returns the quest objectives for the given player.
*
* @param player the player whose objectives to retrieve.
* @return an array of quest objectives.
*/
IQuestObjective[] getObjectives(IPlayer player);
/** @return the category this quest belongs to. */
IQuestCategory getCategory();
/** @return the reward container with items given on completion. */
IContainer getRewards();
/** @return the NPC name associated with this quest. */
String getNpcName();
void setNpcName(String var1);
/** @param name the NPC name. */
void setNpcName(String name);
/** Saves this quest to disk. */
void save();
/** @return true if this quest can be repeated. */
boolean getIsRepeatable();
/**
* Returns the time remaining before the quest can be repeated.
*
* @param player the player.
* @return milliseconds until repeatable, or 0 if ready.
*/
long getTimeUntilRepeat(IPlayer player);
/**
* Sets the repeat type.
*
* @param type 0: None, 1: Instant, 2: Daily, 3: Weekly, 4: Custom.
*/
void setRepeatType(int type);
/** @return the repeat type ordinal. */
int getRepeatType();
/** @return the quest interface (type-specific objective data). */
IQuestInterface getQuestInterface();
/** @return the party options for this quest. */
IPartyOptions getPartyOptions();
/** @return the profile options for this quest. */
IProfileOptions getProfileOptions();
/** @return the custom cooldown in milliseconds for the Custom repeat type. */
long getCustomCooldown();
/** @param newCooldown the custom cooldown in milliseconds. */
void setCustomCooldown(long newCooldown);
}
@@ -2,12 +2,24 @@ package noppes.npcs.api.handler.data;
import java.util.List;
/**
* Represents a category that groups related quests together.
*/
public interface IQuestCategory {
/** @return all quests in this category. */
List<IQuest> quests();
/** @return the category display name. */
String getName();
/**
* Creates a new quest in this category.
*
* @return the newly created quest.
*/
IQuest create();
/** @return the unique category ID. */
int getId();
}
@@ -1,4 +1,8 @@
package noppes.npcs.api.handler.data;
/**
* Quest objective interface for dialog-type quests.
* Players must interact with specific dialogs to complete the quest.
*/
public interface IQuestDialog extends IQuestInterface {
}
@@ -1,4 +1,7 @@
package noppes.npcs.api.handler.data;
/**
* Marker interface for quest objective types (e.g., kill, item, location, dialog).
*/
public interface IQuestInterface {
}
@@ -1,15 +1,26 @@
package noppes.npcs.api.handler.data;
/**
* Quest objective interface for item-collection quests.
* Configures whether items are consumed on turn-in and matching criteria.
*/
public interface IQuestItem extends IQuestInterface {
/** @param leaveItems true to leave items in the player's inventory on turn-in. */
void setLeaveItems(boolean leaveItems);
/** @return true if items remain in the player's inventory on turn-in. */
boolean getLeaveItems();
/** @param ignoreDamage true to ignore item damage when matching. */
void setIgnoreDamage(boolean ignoreDamage);
/** @return true if item damage is ignored when matching. */
boolean getIgnoreDamage();
/** @param ignoreNbt true to ignore NBT data when matching. */
void setIgnoreNbt(boolean ignoreNbt);
/** @return true if NBT data is ignored when matching. */
boolean getIgnoreNbt();
}
@@ -1,7 +1,20 @@
package noppes.npcs.api.handler.data;
/**
* Quest objective interface for kill-type quests.
* Configures the target type for kill counting.
*/
public interface IQuestKill extends IQuestInterface {
/**
* Sets the target matching type.
*
* @param type 0: by entity name, 1: by faction.
*/
void setTargetType(int type);
/**
* @return the target matching type (0: entity name, 1: faction).
*/
int getTargetType();
}
@@ -1,15 +1,26 @@
package noppes.npcs.api.handler.data;
/**
* Quest objective interface for location-based quests.
* Players must visit up to three named locations to complete the quest.
*/
public interface IQuestLocation extends IQuestInterface {
/** @param loc1 the name of the first location objective. */
void setLocation1(String loc1);
/** @return the name of the first location objective. */
String getLocation1();
/** @param loc2 the name of the second location objective. */
void setLocation2(String loc2);
/** @return the name of the second location objective. */
String getLocation2();
/** @param loc3 the name of the third location objective. */
void setLocation3(String loc3);
/** @return the name of the third location objective. */
String getLocation3();
}
@@ -32,11 +32,15 @@ public interface IQuestObjective {
*/
void setPlayerProgress(String playerName, int progress);
/** @return the target progress value needed to complete this objective. */
int getMaxProgress();
/** @return true if this objective has been completed. */
boolean isCompleted();
/** @return the objective description text. */
String getText();
/** @return additional display text for this objective, or null. */
String getAdditionalText();
}
+20 -3
View File
@@ -2,30 +2,47 @@ package noppes.npcs.api.handler.data;
import net.minecraft.item.ItemStack;
/**
* Represents a custom crafting recipe for the carpentry table or vanilla workbench.
*/
public interface IRecipe {
/** @return the recipe display name. */
String getName();
/** @return true if this is a global (vanilla workbench) recipe. */
boolean isGlobal();
void setIsGlobal(boolean var1);
/** @param global true for global; false for carpentry only. */
void setIsGlobal(boolean global);
/** @return true if NBT data is ignored when matching ingredients. */
boolean getIgnoreNBT();
void setIgnoreNBT(boolean var1);
/** @param ignoreNBT true to ignore NBT in ingredient matching. */
void setIgnoreNBT(boolean ignoreNBT);
/** @return true if damage values are ignored when matching ingredients. */
boolean getIgnoreDamage();
void setIgnoreDamage(boolean var1);
/** @param ignoreDamage true to ignore damage in ingredient matching. */
void setIgnoreDamage(boolean ignoreDamage);
/** @return the recipe grid width. */
int getWidth();
/** @return the recipe grid height. */
int getHeight();
/** @return the resulting item stack. */
ItemStack getResult();
/** @return the ingredient item stacks in grid order. */
ItemStack[] getRecipe();
/** Deletes this recipe from the handler. */
void delete();
/** @return the unique recipe ID. */
int getId();
}
@@ -46,6 +46,12 @@ public interface ISlot {
*/
Map<String, NBTTagCompound> getComponents();
/**
* Sets the NBT data for a specific component key.
*
* @param key the component key (e.g. "CNPC+", "DBC").
* @param data the NBT data to store.
*/
void setComponentData(String key, NBTTagCompound data);
/**
@@ -3,35 +3,68 @@ package noppes.npcs.api.handler.data;
import noppes.npcs.api.IPos;
import noppes.npcs.api.entity.IEntity;
/**
* Represents a sound that can be played at a position or attached to an entity,
* with configurable volume, pitch, repeat behavior, and position.
*/
public interface ISound {
/**
* Attaches this sound to an entity. The sound follows the entity.
*
* @param entity the entity to attach to, or null to detach.
*/
void setEntity(IEntity entity);
/** @return the entity this sound is attached to, or null. */
IEntity getEntity();
/** @param repeat true to loop this sound. */
void setRepeat(boolean repeat);
/** @return true if this sound loops. */
boolean repeats();
/** @param delay the delay in ticks between repeats. */
void setRepeatDelay(int delay);
/** @return the delay in ticks between repeats. */
int getRepeatDelay();
/** @param volume the playback volume (1.0 = normal). */
void setVolume(float volume);
/** @return the playback volume. */
float getVolume();
/** @param pitch the playback pitch (1.0 = normal). */
void setPitch(float pitch);
/** @return the playback pitch. */
float getPitch();
/**
* Sets the position where this sound plays.
*
* @param pos the position.
*/
void setPosition(IPos pos);
/**
* Sets the position where this sound plays.
*
* @param x the x coordinate.
* @param y the y coordinate.
* @param z the z coordinate.
*/
void setPosition(float x, float y, float z);
/** @return the x coordinate of the sound position. */
float getX();
/** @return the y coordinate of the sound position. */
float getY();
/** @return the z coordinate of the sound position. */
float getZ();
}
@@ -1,21 +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();
}
@@ -1,16 +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);
}
@@ -2,31 +2,61 @@ 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();
}
@@ -9,7 +9,7 @@ public interface IConditionalAction extends IAction {
/**
* @param condition checked every tick, if it returns true, task is fired
* @return
* @return this action
*/
IConditionalAction setCondition(Function<IAction, Boolean> condition);