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

@@ -12,54 +12,76 @@ public interface IAbilityHandler {
/**
* Get all registered ability type IDs.
*
* @return array of all registered ability type IDs
*/
String[] getTypes();
/**
* Check if an ability type is registered.
*
* @param typeId the ability type ID to check
* @return true if the type is registered
*/
boolean hasType(String typeId);
/**
* Get all built-in ability names.
*
* @return array of all registered ability names (built-in and custom)
*/
String[] getAbilityNameArray();
/**
* Check if a built-in ability exists by name.
*
* @param name the ability name to check
* @return true if an ability with this name exists
*/
boolean hasAbilityName(String name);
/**
* Get all custom ability preset names.
*
* @return array of all custom (user-created) ability names
*/
String[] getCustomAbilityNameArray();
/**
* Check if a custom ability preset exists by name.
*
* @param name the custom ability name to check
* @return true if a custom ability with this name exists
*/
boolean hasCustomAbilityName(String name);
/**
* Delete a custom ability preset by name.
*
* @param name the custom ability name to delete
* @return true if deleted successfully
*/
boolean deleteCustomAbilityByName(String name);
/**
* Get all chained ability names.
*
* @return array of all chained ability names
*/
String[] getChainedAbilityNames();
/**
* Check if a chained ability exists by name.
*
* @param name the chained ability name to check
* @return true if a chained ability with this name exists
*/
boolean hasChainedAbilityName(String name);
/**
* Delete a chained ability by name.
*
* @param name the chained ability name to delete
* @return true if deleted successfully
*/
boolean deleteChainedAbilityByName(String name);
@@ -67,6 +89,7 @@ public interface IAbilityHandler {
/**
* Get a chained ability by name.
*
* @param name the chained ability name
* @return the chained ability, or null if not found
*/
IChainedAbility getChainedAbility(String name);
@@ -74,6 +97,7 @@ public interface IAbilityHandler {
/**
* Save a chained ability. If a chain with the same name exists, it is overwritten.
*
* @param chain the chained ability to save
* @return true if saved successfully
*/
boolean saveChainedAbility(IChainedAbility chain);
@@ -18,12 +18,16 @@ public interface IActionManager {
/**
* Begin processing scheduled actions. Must be called once.
*
* @return this action manager
*/
IActionManager start();
/**
* Halt processing of actions. Queued actions remain but will not run until
* {@link #start()} is called again.
*
* @return this action manager
*/
IActionManager stop();
@@ -59,8 +63,8 @@ public interface IActionManager {
/**
* Enabling prints to the console the life cycle of IActionManager, it's IActionQueues and the scheduled IActions
*
* @param debug
* @return
* @param debug whether to enable debug logging
* @return this action manager
*/
IActionManager setDebugMode(boolean debug);
@@ -148,7 +152,7 @@ public interface IActionManager {
boolean hasQueue(String name);
/**
* @param name
* @param name the name for the new action
* @return True if queue successfully removed from IActionManager and cleared
*/
boolean removeQueue(String name);
@@ -176,7 +180,7 @@ public interface IActionManager {
* Multiple actions chained one after another
* i.e schedule(act1,act2,act3,...)
*
* @param actions
* @param actions the actions to schedule
*/
void schedule(IAction... actions);
@@ -192,7 +196,7 @@ public interface IActionManager {
* Multiple tasks chained one after another
* i.e schedule(task1,task2,task3,...)
*
* @param tasks
* @param tasks the task consumers to schedule
*/
void schedule(Consumer<IAction>... tasks);
@@ -261,7 +265,7 @@ public interface IActionManager {
* Multiple conditionals
* i.e schedule(act1,act2,act3,...)
*
* @param actions
* @param actions the conditional actions to schedule
*/
void schedule(IConditionalAction... actions);
@@ -340,8 +344,8 @@ public interface IActionManager {
/**
* Schedules actions on the parallelQueue, where all actions are executed simultaneously
*
* @param action
* @return
* @param action the action to add to the parallel chain
* @return the parallel action
*/
IAction scheduleParallel(IAction action);
@@ -350,7 +354,7 @@ public interface IActionManager {
* Multiple actions in parallel
* i.e scheduleParallel(act1,act2,act3,...)
*
* @param actions
* @param actions the actions to run in parallel
*/
void scheduleParallel(IAction... actions);
@@ -380,7 +384,7 @@ public interface IActionManager {
boolean hasAny(String name);
/**
* @param name
* @param name the name for the new parallel action
* @return Checks through all available queues and fetches the first IAction with given name
*/
IAction getAny(String name);
@@ -20,11 +20,15 @@ public interface IAnimationHandler {
/**
* Get all built-in animations.
* Built-in animations are read-only and cannot be modified or deleted.
*
* @return array of all built-in animations
*/
IAnimation[] getBuiltInAnimations();
/**
* Get all animations (both built-in and user-created).
*
* @return array of all animations (built-in and custom)
*/
IAnimation[] getAllAnimations();
@@ -38,6 +42,8 @@ public interface IAnimationHandler {
/**
* Get names of all built-in animations.
*
* @return array of all built-in animation names
*/
String[] getBuiltInAnimationNames();
}
@@ -12,11 +12,13 @@ public interface IAuctionHandler {
/**
* Check if the auction system is enabled.
* @return true if the auction system is enabled
*/
boolean isEnabled();
/**
* Get all active listings.
* @return array of all currently active auction listings
*/
IAuctionListing[] getActiveListings();
@@ -32,6 +34,7 @@ public interface IAuctionHandler {
* Get all active listings by a specific seller.
*
* @param sellerUUID The seller's UUID as a string
* @return array of listings created by this seller
*/
IAuctionListing[] getListingsBySeller(String sellerUUID);
@@ -39,11 +42,13 @@ public interface IAuctionHandler {
* Get all listings where a player is the current high bidder.
*
* @param bidderUUID The bidder's UUID as a string
* @return array of listings this player has bid on
*/
IAuctionListing[] getListingsByBidder(String bidderUUID);
/**
* Get total count of active listings.
* @return the number of currently active listings
*/
int getActiveListingCount();
@@ -89,36 +94,43 @@ public interface IAuctionHandler {
/**
* Get the listing fee amount.
* @return the currency fee charged when creating a listing
*/
long getListingFee();
/**
* Get the sales tax percentage (0.0 to 1.0).
* @return the sales tax percentage applied to completed sales
*/
double getSalesTaxPercent();
/**
* Get the minimum bid increment percentage (0.0 to 1.0).
* @return the minimum bid increment as a percentage of current bid
*/
double getMinBidIncrementPercent();
/**
* Get the auction duration in hours.
* @return the default auction duration in hours
*/
int getAuctionDurationHours();
/**
* Get the snipe protection time in minutes.
* @return the snipe protection window in minutes
*/
int getSnipeProtectionMinutes();
/**
* Get the currency name used by the auction system.
* @return the display name of the auction currency
*/
String getCurrencyName();
/**
* Get the minimum listing price.
* @return the minimum starting price for new listings
*/
long getMinimumListingPrice();
@@ -4,47 +4,216 @@ import noppes.npcs.api.IPos;
import noppes.npcs.api.IWorld;
import noppes.npcs.api.entity.IEntity;
/**
* Handles storing and spawning cloned entities.
* Clones are organized by numbered tabs (0-based) or named folders.
*/
public interface ICloneHandler {
/**
* Spawns a clone at the given coordinates.
*
* @param x the x coordinate.
* @param y the y coordinate.
* @param z the z coordinate.
* @param tab the tab index.
* @param name the clone name.
* @param world the world to spawn in.
* @param ignoreProtection whether to bypass spawn protection.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(double x, double y, double z, int tab, String name, IWorld world, boolean ignoreProtection);
/**
* Spawns a clone at the given position.
*
* @param pos the position.
* @param tab the tab index.
* @param name the clone name.
* @param world the world to spawn in.
* @param ignoreProtection whether to bypass spawn protection.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(IPos pos, int tab, String name, IWorld world, boolean ignoreProtection);
/**
* Spawns a clone at the given coordinates with default protection rules.
*
* @param x the x coordinate.
* @param y the y coordinate.
* @param z the z coordinate.
* @param tab the tab index.
* @param name the clone name.
* @param world the world to spawn in.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(double x, double y, double z, int tab, String name, IWorld world);
/**
* Spawns a clone at the given position with default protection rules.
*
* @param pos the position.
* @param tab the tab index.
* @param name the clone name.
* @param world the world to spawn in.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(IPos pos, int tab, String name, IWorld world);
/**
* Returns all clones stored in the specified tab.
*
* @param tab the tab index.
* @param world the world context for entity creation.
* @return an array of entities in the tab.
*/
IEntity[] getTab(int tab, IWorld world);
/**
* Returns a specific clone from a tab by name.
*
* @param tab the tab index.
* @param name the clone name.
* @param world the world context for entity creation.
* @return the entity, or null if not found.
*/
IEntity get(int tab, String name, IWorld world);
/**
* Checks whether a clone with the given name exists in the tab.
*
* @param tab the tab index.
* @param name the clone name.
* @return true if the clone exists; false otherwise.
*/
boolean has(int tab, String name);
/**
* Stores an entity as a clone in the given tab with the specified name.
*
* @param tab the tab index.
* @param name the clone name.
* @param entity the entity to store.
*/
void set(int tab, String name, IEntity entity);
/**
* Removes a clone from the given tab.
*
* @param tab the tab index.
* @param name the clone name.
*/
void remove(int tab, String name);
// --- Custom Folder Methods ---
/**
* Returns all custom folder names.
*
* @return an array of folder names.
*/
String[] getFolders();
/**
* Checks whether a custom folder exists.
*
* @param folderName the folder name.
* @return true if the folder exists; false otherwise.
*/
boolean hasFolder(String folderName);
/**
* Spawns a clone from a custom folder at the given coordinates.
*
* @param x the x coordinate.
* @param y the y coordinate.
* @param z the z coordinate.
* @param folderName the folder name.
* @param name the clone name.
* @param world the world to spawn in.
* @param ignoreProtection whether to bypass spawn protection.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(double x, double y, double z, String folderName, String name, IWorld world, boolean ignoreProtection);
/**
* Spawns a clone from a custom folder at the given position.
*
* @param pos the position.
* @param folderName the folder name.
* @param name the clone name.
* @param world the world to spawn in.
* @param ignoreProtection whether to bypass spawn protection.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(IPos pos, String folderName, String name, IWorld world, boolean ignoreProtection);
/**
* Spawns a clone from a custom folder with default protection rules.
*
* @param x the x coordinate.
* @param y the y coordinate.
* @param z the z coordinate.
* @param folderName the folder name.
* @param name the clone name.
* @param world the world to spawn in.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(double x, double y, double z, String folderName, String name, IWorld world);
/**
* Spawns a clone from a custom folder at the given position with default protection rules.
*
* @param pos the position.
* @param folderName the folder name.
* @param name the clone name.
* @param world the world to spawn in.
* @return the spawned entity, or null on failure.
*/
IEntity spawn(IPos pos, String folderName, String name, IWorld world);
/**
* Returns all clones stored in the specified custom folder.
*
* @param folderName the folder name.
* @param world the world context for entity creation.
* @return an array of entities in the folder.
*/
IEntity[] getFolder(String folderName, IWorld world);
/**
* Returns a specific clone from a custom folder by name.
*
* @param folderName the folder name.
* @param name the clone name.
* @param world the world context for entity creation.
* @return the entity, or null if not found.
*/
IEntity get(String folderName, String name, IWorld world);
/**
* Checks whether a clone exists in a custom folder.
*
* @param folderName the folder name.
* @param name the clone name.
* @return true if the clone exists; false otherwise.
*/
boolean has(String folderName, String name);
/**
* Stores an entity as a clone in a custom folder.
*
* @param folderName the folder name.
* @param name the clone name.
* @param entity the entity to store.
*/
void set(String folderName, String name, IEntity entity);
/**
* Removes a clone from a custom folder.
*
* @param folderName the folder name.
* @param name the clone name.
*/
void remove(String folderName, String name);
}
@@ -5,8 +5,23 @@ import noppes.npcs.api.handler.data.IDialogCategory;
import java.util.List;
/**
* Handles retrieval of dialogs and dialog categories.
*/
public interface IDialogHandler {
/**
* Returns all dialog categories.
*
* @return a list of dialog categories.
*/
List<IDialogCategory> categories();
IDialog get(int var1);
/**
* Returns the dialog with the specified ID.
*
* @param id the dialog ID.
* @return the dialog, or null if not found.
*/
IDialog get(int id);
}
@@ -4,12 +4,40 @@ import noppes.npcs.api.handler.data.IFaction;
import java.util.List;
/**
* Handles creation, deletion, and retrieval of factions.
*/
public interface IFactionHandler {
/**
* Returns all registered factions.
*
* @return a list of factions.
*/
List<IFaction> list();
IFaction delete(int var1);
/**
* Deletes the faction with the given ID.
*
* @param id the faction ID.
* @return the deleted faction, or null if not found.
*/
IFaction delete(int id);
IFaction create(String var1, int var2);
/**
* Creates a new faction with the given name and default points.
*
* @param name the faction name.
* @param defaultPoints the default standing points for new players.
* @return the created faction.
*/
IFaction create(String name, int defaultPoints);
IFaction get(int var1);
/**
* Returns the faction with the given ID.
*
* @param id the faction ID.
* @return the faction, or null if not found.
*/
IFaction get(int id);
}
@@ -3,18 +3,64 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.handler.data.ILinkedItem;
import noppes.npcs.api.item.IItemStack;
/**
* Handles registration and retrieval of linked items.
* Linked items are custom item definitions that can be updated globally.
*/
public interface ILinkedItemHandler {
/**
* Creates a new linked item with the given name.
*
* @param name the item name.
* @return the created linked item.
*/
ILinkedItem createItem(String name);
/**
* Creates an ItemStack from a linked item by its ID.
*
* @param id the linked item ID.
* @return the item stack, or null if the ID is invalid.
*/
IItemStack createItemStack(int id);
/**
* Registers a linked item with this handler.
*
* @param linkedItem the linked item to add.
*/
void add(ILinkedItem linkedItem);
/**
* Removes and returns the linked item with the given ID.
*
* @param id the linked item ID.
* @return the removed linked item, or null if not found.
*/
ILinkedItem remove(int id);
/**
* Returns the linked item with the given ID.
*
* @param id the linked item ID.
* @return the linked item, or null if not found.
*/
ILinkedItem get(int id);
/**
* Checks whether a linked item with the given ID exists.
*
* @param id the linked item ID.
* @return true if it exists; false otherwise.
*/
boolean contains(int id);
/**
* Checks whether the given linked item is registered.
*
* @param linkedItem the linked item to check.
* @return true if it exists; false otherwise.
*/
boolean contains(ILinkedItem linkedItem);
}
@@ -2,17 +2,49 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.handler.data.INaturalSpawn;
/**
* Handles natural spawn configurations for custom NPCs.
*/
public interface INaturalSpawnsHandler {
/**
* Saves all spawn configurations to disk.
*/
void save();
/**
* Returns all registered natural spawn configurations.
*
* @return an array of spawn configurations.
*/
INaturalSpawn[] getSpawns();
/**
* Returns spawn configurations that include the specified biome.
*
* @param biome the biome name.
* @return an array of matching spawn configurations.
*/
INaturalSpawn[] getSpawns(String biome);
/**
* Registers a new natural spawn configuration.
*
* @param spawn the spawn to add.
*/
void addSpawn(INaturalSpawn spawn);
/**
* Removes a natural spawn configuration.
*
* @param spawn the spawn to remove.
*/
void removeSpawn(INaturalSpawn spawn);
/**
* Creates a new empty natural spawn configuration.
*
* @return the created spawn.
*/
INaturalSpawn createSpawn();
}
@@ -2,17 +2,53 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.ISkinOverlay;
/**
* Manages skin overlays applied to an entity or player.
* Overlays are indexed by ID and rendered on top of the base skin.
*/
public interface IOverlayHandler {
/**
* Adds or replaces an overlay at the given ID.
*
* @param id the overlay ID.
* @param overlay the skin overlay to add.
*/
void add(int id, ISkinOverlay overlay);
/**
* Returns the overlay at the given ID.
*
* @param id the overlay ID.
* @return the skin overlay, or null if not found.
*/
ISkinOverlay get(int id);
/**
* Checks whether an overlay exists at the given ID.
*
* @param id the overlay ID.
* @return true if an overlay exists; false otherwise.
*/
boolean has(int id);
/**
* Removes the overlay at the given ID.
*
* @param id the overlay ID.
* @return true if an overlay was removed; false otherwise.
*/
boolean remove(int id);
/**
* Returns the number of active overlays.
*
* @return the overlay count.
*/
int size();
/**
* Removes all overlays.
*/
void clear();
}
@@ -1,4 +1,8 @@
package noppes.npcs.api.handler;
/**
* Holds bank-related data for a player.
* Currently a marker interface.
*/
public interface IPlayerBankData {
}
@@ -3,33 +3,65 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.ability.IPlayerAbilityData;
import noppes.npcs.api.entity.ICustomNpc;
/**
* Provides access to all persistent data categories for a player,
* including companion, dialog, quest, faction, transport, mail, trade, and ability data.
*/
public interface IPlayerData {
/**
* Sets the player's companion NPC.
*
* @param npc the companion NPC, or null to clear.
*/
void setCompanion(ICustomNpc npc);
/**
* Returns the player's companion NPC.
*
* @return the companion NPC, or null if none.
*/
ICustomNpc getCompanion();
/**
* @return true if the player currently has a companion NPC.
*/
boolean hasCompanion();
/**
* @return the entity ID of the companion, or -1 if none.
*/
int getCompanionID();
/** @return the player's dialog data. */
IPlayerDialogData getDialogData();
/** @return the player's bank data. */
IPlayerBankData getBankData();
/** @return the player's quest data. */
IPlayerQuestData getQuestData();
/** @return the player's transport data. */
IPlayerTransportData getTransportData();
/** @return the player's faction data. */
IPlayerFactionData getFactionData();
/** @return the player's item giver data. */
IPlayerItemGiverData getItemGiverData();
/** @return the player's mail data. */
IPlayerMailData getMailData();
/** @return the player's trade data. */
IPlayerTradeData getTradeData();
/** @return the player's ability data. */
IPlayerAbilityData getAbilityData();
/**
* Saves all player data to disk.
*/
void save();
}
@@ -1,10 +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);
}
@@ -1,10 +1,32 @@
package noppes.npcs.api.handler;
/**
* Tracks a player's faction standing points.
*/
public interface IPlayerFactionData {
/**
* Returns the player's points for the given faction.
*
* @param id the faction ID.
* @return the faction points.
*/
int getPoints(int id);
/**
* Adds points to the player's standing with the given faction.
* Use negative values to decrease.
*
* @param id the faction ID.
* @param points the points to add.
*/
void addPoints(int id, int points);
/**
* Sets the player's points for the given faction.
*
* @param id the faction ID.
* @param points the new point value.
*/
void setPoints(int id, int points);
}
@@ -2,11 +2,33 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.jobs.IJobItemGiver;
/**
* Tracks item giver interaction data for a player, including
* cooldown timestamps and interaction history.
*/
public interface IPlayerItemGiverData {
/**
* Returns the last interaction time for the given item giver job.
*
* @param jobItemGiver the item giver job.
* @return the last interaction time in game ticks.
*/
long getTime(IJobItemGiver jobItemGiver);
/**
* Sets the last interaction time for the given item giver job.
*
* @param jobItemGiver the item giver job.
* @param day the time to set in game ticks.
*/
void setTime(IJobItemGiver jobItemGiver, long day);
/**
* Checks whether the player has interacted with the item giver before.
*
* @param jobItemGiver the item giver job.
* @return true if previously interacted; false otherwise.
*/
boolean hasInteractedBefore(IJobItemGiver jobItemGiver);
}
@@ -2,21 +2,50 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.handler.data.IPlayerMail;
/**
* Manages a player's mail inbox, including sending, removing, and querying mail.
*/
public interface IPlayerMailData {
/** @return true if the player has any mail. */
boolean hasMail();
/**
* Adds mail to the player's inbox.
*
* @param mail the mail to add.
*/
void addMail(IPlayerMail mail);
/**
* Removes specific mail from the player's inbox.
*
* @param mail the mail to remove.
*/
void removeMail(IPlayerMail mail);
/**
* Checks if the player has the specified mail.
*
* @param mail the mail to check.
* @return true if the mail exists in the inbox.
*/
boolean hasMail(IPlayerMail mail);
/** @return all mail in the player's inbox. */
IPlayerMail[] getAllMail();
/** @return all unread mail in the player's inbox. */
IPlayerMail[] getUnreadMail();
/** @return all read mail in the player's inbox. */
IPlayerMail[] getReadMail();
/**
* Returns all mail from the given sender.
*
* @param sender the sender name.
* @return an array of matching mail.
*/
IPlayerMail[] getMailFrom(String sender);
}
@@ -2,27 +2,73 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.handler.data.IQuest;
/**
* Tracks a player's quest progress, including active, finished, and tracked quests.
*/
public interface IPlayerQuestData {
/** @return the quest currently being tracked by the player, or null if none. */
IQuest getTrackedQuest();
/**
* Starts the quest with the given ID for the player.
*
* @param id the quest ID.
*/
void startQuest(int id);
/**
* Marks the quest with the given ID as finished.
*
* @param id the quest ID.
*/
void finishQuest(int id);
/**
* Removes the quest from the player's active quest list.
*
* @param id the quest ID.
*/
void stopQuest(int id);
/**
* Removes the quest from both active and finished lists.
*
* @param id the quest ID.
*/
void removeQuest(int id);
/**
* @param id the quest ID.
* @return true if the player has finished the quest.
*/
boolean hasFinishedQuest(int id);
public boolean hasActiveQuest(int id);
/**
* @param id the quest ID.
* @return true if the player has the quest active.
*/
boolean hasActiveQuest(int id);
/** @return all active quests for the player. */
IQuest[] getActiveQuests();
/** @return all finished quests for the player. */
IQuest[] getFinishedQuests();
/**
* Returns the timestamp when the quest was last completed.
*
* @param id the quest ID.
* @return the completion time, or 0 if never completed.
*/
long getLastCompletedTime(int id);
/**
* Sets the last completed time for the quest.
*
* @param id the quest ID.
* @param time the completion timestamp.
*/
void setLastCompletedTime(int id, long time);
}
@@ -11,6 +11,8 @@ public interface IPlayerTradeData {
/**
* Get the current balance
*
* @return the player's current currency balance
*/
long getBalance();
@@ -47,16 +49,22 @@ public interface IPlayerTradeData {
/**
* Get lifetime earned currency
*
* @return the total currency earned over the player's lifetime
*/
long getLifetimeEarned();
/**
* Get lifetime spent currency
*
* @return the total currency spent over the player's lifetime
*/
long getLifetimeSpent();
/**
* Format the balance for display
*
* @return the balance formatted as a human-readable string
*/
String formatBalance();
@@ -69,16 +77,22 @@ public interface IPlayerTradeData {
/**
* Get the number of pending auction claims
*
* @return the number of pending auction claims
*/
int getClaimCount();
/**
* Check if player has any pending auction claims
*
* @return true if the player has pending auction claims
*/
boolean hasClaims();
/**
* Get all pending auction claims for this player.
*
* @return array of the player's pending auction claims
*/
IAuctionClaim[] getClaims();
@@ -2,17 +2,50 @@ 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);
}
@@ -3,17 +3,60 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.handler.data.IProfile;
/**
* Manages player profiles, which allow players to have multiple save slots
* for their CNPC+ data.
*/
public interface IProfileHandler {
/**
* Returns the profile for the given player.
*
* @param player the player.
* @return the player's profile.
*/
IProfile getProfile(IPlayer player);
/**
* Switches the player to a different profile slot.
*
* @param player the player.
* @param slotID the slot ID to switch to.
* @return true if the switch was successful.
*/
boolean changeSlot(IPlayer player, int slotID);
/**
* Checks whether a profile slot exists for the player.
*
* @param player the player.
* @param slotID the slot ID.
* @return true if the slot exists.
*/
boolean hasSlot(IPlayer player, int slotID);
/**
* Removes a profile slot from the player.
*
* @param player the player.
* @param slotID the slot ID to remove.
* @return true if the slot was removed.
*/
boolean removeSlot(IPlayer player, int slotID);
/**
* Returns the player data for a specific profile slot without switching to it.
*
* @param player the player.
* @param slotID the slot ID.
* @return the player data for the slot.
*/
IPlayerData getSlotPlayerData(IPlayer player, int slotID);
/**
* Saves the current slot data for the player.
*
* @param player the player.
*/
void saveSlotData(IPlayer player);
}
@@ -5,8 +5,23 @@ import noppes.npcs.api.handler.data.IQuestCategory;
import java.util.List;
/**
* Handles retrieval of quests and quest categories.
*/
public interface IQuestHandler {
/**
* Returns all quest categories.
*
* @return a list of quest categories.
*/
List<IQuestCategory> categories();
IQuest get(int var1);
/**
* Returns the quest with the given ID.
*
* @param id the quest ID.
* @return the quest, or null if not found.
*/
IQuest get(int id);
}
@@ -6,20 +6,67 @@ import noppes.npcs.api.handler.data.IRecipe;
import java.util.List;
/**
* Handles custom crafting recipes and anvil recipes.
*/
public interface IRecipeHandler {
/** @return all global (vanilla workbench) recipes. */
List<IRecipe> getGlobalList();
/** @return all carpentry table recipes. */
List<IRecipe> getCarpentryList();
/** @return all custom anvil recipes. */
List<IAnvilRecipe> getAnvilList();
void addRecipe(String var1, boolean var2, ItemStack var3, Object... var4);
/**
* Adds a shaped crafting recipe.
*
* @param name the recipe name.
* @param global true for global (vanilla workbench); false for carpentry.
* @param result the resulting item stack.
* @param recipe the recipe pattern and ingredient mappings.
*/
void addRecipe(String name, boolean global, ItemStack result, Object... recipe);
void addRecipe(String var1, boolean var2, ItemStack var3, int var4, int var5, ItemStack... var6);
/**
* Adds a shaped crafting recipe with explicit dimensions.
*
* @param name the recipe name.
* @param global true for global; false for carpentry.
* @param result the resulting item stack.
* @param width the recipe grid width.
* @param height the recipe grid height.
* @param items the ingredient item stacks.
*/
void addRecipe(String name, boolean global, ItemStack result, int width, int height, ItemStack... items);
IRecipe delete(int var1);
/**
* Deletes a crafting recipe by ID.
*
* @param id the recipe ID.
* @return the deleted recipe, or null if not found.
*/
IRecipe delete(int id);
IAnvilRecipe deleteAnvil(int var1);
/**
* Deletes an anvil recipe by ID.
*
* @param id the recipe ID.
* @return the deleted anvil recipe, or null if not found.
*/
IAnvilRecipe deleteAnvil(int id);
/**
* Adds a custom anvil recipe.
*
* @param name the recipe name.
* @param global true for global; false for carpentry.
* @param itemToRepair the item to be repaired.
* @param repairMaterial the material used for repair.
* @param xpCost the experience cost.
* @param repairPercentage the percentage of durability restored per material.
*/
void addAnvilRecipe(String name, boolean global, ItemStack itemToRepair, ItemStack repairMaterial, int xpCost, float repairPercentage);
}
+32 -3
View File
@@ -4,12 +4,41 @@ import noppes.npcs.api.handler.data.ITag;
import java.util.List;
/**
* Handles creation, deletion, and retrieval of tags.
* Tags are labels that can be applied to entities for categorization.
*/
public interface ITagHandler {
/**
* Returns all registered tags.
*
* @return a list of tags.
*/
List<ITag> list();
ITag delete(int var1);
/**
* Deletes the tag with the given ID.
*
* @param id the tag ID.
* @return the deleted tag, or null if not found.
*/
ITag delete(int id);
ITag create(String var1, int var2);
/**
* Creates a new tag with the given name and color.
*
* @param name the tag name.
* @param color the tag color as a packed RGB integer.
* @return the created tag.
*/
ITag create(String name, int color);
ITag get(int var1);
/**
* Returns the tag with the given ID.
*
* @param id the tag ID.
* @return the tag, or null if not found.
*/
ITag get(int id);
}
@@ -29,9 +29,9 @@ import noppes.npcs.api.entity.IEntity;
*/
public interface ITelegraphHandler {
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
// FACTORY METHODS
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
/**
* Create a circle telegraph.
@@ -83,9 +83,9 @@ public interface ITelegraphHandler {
*/
ITelegraph create(String type);
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
// SPAWN METHODS
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
/**
* Spawn a telegraph at a position.
@@ -131,9 +131,9 @@ public interface ITelegraphHandler {
*/
ITelegraphInstance spawn(ITelegraph telegraph, IEntity entity, float yaw);
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
// PRESET MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
/**
* Get a saved telegraph preset by name.
@@ -173,9 +173,9 @@ public interface ITelegraphHandler {
*/
String[] getSavedNames();
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
// REMOVAL
// ═══════════════════════════════════════════════════════════════════════════
// ==========================================================================
/**
* Remove an active telegraph by instance ID.
@@ -2,13 +2,37 @@ package noppes.npcs.api.handler;
import noppes.npcs.api.handler.data.ITransportCategory;
/**
* Handles transport categories and their locations.
*/
public interface ITransportHandler {
/**
* Returns all transport categories.
*
* @return an array of transport categories.
*/
ITransportCategory[] categories();
/**
* Creates a new transport category with the given title.
*
* @param title the category title.
*/
void createCategory(String title);
/**
* Returns the transport category with the given title.
*
* @param title the category title.
* @return the category, or null if not found.
*/
ITransportCategory getCategory(String title);
/**
* Removes the transport category with the given title.
*
* @param title the category title.
*/
void removeCategory(String title);
}
+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);