From d003d6d870db13d56fce223050a06faf15050eae Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 30 Dec 2025 19:29:32 -0500 Subject: [PATCH 01/93] Attack Speed API --- java/noppes/npcs/api/item/IItemCustom.java | 7 +++++++ java/noppes/npcs/api/item/IItemCustomizable.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/java/noppes/npcs/api/item/IItemCustom.java b/java/noppes/npcs/api/item/IItemCustom.java index 355d900..c91f087 100644 --- a/java/noppes/npcs/api/item/IItemCustom.java +++ b/java/noppes/npcs/api/item/IItemCustom.java @@ -61,6 +61,13 @@ public interface IItemCustom extends IItemCustomizable { */ void setItemUseAction(int action); + /** + * Sets the attack speed for the scripted item. + * Speed is the max resistantance time between two attacks in ticks. + * @param speed The attack speed + */ + void setAttackSpeed(int speed); + /** * Sets the enchantability for the scripted item. * @param enchantability The enchantability diff --git a/java/noppes/npcs/api/item/IItemCustomizable.java b/java/noppes/npcs/api/item/IItemCustomizable.java index 58df90b..68e9fcf 100644 --- a/java/noppes/npcs/api/item/IItemCustomizable.java +++ b/java/noppes/npcs/api/item/IItemCustomizable.java @@ -54,6 +54,13 @@ public interface IItemCustomizable extends IItemStack { */ int getEnchantability(); + /** + * Gets the attack speed for the scripted item. + * Speed is the max hurt resistant time in ticks (20 ticks = 1 second) + * @return The attack speed + */ + int getAttackSpeed(); + /** * Gets the texture path for the scripted item. * @return The texture path From aefae8ace3555442da7debff5b95cf410fa057f7 Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Mon, 5 Jan 2026 16:54:41 +0200 Subject: [PATCH 02/93] Animation Data Store (for cross event/frame data handling) --- java/noppes/npcs/api/handler/data/IAnimation.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/noppes/npcs/api/handler/data/IAnimation.java b/java/noppes/npcs/api/handler/data/IAnimation.java index 68dc8ca..97bd5dd 100644 --- a/java/noppes/npcs/api/handler/data/IAnimation.java +++ b/java/noppes/npcs/api/handler/data/IAnimation.java @@ -56,4 +56,12 @@ public interface IAnimation { void setID(int id); long getTotalTime(); + + boolean hasData(String key); + + Object getData(String key); + + IAnimation setData(String key, Object v); + + IAnimation removeData(String key); } From 801d62c0607f301759b627f251e93a5fc6de9d67 Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Mon, 5 Jan 2026 17:14:44 +0200 Subject: [PATCH 03/93] Added IAnimation consumers to API --- java/noppes/npcs/api/handler/data/IAnimation.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/noppes/npcs/api/handler/data/IAnimation.java b/java/noppes/npcs/api/handler/data/IAnimation.java index 97bd5dd..2931779 100644 --- a/java/noppes/npcs/api/handler/data/IAnimation.java +++ b/java/noppes/npcs/api/handler/data/IAnimation.java @@ -1,5 +1,10 @@ package noppes.npcs.api.handler.data; +import noppes.npcs.controllers.data.Animation; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; + public interface IAnimation { IAnimationData getParent(); @@ -64,4 +69,10 @@ public interface IAnimation { IAnimation setData(String key, Object v); IAnimation removeData(String key); + + IAnimation onStart(Consumer task); + + IAnimation onFrame(BiConsumer task); + + IAnimation onEnd(Consumer task); } From ed5640d2385d5626a8dff2dd2d0bc59b6c455f4c Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Mon, 5 Jan 2026 20:17:54 +0200 Subject: [PATCH 04/93] IAnimation instead of Animation --- java/noppes/npcs/api/handler/data/IAnimation.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/noppes/npcs/api/handler/data/IAnimation.java b/java/noppes/npcs/api/handler/data/IAnimation.java index 2931779..2a0243e 100644 --- a/java/noppes/npcs/api/handler/data/IAnimation.java +++ b/java/noppes/npcs/api/handler/data/IAnimation.java @@ -70,9 +70,9 @@ public interface IAnimation { IAnimation removeData(String key); - IAnimation onStart(Consumer task); + IAnimation onStart(Consumer task); - IAnimation onFrame(BiConsumer task); + IAnimation onFrame(BiConsumer task); - IAnimation onEnd(Consumer task); + IAnimation onEnd(Consumer task); } From 3ac76848d32724eff763f2c0c2b8054e40a96e68 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 9 Jan 2026 15:28:48 -0500 Subject: [PATCH 05/93] Ability Push --- java/noppes/npcs/api/AbstractNpcAPI.java | 2 + java/noppes/npcs/api/ability/IAbility.java | 166 ++++++++++++++++++ .../npcs/api/ability/IAbilityHandler.java | 33 ++++ .../npcs/api/ability/IDataAbilities.java | 78 ++++++++ java/noppes/npcs/api/event/IAbilityEvent.java | 120 +++++++++++++ .../npcs/api/handler/IAbilityHandler.java | 49 ++++++ .../npcs/api/handler/data/IAnimation.java | 2 - 7 files changed, 448 insertions(+), 2 deletions(-) create mode 100644 java/noppes/npcs/api/ability/IAbility.java create mode 100644 java/noppes/npcs/api/ability/IAbilityHandler.java create mode 100644 java/noppes/npcs/api/ability/IDataAbilities.java create mode 100644 java/noppes/npcs/api/event/IAbilityEvent.java create mode 100644 java/noppes/npcs/api/handler/IAbilityHandler.java diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 027f66a..9ab9a0a 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -151,6 +151,8 @@ public abstract class AbstractNpcAPI { public abstract IAnimationHandler getAnimations(); + public abstract IAbilityHandler getAbilities(); + public abstract String[] getAllBiomeNames(); public abstract ICustomNpc createNPC(IWorld var1); diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java new file mode 100644 index 0000000..94e16c0 --- /dev/null +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -0,0 +1,166 @@ +package noppes.npcs.api.ability; + +import noppes.npcs.api.INbt; + +/** + * Interface for NPC abilities. + * Abilities are special attacks or actions that NPCs can perform during combat. + */ +public interface IAbility { + + /** + * Get the unique ID of this ability instance. + */ + String getId(); + + /** + * Set the unique ID of this ability instance. + */ + void setId(String id); + + /** + * Get the display name of this ability. + */ + String getName(); + + /** + * Set the display name of this ability. + */ + void setName(String name); + + /** + * Get the type ID of this ability (e.g., "cnpc:slam", "cnpc:beam"). + */ + String getTypeId(); + + /** + * Check if this ability is enabled. + */ + boolean isEnabled(); + + /** + * Enable or disable this ability. + */ + void setEnabled(boolean enabled); + + /** + * Get the selection weight for random ability selection. + * Higher weight = more likely to be selected. + */ + int getWeight(); + + /** + * Set the selection weight. + */ + void setWeight(int weight); + + /** + * Get the minimum range at which this ability can be used. + */ + float getMinRange(); + + /** + * Set the minimum range. + */ + void setMinRange(float range); + + /** + * Get the maximum range at which this ability can be used. + */ + float getMaxRange(); + + /** + * Set the maximum range. + */ + void setMaxRange(float range); + + /** + * Get the cooldown time in ticks. + */ + int getCooldownTicks(); + + /** + * Set the cooldown time in ticks. + */ + void setCooldownTicks(int ticks); + + /** + * Get the wind-up time in ticks (telegraph phase). + */ + int getWindUpTicks(); + + /** + * Set the wind-up time in ticks. + */ + void setWindUpTicks(int ticks); + + /** + * Get the active duration in ticks. + */ + int getActiveTicks(); + + /** + * Set the active duration in ticks. + */ + void setActiveTicks(int ticks); + + /** + * Get the recovery time in ticks. + */ + int getRecoveryTicks(); + + /** + * Set the recovery time in ticks. + */ + void setRecoveryTicks(int ticks); + + /** + * Check if this ability can be interrupted by damage. + */ + boolean isInterruptible(); + + /** + * Set whether this ability can be interrupted. + */ + void setInterruptible(boolean interruptible); + + /** + * Get the damage threshold for interruption. + */ + float getInterruptThreshold(); + + /** + * Set the damage threshold for interruption. + */ + void setInterruptThreshold(float threshold); + + /** + * Check if this ability is currently being executed. + */ + boolean isExecuting(); + + /** + * Check if this ability is on cooldown. + */ + boolean isOnCooldown(); + + /** + * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=RECOVERY). + */ + int getPhaseInt(); + + /** + * Get the current tick within the current phase. + */ + int getCurrentTick(); + + /** + * Get this ability's data as NBT. + */ + INbt getNbt(); + + /** + * Set this ability's data from NBT. + */ + void setNbt(INbt nbt); +} diff --git a/java/noppes/npcs/api/ability/IAbilityHandler.java b/java/noppes/npcs/api/ability/IAbilityHandler.java new file mode 100644 index 0000000..56cf621 --- /dev/null +++ b/java/noppes/npcs/api/ability/IAbilityHandler.java @@ -0,0 +1,33 @@ +package noppes.npcs.api.ability; + +/** + * Handler for ability registration and creation. + * Use this to register custom ability types from external mods. + */ +public interface IAbilityHandler { + + /** + * Register a custom ability type. + * Call during FMLInitializationEvent. + * + * @param typeId The unique type ID (e.g., "mymod:custom_ability") + * @param abilityClass The class that implements the ability + */ + void registerType(String typeId, Class abilityClass); + + /** + * Check if an ability type is registered. + */ + boolean hasType(String typeId); + + /** + * Get all registered ability type IDs. + */ + String[] getTypes(); + + /** + * Create a new ability of the given type. + * Returns null if the type is not registered. + */ + IAbility create(String typeId); +} diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java new file mode 100644 index 0000000..ff117b4 --- /dev/null +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -0,0 +1,78 @@ +package noppes.npcs.api.ability; + +/** + * Interface for an NPC's ability data manager. + * Provides access to the NPC's abilities and execution state. + */ +public interface IDataAbilities { + + /** + * Check if the ability system is enabled for this NPC. + */ + boolean isEnabled(); + + /** + * Enable or disable the ability system for this NPC. + */ + void setEnabled(boolean enabled); + + /** + * Get all abilities assigned to this NPC. + */ + IAbility[] getAbilities(); + + /** + * Add an ability to this NPC. + */ + void addAbility(IAbility ability); + + /** + * Remove an ability by ID. + */ + void removeAbility(String abilityId); + + /** + * Get an ability by ID. + */ + IAbility getAbility(String abilityId); + + /** + * Check if the NPC has an ability with the given ID. + */ + boolean hasAbility(String abilityId); + + /** + * Clear all abilities from this NPC. + */ + void clearAbilities(); + + /** + * Get the currently executing ability, or null if none. + */ + IAbility getCurrentAbility(); + + /** + * Check if any ability is currently executing. + */ + boolean isExecutingAbility(); + + /** + * Interrupt the current ability if one is executing. + */ + void interruptCurrentAbility(); + + /** + * Get the global cooldown timer in ticks. + */ + int getGlobalCooldown(); + + /** + * Set the global cooldown timer in ticks. + */ + void setGlobalCooldown(int ticks); + + /** + * Reset all ability cooldowns. + */ + void resetCooldowns(); +} diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java new file mode 100644 index 0000000..57ab8e2 --- /dev/null +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -0,0 +1,120 @@ +package noppes.npcs.api.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import noppes.npcs.api.IDamageSource; +import noppes.npcs.api.ability.IAbility; +import noppes.npcs.api.entity.ICustomNpc; +import noppes.npcs.api.entity.IEntityLivingBase; + +/** + * Events related to NPC ability execution. + * These events are fired during the ability lifecycle. + */ +public interface IAbilityEvent extends INpcEvent { + + /** + * Get the ability involved in this event. + */ + IAbility getAbility(); + + /** + * Get the target of the ability, or null if no target. + */ + IEntityLivingBase getTarget(); + + /** + * Fired when an ability starts executing (enters WINDUP phase). + * Canceling prevents the ability from starting. + */ + @Cancelable + interface StartEvent extends IAbilityEvent { + } + + /** + * Fired when an ability enters the ACTIVE phase and performs its effect. + * Canceling prevents the ability effect from occurring. + */ + @Cancelable + interface ExecuteEvent extends IAbilityEvent { + } + + /** + * Fired when an ability is interrupted by damage. + */ + interface InterruptEvent extends IAbilityEvent { + /** + * Get the damage source that caused the interruption. + */ + IDamageSource getDamageSource(); + + /** + * Get the amount of damage that caused the interruption. + */ + float getDamage(); + } + + /** + * Fired when an ability completes its full execution cycle. + */ + interface CompleteEvent extends IAbilityEvent { + } + + /** + * Fired when an ability hits an entity with damage. + * Canceling this event prevents the damage from being applied. + */ + @Cancelable + interface HitEvent extends IAbilityEvent { + /** + * Get the entity that was hit by the ability. + */ + IEntityLivingBase getHitEntity(); + + /** + * Get the damage amount. + */ + float getDamage(); + + /** + * Set the damage amount. Allows scripts to modify damage. + */ + void setDamage(float damage); + + /** + * Get the horizontal knockback amount. + */ + float getKnockback(); + + /** + * Set the horizontal knockback amount. + */ + void setKnockback(float knockback); + + /** + * Get the vertical knockback (upward force) amount. + */ + float getKnockbackUp(); + + /** + * Set the vertical knockback (upward force) amount. + */ + void setKnockbackUp(float knockbackUp); + } + + /** + * Fired every tick while an ability is executing. + * Provides the current phase and tick count. + */ + interface TickEvent extends IAbilityEvent { + /** + * Get the current phase of the ability. + * 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = RECOVERY + */ + int getAbilityPhase(); + + /** + * Get the current tick count within the phase. + */ + int getTick(); + } +} diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java new file mode 100644 index 0000000..fc873c2 --- /dev/null +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -0,0 +1,49 @@ +package noppes.npcs.api.handler; + +/** + * Handler for ability presets. Allows scripts to save, load, and manage + * reusable ability templates. + * + * Access via API.getAbilities() + */ +public interface IAbilityHandler { + + /** + * Get all registered ability type IDs. + * These are the types that can be used to create new abilities. + * + * @return Array of type IDs (e.g., "cnpc:slam", "cnpc:charge") + */ + String[] getTypes(); + + /** + * Check if an ability type is registered. + * + * @param typeId The type ID to check + * @return true if the type exists + */ + boolean hasType(String typeId); + + /** + * Get all saved ability preset names. + * + * @return Array of saved ability names + */ + String[] getSavedNames(); + + /** + * Check if a saved ability preset exists. + * + * @param name The name of the ability + * @return true if the preset exists + */ + boolean has(String name); + + /** + * Delete a saved ability preset. + * + * @param name The name of the ability to delete + * @return true if deleted successfully + */ + boolean delete(String name); +} diff --git a/java/noppes/npcs/api/handler/data/IAnimation.java b/java/noppes/npcs/api/handler/data/IAnimation.java index 2a0243e..2344454 100644 --- a/java/noppes/npcs/api/handler/data/IAnimation.java +++ b/java/noppes/npcs/api/handler/data/IAnimation.java @@ -1,7 +1,5 @@ package noppes.npcs.api.handler.data; -import noppes.npcs.controllers.data.Animation; - import java.util.function.BiConsumer; import java.util.function.Consumer; From d6450380c7b50238437130a3268c74c2305a4b05 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 9 Jan 2026 21:47:07 -0500 Subject: [PATCH 06/93] Update IAnimation.java --- java/noppes/npcs/api/handler/data/IAnimation.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/java/noppes/npcs/api/handler/data/IAnimation.java b/java/noppes/npcs/api/handler/data/IAnimation.java index 2a0243e..2344454 100644 --- a/java/noppes/npcs/api/handler/data/IAnimation.java +++ b/java/noppes/npcs/api/handler/data/IAnimation.java @@ -1,7 +1,5 @@ package noppes.npcs.api.handler.data; -import noppes.npcs.controllers.data.Animation; - import java.util.function.BiConsumer; import java.util.function.Consumer; From 76ce22d71317860d8efed5ba2d4c622bcafb95a1 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 9 Jan 2026 22:58:29 -0500 Subject: [PATCH 07/93] Add Hook Name to Custom Hooks --- .../npcs/api/event/IAnimationEvent.java | 12 +++++ java/noppes/npcs/api/event/IBlockEvent.java | 12 +++++ .../npcs/api/event/ICustomGuiEvent.java | 18 +++++++ .../npcs/api/event/ICustomNPCsEvent.java | 3 ++ java/noppes/npcs/api/event/IDialogEvent.java | 3 ++ java/noppes/npcs/api/event/IForgeEvent.java | 9 ++++ java/noppes/npcs/api/event/IItemEvent.java | 12 +++++ .../npcs/api/event/ILinkedItemEvent.java | 7 ++- java/noppes/npcs/api/event/INpcEvent.java | 12 +++++ java/noppes/npcs/api/event/IPlayerEvent.java | 47 +++++++++++++++++++ .../npcs/api/event/IProjectileEvent.java | 6 +++ java/noppes/npcs/api/event/IQuestEvent.java | 3 ++ 12 files changed, 143 insertions(+), 1 deletion(-) diff --git a/java/noppes/npcs/api/event/IAnimationEvent.java b/java/noppes/npcs/api/event/IAnimationEvent.java index 400c597..e5ce165 100644 --- a/java/noppes/npcs/api/event/IAnimationEvent.java +++ b/java/noppes/npcs/api/event/IAnimationEvent.java @@ -14,11 +14,17 @@ public interface IAnimationEvent extends ICustomNPCsEvent { IAnimatable getEntity(); + /** + * @hookName animationStart + */ @Cancelable interface Started extends IAnimationEvent { } + /** + * @hookName animationEnd + */ interface Ended extends IAnimationEvent { } @@ -29,10 +35,16 @@ public interface IAnimationEvent extends ICustomNPCsEvent { IFrame getFrame(); + /** + * @hookName frameEnter + */ interface Entered extends IFrameEvent { } + /** + * @hookName frameExit + */ interface Exited extends IFrameEvent { } diff --git a/java/noppes/npcs/api/event/IBlockEvent.java b/java/noppes/npcs/api/event/IBlockEvent.java index 2e85076..bd7d65f 100644 --- a/java/noppes/npcs/api/event/IBlockEvent.java +++ b/java/noppes/npcs/api/event/IBlockEvent.java @@ -8,6 +8,9 @@ import noppes.npcs.api.entity.IPlayer; public interface IBlockEvent extends ICustomNPCsEvent { IBlock getBlock(); + /** + * @hookName fallenUpon + */ @Cancelable interface EntityFallenUponEvent extends IBlockEvent{ IEntity getEntity(); @@ -31,6 +34,9 @@ public interface IBlockEvent extends ICustomNPCsEvent { int getPrevPower(); int getPower(); } + /** + * @hookName broken + */ interface BreakEvent extends IBlockEvent{ } @@ -38,6 +44,9 @@ public interface IBlockEvent extends ICustomNPCsEvent { interface ExplodedEvent extends IBlockEvent{ } + /** + * @hookName rainFilled + */ interface RainFillEvent extends IBlockEvent{ } @@ -49,6 +58,9 @@ public interface IBlockEvent extends ICustomNPCsEvent { interface InitEvent extends IBlockEvent{ } + /** + * @hookName tick + */ interface UpdateEvent extends IBlockEvent{ } diff --git a/java/noppes/npcs/api/event/ICustomGuiEvent.java b/java/noppes/npcs/api/event/ICustomGuiEvent.java index b3f905e..d5b3578 100644 --- a/java/noppes/npcs/api/event/ICustomGuiEvent.java +++ b/java/noppes/npcs/api/event/ICustomGuiEvent.java @@ -10,15 +10,27 @@ public interface ICustomGuiEvent extends IPlayerEvent { int getId(); + /** + * @hookName customGuiButton + */ interface ButtonEvent extends ICustomGuiEvent { } + /** + * @hookName customGuiTextfield + */ interface UnfocusedEvent extends ICustomGuiEvent { } + /** + * @hookName customGuiClosed + */ interface CloseEvent extends ICustomGuiEvent { } + /** + * @hookName customGuiScroll + */ interface ScrollEvent extends ICustomGuiEvent { String[] getSelection(); @@ -27,10 +39,16 @@ public interface ICustomGuiEvent extends IPlayerEvent { int getScrollIndex(); } + /** + * @hookName customGuiSlot + */ interface SlotEvent extends ICustomGuiEvent { IItemStack getStack(); } + /** + * @hookName customGuiSlotClicked + */ @Cancelable interface SlotClickEvent extends ICustomGuiEvent { IItemStack getStack(); diff --git a/java/noppes/npcs/api/event/ICustomNPCsEvent.java b/java/noppes/npcs/api/event/ICustomNPCsEvent.java index bc82109..961ecf0 100644 --- a/java/noppes/npcs/api/event/ICustomNPCsEvent.java +++ b/java/noppes/npcs/api/event/ICustomNPCsEvent.java @@ -9,6 +9,9 @@ public interface ICustomNPCsEvent { String getHookName(); + /** + * @hookName onCNPCNaturalSpawn + */ @Cancelable interface CNPCNaturalSpawnEvent extends ICustomNPCsEvent { INaturalSpawn getNaturalSpawn(); diff --git a/java/noppes/npcs/api/event/IDialogEvent.java b/java/noppes/npcs/api/event/IDialogEvent.java index 691a730..eda5e7a 100644 --- a/java/noppes/npcs/api/event/IDialogEvent.java +++ b/java/noppes/npcs/api/event/IDialogEvent.java @@ -15,6 +15,9 @@ public interface IDialogEvent extends IPlayerEvent { interface DialogOption extends IDialogEvent { } + /** + * @hookName dialogClose + */ interface DialogClosed extends IDialogEvent { } } diff --git a/java/noppes/npcs/api/event/IForgeEvent.java b/java/noppes/npcs/api/event/IForgeEvent.java index 0dfc333..a88934c 100644 --- a/java/noppes/npcs/api/event/IForgeEvent.java +++ b/java/noppes/npcs/api/event/IForgeEvent.java @@ -8,14 +8,23 @@ public interface IForgeEvent extends ICustomNPCsEvent { Event getEvent(); + /** + * @hookName forgeWorld + */ interface WorldEvent extends IForgeEvent { IWorld getWorld(); } + /** + * @hookName forgeEntity + */ interface EntityEvent extends IForgeEvent { IEntity getEntity(); } + /** + * @hookName forgeInit + */ interface InitEvent extends IForgeEvent { } } diff --git a/java/noppes/npcs/api/event/IItemEvent.java b/java/noppes/npcs/api/event/IItemEvent.java index e522695..c6c2bde 100644 --- a/java/noppes/npcs/api/event/IItemEvent.java +++ b/java/noppes/npcs/api/event/IItemEvent.java @@ -13,6 +13,9 @@ public interface IItemEvent extends ICustomNPCsEvent { interface InitEvent extends IItemEvent { } + /** + * @hookName tick + */ interface UpdateEvent extends IItemEvent { IEntity getEntity(); } @@ -60,6 +63,9 @@ public interface IItemEvent extends ICustomNPCsEvent { IEntity getSwingingEntity(); } + /** + * @hookName startItem + */ interface StartUsingItem extends IItemEvent { IPlayer getPlayer(); @@ -72,12 +78,18 @@ public interface IItemEvent extends ICustomNPCsEvent { int getDuration(); } + /** + * @hookName stopItem + */ interface StopUsingItem extends IItemEvent { IPlayer getPlayer(); int getDuration(); } + /** + * @hookName finishItem + */ interface FinishUsingItem extends IItemEvent { IPlayer getPlayer(); diff --git a/java/noppes/npcs/api/event/ILinkedItemEvent.java b/java/noppes/npcs/api/event/ILinkedItemEvent.java index d9f91b1..6e9194c 100644 --- a/java/noppes/npcs/api/event/ILinkedItemEvent.java +++ b/java/noppes/npcs/api/event/ILinkedItemEvent.java @@ -2,7 +2,9 @@ package noppes.npcs.api.event; public interface ILinkedItemEvent extends IItemEvent { - // Version Change Event + /** + * @hookName versionChanged + */ interface VersionChangeEvent extends IItemEvent { int getVersion(); @@ -10,6 +12,9 @@ public interface ILinkedItemEvent extends IItemEvent { int getPreviousVersion(); } + /** + * @hookName buildingItem + */ interface BuildEvent extends IItemEvent { } } diff --git a/java/noppes/npcs/api/event/INpcEvent.java b/java/noppes/npcs/api/event/INpcEvent.java index d6bfa85..adcc400 100644 --- a/java/noppes/npcs/api/event/INpcEvent.java +++ b/java/noppes/npcs/api/event/INpcEvent.java @@ -57,6 +57,9 @@ public interface INpcEvent extends ICustomNPCsEvent { float getDamage(); } + /** + * @hookName meleeSwing + */ interface SwingEvent extends INpcEvent { /** @@ -66,10 +69,16 @@ public interface INpcEvent extends ICustomNPCsEvent { IItemStack getItemStack(); } + /** + * @hookName kills + */ interface KilledEntityEvent { IEntityLivingBase getEntity(); } + /** + * @hookName killed + */ @Cancelable interface DiedEvent extends INpcEvent { IEntity getSource(); @@ -127,6 +136,9 @@ public interface INpcEvent extends ICustomNPCsEvent { IEntityLivingBase getTarget(); } + /** + * @hookName tick + */ interface UpdateEvent extends INpcEvent { } diff --git a/java/noppes/npcs/api/event/IPlayerEvent.java b/java/noppes/npcs/api/event/IPlayerEvent.java index 15d6619..82e82f8 100644 --- a/java/noppes/npcs/api/event/IPlayerEvent.java +++ b/java/noppes/npcs/api/event/IPlayerEvent.java @@ -73,6 +73,9 @@ public interface IPlayerEvent extends ICustomNPCsEvent { interface RespawnEvent extends IPlayerEvent { } + /** + * @hookName changedDim + */ interface ChangedDimension extends IPlayerEvent { int getFromDim(); @@ -105,6 +108,9 @@ public interface IPlayerEvent extends ICustomNPCsEvent { interface LightningEvent extends IPlayerEvent { } + /** + * @hookName playSound + */ @Cancelable interface SoundEvent extends IPlayerEvent { String getName(); @@ -122,10 +128,16 @@ public interface IPlayerEvent extends ICustomNPCsEvent { interface JumpEvent extends IPlayerEvent { } + /** + * @hookName kills + */ interface KilledEntityEvent extends IPlayerEvent { IEntityLivingBase getEntity(); } + /** + * @hookName killed + */ interface DiedEvent extends IPlayerEvent { IDamageSource getDamageSource(); @@ -198,12 +210,18 @@ public interface IPlayerEvent extends ICustomNPCsEvent { IPlayer getPlayer(); } + /** + * @hookName tick + */ interface UpdateEvent extends IPlayerEvent { } interface InitEvent extends IPlayerEvent { } + /** + * @hookName startItem + */ interface StartUsingItem extends IPlayerEvent { IItemStack getItem(); @@ -216,18 +234,27 @@ public interface IPlayerEvent extends ICustomNPCsEvent { int getDuration(); } + /** + * @hookName stopItem + */ interface StopUsingItem extends IPlayerEvent { IItemStack getItem(); int getDuration(); } + /** + * @hookName finishItem + */ interface FinishUsingItem extends IPlayerEvent { IItemStack getItem(); int getDuration(); } + /** + * @hookName breakBlock + */ @Cancelable interface BreakEvent extends IPlayerEvent { IBlock getBlock(); @@ -284,12 +311,23 @@ public interface IPlayerEvent extends ICustomNPCsEvent { IPlayerEffect getEffect(); + /** + * @hookName onEffectAdd + */ interface Added extends EffectEvent { } + + /** + * @hookName onEffectTick + */ interface Ticked extends EffectEvent { } + + /** + * @hookName onEffectRemove + */ interface Removed extends EffectEvent { /** @@ -323,6 +361,9 @@ public interface IPlayerEvent extends ICustomNPCsEvent { */ boolean isPost(); + /** + * @hookName profileChange + */ @Cancelable interface Changed extends ProfileEvent { /** @@ -331,9 +372,15 @@ public interface IPlayerEvent extends ICustomNPCsEvent { int getPrevSlot(); } + /** + * @hookName profileCreate + */ @Cancelable interface Create extends ProfileEvent {} + /** + * @hookName profileRemove + */ @Cancelable interface Removed extends ProfileEvent {} } diff --git a/java/noppes/npcs/api/event/IProjectileEvent.java b/java/noppes/npcs/api/event/IProjectileEvent.java index 657c68d..949318f 100644 --- a/java/noppes/npcs/api/event/IProjectileEvent.java +++ b/java/noppes/npcs/api/event/IProjectileEvent.java @@ -9,9 +9,15 @@ public interface IProjectileEvent extends ICustomNPCsEvent { public IProjectile getProjectile(); public IEntity getSource(); + /** + * @hookName projectileTick + */ interface UpdateEvent extends IProjectileEvent { } + /** + * @hookName projectileImpact + */ interface ImpactEvent extends IProjectileEvent { public int getType(); public IEntity getEntity(); diff --git a/java/noppes/npcs/api/event/IQuestEvent.java b/java/noppes/npcs/api/event/IQuestEvent.java index 997c377..a871bc6 100644 --- a/java/noppes/npcs/api/event/IQuestEvent.java +++ b/java/noppes/npcs/api/event/IQuestEvent.java @@ -15,6 +15,9 @@ public interface IQuestEvent extends IPlayerEvent { interface QuestStartEvent extends IQuestEvent { } + /** + * @hookName questTurnIn + */ @Cancelable interface QuestTurnedInEvent extends IQuestEvent { void setExpReward(int expReward); From 5cd0888511c6ab16fa454919c6269e4013bbc965 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 10 Jan 2026 23:05:56 -0500 Subject: [PATCH 08/93] Update IAbility.java --- java/noppes/npcs/api/ability/IAbility.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 94e16c0..9d9ac16 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -124,16 +124,6 @@ public interface IAbility { */ void setInterruptible(boolean interruptible); - /** - * Get the damage threshold for interruption. - */ - float getInterruptThreshold(); - - /** - * Set the damage threshold for interruption. - */ - void setInterruptThreshold(float threshold); - /** * Check if this ability is currently being executed. */ From 48cfcb3ea529e79b0ba18fdd4ba768bf6275c75e Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 11 Jan 2026 17:14:59 -0500 Subject: [PATCH 09/93] Add Script Hook Handler for Registering Script Hooks --- java/noppes/npcs/api/AbstractNpcAPI.java | 24 ++++- .../npcs/api/handler/IScriptHookHandler.java | 96 +++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 java/noppes/npcs/api/handler/IScriptHookHandler.java diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 027f66a..b6d568b 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -16,7 +16,21 @@ import noppes.npcs.api.entity.ICustomNpc; import noppes.npcs.api.entity.IEntity; import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.gui.ICustomGui; -import noppes.npcs.api.handler.*; +import noppes.npcs.api.handler.IActionManager; +import noppes.npcs.api.handler.IAnimationHandler; +import noppes.npcs.api.handler.IAttributeHandler; +import noppes.npcs.api.handler.ICloneHandler; +import noppes.npcs.api.handler.ICustomEffectHandler; +import noppes.npcs.api.handler.IDialogHandler; +import noppes.npcs.api.handler.IFactionHandler; +import noppes.npcs.api.handler.IMagicHandler; +import noppes.npcs.api.handler.INaturalSpawnsHandler; +import noppes.npcs.api.handler.IPartyHandler; +import noppes.npcs.api.handler.IProfileHandler; +import noppes.npcs.api.handler.IQuestHandler; +import noppes.npcs.api.handler.IRecipeHandler; +import noppes.npcs.api.handler.IScriptHookHandler; +import noppes.npcs.api.handler.ITransportHandler; import noppes.npcs.api.handler.data.IAnimation; import noppes.npcs.api.handler.data.IFrame; import noppes.npcs.api.handler.data.IFramePart; @@ -151,6 +165,14 @@ public abstract class AbstractNpcAPI { public abstract IAnimationHandler getAnimations(); + /** + * Get the script hook handler for registering custom hooks. + * Addon mods can use this to register hooks that will appear in script editor GUIs. + * + * @return The script hook handler + */ + public abstract IScriptHookHandler getScriptHooks(); + public abstract String[] getAllBiomeNames(); public abstract ICustomNpc createNPC(IWorld var1); diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java new file mode 100644 index 0000000..37df4b5 --- /dev/null +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -0,0 +1,96 @@ +package noppes.npcs.api.handler; + +import java.util.List; + +/** + * Handler for registering and retrieving script hooks. + * Addon mods can register custom hooks that will appear in the script editor GUIs. + * + * Available contexts: + * - "npc" - NPC script editor + * - "player" - Player scripts editor + * - "block" - Scripted block editor + * - "item" - Scripted item editor + * - "linked_item" - Linked item editor + * - "forge" - Forge scripts editor + * - "global_npc" - Global NPC scripts editor + * - "recipe" - Recipe scripts editor + * - "effect" - Custom effect scripts editor + */ +public interface IScriptHookHandler { + + // Context constants + String CONTEXT_NPC = "npc"; + String CONTEXT_PLAYER = "player"; + String CONTEXT_BLOCK = "block"; + String CONTEXT_ITEM = "item"; + String CONTEXT_LINKED_ITEM = "linked_item"; + String CONTEXT_FORGE = "forge"; + String CONTEXT_GLOBAL_NPC = "global_npc"; + String CONTEXT_RECIPE = "recipe"; + String CONTEXT_EFFECT = "effect"; + + /** + * Register a hook for a single context. + * + * @param context The context identifier (e.g., "npc", "player", "block") + * @param functionName The script function name (e.g., "onMyCustomEvent") + */ + void registerHook(String context, String functionName); + + /** + * Register a hook for multiple contexts at once. + * + * @param functionName The script function name + * @param contexts The contexts where this hook should appear + */ + void registerHooks(String functionName, String... contexts); + + /** + * Unregister a hook from a specific context. + * + * @param context The context to remove the hook from + * @param functionName The function name to remove + */ + void unregisterHook(String context, String functionName); + + /** + * Unregister a hook from all contexts. + * + * @param functionName The function name to remove + */ + void unregisterHookFromAll(String functionName); + + /** + * Get all registered addon hooks for a context. + * This does not include built-in hooks. + * + * @param context The context identifier + * @return List of hook function names for that context + */ + List getAddonHooks(String context); + + /** + * Get all hooks (built-in + addon) for a context. + * + * @param context The context identifier + * @return List of all hook function names for that context + */ + List getAllHooks(String context); + + /** + * Check if a hook is registered in a specific context. + * + * @param context The context to check + * @param functionName The function name to look for + * @return true if the hook is registered + */ + boolean hasHook(String context, String functionName); + + /** + * Get all available context identifiers. + * + * @return Array of context strings + */ + String[] getContexts(); +} From 95152bdb632d749636242c6c4b4fcaf2985f6e4c Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 11 Jan 2026 20:34:45 -0500 Subject: [PATCH 10/93] Update IScriptHookHandler.java --- java/noppes/npcs/api/handler/IScriptHookHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index 37df4b5..2c89098 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -26,7 +26,6 @@ public interface IScriptHookHandler { String CONTEXT_ITEM = "item"; String CONTEXT_LINKED_ITEM = "linked_item"; String CONTEXT_FORGE = "forge"; - String CONTEXT_GLOBAL_NPC = "global_npc"; String CONTEXT_RECIPE = "recipe"; String CONTEXT_EFFECT = "effect"; From 339e0f164e8c7b08c3469f61027fa25aa9e5c118 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 22 Jan 2026 12:38:49 -0500 Subject: [PATCH 11/93] Add Player Currency, Stock Options, Trader Syncing API --- java/noppes/npcs/api/entity/IPlayer.java | 67 ++++++++ .../npcs/api/handler/IPlayerCurrencyData.java | 62 ++++++++ java/noppes/npcs/api/handler/IPlayerData.java | 2 + java/noppes/npcs/api/roles/IRoleTrader.java | 150 ++++++++++++++++++ 4 files changed, 281 insertions(+) create mode 100644 java/noppes/npcs/api/handler/IPlayerCurrencyData.java diff --git a/java/noppes/npcs/api/entity/IPlayer.java b/java/noppes/npcs/api/entity/IPlayer.java index 14610af..ba3a1f9 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -675,4 +675,71 @@ public interface IPlayer extends IEntityLivingBase, IPlayer[] getPartyMembers(); + + // ========================================= + // Currency Methods + // ========================================= + + /** + * Gets the player's current currency balance. + * If Vault is configured and available, returns Vault balance. + * Otherwise returns CNPC+ built-in currency balance. + * + * @return The player's currency balance + */ + long getCurrencyBalance(); + + /** + * Sets the player's currency balance. + * If Vault is configured and available, sets Vault balance. + * Otherwise sets CNPC+ built-in currency balance. + * + * @param amount The new balance + */ + void setCurrencyBalance(long amount); + + /** + * Deposits (adds) currency to the player's balance. + * If Vault is configured and available, deposits to Vault. + * Otherwise deposits to CNPC+ built-in currency. + * + * @param amount The amount to deposit + * @return true if successful, false if would exceed max balance + */ + boolean depositCurrency(long amount); + + /** + * Withdraws (removes) currency from the player's balance. + * If Vault is configured and available, withdraws from Vault. + * Otherwise withdraws from CNPC+ built-in currency. + * + * @param amount The amount to withdraw + * @return true if successful, false if insufficient funds + */ + boolean withdrawCurrency(long amount); + + /** + * Checks if the player can afford the specified amount. + * If Vault is configured and available, checks Vault balance. + * Otherwise checks CNPC+ built-in currency balance. + * + * @param amount The amount to check + * @return true if the player has enough currency + */ + boolean canAffordCurrency(long amount); + + /** + * Checks if Vault is being used for currency operations. + * + * @return true if Vault is configured AND available, false if using CNPC+ built-in currency + */ + boolean isUsingVaultCurrency(); + + /** + * Gets the player's formatted currency balance for display. + * Uses Vault formatting if Vault is active, otherwise uses CNPC+ formatting. + * + * @return The formatted balance string + */ + String getFormattedCurrencyBalance(); } diff --git a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java b/java/noppes/npcs/api/handler/IPlayerCurrencyData.java new file mode 100644 index 0000000..5e41452 --- /dev/null +++ b/java/noppes/npcs/api/handler/IPlayerCurrencyData.java @@ -0,0 +1,62 @@ +package noppes.npcs.api.handler; + +/** + * Interface for player currency data. + * Note: If Vault integration is enabled in config, these operations + * will use the Vault economy instead of CNPC+ built-in currency. + */ +public interface IPlayerCurrencyData { + + /** + * Get the current balance + */ + long getBalance(); + + /** + * Set the balance directly + * @param balance The new balance + */ + void setBalance(long balance); + + /** + * Add currency to balance (deposit) + * @param amount Amount to add + * @return true if successful, false if would exceed max balance + */ + boolean deposit(long amount); + + /** + * Remove currency from balance (withdraw) + * @param amount Amount to remove + * @return true if successful, false if insufficient funds + */ + boolean withdraw(long amount); + + /** + * Check if player can afford an amount + * @param amount Amount to check + * @return true if player has enough balance + */ + boolean canAfford(long amount); + + /** + * Get lifetime earned currency + */ + long getLifetimeEarned(); + + /** + * Get lifetime spent currency + */ + long getLifetimeSpent(); + + /** + * Format the balance for display + */ + String formatBalance(); + + /** + * Check if Vault is being used for currency operations + * @return true if Vault is handling currency, false if using CNPC+ built-in + */ + boolean isUsingVault(); +} diff --git a/java/noppes/npcs/api/handler/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index 88c1ce5..cbcb397 100644 --- a/java/noppes/npcs/api/handler/IPlayerData.java +++ b/java/noppes/npcs/api/handler/IPlayerData.java @@ -25,5 +25,7 @@ public interface IPlayerData { IPlayerMailData getMailData(); + IPlayerCurrencyData getCurrencyData(); + void save(); } diff --git a/java/noppes/npcs/api/roles/IRoleTrader.java b/java/noppes/npcs/api/roles/IRoleTrader.java index 69ee2b3..3f43146 100644 --- a/java/noppes/npcs/api/roles/IRoleTrader.java +++ b/java/noppes/npcs/api/roles/IRoleTrader.java @@ -116,4 +116,154 @@ public interface IRoleTrader extends IRole { * @param player */ void enableSlot(int slot, IPlayer player); + + // ==================== Stock System ==================== + + /** + * @return Whether stock system is enabled + */ + boolean isStockEnabled(); + + /** + * Enable or disable stock system + */ + void setStockEnabled(boolean enabled); + + /** + * @return Whether stock is tracked per-player (true) or globally (false) + */ + boolean isPerPlayerStock(); + + /** + * Set whether stock is per-player or global + */ + void setPerPlayerStock(boolean perPlayer); + + /** + * Get the stock reset type + * @return 0=NONE, 1=MCDAILY, 2=MCWEEKLY, 3=MCCUSTOM, 4=RLDAILY, 5=RLWEEKLY, 6=RLCUSTOM + */ + int getStockResetType(); + + /** + * Set stock reset type + * @param type 0=NONE, 1=MCDAILY, 2=MCWEEKLY, 3=MCCUSTOM, 4=RLDAILY, 5=RLWEEKLY, 6=RLCUSTOM + */ + void setStockResetType(int type); + + /** + * Get custom reset time (only used for MCCUSTOM/RLCUSTOM) + * @return Custom time in ticks (MC) or milliseconds (RL) + */ + long getCustomResetTime(); + + /** + * Set custom reset time + * @param time Time in ticks (MC) or milliseconds (RL) + */ + void setCustomResetTime(long time); + + /** + * Get max stock for a slot + * @param slot Slot number 0-17 + * @return Max stock, -1 = unlimited + */ + int getMaxStock(int slot); + + /** + * Set max stock for a slot + * @param slot Slot number 0-17 + * @param amount Max stock, -1 = unlimited + */ + void setMaxStock(int slot, int amount); + + /** + * Get available stock for a slot (global mode) + * @param slot Slot number 0-17 + * @return Available stock, Integer.MAX_VALUE if unlimited + */ + int getAvailableStock(int slot); + + /** + * Get available stock for a slot for a specific player (per-player mode) + * @param slot Slot number 0-17 + * @param player The player + * @return Available stock, Integer.MAX_VALUE if unlimited + */ + int getAvailableStock(int slot, IPlayer player); + + /** + * Reset all stock to max values + */ + void resetStock(); + + /** + * Reset the cooldown timer without resetting stock values + * Stock will reset on next trigger after this is called + */ + void resetCooldown(); + + /** + * Get current stock for a slot (global mode) + * @param slot Slot number 0-17 + * @return Current stock, -1 if not initialized + */ + int getCurrentStock(int slot); + + /** + * Set current stock for a slot (global mode only) + * @param slot Slot number 0-17 + * @param amount Current stock amount + */ + void setCurrentStock(int slot, int amount); + + /** + * Get purchased amount for a player in a slot (per-player mode) + * @param slot Slot number 0-17 + * @param player The player + * @return Purchased amount (stock available = maxStock - purchasedAmount) + */ + int getPlayerPurchased(int slot, IPlayer player); + + /** + * Set purchased amount for a player in a slot (per-player mode) + * @param slot Slot number 0-17 + * @param player The player + * @param amount Purchased amount + */ + void setPlayerPurchased(int slot, IPlayer player, int amount); + + /** + * Get the timestamp of the last stock reset + * @return Time in ticks (MC) or milliseconds (RL), depending on reset type + */ + long getLastResetTime(); + + /** + * Get time remaining until next stock reset + * @return Time remaining in ticks (MC) or milliseconds (RL), -1 if no reset scheduled + */ + long getTimeUntilReset(); + + // ==================== Currency Cost System ==================== + + /** + * Get the currency cost for a slot (additive to item costs) + * @param slot Slot number 0-17 + * @return Currency cost, 0 = no cost + */ + long getCurrencyCost(int slot); + + /** + * Set the currency cost for a slot (additive to item costs) + * @param slot Slot number 0-17 + * @param cost Currency cost, 0 = no cost + */ + void setCurrencyCost(int slot, long cost); + + /** + * @param slot Slot number 0-17 + * @return Whether this slot has a currency cost > 0 + */ + boolean hasCurrencyCost(int slot); } From c962f678a4f1bb83194d805cf3b5681fd5c70b1a Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 22 Jan 2026 14:25:22 -0500 Subject: [PATCH 12/93] Remove Contexts from Hook Handler --- java/noppes/npcs/api/handler/IScriptHookHandler.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index 2c89098..a0674ca 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -16,19 +16,11 @@ import java.util.List; * - "global_npc" - Global NPC scripts editor * - "recipe" - Recipe scripts editor * - "effect" - Custom effect scripts editor + * + * Note: Context constants are deprecated. Use ScriptContext.XXX.hookContext instead. */ public interface IScriptHookHandler { - // Context constants - String CONTEXT_NPC = "npc"; - String CONTEXT_PLAYER = "player"; - String CONTEXT_BLOCK = "block"; - String CONTEXT_ITEM = "item"; - String CONTEXT_LINKED_ITEM = "linked_item"; - String CONTEXT_FORGE = "forge"; - String CONTEXT_RECIPE = "recipe"; - String CONTEXT_EFFECT = "effect"; - /** * Register a hook for a single context. * From 87394b9723d0333756aaa38975f55db31871235d Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Thu, 22 Jan 2026 22:57:04 +0200 Subject: [PATCH 13/93] Forgot API ScriptHookController --- java/noppes/npcs/api/handler/IScriptHookHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index a0674ca..da62eef 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -1,5 +1,7 @@ package noppes.npcs.api.handler; +import noppes.npcs.constants.ScriptContext; + import java.util.List; /** @@ -21,6 +23,10 @@ import java.util.List; */ public interface IScriptHookHandler { + void registerHooks(ScriptContext context, String functionName); + + void registerHooks(ScriptContext context, String... functionNames); + /** * Register a hook for a single context. * From 6fe282f3c69258ab762f840d78388316e1497b68 Mon Sep 17 00:00:00 2001 From: bigguy345 Date: Fri, 23 Jan 2026 00:04:09 +0200 Subject: [PATCH 14/93] fixd ScriptHookController --- java/noppes/npcs/api/handler/IScriptHookHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index da62eef..eb5cc7e 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -23,7 +23,7 @@ import java.util.List; */ public interface IScriptHookHandler { - void registerHooks(ScriptContext context, String functionName); + void registerHook(ScriptContext context, String functionName); void registerHooks(ScriptContext context, String... functionNames); From b90df20fc42f11f7ff69e79792881ebc209735eb Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 22 Jan 2026 17:27:46 -0500 Subject: [PATCH 15/93] Update IScriptHookHandler.java --- java/noppes/npcs/api/handler/IScriptHookHandler.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index eb5cc7e..3c7f74e 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -1,7 +1,5 @@ package noppes.npcs.api.handler; -import noppes.npcs.constants.ScriptContext; - import java.util.List; /** @@ -18,15 +16,9 @@ import java.util.List; * - "global_npc" - Global NPC scripts editor * - "recipe" - Recipe scripts editor * - "effect" - Custom effect scripts editor - * - * Note: Context constants are deprecated. Use ScriptContext.XXX.hookContext instead. */ public interface IScriptHookHandler { - void registerHook(ScriptContext context, String functionName); - - void registerHooks(ScriptContext context, String... functionNames); - /** * Register a hook for a single context. * From 7a337a5704c442fb98a0fd4e0ba26210cb54af98 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 22 Jan 2026 17:58:06 -0500 Subject: [PATCH 16/93] Hook Definition --- .../npcs/api/handler/IHookDefinition.java | 106 ++++++++++++++++++ .../npcs/api/handler/IScriptHookHandler.java | 73 ++++++++++-- 2 files changed, 168 insertions(+), 11 deletions(-) create mode 100644 java/noppes/npcs/api/handler/IHookDefinition.java diff --git a/java/noppes/npcs/api/handler/IHookDefinition.java b/java/noppes/npcs/api/handler/IHookDefinition.java new file mode 100644 index 0000000..6068203 --- /dev/null +++ b/java/noppes/npcs/api/handler/IHookDefinition.java @@ -0,0 +1,106 @@ +package noppes.npcs.api.handler; + +/** + * Defines metadata for a script hook, enabling rich hook registration with proper + * type information for stub generation, imports, and documentation. + * + *

Design Decision

+ * Uses {@code String eventClassName} instead of {@code Class} in the API to avoid + * classloading issues with addons (addon classes may not be loaded when hooks are registered). + * + *

Usage Example

+ *
{@code
+ * // Addon registration with full metadata
+ * IScriptHookHandler hooks = NpcAPI.Instance().getScriptHooks();
+ * hooks.registerHookDefinition("player", HookDefinition.builder("onDBCTransform")
+ *     .eventClass("com.dbc.api.event.IDBCEvent$TransformEvent")
+ *     .paramNames("event")
+ *     .requiredImports("com.dbc.api.event.IDBCEvent")
+ *     .cancelable(true)
+ *     .build());
+ * }
+ */ +public interface IHookDefinition { + + /** + * The hook name (function name in scripts). + * + * @return Hook name, e.g., "questStart", "onDBCTransform" + */ + String hookName(); + + /** + * Full qualified class name of the event type. + * Uses '$' for nested classes (e.g., "noppes.npcs.api.event.IQuestEvent$QuestStartEvent"). + * + * @return Fully qualified event class name, or null if unknown + */ + String eventClassName(); + + /** + * Parameter names for stub generation. + * + * @return Array of parameter names, defaults to ["event"] + */ + String[] paramNames(); + + /** + * Imports required for this hook's event type. + * These will be added to the script's default imports. + * + * @return Array of fully qualified class/package names to import + */ + String[] requiredImports(); + + /** + * Whether the event is cancelable (has @Cancelable annotation). + * + * @return true if event can be canceled + */ + boolean isCancelable(); + + /** + * Lazily resolve the event class. Returns null if class is not available + * (e.g., addon not loaded). + * + * @return The event class, or null if unavailable + */ + default Class getEventClass() { + String className = eventClassName(); + if (className == null || className.isEmpty()) { + return null; + } + try { + return Class.forName(className); + } catch (ClassNotFoundException e) { + return null; + } + } + + /** + * Generate a usable type name for stub generation. + * Handles nested classes by converting '$' to '.'. + * + *

Examples:

+ *
    + *
  • "noppes.npcs.api.event.IQuestEvent$QuestStartEvent" → "IQuestEvent.QuestStartEvent"
  • + *
  • "com.example.MyEvent" → "MyEvent"
  • + *
+ * + * @return The usable type name for code generation, or null if no event class + */ + default String getUsableTypeName() { + String className = eventClassName(); + if (className == null || className.isEmpty()) { + return null; + } + + int lastDot = className.lastIndexOf('.'); + if (lastDot < 0) { + return className.replace('$', '.'); + } + + String simplePart = className.substring(lastDot + 1); + return simplePart.replace('$', '.'); + } +} diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index 3c7f74e..178239d 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -6,21 +6,72 @@ import java.util.List; * Handler for registering and retrieving script hooks. * Addon mods can register custom hooks that will appear in the script editor GUIs. * - * Available contexts: - * - "npc" - NPC script editor - * - "player" - Player scripts editor - * - "block" - Scripted block editor - * - "item" - Scripted item editor - * - "linked_item" - Linked item editor - * - "forge" - Forge scripts editor - * - "global_npc" - Global NPC scripts editor - * - "recipe" - Recipe scripts editor - * - "effect" - Custom effect scripts editor + *

Available contexts:

+ *
    + *
  • "npc" - NPC script editor
  • + *
  • "player" - Player scripts editor
  • + *
  • "block" - Scripted block editor
  • + *
  • "item" - Scripted item editor
  • + *
  • "linked_item" - Linked item editor
  • + *
  • "forge" - Forge scripts editor
  • + *
  • "global_npc" - Global NPC scripts editor
  • + *
  • "recipe" - Recipe scripts editor
  • + *
  • "effect" - Custom effect scripts editor
  • + *
+ * + *

Rich Hook Registration (Recommended)

+ * Use {@link #registerHookDefinition(String, IHookDefinition)} for full metadata support: + *
{@code
+ * hooks.registerHookDefinition("player", HookDefinition.builder("onDBCTransform")
+ *     .eventClass(IDBCEvent.TransformEvent.class)
+ *     .requiredImports("com.dbc.api.event.IDBCEvent")
+ *     .cancelable(true)
+ *     .build());
+ * }
*/ public interface IScriptHookHandler { + // ==================== RICH HOOK REGISTRATION (NEW) ==================== + /** - * Register a hook for a single context. + * Register a hook with full metadata including event type, imports, and cancelability. + * This is the recommended way to register addon hooks. + * + * @param context The context identifier (e.g., "npc", "player", "block") + * @param definition The hook definition containing all metadata + */ + void registerHookDefinition(String context, IHookDefinition definition); + + /** + * Get the hook definition for a specific hook. + * + * @param context The context identifier + * @param hookName The hook function name + * @return The hook definition, or null if not found or no metadata available + */ + IHookDefinition getHookDefinition(String context, String hookName); + + /** + * Get all hook definitions for a context. + * + * @param context The context identifier + * @return List of all hook definitions (may be empty, never null) + */ + List getAllHookDefinitions(String context); + + /** + * Get the current hook revision number. + * This increments each time a hook is registered, allowing caches to invalidate. + * + * @return The current revision number + */ + int getHookRevision(); + + // ==================== LEGACY HOOK REGISTRATION ==================== + + /** + * Register a hook for a single context (legacy method). + * Creates a minimal definition without event type metadata. * * @param context The context identifier (e.g., "npc", "player", "block") * @param functionName The script function name (e.g., "onMyCustomEvent") From 64fe8794e71d82f09449e6c916c7902fe890cab7 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 22 Jan 2026 19:55:48 -0500 Subject: [PATCH 17/93] True Cleaning --- .../npcs/api/handler/IScriptHookHandler.java | 85 ++++--------------- 1 file changed, 18 insertions(+), 67 deletions(-) diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index 178239d..a1eab86 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -19,23 +19,17 @@ import java.util.List; *
  • "effect" - Custom effect scripts editor
  • * * - *

    Rich Hook Registration (Recommended)

    - * Use {@link #registerHookDefinition(String, IHookDefinition)} for full metadata support: + *

    Hook Registration

    + * Use {@link #registerHookDefinition(String, IHookDefinition)} to register hooks: *
    {@code
    - * hooks.registerHookDefinition("player", HookDefinition.builder("onDBCTransform")
    - *     .eventClass(IDBCEvent.TransformEvent.class)
    - *     .requiredImports("com.dbc.api.event.IDBCEvent")
    - *     .cancelable(true)
    - *     .build());
    + * hooks.registerHookDefinition("player",
    + *     HookDefinition.of("onDBCTransform", IDBCEvent.TransformEvent.class));
      * }
    */ public interface IScriptHookHandler { - // ==================== RICH HOOK REGISTRATION (NEW) ==================== - /** - * Register a hook with full metadata including event type, imports, and cancelability. - * This is the recommended way to register addon hooks. + * Register a hook with full metadata including event type and imports. * * @param context The context identifier (e.g., "npc", "player", "block") * @param definition The hook definition containing all metadata @@ -47,7 +41,7 @@ public interface IScriptHookHandler { * * @param context The context identifier * @param hookName The hook function name - * @return The hook definition, or null if not found or no metadata available + * @return The hook definition, or null if not found */ IHookDefinition getHookDefinition(String context, String hookName); @@ -60,61 +54,10 @@ public interface IScriptHookHandler { List getAllHookDefinitions(String context); /** - * Get the current hook revision number. - * This increments each time a hook is registered, allowing caches to invalidate. - * - * @return The current revision number - */ - int getHookRevision(); - - // ==================== LEGACY HOOK REGISTRATION ==================== - - /** - * Register a hook for a single context (legacy method). - * Creates a minimal definition without event type metadata. - * - * @param context The context identifier (e.g., "npc", "player", "block") - * @param functionName The script function name (e.g., "onMyCustomEvent") - */ - void registerHook(String context, String functionName); - - /** - * Register a hook for multiple contexts at once. - * - * @param functionName The script function name - * @param contexts The contexts where this hook should appear - */ - void registerHooks(String functionName, String... contexts); - - /** - * Unregister a hook from a specific context. - * - * @param context The context to remove the hook from - * @param functionName The function name to remove - */ - void unregisterHook(String context, String functionName); - - /** - * Unregister a hook from all contexts. - * - * @param functionName The function name to remove - */ - void unregisterHookFromAll(String functionName); - - /** - * Get all registered addon hooks for a context. - * This does not include built-in hooks. + * Get all hook names for a context. * * @param context The context identifier - * @return List of hook function names for that context - */ - List getAddonHooks(String context); - - /** - * Get all hooks (built-in + addon) for a context. - * - * @param context The context identifier - * @return List of all hook function names for that context + * @return List of all hook function names */ List getAllHooks(String context); @@ -122,10 +65,18 @@ public interface IScriptHookHandler { * Check if a hook is registered in a specific context. * * @param context The context to check - * @param functionName The function name to look for + * @param hookName The function name to look for * @return true if the hook is registered */ - boolean hasHook(String context, String functionName); + boolean hasHook(String context, String hookName); + + /** + * Get the current hook revision number. + * This increments each time a hook is registered, allowing caches to invalidate. + * + * @return The current revision number + */ + int getHookRevision(); /** * Get all available context identifiers. From a6b4a131c843f27bbd3c561168f18498cb9d59ec Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 22 Jan 2026 23:07:36 -0500 Subject: [PATCH 18/93] Large Cleanup to Code Imports and Formatting --- README.md | 7 +- .../minecraft/block/properties/IProperty.java | 9 +- .../minecraft/block/state/IBlockState.java | 7 +- java/net/minecraft/util/Vec3i.java | 85 +++--- java/net/minecraft/util/math/BlockPos.java | 244 +++++++----------- java/noppes/npcs/api/AbstractNpcAPI.java | 23 +- java/noppes/npcs/api/IBlock.java | 2 +- java/noppes/npcs/api/IContainer.java | 4 +- java/noppes/npcs/api/INbt.java | 8 +- java/noppes/npcs/api/IParticle.java | 114 +++++--- java/noppes/npcs/api/IPos.java | 1 - java/noppes/npcs/api/ISkinOverlay.java | 14 +- java/noppes/npcs/api/ITileEntity.java | 1 + java/noppes/npcs/api/ITimers.java | 8 +- java/noppes/npcs/api/IWorld.java | 103 +++++--- .../npcs/api/ability/IAbilityHandler.java | 2 +- .../noppes/npcs/api/block/IBlockScripted.java | 1 + java/noppes/npcs/api/entity/ICustomNpc.java | 8 +- java/noppes/npcs/api/entity/IEntity.java | 5 +- .../noppes/npcs/api/entity/IEntityLiving.java | 1 - java/noppes/npcs/api/entity/IPixelmon.java | 6 +- java/noppes/npcs/api/entity/IPlayer.java | 30 ++- java/noppes/npcs/api/entity/IVillager.java | 1 - java/noppes/npcs/api/event/IAbilityEvent.java | 1 - java/noppes/npcs/api/event/IBlockEvent.java | 21 +- java/noppes/npcs/api/event/INpcEvent.java | 3 +- java/noppes/npcs/api/event/IPartyEvent.java | 3 +- java/noppes/npcs/api/event/IPlayerEvent.java | 8 +- .../npcs/api/event/IProjectileEvent.java | 3 + java/noppes/npcs/api/gui/ICustomGui.java | 9 +- .../npcs/api/handler/IAbilityHandler.java | 2 +- .../npcs/api/handler/IActionManager.java | 36 +-- .../npcs/api/handler/IAttributeHandler.java | 2 +- .../npcs/api/handler/ICloneHandler.java | 2 + .../npcs/api/handler/IPlayerCurrencyData.java | 5 + java/noppes/npcs/api/handler/IPlayerData.java | 1 + .../npcs/api/handler/IPlayerQuestData.java | 2 +- .../npcs/api/handler/IScriptHookHandler.java | 6 +- .../noppes/npcs/api/handler/data/IAction.java | 22 +- .../npcs/api/handler/data/IActionChain.java | 5 +- .../npcs/api/handler/data/IAnvilRecipe.java | 4 +- .../noppes/npcs/api/handler/data/IDialog.java | 6 + .../npcs/api/handler/data/IDialogImage.java | 14 + .../npcs/api/handler/data/IFramePart.java | 2 +- .../npcs/api/handler/data/IMagicCycle.java | 4 +- .../npcs/api/handler/data/IMagicData.java | 4 +- java/noppes/npcs/api/handler/data/IParty.java | 8 +- .../npcs/api/handler/data/IPartyOptions.java | 8 +- .../api/handler/data/IProfileOptions.java | 8 +- .../npcs/api/handler/data/IQuestItem.java | 3 + .../npcs/api/handler/data/IQuestKill.java | 1 + .../npcs/api/handler/data/IQuestLocation.java | 3 + .../api/handler/data/IQuestObjective.java | 2 +- .../data/actions/IConditionalAction.java | 2 + java/noppes/npcs/api/item/IItemCustom.java | 10 + .../npcs/api/item/IItemCustomizable.java | 33 +++ java/noppes/npcs/api/item/IItemStack.java | 4 +- java/noppes/npcs/api/jobs/IJobBard.java | 6 +- java/noppes/npcs/api/jobs/IJobGuard.java | 3 + java/noppes/npcs/api/jobs/IJobHealer.java | 2 + .../noppes/npcs/api/overlay/IOverlayLine.java | 8 + java/noppes/npcs/api/package-info.java | 1 + java/noppes/npcs/api/roles/IRoleFollower.java | 20 +- java/noppes/npcs/api/roles/IRoleTrader.java | 42 ++- .../npcs/api/scoreboard/IScoreboard.java | 2 +- 65 files changed, 606 insertions(+), 409 deletions(-) diff --git a/README.md b/README.md index e8dbef2..c11cdcf 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # CustomNPC-Plus-API + External API for scripting and to allow mods/plugins to hook into CustomNPC+ ## How to use in a Mod -Basically just download the api code and include it in your mod. -In your mod you can check if CustomNPC+ is installed with `NpcAPI.IsAvailable()` +Basically just download the api code and include it in your mod. + +In your mod you can check if CustomNPC+ is installed with `NpcAPI.IsAvailable()` To use the events, register your events with `NpcAPI.Instance().events().register(youreventclass)` ## Extra + JavaDocs: https://kamkeel.github.io/CustomNPC-Plus/ [![Discord Badge](https://img.shields.io/badge/KAMKEEL_Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/pQqRTvFeJ5) diff --git a/java/net/minecraft/block/properties/IProperty.java b/java/net/minecraft/block/properties/IProperty.java index 046b17e..06ef729 100644 --- a/java/net/minecraft/block/properties/IProperty.java +++ b/java/net/minecraft/block/properties/IProperty.java @@ -2,10 +2,11 @@ package net.minecraft.block.properties; import java.util.Collection; -/** This code is owned by Minecraft */ +/** + * This code is owned by Minecraft + */ -public interface IProperty> -{ +public interface IProperty> { String getName(); Collection getAllowedValues(); @@ -16,4 +17,4 @@ public interface IProperty> * Get the name for the given value. */ String getName(T value); -} \ No newline at end of file +} diff --git a/java/net/minecraft/block/state/IBlockState.java b/java/net/minecraft/block/state/IBlockState.java index da591b8..ef8dacb 100644 --- a/java/net/minecraft/block/state/IBlockState.java +++ b/java/net/minecraft/block/state/IBlockState.java @@ -6,10 +6,11 @@ import net.minecraft.block.properties.IProperty; import java.util.Collection; -/** This code is owned by Minecraft */ +/** + * This code is owned by Minecraft + */ -public interface IBlockState -{ +public interface IBlockState { Collection getPropertyNames(); > T getValue(IProperty property); diff --git a/java/net/minecraft/util/Vec3i.java b/java/net/minecraft/util/Vec3i.java index cc672cd..9c7bdef 100644 --- a/java/net/minecraft/util/Vec3i.java +++ b/java/net/minecraft/util/Vec3i.java @@ -2,31 +2,42 @@ package net.minecraft.util; import com.google.common.base.Objects; -/** This code is owned by Minecraft */ +/** + * This code is owned by Minecraft + */ -public class Vec3i implements Comparable -{ - /** X coordinate */ +public class Vec3i implements Comparable { + /** + * X coordinate + */ private final int x; - /** Y coordinate */ + /** + * Y coordinate + */ private final int y; - /** Z coordinate */ + /** + * Z coordinate + */ private final int z; - /** Double X coordinate */ + /** + * Double X coordinate + */ private final double xd; - /** Double Y coordinate */ + /** + * Double Y coordinate + */ private final double yd; - /** Double Z coordinate */ + /** + * Double Z coordinate + */ private final double zd; - public Vec3i(int xIn, int yIn, int zIn) - { + public Vec3i(int xIn, int yIn, int zIn) { this((double) xIn, (double) yIn, (double) zIn); } - public Vec3i(double xIn, double yIn, double zIn) - { + public Vec3i(double xIn, double yIn, double zIn) { this.x = MathHelper.floor_double(xIn); this.y = MathHelper.floor_double(yIn); this.z = MathHelper.floor_double(zIn); @@ -35,54 +46,43 @@ public class Vec3i implements Comparable this.zd = zIn; } - public boolean equals(Object p_equals_1_) - { - if (this == p_equals_1_) - { + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { return true; - } - else if (!(p_equals_1_ instanceof Vec3i)) - { + } else if (!(p_equals_1_ instanceof Vec3i)) { return false; - } - else - { - Vec3i vec3I = (Vec3i)p_equals_1_; + } else { + Vec3i vec3I = (Vec3i) p_equals_1_; return this.getX() != vec3I.getX() ? false : (this.getY() != vec3I.getY() ? false : this.getZ() == vec3I.getZ()); } } - public int hashCode() - { + public int hashCode() { return (this.getY() + this.getZ() * 31) * 31 + this.getX(); } - public int compareTo(Vec3i p_compareTo_1_) - { + public int compareTo(Vec3i p_compareTo_1_) { return this.getY() == p_compareTo_1_.getY() ? (this.getZ() == p_compareTo_1_.getZ() ? this.getX() - p_compareTo_1_.getX() : this.getZ() - p_compareTo_1_.getZ()) : this.getY() - p_compareTo_1_.getY(); } /** * Get the X coordinate */ - public int getX() - { + public int getX() { return this.x; } /** * Get the Y coordinate */ - public int getY() - { + public int getY() { return this.y; } /** * Get the Z coordinate */ - public int getZ() - { + public int getZ() { return this.z; } @@ -90,37 +90,32 @@ public class Vec3i implements Comparable /** * Get the X coordinate as a double */ - public double getXD() - { + public double getXD() { return this.xd; } /** * Get the Y coordinate as a double */ - public double getYD() - { + public double getYD() { return this.yd; } /** * Get the Z coordinate as a double */ - public double getZD() - { + public double getZD() { return this.zd; } /** * Calculate the cross product of this and the given Vector */ - public Vec3i crossProduct(Vec3i vec) - { + public Vec3i crossProduct(Vec3i vec) { return new Vec3i(this.getYD() * vec.getZD() - this.getZD() * vec.getYD(), this.getZD() * vec.getXD() - this.getXD() * vec.getZD(), this.getXD() * vec.getYD() - this.getYD() * vec.getXD()); } - public String toString() - { + public String toString() { return Objects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); } -} \ No newline at end of file +} diff --git a/java/net/minecraft/util/math/BlockPos.java b/java/net/minecraft/util/math/BlockPos.java index 20b8857..131e037 100644 --- a/java/net/minecraft/util/math/BlockPos.java +++ b/java/net/minecraft/util/math/BlockPos.java @@ -17,10 +17,11 @@ import java.util.List; * Pasted in from 1.9, with the Vec3d constructor removed */ @Immutable -public class BlockPos extends Vec3i -{ +public class BlockPos extends Vec3i { private static final Logger LOGGER = LogManager.getLogger(); - /** The BlockPos with all coordinates 0 */ + /** + * The BlockPos with all coordinates 0 + */ public static final BlockPos ORIGIN = new BlockPos(0, 0, 0); private static final int NUM_X_BITS = 26; //1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000)); //Manually calculated because of crash private static final int NUM_Z_BITS = NUM_X_BITS; @@ -31,231 +32,193 @@ public class BlockPos extends Vec3i private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L; private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L; - public BlockPos(int x, int y, int z) - { + public BlockPos(int x, int y, int z) { super(x, y, z); } - public BlockPos(double x, double y, double z) - { + public BlockPos(double x, double y, double z) { super(x, y, z); } - public BlockPos(Entity source) - { + public BlockPos(Entity source) { this(source.posX, source.posY, source.posZ); } - public BlockPos(Vec3i source) - { + public BlockPos(Vec3i source) { this(source.getXD(), source.getYD(), source.getZD()); } /** * Add the given coordinates to the coordinates of this BlockPos */ - public BlockPos add(double x, double y, double z) - { + public BlockPos add(double x, double y, double z) { return x == 0.0D && y == 0.0D && z == 0.0D ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z); } /** * Add the given coordinates to the coordinates of this BlockPos */ - public BlockPos add(int x, int y, int z) - { + public BlockPos add(int x, int y, int z) { return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z); } /** * Add the given Vector to this BlockPos */ - public BlockPos add(Vec3i vec) - { + public BlockPos add(Vec3i vec) { return vec.getXD() == 0 && vec.getYD() == 0 && vec.getZD() == 0 ? this : new BlockPos(this.getXD() + vec.getXD(), this.getYD() + vec.getYD(), this.getZD() + vec.getZD()); } /** * Offset this BlockPos 1 block up */ - public BlockPos up() - { + public BlockPos up() { return this.up(1); } /** * Offset this BlockPos n blocks up */ - public BlockPos up(double n) - { + public BlockPos up(double n) { return this.offset(EnumFacing.UP, n); } /** * Offset this BlockPos 1 block down */ - public BlockPos down() - { + public BlockPos down() { return this.down(1); } /** * Offset this BlockPos n blocks down */ - public BlockPos down(double n) - { + public BlockPos down(double n) { return this.offset(EnumFacing.DOWN, n); } /** * Offset this BlockPos 1 block in northern direction */ - public BlockPos north() - { + public BlockPos north() { return this.north(1); } /** * Offset this BlockPos n blocks in northern direction */ - public BlockPos north(double n) - { + public BlockPos north(double n) { return this.offset(EnumFacing.NORTH, n); } /** * Offset this BlockPos 1 block in southern direction */ - public BlockPos south() - { + public BlockPos south() { return this.south(1); } /** * Offset this BlockPos n blocks in southern direction */ - public BlockPos south(double n) - { + public BlockPos south(double n) { return this.offset(EnumFacing.SOUTH, n); } /** * Offset this BlockPos 1 block in western direction */ - public BlockPos west() - { + public BlockPos west() { return this.west(1); } /** * Offset this BlockPos n blocks in western direction */ - public BlockPos west(double n) - { + public BlockPos west(double n) { return this.offset(EnumFacing.WEST, n); } /** * Offset this BlockPos 1 block in eastern direction */ - public BlockPos east() - { + public BlockPos east() { return this.east(1); } /** * Offset this BlockPos n blocks in eastern direction */ - public BlockPos east(double n) - { + public BlockPos east(double n) { return this.offset(EnumFacing.EAST, n); } /** * Offset this BlockPos 1 block in the given direction */ - public BlockPos offset(EnumFacing facing) - { + public BlockPos offset(EnumFacing facing) { return this.offset(facing, 1); } /** * Offsets this BlockPos n blocks in the given direction */ - public BlockPos offset(EnumFacing facing, double n) - { + public BlockPos offset(EnumFacing facing, double n) { return n == 0 ? this : new BlockPos(this.getXD() + facing.getFrontOffsetX() * n, this.getYD() + facing.getFrontOffsetY() * n, this.getZD() + facing.getFrontOffsetZ() * n); } /** * Calculate the cross product of this and the given Vector */ - public BlockPos crossProduct(Vec3i vec) - { + public BlockPos crossProduct(Vec3i vec) { return new BlockPos(this.getYD() * vec.getZD() - this.getZD() * vec.getYD(), this.getZD() * vec.getXD() - this.getXD() * vec.getZD(), this.getXD() * vec.getYD() - this.getYD() * vec.getXD()); } /** * Serialize this BlockPos into a long value */ - public long toLong() - { - return ((long)this.getX() & X_MASK) << X_SHIFT | ((long)this.getY() & Y_MASK) << Y_SHIFT | ((long)this.getZ() & Z_MASK) << 0; + public long toLong() { + return ((long) this.getX() & X_MASK) << X_SHIFT | ((long) this.getY() & Y_MASK) << Y_SHIFT | ((long) this.getZ() & Z_MASK) << 0; } /** * Create a BlockPos from a serialized long value (created by toLong) */ - public static BlockPos fromLong(long serialized) - { - int i = (int)(serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); - int j = (int)(serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS); - int k = (int)(serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS); + public static BlockPos fromLong(long serialized) { + int i = (int) (serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); + int j = (int) (serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS); + int k = (int) (serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS); return new BlockPos(i, j, k); } /** * Create an Iterable that returns all positions in the box specified by the given corners */ - public static Iterable getAllInBox(BlockPos from, BlockPos to) - { + public static Iterable getAllInBox(BlockPos from, BlockPos to) { final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ())); final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ())); - return new Iterable() - { - public Iterator iterator() - { - return new AbstractIterator() - { + return new Iterable() { + public Iterator iterator() { + return new AbstractIterator() { private BlockPos lastReturned = null; - protected BlockPos computeNext() - { - if (this.lastReturned == null) - { + + protected BlockPos computeNext() { + if (this.lastReturned == null) { this.lastReturned = blockpos; return this.lastReturned; - } - else if (this.lastReturned.equals(blockpos1)) - { - return (BlockPos)this.endOfData(); - } - else - { + } else if (this.lastReturned.equals(blockpos1)) { + return (BlockPos) this.endOfData(); + } else { int i = this.lastReturned.getX(); int j = this.lastReturned.getY(); int k = this.lastReturned.getZ(); - if (i < blockpos1.getX()) - { + if (i < blockpos1.getX()) { ++i; - } - else if (j < blockpos1.getY()) - { + } else if (j < blockpos1.getY()) { i = blockpos.getX(); ++j; - } - else if (k < blockpos1.getZ()) - { + } else if (k < blockpos1.getZ()) { i = blockpos.getX(); j = blockpos.getY(); ++k; @@ -270,27 +233,29 @@ public class BlockPos extends Vec3i }; } - public static class MutableBlockPos extends BlockPos - { - /** Mutable X Coordinate */ + public static class MutableBlockPos extends BlockPos { + /** + * Mutable X Coordinate + */ protected int x; - /** Mutable Y Coordinate */ + /** + * Mutable Y Coordinate + */ protected int y; - /** Mutable Z Coordinate */ + /** + * Mutable Z Coordinate + */ protected int z; - public MutableBlockPos() - { + public MutableBlockPos() { this(0, 0, 0); } - public MutableBlockPos(BlockPos pos) - { + public MutableBlockPos(BlockPos pos) { this(pos.getX(), pos.getY(), pos.getZ()); } - public MutableBlockPos(int x_, int y_, int z_) - { + public MutableBlockPos(int x_, int y_, int z_) { super(0, 0, 0); this.x = x_; this.y = y_; @@ -300,60 +265,51 @@ public class BlockPos extends Vec3i /** * Gets the X coordinate. */ - public int getX() - { + public int getX() { return this.x; } /** * Gets the Y coordinate. */ - public int getY() - { + public int getY() { return this.y; } /** * Gets the Z coordinate. */ - public int getZ() - { + public int getZ() { return this.z; } /** * Sets the position, MUST not be name 'set' as that causes obfusication conflicts with func_185343_d */ - public BlockPos.MutableBlockPos setPos(int xIn, int yIn, int zIn) - { + public BlockPos.MutableBlockPos setPos(int xIn, int yIn, int zIn) { this.x = xIn; this.y = yIn; this.z = zIn; return this; } - public BlockPos.MutableBlockPos setPos(double p_189532_1_, double p_189532_3_, double p_189532_5_) - { + public BlockPos.MutableBlockPos setPos(double p_189532_1_, double p_189532_3_, double p_189532_5_) { return this.setPos(MathHelper.floor_double(p_189532_1_), MathHelper.floor_double(p_189532_3_), MathHelper.floor_double(p_189532_5_)); } - public BlockPos.MutableBlockPos setPos(Vec3i p_189533_1_) - { + public BlockPos.MutableBlockPos setPos(Vec3i p_189533_1_) { return this.setPos(p_189533_1_.getX(), p_189533_1_.getY(), p_189533_1_.getZ()); } - public BlockPos.MutableBlockPos move(EnumFacing p_189536_1_) - { + public BlockPos.MutableBlockPos move(EnumFacing p_189536_1_) { return this.move(p_189536_1_, 1); } - public BlockPos.MutableBlockPos move(EnumFacing p_189534_1_, int p_189534_2_) - { + public BlockPos.MutableBlockPos move(EnumFacing p_189534_1_, int p_189534_2_) { return this.setPos(this.x + p_189534_1_.getFrontOffsetX() * p_189534_2_, this.y + p_189534_1_.getFrontOffsetY() * p_189534_2_, this.z + p_189534_1_.getFrontOffsetZ() * p_189534_2_); } - public void setY(int yIn) - { + public void setY(int yIn) { this.y = yIn; } @@ -363,42 +319,33 @@ public class BlockPos extends Vec3i *

    When storing a BlockPos given to you for an extended period of time, make sure you * use this in case the value is changed internally.

    */ - public BlockPos toImmutable() - { + public BlockPos toImmutable() { return new BlockPos(this); } } - public static final class PooledMutableBlockPos extends BlockPos.MutableBlockPos - { + public static final class PooledMutableBlockPos extends BlockPos.MutableBlockPos { private boolean released; private static final List POOL = Lists.newArrayList(); - private PooledMutableBlockPos(int xIn, int yIn, int zIn) - { + private PooledMutableBlockPos(int xIn, int yIn, int zIn) { super(xIn, yIn, zIn); } - public static BlockPos.PooledMutableBlockPos retain() - { + public static BlockPos.PooledMutableBlockPos retain() { return retain(0, 0, 0); } - public static BlockPos.PooledMutableBlockPos retain(double xIn, double yIn, double zIn) - { + public static BlockPos.PooledMutableBlockPos retain(double xIn, double yIn, double zIn) { return retain(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn)); } - public static BlockPos.PooledMutableBlockPos retain(int xIn, int yIn, int zIn) - { - synchronized (POOL) - { - if (!POOL.isEmpty()) - { - BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = (BlockPos.PooledMutableBlockPos)POOL.remove(POOL.size() - 1); + public static BlockPos.PooledMutableBlockPos retain(int xIn, int yIn, int zIn) { + synchronized (POOL) { + if (!POOL.isEmpty()) { + BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = (BlockPos.PooledMutableBlockPos) POOL.remove(POOL.size() - 1); - if (blockpos$pooledmutableblockpos != null && blockpos$pooledmutableblockpos.released) - { + if (blockpos$pooledmutableblockpos != null && blockpos$pooledmutableblockpos.released) { blockpos$pooledmutableblockpos.released = false; blockpos$pooledmutableblockpos.set(xIn, yIn, zIn); return blockpos$pooledmutableblockpos; @@ -409,12 +356,9 @@ public class BlockPos extends Vec3i return new BlockPos.PooledMutableBlockPos(xIn, yIn, zIn); } - public void release() - { - synchronized (POOL) - { - if (POOL.size() < 100) - { + public void release() { + synchronized (POOL) { + if (POOL.size() < 100) { POOL.add(this); } @@ -422,35 +366,29 @@ public class BlockPos extends Vec3i } } - public BlockPos.PooledMutableBlockPos set(int xIn, int yIn, int zIn) - { - if (this.released) - { + public BlockPos.PooledMutableBlockPos set(int xIn, int yIn, int zIn) { + if (this.released) { BlockPos.LOGGER.error("PooledMutableBlockPosition modified after it was released.", new Throwable()); this.released = false; } - return (BlockPos.PooledMutableBlockPos)super.setPos(xIn, yIn, zIn); + return (BlockPos.PooledMutableBlockPos) super.setPos(xIn, yIn, zIn); } - public BlockPos.PooledMutableBlockPos set(double xIn, double yIn, double zIn) - { - return (BlockPos.PooledMutableBlockPos)super.setPos(xIn, yIn, zIn); + public BlockPos.PooledMutableBlockPos set(double xIn, double yIn, double zIn) { + return (BlockPos.PooledMutableBlockPos) super.setPos(xIn, yIn, zIn); } - public BlockPos.PooledMutableBlockPos set(Vec3i vec) - { - return (BlockPos.PooledMutableBlockPos)super.setPos(vec); + public BlockPos.PooledMutableBlockPos set(Vec3i vec) { + return (BlockPos.PooledMutableBlockPos) super.setPos(vec); } - public BlockPos.PooledMutableBlockPos offsetMutable(EnumFacing facing) - { - return (BlockPos.PooledMutableBlockPos)super.move(facing); + public BlockPos.PooledMutableBlockPos offsetMutable(EnumFacing facing) { + return (BlockPos.PooledMutableBlockPos) super.move(facing); } - public BlockPos.PooledMutableBlockPos movePos(EnumFacing p_189538_1_, int p_189538_2_) - { - return (BlockPos.PooledMutableBlockPos)super.move(p_189538_1_, p_189538_2_); + public BlockPos.PooledMutableBlockPos movePos(EnumFacing p_189538_1_, int p_189538_2_) { + return (BlockPos.PooledMutableBlockPos) super.move(p_189538_1_, p_189538_2_); } } } diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index f07dd98..488b3a1 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -19,7 +19,6 @@ import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IAbilityHandler; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IAnimationHandler; -import noppes.npcs.api.handler.IAttributeHandler; import noppes.npcs.api.handler.ICloneHandler; import noppes.npcs.api.handler.ICustomEffectHandler; import noppes.npcs.api.handler.IDialogHandler; @@ -60,7 +59,8 @@ public abstract class AbstractNpcAPI { /** * Tempdata gets cleared when the server restarts. All worlds share the same temp data. - * @param key The key for the data stored + * + * @param key The key for the data stored * @param value The data stored */ public abstract void setTempData(String key, Object value); @@ -91,7 +91,8 @@ public abstract class AbstractNpcAPI { /** * Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved - * @param key The key for the data stored + * + * @param key The key for the data stored * @param value The data stored. This data can be either a Number or a String. Other data is not stored */ public abstract void setStoredData(String key, Object value); @@ -124,7 +125,7 @@ public abstract class AbstractNpcAPI { public abstract boolean hasGlobalObject(String key); - public abstract HashMap getEngineObjects(); + public abstract HashMap getEngineObjects(); public abstract long sizeOfObject(Object obj); @@ -220,8 +221,8 @@ public abstract class AbstractNpcAPI { * Forms a box with corners as the input IPos parameters, and returns all * points inside the box as a list of IPos vectors. * - * @param from The starting IPos vector, first corner of the box. - * @param to The ending IPos vector, opposite corner of the box. + * @param from The starting IPos vector, first corner of the box. + * @param to The ending IPos vector, opposite corner of the box. * @param sortByDistance Sorts the list by distance from the "from" IPos parameter. * @return The list of all IPos vectors inside the box. */ @@ -312,7 +313,7 @@ public abstract class AbstractNpcAPI { * 7: Aztec * 8: CustomNPCs Classic * 9: Spanish - * @param gender The gender of the name: + * @param gender The gender of the name: * 0: Random * 1: Male * 2: Female @@ -389,9 +390,9 @@ public abstract class AbstractNpcAPI { /** * - * @param id The id of the custom GUI. - * @param width The width of the GUI in pixels. - * @param height The height of the GUI in pixels. + * @param id The id of the custom GUI. + * @param width The width of the GUI in pixels. + * @param height The height of the GUI in pixels. * @param pauseGame Whether the GUI pauses the game or not. * @return A new ICustomGui object with the given attributes. */ @@ -399,7 +400,7 @@ public abstract class AbstractNpcAPI { /** * - * @return A new ICustomOverlay overlay object with the given ID. + * @return A new ICustomOverlay overlay object with the given ID. */ public abstract ICustomOverlay createCustomOverlay(int id); diff --git a/java/noppes/npcs/api/IBlock.java b/java/noppes/npcs/api/IBlock.java index 18ed908..cadd035 100644 --- a/java/noppes/npcs/api/IBlock.java +++ b/java/noppes/npcs/api/IBlock.java @@ -19,7 +19,7 @@ public interface IBlock { /** * Moves the block to a new position in the given world. The old position is replaced with air. * - * @param pos The new position of the block + * @param pos The new position of the block * @param world The destination world of the block * @return Whether the block was successfully placed */ diff --git a/java/noppes/npcs/api/IContainer.java b/java/noppes/npcs/api/IContainer.java index 691f5ad..d3543c2 100644 --- a/java/noppes/npcs/api/IContainer.java +++ b/java/noppes/npcs/api/IContainer.java @@ -31,9 +31,9 @@ public interface IContainer { /** * - * @param itemStack The item stack to be searched in the container + * @param itemStack The item stack to be searched in the container * @param ignoreDamage Whether damage should be ignored when searching - * @param ignoreNBT Whether NBT values should be ignored when searching + * @param ignoreNBT Whether NBT values should be ignored when searching * @return The amount of the item stack found, based on the flags given above. */ int count(IItemStack itemStack, boolean ignoreDamage, boolean ignoreNBT); diff --git a/java/noppes/npcs/api/INbt.java b/java/noppes/npcs/api/INbt.java index e8efebb..234befa 100644 --- a/java/noppes/npcs/api/INbt.java +++ b/java/noppes/npcs/api/INbt.java @@ -6,13 +6,13 @@ import net.minecraft.nbt.NBTTagCompound; * A scripted data representation of an MC NBTTagCompound object. Using these functions modifies the compound tag * associated with this object. Any changes made to the compound tag are made directly to its "tagMap" attribute, * minimizing the impact of setting/getting NBT data with this object on performance. - * + *

    * Compound tags, unlike list tags, can contain multiple types of NBT tag types. Compound tags can even * contain compound tags inside them, and if that compound tag is accessed, an object like this one will also be returned! - * + *

    * Every tag inside a compound tag has a -unique- "key". If you try to put another tag of the same key inside the * compound tag, it will replace the previous tag. - * + *

    * The types and their type as an integer are as follows: * 1: Byte * 2: Short @@ -94,7 +94,7 @@ public interface INbt { /** * Adds a new tag list to the compound tag with the given key. * - * @param key The key for the list tag + * @param key The key for the list tag * @param value The list of objects to be in the list. The type of the first element in this list becomes the tag * list's type, and if later objects are not of this type, they will not be added. */ diff --git a/java/noppes/npcs/api/IParticle.java b/java/noppes/npcs/api/IParticle.java index 51187b6..aec09be 100644 --- a/java/noppes/npcs/api/IParticle.java +++ b/java/noppes/npcs/api/IParticle.java @@ -5,14 +5,14 @@ import noppes.npcs.api.entity.IEntity; /** * A particle that can be spawned in the world, complete with translation, scale, rotate, and color transformations. * (CNPC+ original!) - * + *

    * To create a particle object: * API.createParticle(directory); * Then modify its attributes as you please, and call the particle's spawn functions to see it in the world. - * + *

    * Spawning this particle in the world sends a hefty packet with all its data to the client. The particle is then * rendered with a custom renderer based on all the given attributes. - * + *

    * If a particle appears to not appear at first, try increasing its scale or changing its position. The entity it's * being spawned on or a block in the world may be blocking it. * @@ -34,9 +34,9 @@ public interface IParticle { /** * * @param world Spawns the particle in the given world, at a position determined by the input parameters. - * @param x The X position the particle will spawn in the world. - * @param y The Y position the particle will spawn in the world. - * @param z The Z position the particle will spawn in the world. + * @param x The X position the particle will spawn in the world. + * @param y The Y position the particle will spawn in the world. + * @param z The Z position the particle will spawn in the world. */ void spawn(IWorld world, double x, double y, double z); @@ -54,9 +54,11 @@ public interface IParticle { * @param glows If true, this particle ignores all lighting and always renders with full brightness. */ void setGlows(boolean glows); + boolean getGlows(); void setNoClip(boolean noClip); + boolean getNoClip(); /** @@ -64,6 +66,7 @@ public interface IParticle { * @param facePlayer Whether the particle is always facing the player's camera. If this is disabled, the particle will appear to be laying flat face down on the ground if its rotation is unchanged. */ void setFacePlayer(boolean facePlayer); + boolean getFacePlayer(); /** @@ -71,6 +74,7 @@ public interface IParticle { * @param directory The directory of this particle's texture. This can be any texture in a resource pack or mod, and even a URL! */ void setDirectory(String directory); + String getDirectory(); /** @@ -78,6 +82,7 @@ public interface IParticle { * @param amount The amount of multiples of this particle to spawn in the world. Not too good looking if used, but has some edge cases where it's alright. */ void setAmount(int amount); + int getAmount(); /** @@ -85,45 +90,56 @@ public interface IParticle { * @param maxAge The maximum age this particle will be around for, in MC ticks. */ void setMaxAge(int maxAge); + int getMaxAge(); /** * The width and height of the particle's texture you want to render in pixels. Anything more gets cut off. - * @param width The width of the particle's texture, in pixels. + * + * @param width The width of the particle's texture, in pixels. * @param height The height of the particle's texture, in pixels. */ void setSize(int width, int height); + int getWidth(); + int getHeight(); /** - * The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point. + * The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point. + * * @param offsetX The horizontal offset, in pixels (u). * @param offsetY The vertical offset, in pixels (v). */ void setOffset(int offsetX, int offsetY); + int getOffsetX(); + int getOffsetY(); /** * Enables animation on the particle. Must set a custom width and height first using the setSize(width,height) function. * Every frame of animation the particle goes through should be saved on a single image file. - * + *

    * The renderer will read the frames of animation based on the given width and height of the particle, starting from the given X and Y offsets. * The renderer then goes rightwards (width) pixels for every frame. Once it can't go rightwards anymore, * the animation goes down (height) pixels, and once again keeps going rightwards if it has to. - * + *

    * If the animation loops, once there is nowhere downward to go, the animation will start over at the X and Y offset. * - * @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second) - * @param animLoop Whether the animation loops or not. + * @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second) + * @param animLoop Whether the animation loops or not. * @param animStart The amount of ticks before the particle starts animating. - * @param animEnd The amount of ticks the particle is around for before it stops animating. + * @param animEnd The amount of ticks the particle is around for before it stops animating. */ void setAnim(int animRate, boolean animLoop, int animStart, int animEnd); + int getAnimRate(); + boolean getAnimLoop(); + int getAnimStart(); + int getAnimEnd(); /** @@ -133,94 +149,126 @@ public interface IParticle { * @param z The Z position from the particle's origin the particle will spawn at. */ void setPosition(double x, double y, double z); + double getX(); + double getY(); + double getZ(); void setPosition(IPos pos); + void getPos(); void setMotion(double motionX, double motionY, double motionZ, float gravity); + double getMotionX(); + double getMotionY(); + double getMotionZ(); + float getGravity(); /** * - * @param HEXColor The starting HEX color of the particle. - * @param HEXColor2 The ending HEX color of the particle. - * @param HEXColorRate The rate of interpolation between the two HEX colors. + * @param HEXColor The starting HEX color of the particle. + * @param HEXColor2 The ending HEX color of the particle. + * @param HEXColorRate The rate of interpolation between the two HEX colors. * @param HEXColorStart The amount of ticks the particle is around for before its colors begin interpolating between HEXColor and HEXColor2. */ void setHEXColor(int HEXColor, int HEXColor2, float HEXColorRate, int HEXColorStart); + int getHEXColor1(); + int getHEXColor2(); + float getHEXColorRate(); + int getHEXColorStart(); /** * - * @param alpha1 The starting transparency of the particle. - * @param alpha2 The ending transparency of the particle. - * @param alphaRate The rate of interpolation between the two transparency values. + * @param alpha1 The starting transparency of the particle. + * @param alpha2 The ending transparency of the particle. + * @param alphaRate The rate of interpolation between the two transparency values. * @param alphaRateStart The amount of ticks the particle is around for before its colors begin interpolating between alpha1 and alpha2. */ void setAlpha(float alpha1, float alpha2, float alphaRate, int alphaRateStart); + float getAlpha1(); + float getAlpha2(); + float getAlphaRate(); + int getAlphaRateStart(); /** * - * @param scale1 The starting scale/size of the particle. - * @param scale2 The ending scale/size of the particle. - * @param scaleRate The rate of interpolation between the two scale values. + * @param scale1 The starting scale/size of the particle. + * @param scale2 The ending scale/size of the particle. + * @param scaleRate The rate of interpolation between the two scale values. * @param scaleRateStart The amount of ticks the particle is around for before its colors begin interpolating between scale1 and scale2. */ void setScale(float scale1, float scale2, float scaleRate, int scaleRateStart); void setScaleX(float scale1, float scale2, float scaleRate, int scaleRateStart); + float getScaleX1(); + float getScaleX2(); + float getScaleXRate(); + int getScaleXRateStart(); void setScaleY(float scale1, float scale2, float scaleRate, int scaleRateStart); + float getScaleY1(); + float getScaleY2(); + float getScaleYRate(); + int getScaleYRateStart(); /** * Enables rotation about the X axis. * If the particle is set to always face the player, this axis is a constant horizontal line on the player's camera. * - * @param rotationX1 The starting X rotation of the particle. - * @param rotationX2 The ending X rotation of the particle. - * @param rotationXRate The rate of interpolation between the two X rotation values. + * @param rotationX1 The starting X rotation of the particle. + * @param rotationX2 The ending X rotation of the particle. + * @param rotationXRate The rate of interpolation between the two X rotation values. * @param rotationXRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationX1 and rotationX2. */ void setRotationX(float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart); + float getRotationX1(); + float getRotationX2(); + float getRotationXRate(); + int getRotationXRateStart(); /** * Enables rotation about the Y axis. * If the particle is set to always face the player, this axis is a constant vertical line on the player's camera. * - * @param rotationY1 The starting Y rotation of the particle. - * @param rotationY2 The ending Y rotation of the particle. - * @param rotationYRate The rate of interpolation between the two Y rotation values. + * @param rotationY1 The starting Y rotation of the particle. + * @param rotationY2 The ending Y rotation of the particle. + * @param rotationYRate The rate of interpolation between the two Y rotation values. * @param rotationYRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationY1 and rotationY2. */ void setRotationY(float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart); + float getRotationY1(); + float getRotationY2(); + float getRotationYRate(); + int getRotationYRateStart(); /** @@ -228,15 +276,19 @@ public interface IParticle { * If the particle is set to always face the player, this axis is a constant line going into the player's camera. * You'll be using this one most often if the particle is set to face the player. * - * @param rotationZ1 The starting Z rotation of the particle. - * @param rotationZ2 The ending Z rotation of the particle. - * @param rotationZRate The rate of interpolation between the two Z rotation values. + * @param rotationZ1 The starting Z rotation of the particle. + * @param rotationZ2 The ending Z rotation of the particle. + * @param rotationZRate The rate of interpolation between the two Z rotation values. * @param rotationZRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationZ1 and rotationZ2. */ void setRotationZ(float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart); + float getRotationZ1(); + float getRotationZ2(); + float getRotationZRate(); + int getRotationZRateStart(); } diff --git a/java/noppes/npcs/api/IPos.java b/java/noppes/npcs/api/IPos.java index 3e06a31..45ba39e 100644 --- a/java/noppes/npcs/api/IPos.java +++ b/java/noppes/npcs/api/IPos.java @@ -137,7 +137,6 @@ public interface IPos { /** * Returns a normalized vector of this block's position, calculated by: * - * * @return The normalized vector of this block position. */ IPos normalize(); diff --git a/java/noppes/npcs/api/ISkinOverlay.java b/java/noppes/npcs/api/ISkinOverlay.java index 8582af5..04b43c6 100644 --- a/java/noppes/npcs/api/ISkinOverlay.java +++ b/java/noppes/npcs/api/ISkinOverlay.java @@ -3,7 +3,7 @@ package noppes.npcs.api; /** * A skin overlay object for both NPCs and players. Several skin overlays at a time can be layered on top of each other. * In an NPC's case, the old overlay texture is now the skin overlay with ID 0. - * + *

    * Modifying these attributes, an overlay can be made to look like a powered creeper effect, just a new skin, or both! */ public interface ISkinOverlay { @@ -11,24 +11,28 @@ public interface ISkinOverlay { * Sets the directory texture of the overlay. Does not support URLs. */ void setTexture(String texture); + String getTexture(); /** * Sets whether this overlay glows in the dark or not. */ void setGlow(boolean glow); + boolean getGlow(); /** * Sets whether this overlay blends on top of bottom textures at any alpha value. */ void setBlend(boolean blend); + boolean getBlend(); /** * Sets the transparency of the overlay, from 0 to 1. */ void setAlpha(float alpha); + float getAlpha(); /** @@ -36,13 +40,16 @@ public interface ISkinOverlay { * the entity's model. */ void setSize(float size); + float getSize(); /** * Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more. */ void setTextureScale(float scaleX, float scaleY); + float getTextureScaleX(); + float getTextureScaleY(); /** @@ -50,14 +57,19 @@ public interface ISkinOverlay { * This does not move the entire overlay, it just moves the position at which the texture begins rendering. */ void setSpeed(float speedX, float speedY); + float getSpeedX(); + float getSpeedY(); /** * Sets the amount in each direction by which the overlay will be offset from the entity. */ void setOffset(float offsetX, float offsetY, float offsetZ); + float getOffsetX(); + float getOffsetY(); + float getOffsetZ(); } diff --git a/java/noppes/npcs/api/ITileEntity.java b/java/noppes/npcs/api/ITileEntity.java index 86b9b97..4443c85 100644 --- a/java/noppes/npcs/api/ITileEntity.java +++ b/java/noppes/npcs/api/ITileEntity.java @@ -36,6 +36,7 @@ public interface ITileEntity { * @return The distance of this tile entity from the point given by the x, y, and z parameters. */ double getDistanceFrom(double x, double y, double z); + double getDistanceFrom(IPos pos); /** diff --git a/java/noppes/npcs/api/ITimers.java b/java/noppes/npcs/api/ITimers.java index b450fa4..b0da686 100644 --- a/java/noppes/npcs/api/ITimers.java +++ b/java/noppes/npcs/api/ITimers.java @@ -8,8 +8,8 @@ public interface ITimers { * Adds a timer to the NPC or player with the given attributes. If this function is used and there is already a * timer with the given ID, an exception will be thrown. * - * @param id The id of the timer. - * @param ticks The amount of ticks before the timer ends. + * @param id The id of the timer. + * @param ticks The amount of ticks before the timer ends. * @param repeat Whether this timer repeats when it reaches its maximum amount of ticks. */ void start(int id, int ticks, boolean repeat); @@ -18,8 +18,8 @@ public interface ITimers { * Adds a timer to the NPC or player with the given attributes. No exception will be thrown if there is already a * timer with the given ID when using this function. * - * @param id The id of the timer. - * @param ticks The amount of ticks before the timer ends. + * @param id The id of the timer. + * @param ticks The amount of ticks before the timer ends. * @param repeat Whether this timer repeats when it reaches its maximum amount of ticks. */ void forceStart(int id, int ticks, boolean repeat); diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index be3cfab..b25d3a8 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -29,9 +29,9 @@ public interface IWorld { public IBlock getBlock(int x, int y, int z); /** - * @param pos - * @return The block at the given position. Returns null if there isn't a block - */ + * @param pos + * @return The block at the given position. Returns null if there isn't a block + */ public IBlock getBlock(IPos pos); /** @@ -39,45 +39,56 @@ public interface IWorld { * @return The top-most block in the world as an IBlock object. */ IBlock getTopBlock(int x, int z); + IBlock getTopBlock(IPos pos); boolean isBlockFreezable(IPos pos); + boolean isBlockFreezable(int x, int y, int z); boolean isBlockFreezableNaturally(IPos pos); + boolean isBlockFreezableNaturally(int x, int y, int z); boolean canBlockFreeze(IPos pos, boolean adjacentToWater); + boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater); boolean canBlockFreezeBody(IPos pos, boolean adjacentToWater); + boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater); boolean canSnowAt(IPos pos, boolean checkLight); + boolean canSnowAt(int x, int y, int z, boolean checkLight); boolean canSnowAtBody(IPos pos, boolean checkLight); + boolean canSnowAtBody(int x, int y, int z, boolean checkLight); /** * @return The Y-value of the world at this x & z value based on the height map of the world. */ int getHeightValue(int x, int z); + int getHeightValue(IPos pos); /** * @return The minimum Y-value of the world at this x & z value based on the height map of the world. */ int getChunkHeightMapMinimum(int x, int z); + int getChunkHeightMapMinimum(IPos pos); /** * @return The metadata of the block at this position. */ int getBlockMetadata(int x, int y, int z); + int getBlockMetadata(IPos pos); boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag); + boolean setBlockMetadataWithNotify(IPos pos, int metadata, int flag); /** @@ -87,6 +98,7 @@ public interface IWorld { * @return can the block at this position see the sky or are there no blocks above this one */ boolean canSeeSky(int x, int y, int z); + /** * @param pos * @return can the block at this position see the sky or are there no blocks above this one @@ -94,9 +106,11 @@ public interface IWorld { boolean canSeeSky(IPos pos); int getFullBlockLightValue(int x, int y, int z); + int getFullBlockLightValue(IPos pos); int getBlockLightValue(int x, int y, int z); + int getBlockLightValue(IPos pos); void playSoundAtEntity(IEntity entity, String sound, float volume, float pitch); @@ -120,11 +134,13 @@ public interface IWorld { IPlayer getClosestPlayerToEntity(IEntity entity, double range); IPlayer getClosestPlayer(double x, double y, double z, double range); + IPlayer getClosestPlayer(IPos pos, double range); IPlayer getClosestVulnerablePlayerToEntity(IEntity entity, double range); IPlayer getClosestVulnerablePlayer(double x, double y, double z, double range); + IPlayer getClosestVulnerablePlayer(IPos pos, double range); /** @@ -144,12 +160,14 @@ public interface IWorld { * Sets the block's tile entity at the given position. */ void setTileEntity(int x, int y, int z, ITileEntity tileEntity); + void setTileEntity(IPos pos, ITileEntity tileEntity); /** * Removes the block's tile entity at the given position. */ void removeTileEntity(int x, int y, int z); + void removeTileEntity(IPos pos); /** @@ -157,17 +175,21 @@ public interface IWorld { * @return True if the block at this position is of cubic shape. (Not a stair, slab, etc.) */ boolean isBlockFullCube(int x, int y, int z); + boolean isBlockFullCube(IPos pos); long getSeed(); void setSpawnLocation(int x, int y, int z); + void setSpawnLocation(IPos pos); boolean canLightningStrikeAt(int x, int y, int z); + boolean canLightningStrikeAt(IPos pos); boolean isBlockHighHumidity(int x, int y, int z); + boolean isBlockHighHumidity(IPos pos); /** @@ -178,24 +200,27 @@ public interface IWorld { * @since 1.7.10d */ String getSignText(int x, int y, int z); + String getSignText(IPos pos); /** - * @param x World position x - * @param y World position y - * @param z World position z + * @param x World position x + * @param y World position y + * @param z World position z * @param item The block to be set */ boolean setBlock(int x, int y, int z, IItemStack item); + boolean setBlock(IPos pos, IItemStack item); - /** - * @param x World position x - * @param y World position y - * @param z World position z - * @param block The block to be set - */ + /** + * @param x World position x + * @param y World position y + * @param z World position z + * @param block The block to be set + */ boolean setBlock(int x, int y, int z, IBlock block); + boolean setBlock(IPos pos, IBlock block); /** @@ -204,6 +229,7 @@ public interface IWorld { * @param z World position z */ void removeBlock(int x, int y, int z); + void removeBlock(IPos pos); boolean isPlaceCancelled(int posX, int posY, int posZ); @@ -224,8 +250,9 @@ public interface IWorld { /** * starting at the start position, draw a line in the lookVector direction until a block is detected + * * @param startPos - * @param lookVector should be a normalized direction vector + * @param lookVector should be a normalized direction vector * @param maxDistance * @return the first detected block but null if maxDistance is reached */ @@ -288,27 +315,30 @@ public interface IWorld { * @param z The z position */ void thunderStrike(double x, double y, double z); + void thunderStrike(IPos pos); /** * Sends a packet from the server to the client everytime its called. Probably should not use this too much. + * * @param particle Particle name. Particle name list: http://minecraft.wiki/w/Particles - * @param x The x position - * @param y The y position - * @param z The z position - * @param dx Usually used for the x motion - * @param dy Usually used for the y motion - * @param dz Usually used for the z motion - * @param speed Speed of the particles, usually between 0 and 1 - * @param count Particle count + * @param x The x position + * @param y The y position + * @param z The z position + * @param dx Usually used for the x motion + * @param dy Usually used for the y motion + * @param dz Usually used for the z motion + * @param speed Speed of the particles, usually between 0 and 1 + * @param count Particle count */ void spawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count); + void spawnParticle(String particle, IPos pos, double dx, double dy, double dz, double speed, int count); /** - * @param id The items name + * @param id The items name * @param damage The damage value - * @param size The number of items in the item + * @param size The number of items in the item * @return Returns the item */ IItemStack createItem(String id, int damage, int size); @@ -356,14 +386,15 @@ public interface IWorld { String[] getStoredDataKeys(); /** - * @param x Position x - * @param y Position y - * @param z Position z + * @param x Position x + * @param y Position y + * @param z Position z * @param range Range of the explosion - * @param fire Whether or not the explosion does fire damage + * @param fire Whether or not the explosion does fire damage * @param grief Whether or not the explosion does damage to blocks */ void explode(double x, double y, double z, float range, boolean fire, boolean grief); + void explode(IPos pos, float range, boolean fire, boolean grief); IPlayer[] getAllServerPlayers(); @@ -371,36 +402,40 @@ public interface IWorld { public String[] getPlayerNames(); /** - * @since 1.7.10c * @param x Position x * @param z Position z * @return Returns the name of the biome + * @since 1.7.10c */ String getBiomeName(int x, int z); + String getBiomeName(IPos pos); /** * Lets you spawn a server side cloned entity - * @param x The x position the clone will be spawned at - * @param y The y position the clone will be spawned at - * @param z The z position the clone will be spawned at - * @param tab The tab in which the clone is - * @param name Name of the cloned entity + * + * @param x The x position the clone will be spawned at + * @param y The y position the clone will be spawned at + * @param z The z position the clone will be spawned at + * @param tab The tab in which the clone is + * @param name Name of the cloned entity * @param ignoreProtection Whether the spawning of this clone skips protection checks. * @return Returns the entity which was spawned */ IEntity spawnClone(int x, int y, int z, int tab, String name, boolean ignoreProtection); + IEntity spawnClone(IPos pos, int tab, String name, boolean ignoreProtection); IEntity spawnClone(int x, int y, int z, int tab, String name); + IEntity spawnClone(IPos pos, int tab, String name); IScoreboard getScoreboard(); /** + * @return Returns minecraft world object * @since 1.7.10c * Expert use only - * @return Returns minecraft world object */ WorldServer getMCWorld(); diff --git a/java/noppes/npcs/api/ability/IAbilityHandler.java b/java/noppes/npcs/api/ability/IAbilityHandler.java index 56cf621..1f0b689 100644 --- a/java/noppes/npcs/api/ability/IAbilityHandler.java +++ b/java/noppes/npcs/api/ability/IAbilityHandler.java @@ -10,7 +10,7 @@ public interface IAbilityHandler { * Register a custom ability type. * Call during FMLInitializationEvent. * - * @param typeId The unique type ID (e.g., "mymod:custom_ability") + * @param typeId The unique type ID (e.g., "mymod:custom_ability") * @param abilityClass The class that implements the ability */ void registerType(String typeId, Class abilityClass); diff --git a/java/noppes/npcs/api/block/IBlockScripted.java b/java/noppes/npcs/api/block/IBlockScripted.java index a6da807..213c04d 100644 --- a/java/noppes/npcs/api/block/IBlockScripted.java +++ b/java/noppes/npcs/api/block/IBlockScripted.java @@ -72,6 +72,7 @@ public interface IBlockScripted extends IBlock { * Use /gamerule commandBlockOutput false/true to turn off/on command block feedback
    * Setting NpcUseOpCommands to true in the CustomNPCs.cfg should allow the npc to run op commands, be warned this could be a major security risk, use at own risk
    * For permission plugins the commands are run under uuid:c9c843f8-4cb1-4c82-aa61-e264291b7bd6 and name:[customnpcs] + * * @param command The command to be executed */ void executeCommand(String command); diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index 9d51ff1..dd92407 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -6,7 +6,11 @@ import noppes.npcs.api.ITimers; import noppes.npcs.api.entity.data.IModelData; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; -import noppes.npcs.api.handler.data.*; +import noppes.npcs.api.handler.data.IAnimationData; +import noppes.npcs.api.handler.data.IDialog; +import noppes.npcs.api.handler.data.IFaction; +import noppes.npcs.api.handler.data.ILines; +import noppes.npcs.api.handler.data.IMagicData; import noppes.npcs.api.item.IItemStack; import noppes.npcs.api.jobs.IJob; import noppes.npcs.api.roles.IRole; @@ -494,7 +498,7 @@ public interface ICustomNpc extends IEntityLiving, /** * Gets the Aim Type for an NPC * - * @return 0: No, 1: Yes, 2: On Shot + * @return 0: No, 1: Yes, 2: On Shot */ byte getAimType(); diff --git a/java/noppes/npcs/api/entity/IEntity.java b/java/noppes/npcs/api/entity/IEntity.java index 340cd5e..4255d73 100644 --- a/java/noppes/npcs/api/entity/IEntity.java +++ b/java/noppes/npcs/api/entity/IEntity.java @@ -541,19 +541,20 @@ public interface IEntity { IEntity[] getCapturedDrops(); /** - * @since 1.7.10c * @return Whether the entity is sneaking. + * @since 1.7.10c */ boolean isSneaking(); /** - * @since 1.7.10c * @return Whether the entity is sprinting. + * @since 1.7.10c */ boolean isSprinting(); /** * Expert users only. + * * @return The underlying Minecraft entity. */ T getMCEntity(); diff --git a/java/noppes/npcs/api/entity/IEntityLiving.java b/java/noppes/npcs/api/entity/IEntityLiving.java index 86afb01..4e3f479 100644 --- a/java/noppes/npcs/api/entity/IEntityLiving.java +++ b/java/noppes/npcs/api/entity/IEntityLiving.java @@ -1,7 +1,6 @@ package noppes.npcs.api.entity; import net.minecraft.entity.EntityLiving; -import noppes.npcs.api.entity.IEntityLivingBase; /** * Represents a living entity (mob, NPC, etc.) that extends the base living functionality. diff --git a/java/noppes/npcs/api/entity/IPixelmon.java b/java/noppes/npcs/api/entity/IPixelmon.java index 085a280..e8ab427 100644 --- a/java/noppes/npcs/api/entity/IPixelmon.java +++ b/java/noppes/npcs/api/entity/IPixelmon.java @@ -1,7 +1,6 @@ package noppes.npcs.api.entity; import net.minecraft.entity.passive.EntityTameable; -import noppes.npcs.api.item.IItemStack; /** * Represents a Pixelmon (a tameable creature) with additional attributes @@ -37,6 +36,7 @@ public interface IPixelmon extends IAnimal { /** * Gets the Individual Value (IV) for the specified stat. + * * @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed * @return the IV value, or -1 if invalid. */ @@ -84,7 +84,7 @@ public interface IPixelmon extends IAnimal { /** * @return The Pixelmon's size type (0: Pygmy, 1: Runt, 2: Small, 3: Normal, 4: Huge, 5: Giant, - * 6: Enormous, 7: Ginormous, 8: Microscopic). + * 6: Enormous, 7: Ginormous, 8: Microscopic). */ int getSize(); @@ -121,7 +121,7 @@ public interface IPixelmon extends IAnimal { /** * @return The type of Poké Ball in which the Pixelmon is contained - * (-1: Uncaught, 0: Pokéball, 1: Great Ball, etc.). + * (-1: Uncaught, 0: Pokéball, 1: Great Ball, etc.). */ int getPokeball(); diff --git a/java/noppes/npcs/api/entity/IPlayer.java b/java/noppes/npcs/api/entity/IPlayer.java index ba3a1f9..9026f9a 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -2,12 +2,23 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; -import noppes.npcs.api.*; +import noppes.npcs.api.IBlock; +import noppes.npcs.api.IContainer; +import noppes.npcs.api.IPixelmonPlayerData; +import noppes.npcs.api.IPos; +import noppes.npcs.api.IScreenSize; +import noppes.npcs.api.ITimers; +import noppes.npcs.api.IWorld; import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; import noppes.npcs.api.handler.IPlayerData; -import noppes.npcs.api.handler.data.*; +import noppes.npcs.api.handler.data.IAnimationData; +import noppes.npcs.api.handler.data.IDialog; +import noppes.npcs.api.handler.data.IMagicData; +import noppes.npcs.api.handler.data.IPlayerAttributes; +import noppes.npcs.api.handler.data.IQuest; +import noppes.npcs.api.handler.data.ISound; import noppes.npcs.api.item.IItemStack; import noppes.npcs.api.overlay.ICustomOverlay; @@ -313,8 +324,8 @@ public interface IPlayer extends IEntityLivingBase, void setMode(int type); /** - * @since 1.7.10d * @return Returns an IItemStack array of size 36 representing the player's inventory. + * @since 1.7.10d */ IItemStack[] getInventory(); @@ -327,11 +338,11 @@ public interface IPlayer extends IEntityLivingBase, int inventoryItemCount(IItemStack item, boolean ignoreNBT, boolean ignoreDamage); /** - * @since 1.7.10c * @param id The item's name. * @param damage The damage value. * @param amount How many items will be removed. * @return True if the items were removed successfully, false if the amount exceeds what the player has or the item doesn't exist. + * @since 1.7.10c */ boolean removeItem(String id, int damage, int amount); @@ -353,19 +364,19 @@ public interface IPlayer extends IEntityLivingBase, int removeAllItems(IItemStack item, boolean ignoreNBT, boolean ignoreDamage); /** - * @since 1.7.10c * @param item The item to be added. * @param amount The number of items to add. * @return True if the item was given successfully, false otherwise. + * @since 1.7.10c */ boolean giveItem(IItemStack item, int amount); /** - * @since 1.7.10c * @param id The item's name. * @param damage The damage value. * @param amount The number of items to add. * @return True if the item was given successfully, false otherwise. + * @since 1.7.10c */ boolean giveItem(String id, int damage, int amount); @@ -511,22 +522,22 @@ public interface IPlayer extends IEntityLivingBase, boolean hasBukkitPermission(String permission); /** - * @since 1.7.10c * @return Returns the player's experience level. + * @since 1.7.10c */ int getExpLevel(); /** - * @since 1.7.10c * @param level The new experience level to set. + * @since 1.7.10c */ void setExpLevel(int level); /** * Requires Pixelmon to be installed. * - * @since 1.7.10d * @return Returns the player's Pixelmon data, or null if Pixelmon is not enabled. + * @since 1.7.10d */ IPixelmonPlayerData getPixelmonData(); @@ -673,7 +684,6 @@ public interface IPlayer extends IEntityLivingBase, IActionManager getActionManager(); - IPlayer[] getPartyMembers(); // ========================================= diff --git a/java/noppes/npcs/api/entity/IVillager.java b/java/noppes/npcs/api/entity/IVillager.java index a7eb5e3..fa6e51d 100644 --- a/java/noppes/npcs/api/entity/IVillager.java +++ b/java/noppes/npcs/api/entity/IVillager.java @@ -1,7 +1,6 @@ package noppes.npcs.api.entity; import net.minecraft.entity.passive.EntityVillager; -import noppes.npcs.api.entity.IEntityLivingBase; /** * Represents a villager entity with additional trading-related methods. diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 57ab8e2..21c9cd3 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -3,7 +3,6 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.IDamageSource; import noppes.npcs.api.ability.IAbility; -import noppes.npcs.api.entity.ICustomNpc; import noppes.npcs.api.entity.IEntityLivingBase; /** diff --git a/java/noppes/npcs/api/event/IBlockEvent.java b/java/noppes/npcs/api/event/IBlockEvent.java index bd7d65f..67bece3 100644 --- a/java/noppes/npcs/api/event/IBlockEvent.java +++ b/java/noppes/npcs/api/event/IBlockEvent.java @@ -8,12 +8,14 @@ import noppes.npcs.api.entity.IPlayer; public interface IBlockEvent extends ICustomNPCsEvent { IBlock getBlock(); + /** * @hookName fallenUpon */ @Cancelable - interface EntityFallenUponEvent extends IBlockEvent{ + interface EntityFallenUponEvent extends IBlockEvent { IEntity getEntity(); + float getDistanceFallen(); } @@ -30,24 +32,28 @@ public interface IBlockEvent extends ICustomNPCsEvent { int getSide(); } - interface RedstoneEvent extends IBlockEvent{ + interface RedstoneEvent extends IBlockEvent { int getPrevPower(); + int getPower(); } + /** * @hookName broken */ - interface BreakEvent extends IBlockEvent{ + interface BreakEvent extends IBlockEvent { } + @Cancelable - interface ExplodedEvent extends IBlockEvent{ + interface ExplodedEvent extends IBlockEvent { } + /** * @hookName rainFilled */ - interface RainFillEvent extends IBlockEvent{ + interface RainFillEvent extends IBlockEvent { } @@ -55,13 +61,14 @@ public interface IBlockEvent extends ICustomNPCsEvent { IPos getChangedPos(); } - interface InitEvent extends IBlockEvent{ + interface InitEvent extends IBlockEvent { } + /** * @hookName tick */ - interface UpdateEvent extends IBlockEvent{ + interface UpdateEvent extends IBlockEvent { } diff --git a/java/noppes/npcs/api/event/INpcEvent.java b/java/noppes/npcs/api/event/INpcEvent.java index adcc400..4c4bac9 100644 --- a/java/noppes/npcs/api/event/INpcEvent.java +++ b/java/noppes/npcs/api/event/INpcEvent.java @@ -17,7 +17,7 @@ public interface INpcEvent extends ICustomNPCsEvent { int getId(); } - interface CollideEvent extends INpcEvent{ + interface CollideEvent extends INpcEvent { IEntity getEntity(); } @@ -64,6 +64,7 @@ public interface INpcEvent extends ICustomNPCsEvent { /** * Can be null + * * @return Returns the swung item */ IItemStack getItemStack(); diff --git a/java/noppes/npcs/api/event/IPartyEvent.java b/java/noppes/npcs/api/event/IPartyEvent.java index 9094d2a..d1994de 100644 --- a/java/noppes/npcs/api/event/IPartyEvent.java +++ b/java/noppes/npcs/api/event/IPartyEvent.java @@ -19,7 +19,8 @@ public interface IPartyEvent { } @Cancelable - interface PartyQuestTurnedInEvent extends IPartyEvent { } + interface PartyQuestTurnedInEvent extends IPartyEvent { + } @Cancelable interface PartyInviteEvent extends IPartyEvent { diff --git a/java/noppes/npcs/api/event/IPlayerEvent.java b/java/noppes/npcs/api/event/IPlayerEvent.java index 82e82f8..2d36189 100644 --- a/java/noppes/npcs/api/event/IPlayerEvent.java +++ b/java/noppes/npcs/api/event/IPlayerEvent.java @@ -289,7 +289,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } interface FillBucketEvent extends IPlayerEvent { - IItemStack getCurrent() ; + IItemStack getCurrent(); IItemStack getFilled(); } @@ -376,12 +376,14 @@ public interface IPlayerEvent extends ICustomNPCsEvent { * @hookName profileCreate */ @Cancelable - interface Create extends ProfileEvent {} + interface Create extends ProfileEvent { + } /** * @hookName profileRemove */ @Cancelable - interface Removed extends ProfileEvent {} + interface Removed extends ProfileEvent { + } } } diff --git a/java/noppes/npcs/api/event/IProjectileEvent.java b/java/noppes/npcs/api/event/IProjectileEvent.java index 949318f..5137273 100644 --- a/java/noppes/npcs/api/event/IProjectileEvent.java +++ b/java/noppes/npcs/api/event/IProjectileEvent.java @@ -7,6 +7,7 @@ import noppes.npcs.api.entity.IProjectile; public interface IProjectileEvent extends ICustomNPCsEvent { public IProjectile getProjectile(); + public IEntity getSource(); /** @@ -20,7 +21,9 @@ public interface IProjectileEvent extends ICustomNPCsEvent { */ interface ImpactEvent extends IProjectileEvent { public int getType(); + public IEntity getEntity(); + public IBlock getBlock(); } diff --git a/java/noppes/npcs/api/gui/ICustomGui.java b/java/noppes/npcs/api/gui/ICustomGui.java index 1cc286a..3a92495 100644 --- a/java/noppes/npcs/api/gui/ICustomGui.java +++ b/java/noppes/npcs/api/gui/ICustomGui.java @@ -3,6 +3,7 @@ package noppes.npcs.api.gui; import net.minecraft.nbt.NBTTagCompound; import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.item.IItemStack; + import java.util.List; /** @@ -90,10 +91,10 @@ public interface ICustomGui { /** * Adds a button to the GUI. * - * @param id the component ID. - * @param text the button label. - * @param x the x position. - * @param y the y position. + * @param id the component ID. + * @param text the button label. + * @param x the x position. + * @param y the y position. * @return the created button. */ IButton addButton(int id, String text, int x, int y); diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java index fc873c2..f6e8670 100644 --- a/java/noppes/npcs/api/handler/IAbilityHandler.java +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -3,7 +3,7 @@ package noppes.npcs.api.handler; /** * Handler for ability presets. Allows scripts to save, load, and manage * reusable ability templates. - * + *

    * Access via API.getAbilities() */ public interface IAbilityHandler { diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index cff50a4..683f410 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -5,7 +5,6 @@ import noppes.npcs.api.handler.data.IActionChain; import noppes.npcs.api.handler.data.IActionQueue; import noppes.npcs.api.handler.data.actions.IConditionalAction; -import java.util.List; import java.util.Queue; import java.util.function.Consumer; import java.util.function.Function; @@ -35,10 +34,10 @@ public interface IActionManager { /** * Create a new action instance without immediately scheduling it. * - * @param name a unique name for this action - * @param maxDuration the maximum lifetime of the action in ticks - * @param delay number of ticks to wait before the first run - * @param action code to execute each time the action "fires" + * @param name a unique name for this action + * @param maxDuration the maximum lifetime of the action in ticks + * @param delay number of ticks to wait before the first run + * @param action code to execute each time the action "fires" * @return a fresh {@link IAction} object */ IAction create(String name, int maxDuration, int delay, Consumer action); @@ -59,6 +58,7 @@ public interface IActionManager { /** * Enabling prints to the console the life cycle of IActionManager, it's IActionQueues and the scheduled IActions + * * @param debug * @return */ @@ -131,8 +131,8 @@ public interface IActionManager { */ IConditionalAction create(String name, Function condition, Consumer task, Function terminateWhen, Consumer onTermination); - /////////////////////////////////////////////////// - /////////////////////////////////////////////////// + /// //////////////////////////////////////////////// + /// //////////////////////////////////////////////// // Queues IActionQueue createQueue(String name); @@ -183,7 +183,7 @@ public interface IActionManager { /** * Convenience for {@link #create(Consumer)} + enqueue. * - * @param task code to execute each time the task "fires" + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(Consumer task); @@ -199,8 +199,8 @@ public interface IActionManager { /** * Convenience for {@link #create(String, Consumer)} + enqueue. * - * @param delay number of ticks to wait before the first task run - * @param task code to execute each time the task "fires" + * @param delay number of ticks to wait before the first task run + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(int delay, Consumer task); @@ -208,8 +208,8 @@ public interface IActionManager { /** * Convenience for {@link #create(String, Consumer)} + enqueue. * - * @param name a unique name for this action - * @param task code to execute each time the task "fires" + * @param name a unique name for this action + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(String name, Consumer task); @@ -217,9 +217,9 @@ public interface IActionManager { /** * Convenience for {@link #create(String, int, Consumer)} + enqueue. * - * @param name a unique name for this action + * @param name a unique name for this action * @param delay number of ticks to wait before the first task run - * @param task code to execute each time the task "fires" + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(String name, int delay, Consumer task); @@ -227,10 +227,10 @@ public interface IActionManager { /** * Convenience for {@link #create(String, int, int, Consumer)} + enqueue. * - * @param name a unique name for this action - * @param maxDuration the maximum lifetime of the action in ticks - * @param delay number of ticks to wait before the first task run - * @param task code to execute each time the task "fires" + * @param name a unique name for this action + * @param maxDuration the maximum lifetime of the action in ticks + * @param delay number of ticks to wait before the first task run + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(String name, int maxDuration, int delay, Consumer task); diff --git a/java/noppes/npcs/api/handler/IAttributeHandler.java b/java/noppes/npcs/api/handler/IAttributeHandler.java index 0ff0068..94a2ce5 100644 --- a/java/noppes/npcs/api/handler/IAttributeHandler.java +++ b/java/noppes/npcs/api/handler/IAttributeHandler.java @@ -19,7 +19,7 @@ public interface IAttributeHandler { * * @param player the player whose attributes are requested * @return an {@link IPlayerAttributes} instance containing all custom attributes for the player, - * or null if the player is invalid + * or null if the player is invalid */ IPlayerAttributes getPlayerAttributes(IPlayer player); diff --git a/java/noppes/npcs/api/handler/ICloneHandler.java b/java/noppes/npcs/api/handler/ICloneHandler.java index 6d8f8c2..90fecfb 100644 --- a/java/noppes/npcs/api/handler/ICloneHandler.java +++ b/java/noppes/npcs/api/handler/ICloneHandler.java @@ -7,9 +7,11 @@ import noppes.npcs.api.entity.IEntity; public interface ICloneHandler { IEntity spawn(double x, double y, double z, int tab, String name, IWorld world, boolean ignoreProtection); + IEntity spawn(IPos pos, int tab, String name, IWorld world, boolean ignoreProtection); IEntity spawn(double x, double y, double z, int tab, String name, IWorld world); + IEntity spawn(IPos pos, int tab, String name, IWorld world); IEntity[] getTab(int tab, IWorld world); diff --git a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java b/java/noppes/npcs/api/handler/IPlayerCurrencyData.java index 5e41452..0b9c84b 100644 --- a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java +++ b/java/noppes/npcs/api/handler/IPlayerCurrencyData.java @@ -14,12 +14,14 @@ public interface IPlayerCurrencyData { /** * Set the balance directly + * * @param balance The new balance */ void setBalance(long balance); /** * Add currency to balance (deposit) + * * @param amount Amount to add * @return true if successful, false if would exceed max balance */ @@ -27,6 +29,7 @@ public interface IPlayerCurrencyData { /** * Remove currency from balance (withdraw) + * * @param amount Amount to remove * @return true if successful, false if insufficient funds */ @@ -34,6 +37,7 @@ public interface IPlayerCurrencyData { /** * Check if player can afford an amount + * * @param amount Amount to check * @return true if player has enough balance */ @@ -56,6 +60,7 @@ public interface IPlayerCurrencyData { /** * Check if Vault is being used for currency operations + * * @return true if Vault is handling currency, false if using CNPC+ built-in */ boolean isUsingVault(); diff --git a/java/noppes/npcs/api/handler/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index cbcb397..9382a69 100644 --- a/java/noppes/npcs/api/handler/IPlayerData.java +++ b/java/noppes/npcs/api/handler/IPlayerData.java @@ -1,4 +1,5 @@ package noppes.npcs.api.handler; + import noppes.npcs.api.entity.ICustomNpc; public interface IPlayerData { diff --git a/java/noppes/npcs/api/handler/IPlayerQuestData.java b/java/noppes/npcs/api/handler/IPlayerQuestData.java index 219a146..0e7afae 100644 --- a/java/noppes/npcs/api/handler/IPlayerQuestData.java +++ b/java/noppes/npcs/api/handler/IPlayerQuestData.java @@ -24,5 +24,5 @@ public interface IPlayerQuestData { long getLastCompletedTime(int id); - void setLastCompletedTime(int id,long time); + void setLastCompletedTime(int id, long time); } diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index a1eab86..3290e28 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -31,7 +31,7 @@ public interface IScriptHookHandler { /** * Register a hook with full metadata including event type and imports. * - * @param context The context identifier (e.g., "npc", "player", "block") + * @param context The context identifier (e.g., "npc", "player", "block") * @param definition The hook definition containing all metadata */ void registerHookDefinition(String context, IHookDefinition definition); @@ -39,7 +39,7 @@ public interface IScriptHookHandler { /** * Get the hook definition for a specific hook. * - * @param context The context identifier + * @param context The context identifier * @param hookName The hook function name * @return The hook definition, or null if not found */ @@ -64,7 +64,7 @@ public interface IScriptHookHandler { /** * Check if a hook is registered in a specific context. * - * @param context The context to check + * @param context The context to check * @param hookName The function name to look for * @return true if the hook is registered */ diff --git a/java/noppes/npcs/api/handler/data/IAction.java b/java/noppes/npcs/api/handler/data/IAction.java index 9d7e104..29e3d9e 100644 --- a/java/noppes/npcs/api/handler/data/IAction.java +++ b/java/noppes/npcs/api/handler/data/IAction.java @@ -72,15 +72,15 @@ public interface IAction { /** * @return the maximum number of ticks this action is allowed to run before auto marking done - * + *

    * P.S: If max duration is reached and this IAction's thread (created using {@link #threadify()}) is paused by any of the pausing methods, - * the thread is forcibly resumed and finishes the task execution. + * the thread is forcibly resumed and finishes the task execution. */ int getMaxDuration(); /** * @param ticks max duration - * default: -1, infinite + * default: -1, infinite * @return */ IAction setMaxDuration(int ticks); @@ -171,12 +171,14 @@ public interface IAction { /** * Executes task every tick (Sets updateEvery to 1) + * * @return */ IAction everyTick(); /** * Executes task every second (Sets updateEvery to 20) + * * @return */ IAction everySecond(); @@ -206,7 +208,7 @@ 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. */ - void pauseUntil(Function until); + void pauseUntil(Function until); /** * Resumes thread that was previously paused by {@link #pause()}, {@link #pauseUntil(Function)}, {@link #pauseFor(int)} or {@link #pauseFor(long)} @@ -306,17 +308,17 @@ public interface IAction { void conditional(IConditionalAction... actions); - IConditionalAction conditional(Function condition, Consumer task); + IConditionalAction conditional(Function condition, Consumer task); - IConditionalAction conditional(String name, Function condition, Consumer task); + IConditionalAction conditional(String name, Function condition, Consumer task); - IConditionalAction conditional(Function condition, Consumer task, Function terminate); + IConditionalAction conditional(Function condition, Consumer task, Function terminate); - IConditionalAction conditional(String name, Function condition, Consumer task, Function terminate); + IConditionalAction conditional(String name, Function condition, Consumer task, Function terminate); - IConditionalAction conditional(Function condition, Consumer task, Function terminateWhen, Consumer onTermination); + IConditionalAction conditional(Function condition, Consumer task, Function terminateWhen, Consumer onTermination); - IConditionalAction conditional(String name, Function condition, Consumer task, Function terminateWhen, Consumer onTermination); + IConditionalAction conditional(String name, Function condition, Consumer task, Function terminateWhen, Consumer onTermination); /** * Enqueue another IAction on the parallel chain which starts firing simultaneously as this. diff --git a/java/noppes/npcs/api/handler/data/IActionChain.java b/java/noppes/npcs/api/handler/data/IActionChain.java index cd4efcf..7192c27 100644 --- a/java/noppes/npcs/api/handler/data/IActionChain.java +++ b/java/noppes/npcs/api/handler/data/IActionChain.java @@ -21,8 +21,8 @@ public interface IActionChain { /** * * @param delay ticks between an IAction and another - * @param name name of IAction - * @param task task of IAction + * @param name name of IAction + * @param task task of IAction * @return */ IActionChain after(int delay, String name, Consumer task); @@ -31,6 +31,7 @@ public interface IActionChain { /** * Start IActionManager + * * @return */ IActionChain start(); diff --git a/java/noppes/npcs/api/handler/data/IAnvilRecipe.java b/java/noppes/npcs/api/handler/data/IAnvilRecipe.java index 6fcda5b..9de714b 100644 --- a/java/noppes/npcs/api/handler/data/IAnvilRecipe.java +++ b/java/noppes/npcs/api/handler/data/IAnvilRecipe.java @@ -20,7 +20,8 @@ public interface IAnvilRecipe { /** * Checks whether the provided item and repair material match this recipe. - * @param itemToRepair the damaged item + * + * @param itemToRepair the damaged item * @param repairMaterial the material used to repair * @return true if the items match the recipe requirements */ @@ -28,6 +29,7 @@ public interface IAnvilRecipe { /** * Returns the repaired item based on the input damaged item. + * * @param itemToRepair the input damaged item * @return a copy with reduced damage */ diff --git a/java/noppes/npcs/api/handler/data/IDialog.java b/java/noppes/npcs/api/handler/data/IDialog.java index 82743a0..620f286 100644 --- a/java/noppes/npcs/api/handler/data/IDialog.java +++ b/java/noppes/npcs/api/handler/data/IDialog.java @@ -1,4 +1,5 @@ package noppes.npcs.api.handler.data; + import java.util.List; public interface IDialog { @@ -29,18 +30,23 @@ public interface IDialog { IDialogCategory getCategory(); void setDarkenScreen(boolean darkenScreen); + boolean getDarkenScreen(); void setDisableEsc(boolean disableEsc); + boolean getDisableEsc(); void setShowWheel(boolean showWheel); + boolean getShowWheel(); void setHideNPC(boolean hideNPC); + boolean getHideNPC(); void setSound(String sound); + String getSound(); void save(); diff --git a/java/noppes/npcs/api/handler/data/IDialogImage.java b/java/noppes/npcs/api/handler/data/IDialogImage.java index f019cd5..f48cefd 100644 --- a/java/noppes/npcs/api/handler/data/IDialogImage.java +++ b/java/noppes/npcs/api/handler/data/IDialogImage.java @@ -4,38 +4,52 @@ public interface IDialogImage { int getId(); void setTexture(String texture); + String getTexture(); void setPosition(int x, int y); + int getX(); + int getY(); void setWidthHeight(int width, int height); + int getWidth(); + int getHeight(); void setTextureOffset(int offsetX, int offsetY); + int getTextureX(); + int getTextureY(); void setColor(int color); + int getColor(); void setSelectedColor(int color); + int getSelectedColor(); void setScale(float scale); + float getScale(); void setAlpha(float alpha); + float getAlpha(); void setRotation(float rotation); + float getRotation(); void setImageType(int imageType); + int getImageType(); void setAlignment(int alignment); + int getAlignment(); } diff --git a/java/noppes/npcs/api/handler/data/IFramePart.java b/java/noppes/npcs/api/handler/data/IFramePart.java index 66a9f09..3bb63e2 100644 --- a/java/noppes/npcs/api/handler/data/IFramePart.java +++ b/java/noppes/npcs/api/handler/data/IFramePart.java @@ -1,6 +1,6 @@ package noppes.npcs.api.handler.data; -public interface IFramePart{ +public interface IFramePart { String getName(); diff --git a/java/noppes/npcs/api/handler/data/IMagicCycle.java b/java/noppes/npcs/api/handler/data/IMagicCycle.java index 976fed2..3f88337 100644 --- a/java/noppes/npcs/api/handler/data/IMagicCycle.java +++ b/java/noppes/npcs/api/handler/data/IMagicCycle.java @@ -45,7 +45,7 @@ public interface IMagicCycle { /** * Gets the layout type for the cycle. * This is typically an integer representation of the layout enum. - * + *

    * 0: CIRCULAR * 1: SQUARE * 2: TREE @@ -62,7 +62,7 @@ public interface IMagicCycle { /** * Sets the layout type for the cycle. * The provided integer should correspond to a valid layout type. - * + *

    * 0: CIRCULAR * 1: SQUARE * 2: TREE diff --git a/java/noppes/npcs/api/handler/data/IMagicData.java b/java/noppes/npcs/api/handler/data/IMagicData.java index c72f0e8..de3e080 100644 --- a/java/noppes/npcs/api/handler/data/IMagicData.java +++ b/java/noppes/npcs/api/handler/data/IMagicData.java @@ -24,9 +24,9 @@ public interface IMagicData { boolean isEmpty(); /** - * @param id The ID of the Magic + * @param id The ID of the Magic * @param damage The bonus damage for the Magic - * @param split The split of the Magic + * @param split The split of the Magic */ void addMagic(int id, float damage, float split); diff --git a/java/noppes/npcs/api/handler/data/IParty.java b/java/noppes/npcs/api/handler/data/IParty.java index c2b6e4a..9595d0e 100644 --- a/java/noppes/npcs/api/handler/data/IParty.java +++ b/java/noppes/npcs/api/handler/data/IParty.java @@ -18,24 +18,28 @@ public interface IParty { /** * Set a quest to the party (this does not validate use validateQuest()) + * * @param quest Quest Object */ void setQuest(IQuest quest); /** * Get the Quest for the Party, can be null + * * @return quest */ IQuest getQuest(); /** * Get the Quest ID for Party | -1 if no quest + * * @return quest id */ int getCurrentQuestID(); /** * Get the Quest Name for Party | BLANK if no quest + * * @return quest name */ String getCurrentQuestName(); @@ -68,12 +72,14 @@ public interface IParty { /** * Check if Player is in Party with IPlayer + * * @return true/false if player is in party */ boolean hasPlayer(IPlayer player); /** * Check if Player is in Party with Player Name + * * @return true/false if player is in party */ boolean hasPlayer(String playerName); @@ -90,7 +96,7 @@ public interface IParty { /** - * @param questID ID for the Quest to Verify + * @param questID ID for the Quest to Verify * @param sendLeaderMessages IF true will send ERROR message to Party Leader on why the quest could not be set * @return true/false if the party CAN have the quest set */ diff --git a/java/noppes/npcs/api/handler/data/IPartyOptions.java b/java/noppes/npcs/api/handler/data/IPartyOptions.java index 038902a..4ce1b72 100644 --- a/java/noppes/npcs/api/handler/data/IPartyOptions.java +++ b/java/noppes/npcs/api/handler/data/IPartyOptions.java @@ -12,7 +12,7 @@ public interface IPartyOptions { public void setOnlyParty(boolean onlyParty); /** - * @return 0:Leader, 1:All, 2:Valid + * @return 0:Leader, 1:All, 2:Valid */ public int getPartyRequirements(); @@ -22,7 +22,7 @@ public interface IPartyOptions { public void setPartyRequirements(int partyRequirements); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ public int getRewardControl(); @@ -32,7 +32,7 @@ public interface IPartyOptions { public void setRewardControl(int rewardControl); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ public int getCompleteFor(); @@ -42,7 +42,7 @@ public interface IPartyOptions { public void setCompleteFor(int completeFor); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ int getExecuteCommandFor(); diff --git a/java/noppes/npcs/api/handler/data/IProfileOptions.java b/java/noppes/npcs/api/handler/data/IProfileOptions.java index 8caed42..025e56b 100644 --- a/java/noppes/npcs/api/handler/data/IProfileOptions.java +++ b/java/noppes/npcs/api/handler/data/IProfileOptions.java @@ -7,22 +7,22 @@ public interface IProfileOptions { void setProfileOptions(boolean enable); /** - * @param profileType 0:Individual, 1:Shared + * @param profileType 0:Individual, 1:Shared */ void setCooldownControl(int profileType); /** - * @return 0:Individual, 1:Shared + * @return 0:Individual, 1:Shared */ int getCooldownControl(); /** - * @param profileType 0:Individual, 1:Shared + * @param profileType 0:Individual, 1:Shared */ void setCompleteControl(int profileType); /** - * @return 0:Individual, 1:Shared + * @return 0:Individual, 1:Shared */ int getCompleteControl(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestItem.java b/java/noppes/npcs/api/handler/data/IQuestItem.java index 4a025b6..883634b 100644 --- a/java/noppes/npcs/api/handler/data/IQuestItem.java +++ b/java/noppes/npcs/api/handler/data/IQuestItem.java @@ -2,11 +2,14 @@ package noppes.npcs.api.handler.data; public interface IQuestItem extends IQuestInterface { void setLeaveItems(boolean leaveItems); + boolean getLeaveItems(); void setIgnoreDamage(boolean ignoreDamage); + boolean getIgnoreDamage(); void setIgnoreNbt(boolean ignoreNbt); + boolean getIgnoreNbt(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestKill.java b/java/noppes/npcs/api/handler/data/IQuestKill.java index aaaa20a..86074d1 100644 --- a/java/noppes/npcs/api/handler/data/IQuestKill.java +++ b/java/noppes/npcs/api/handler/data/IQuestKill.java @@ -2,5 +2,6 @@ package noppes.npcs.api.handler.data; public interface IQuestKill extends IQuestInterface { void setTargetType(int type); + int getTargetType(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestLocation.java b/java/noppes/npcs/api/handler/data/IQuestLocation.java index c27a97a..27e43b5 100644 --- a/java/noppes/npcs/api/handler/data/IQuestLocation.java +++ b/java/noppes/npcs/api/handler/data/IQuestLocation.java @@ -2,11 +2,14 @@ package noppes.npcs.api.handler.data; public interface IQuestLocation extends IQuestInterface { void setLocation1(String loc1); + String getLocation1(); void setLocation2(String loc2); + String getLocation2(); void setLocation3(String loc3); + String getLocation3(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestObjective.java b/java/noppes/npcs/api/handler/data/IQuestObjective.java index 84b997f..d909a08 100644 --- a/java/noppes/npcs/api/handler/data/IQuestObjective.java +++ b/java/noppes/npcs/api/handler/data/IQuestObjective.java @@ -28,7 +28,7 @@ public interface IQuestObjective { * have a party * * @param playerName Name of Player - * @param progress Progress Amount + * @param progress Progress Amount */ void setPlayerProgress(String playerName, int progress); diff --git a/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java b/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java index 0b94a64..63b5f30 100644 --- a/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java +++ b/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java @@ -33,12 +33,14 @@ public interface IConditionalAction extends IAction { /** * Note: Only for Conditional Actions + * * @return how many times this conditional action has tested its condition */ int getCheckCount(); /** * Note: Only for Conditional Actions + * * @return the maximum number of checks before auto-expiring, or -1 if unlimited */ int getMaxChecks(); diff --git a/java/noppes/npcs/api/item/IItemCustom.java b/java/noppes/npcs/api/item/IItemCustom.java index c91f087..45145b7 100644 --- a/java/noppes/npcs/api/item/IItemCustom.java +++ b/java/noppes/npcs/api/item/IItemCustom.java @@ -14,12 +14,14 @@ public interface IItemCustom extends IItemCustomizable { /** * Sets the armor type for the scripted item. + * * @param armorType The armor type */ void setArmorType(int armorType); /** * Sets whether the scripted item is a tool. + * * @param isTool True if the item is a tool, false otherwise */ void setIsTool(boolean isTool); @@ -27,36 +29,42 @@ public interface IItemCustom extends IItemCustomizable { /** * Sets whether the scripted item is a normal item. Will disable * all forms of Rotation, Translation, Scale Rendering in hand and on ground + * * @param normalItem True if the item is a normal item, false otherwise */ void setIsNormalItem(boolean normalItem); /** * Sets the dig speed for the scripted item. + * * @param digSpeed The dig speed */ void setDigSpeed(int digSpeed); /** * Sets the maximum stack size for the scripted item. + * * @param maxStackSize The maximum stack size */ void setMaxStackSize(int maxStackSize); /** * Sets the current durability value for the scripted item. + * * @param durabilityValue The durability value */ void setDurabilityValue(float durabilityValue); /** * Sets the maximum item use duration for the scripted item. + * * @param duration The maximum item use duration */ void setMaxItemUseDuration(int duration); /** * Sets the item use action for the scripted item. + * * @param action The item use action */ void setItemUseAction(int action); @@ -64,12 +72,14 @@ public interface IItemCustom extends IItemCustomizable { /** * Sets the attack speed for the scripted item. * Speed is the max resistantance time between two attacks in ticks. + * * @param speed The attack speed */ void setAttackSpeed(int speed); /** * Sets the enchantability for the scripted item. + * * @param enchantability The enchantability */ void setEnchantability(int enchantability); diff --git a/java/noppes/npcs/api/item/IItemCustomizable.java b/java/noppes/npcs/api/item/IItemCustomizable.java index 68e9fcf..c085052 100644 --- a/java/noppes/npcs/api/item/IItemCustomizable.java +++ b/java/noppes/npcs/api/item/IItemCustomizable.java @@ -8,48 +8,56 @@ public interface IItemCustomizable extends IItemStack { /** * Gets the armor type for the scripted item. + * * @return The armor type */ int getArmorType(); /** * Checks if the scripted item is a tool. Allows for enchanting + * * @return True if the item is a tool, false otherwise */ boolean isTool(); /** * Checks if the scripted item is a normal item. + * * @return True if the item is a normal item, false otherwise */ boolean isNormalItem(); /** * Gets the dig speed for the scripted item. + * * @return The dig speed */ int getDigSpeed(); /** * Gets the current durability value for the scripted item. + * * @return The durability value */ double getDurabilityValue(); /** * Gets the maximum item use duration for the scripted item. + * * @return The maximum item use duration */ int getMaxItemUseDuration(); /** * Gets the item use action for the scripted item. + * * @return The item use action */ int getItemUseAction(); /** * Gets the enchantability for the scripted item. + * * @return The enchantability */ int getEnchantability(); @@ -57,60 +65,70 @@ public interface IItemCustomizable extends IItemStack { /** * Gets the attack speed for the scripted item. * Speed is the max hurt resistant time in ticks (20 ticks = 1 second) + * * @return The attack speed */ int getAttackSpeed(); /** * Gets the texture path for the scripted item. + * * @return The texture path */ String getTexture(); /** * Sets the texture path for the scripted item. Can be a URL + * * @param texture The texture path */ void setTexture(String texture); /** * Checks if the durability bar should be shown for the scripted item. + * * @return True if the durability bar should be shown, false otherwise */ Boolean getDurabilityShow(); /** * Sets whether the durability bar should be shown for the scripted item. + * * @param durabilityShow True if the durability bar should be shown, false otherwise */ void setDurabilityShow(Boolean durabilityShow); /** * Gets the color of the durability bar for the scripted item. + * * @return The durability bar color */ Integer getDurabilityColor(); /** * Sets the color of the durability bar for the scripted item. + * * @param durabilityColor The durability bar color */ void setDurabilityColor(Integer durabilityColor); /** * Gets the color of the scripted item. + * * @return The item color */ Integer getColor(); /** * Sets the color of the scripted item. + * * @param color The item color */ void setColor(Integer color); /** * Sets the rotation values for the scripted item. + * * @param rotationX The X-axis rotation * @param rotationY The Y-axis rotation * @param rotationZ The Z-axis rotation @@ -119,6 +137,7 @@ public interface IItemCustomizable extends IItemStack { /** * Sets the rotation rate values for the scripted item. Spinning Speed + * * @param rotationXRate The X-axis rotation rate * @param rotationYRate The Y-axis rotation rate * @param rotationZRate The Z-axis rotation rate @@ -127,6 +146,7 @@ public interface IItemCustomizable extends IItemStack { /** * Sets the scale values for the scripted item. + * * @param scaleX The X-axis scale * @param scaleY The Y-axis scale * @param scaleZ The Z-axis scale @@ -135,6 +155,7 @@ public interface IItemCustomizable extends IItemStack { /** * Sets the translation values for the scripted item. + * * @param translateX The X-axis translation * @param translateY The Y-axis translation * @param translateZ The Z-axis translation @@ -143,72 +164,84 @@ public interface IItemCustomizable extends IItemStack { /** * Gets the X-axis rotation for the scripted item. + * * @return The X-axis rotation */ Float getRotationX(); /** * Gets the Y-axis rotation for the scripted item. + * * @return The Y-axis rotation */ Float getRotationY(); /** * Gets the Z-axis rotation for the scripted item. + * * @return The Z-axis rotation */ Float getRotationZ(); /** * Gets the X-axis rotation rate for the scripted item. + * * @return The X-axis rotation rate */ Float getRotationXRate(); /** * Gets the Y-axis rotation rate for the scripted item. + * * @return The Y-axis rotation rate */ Float getRotationYRate(); /** * Gets the Z-axis rotation rate for the scripted item. + * * @return The Z-axis rotation rate */ Float getRotationZRate(); /** * Gets the X-axis scale for the scripted item. + * * @return The X-axis scale */ Float getScaleX(); /** * Gets the Y-axis scale for the scripted item. + * * @return The Y-axis scale */ Float getScaleY(); /** * Gets the Z-axis scale for the scripted item. + * * @return The Z-axis scale */ Float getScaleZ(); /** * Gets the X-axis translation for the scripted item. + * * @return The X-axis translation */ Float getTranslateX(); /** * Gets the Y-axis translation for the scripted item. + * * @return The Y-axis translation */ Float getTranslateY(); /** * Gets the Z-axis translation for the scripted item. + * * @return The Z-axis translation */ Float getTranslateZ(); diff --git a/java/noppes/npcs/api/item/IItemStack.java b/java/noppes/npcs/api/item/IItemStack.java index 92e51dd..8aa50d2 100644 --- a/java/noppes/npcs/api/item/IItemStack.java +++ b/java/noppes/npcs/api/item/IItemStack.java @@ -375,9 +375,9 @@ public interface IItemStack { /** * Compares this item with another item, with options to ignore damage and/or NBT data. * - * @param item The item to compare. + * @param item The item to compare. * @param ignoreDamage true to ignore damage values. - * @param ignoreNBT true to ignore NBT data. + * @param ignoreNBT true to ignore NBT data. * @return true if the items are considered equal, false otherwise. */ boolean compare(IItemStack item, boolean ignoreDamage, boolean ignoreNBT); diff --git a/java/noppes/npcs/api/jobs/IJobBard.java b/java/noppes/npcs/api/jobs/IJobBard.java index 7dbb2d3..b3a5cd8 100644 --- a/java/noppes/npcs/api/jobs/IJobBard.java +++ b/java/noppes/npcs/api/jobs/IJobBard.java @@ -1,7 +1,7 @@ package noppes.npcs.api.jobs; public interface IJobBard extends IJob { - + String getSong(); void setSong(String song); @@ -11,14 +11,18 @@ public interface IJobBard extends IJob { int getInstrumentId(); void setMinRange(int range); + int getMinRange(); void setMaxRange(int range); + int getMaxRange(); void setStreaming(boolean streaming); + boolean getStreaming(); void hasOffRange(boolean value); + boolean hasOffRange(); } diff --git a/java/noppes/npcs/api/jobs/IJobGuard.java b/java/noppes/npcs/api/jobs/IJobGuard.java index 166f7df..51e1f3f 100644 --- a/java/noppes/npcs/api/jobs/IJobGuard.java +++ b/java/noppes/npcs/api/jobs/IJobGuard.java @@ -2,11 +2,14 @@ package noppes.npcs.api.jobs; public interface IJobGuard extends IJob { boolean attackCreepers(); + void attackCreepers(boolean value); boolean attacksAnimals(); + void attacksAnimals(boolean value); boolean attackHostileMobs(); + void attackHostileMobs(boolean value); } diff --git a/java/noppes/npcs/api/jobs/IJobHealer.java b/java/noppes/npcs/api/jobs/IJobHealer.java index 361df11..14e51c4 100644 --- a/java/noppes/npcs/api/jobs/IJobHealer.java +++ b/java/noppes/npcs/api/jobs/IJobHealer.java @@ -7,8 +7,10 @@ public interface IJobHealer extends IJob { void heal(IEntityLivingBase entity, float amount); void setRange(int range); + int getRange(); void setSpeed(int speed); + int getSpeed(); } diff --git a/java/noppes/npcs/api/overlay/IOverlayLine.java b/java/noppes/npcs/api/overlay/IOverlayLine.java index 8b47d98..1e12b1b 100644 --- a/java/noppes/npcs/api/overlay/IOverlayLine.java +++ b/java/noppes/npcs/api/overlay/IOverlayLine.java @@ -2,14 +2,22 @@ package noppes.npcs.api.overlay; public interface IOverlayLine extends ICustomOverlayComponent { int getX1(); + int getY1(); + int getX2(); + int getY2(); + int getThickness(); void setX1(int x1); + void setY1(int y1); + void setX2(int x2); + void setY2(int y2); + void setThickness(int thickness); } diff --git a/java/noppes/npcs/api/package-info.java b/java/noppes/npcs/api/package-info.java index 4ab2b54..9e53615 100644 --- a/java/noppes/npcs/api/package-info.java +++ b/java/noppes/npcs/api/package-info.java @@ -1,3 +1,4 @@ @API(owner = "customnpcs", provides = "Core", apiVersion = "0.1") package noppes.npcs.api; + import cpw.mods.fml.common.API; diff --git a/java/noppes/npcs/api/roles/IRoleFollower.java b/java/noppes/npcs/api/roles/IRoleFollower.java index 6e7aaa7..78b2aed 100644 --- a/java/noppes/npcs/api/roles/IRoleFollower.java +++ b/java/noppes/npcs/api/roles/IRoleFollower.java @@ -5,20 +5,20 @@ import noppes.npcs.api.entity.IPlayer; public interface IRoleFollower extends IRole { /** - * @since 1.7.10c * @param player Player who is set as the owner. If null given everything resets + * @since 1.7.10c */ void setOwner(IPlayer player); /** - * @since 1.7.10c * @return Returns the followers owner. Returns null if he has no owner or the owner is offline + * @since 1.7.10c */ IPlayer getOwner(); /** - * @since 1.7.10c * @return Returns whether or not the follower has an owner + * @since 1.7.10c */ boolean hasOwner(); @@ -27,44 +27,44 @@ public interface IRoleFollower extends IRole { void setIsFollowing(boolean following); /** - * @since 1.7.10c * @return Returns days left + * @since 1.7.10c */ int getDaysLeft(); /** - * @since 1.7.10c * @param days The days you want to add to the days remaining + * @since 1.7.10c */ void addDaysLeft(int days); /** - * @since 1.7.10c * @return Returns whether or not the follower is set to infinite days + * @since 1.7.10c */ boolean getInfiniteDays(); /** - * @since 1.7.10c * @param infinite Sets whether the days hired are infinite + * @since 1.7.10c */ void setInfiniteDays(boolean infinite); /** - * @since 1.7.10c * @return Return whether the gui is disabled + * @since 1.7.10c */ boolean getGuiDisabled(); /** - * @since 1.7.10c * @param disabled Set the gui to be disabled or not + * @since 1.7.10c */ void setGuiDisabled(boolean disabled); /** - * @param index Index of Rate [0 - 2] + * @param index Index of Rate [0 - 2] * @param amount Amount hired for */ public void setRate(int index, int amount); diff --git a/java/noppes/npcs/api/roles/IRoleTrader.java b/java/noppes/npcs/api/roles/IRoleTrader.java index 3f43146..b76a39e 100644 --- a/java/noppes/npcs/api/roles/IRoleTrader.java +++ b/java/noppes/npcs/api/roles/IRoleTrader.java @@ -6,17 +6,17 @@ import noppes.npcs.api.item.IItemStack; public interface IRoleTrader extends IRole { /** - * @param slot Slot number 0-17 - * @param currency Currency item + * @param slot Slot number 0-17 + * @param currency Currency item * @param currency2 Currency item number two - * @param sold Item to be sold by this npc + * @param sold Item to be sold by this npc */ void setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold); /** - * @param slot Slot number 0-17 + * @param slot Slot number 0-17 * @param currency Currency item - * @param sold Item to be sold by this npc + * @param sold Item to be sold by this npc */ void setSellOption(int slot, IItemStack currency, IItemStack sold); @@ -67,12 +67,14 @@ public interface IRoleTrader extends IRole { /** * sets the purchase num for that slot to 0 + * * @param slot */ void resetPurchaseNum(int slot); /** * sets the purchase num for that slot and player to 0 + * * @param slot * @param player */ @@ -93,12 +95,14 @@ public interface IRoleTrader extends IRole { /** * prevent an item from being sold on that slot + * * @param slot */ void disableSlot(int slot); /** * disables the slot for this player + * * @param slot * @param player */ @@ -106,12 +110,14 @@ public interface IRoleTrader extends IRole { /** * allow an item to be sold on that slot + * * @param slot */ void enableSlot(int slot); /** * enables the slot for this player + * * @param slot * @param player */ @@ -141,30 +147,35 @@ public interface IRoleTrader extends IRole { /** * Get the stock reset type + * * @return 0=NONE, 1=MCDAILY, 2=MCWEEKLY, 3=MCCUSTOM, 4=RLDAILY, 5=RLWEEKLY, 6=RLCUSTOM */ int getStockResetType(); /** * Set stock reset type + * * @param type 0=NONE, 1=MCDAILY, 2=MCWEEKLY, 3=MCCUSTOM, 4=RLDAILY, 5=RLWEEKLY, 6=RLCUSTOM */ void setStockResetType(int type); /** * Get custom reset time (only used for MCCUSTOM/RLCUSTOM) + * * @return Custom time in ticks (MC) or milliseconds (RL) */ long getCustomResetTime(); /** * Set custom reset time + * * @param time Time in ticks (MC) or milliseconds (RL) */ void setCustomResetTime(long time); /** * Get max stock for a slot + * * @param slot Slot number 0-17 * @return Max stock, -1 = unlimited */ @@ -172,13 +183,15 @@ public interface IRoleTrader extends IRole { /** * Set max stock for a slot - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param amount Max stock, -1 = unlimited */ void setMaxStock(int slot, int amount); /** * Get available stock for a slot (global mode) + * * @param slot Slot number 0-17 * @return Available stock, Integer.MAX_VALUE if unlimited */ @@ -186,7 +199,8 @@ public interface IRoleTrader extends IRole { /** * Get available stock for a slot for a specific player (per-player mode) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param player The player * @return Available stock, Integer.MAX_VALUE if unlimited */ @@ -205,6 +219,7 @@ public interface IRoleTrader extends IRole { /** * Get current stock for a slot (global mode) + * * @param slot Slot number 0-17 * @return Current stock, -1 if not initialized */ @@ -212,14 +227,16 @@ public interface IRoleTrader extends IRole { /** * Set current stock for a slot (global mode only) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param amount Current stock amount */ void setCurrentStock(int slot, int amount); /** * Get purchased amount for a player in a slot (per-player mode) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param player The player * @return Purchased amount (stock available = maxStock - purchasedAmount) */ @@ -227,7 +244,8 @@ public interface IRoleTrader extends IRole { /** * Set purchased amount for a player in a slot (per-player mode) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param player The player * @param amount Purchased amount */ @@ -235,12 +253,14 @@ public interface IRoleTrader extends IRole { /** * Get the timestamp of the last stock reset + * * @return Time in ticks (MC) or milliseconds (RL), depending on reset type */ long getLastResetTime(); /** * Get time remaining until next stock reset + * * @return Time remaining in ticks (MC) or milliseconds (RL), -1 if no reset scheduled */ long getTimeUntilReset(); @@ -249,6 +269,7 @@ public interface IRoleTrader extends IRole { /** * Get the currency cost for a slot (additive to item costs) + * * @param slot Slot number 0-17 * @return Currency cost, 0 = no cost */ @@ -256,6 +277,7 @@ public interface IRoleTrader extends IRole { /** * Set the currency cost for a slot (additive to item costs) + * * @param slot Slot number 0-17 * @param cost Currency cost, 0 = no cost */ diff --git a/java/noppes/npcs/api/scoreboard/IScoreboard.java b/java/noppes/npcs/api/scoreboard/IScoreboard.java index 6e5f7af..3adf4ed 100644 --- a/java/noppes/npcs/api/scoreboard/IScoreboard.java +++ b/java/noppes/npcs/api/scoreboard/IScoreboard.java @@ -16,7 +16,7 @@ public interface IScoreboard { void setPlayerScore(String player, String objective, int score, String datatag); void setPlayerScore(IPlayer player, String objective, int score, String datatag); - + int getPlayerScore(String player, String objective, String datatag); int getPlayerScore(IPlayer player, String objective, String datatag); From c8a2fb9824de8488627f66eed2a5254ee8690016 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 24 Jan 2026 02:35:13 -0500 Subject: [PATCH 19/93] Telegraph API System --- java/noppes/npcs/api/AbstractNpcAPI.java | 12 + java/noppes/npcs/api/ITelegraph.java | 224 ++++++++++++++++++ java/noppes/npcs/api/ITelegraphInstance.java | 114 +++++++++ .../npcs/api/handler/ITelegraphHandler.java | 193 +++++++++++++++ 4 files changed, 543 insertions(+) create mode 100644 java/noppes/npcs/api/ITelegraph.java create mode 100644 java/noppes/npcs/api/ITelegraphInstance.java create mode 100644 java/noppes/npcs/api/handler/ITelegraphHandler.java diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 488b3a1..f5dab48 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -30,6 +30,7 @@ import noppes.npcs.api.handler.IProfileHandler; import noppes.npcs.api.handler.IQuestHandler; import noppes.npcs.api.handler.IRecipeHandler; import noppes.npcs.api.handler.IScriptHookHandler; +import noppes.npcs.api.handler.ITelegraphHandler; import noppes.npcs.api.handler.ITransportHandler; import noppes.npcs.api.handler.data.IAnimation; import noppes.npcs.api.handler.data.IFrame; @@ -177,6 +178,17 @@ public abstract class AbstractNpcAPI { public abstract IAbilityHandler getAbilities(); + public abstract ITelegraphHandler getTelegraphs(); + + /** + * Create a telegraph directly. + * Convenience method equivalent to getTelegraphs().create(type). + * + * @param type Type name: "circle", "ring", "line", "cone", "point" + * @return A new telegraph configuration + */ + public abstract ITelegraph createTelegraph(String type); + public abstract String[] getAllBiomeNames(); public abstract ICustomNpc createNPC(IWorld var1); diff --git a/java/noppes/npcs/api/ITelegraph.java b/java/noppes/npcs/api/ITelegraph.java new file mode 100644 index 0000000..389cddc --- /dev/null +++ b/java/noppes/npcs/api/ITelegraph.java @@ -0,0 +1,224 @@ +package noppes.npcs.api; + +import noppes.npcs.api.entity.IEntity; + +/** + * A telegraph is a visual warning indicator that displays on the ground. + * Telegraphs are commonly used to warn players of incoming attacks or mark areas of effect. + *

    + * To create a telegraph: + *

    + * var telegraph = API.getTelegraphs().createCircle(5.0);
    + * telegraph.setDuration(60); // 3 seconds
    + * telegraph.setColor(0x80FF0000); // Semi-transparent red
    + * var instance = telegraph.spawn(world, x, y, z);
    + * 
    + *

    + * Telegraph types: + *

      + *
    • CIRCLE - A filled circle with a radius
    • + *
    • RING - A ring with inner and outer radius
    • + *
    • LINE - A rectangular line in a direction
    • + *
    • CONE - A cone/arc shape
    • + *
    • POINT - A small point marker
    • + *
    + */ +public interface ITelegraph { + + // ═══════════════════════════════════════════════════════════════════════════ + // TYPE + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the telegraph type. + * + * @return Type name: "CIRCLE", "RING", "LINE", "CONE", or "POINT" + */ + String getType(); + + /** + * Set the telegraph type. + * + * @param type Type name: "circle", "ring", "line", "cone", or "point" (case insensitive) + */ + void setType(String type); + + // ═══════════════════════════════════════════════════════════════════════════ + // SHAPE PARAMETERS + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the radius (for CIRCLE and RING types). + */ + float getRadius(); + + /** + * Set the radius (for CIRCLE and RING types). + */ + void setRadius(float radius); + + /** + * Get the inner radius (for RING type). + */ + float getInnerRadius(); + + /** + * Set the inner radius (for RING type). + */ + void setInnerRadius(float innerRadius); + + /** + * Get the length (for LINE and CONE types). + */ + float getLength(); + + /** + * Set the length (for LINE and CONE types). + */ + void setLength(float length); + + /** + * Get the width (for LINE type). + */ + float getWidth(); + + /** + * Set the width (for LINE type). + */ + void setWidth(float width); + + /** + * Get the angle in degrees (for CONE type). + */ + float getAngle(); + + /** + * Set the angle in degrees (for CONE type). + */ + void setAngle(float angle); + + // ═══════════════════════════════════════════════════════════════════════════ + // TIMING + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the duration in ticks. + */ + int getDuration(); + + /** + * Set the duration in ticks (20 ticks = 1 second). + */ + void setDuration(int ticks); + + // ═══════════════════════════════════════════════════════════════════════════ + // COLORS + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the primary color in ARGB format. + */ + int getColor(); + + /** + * Set the primary color in ARGB format. + * Example: 0x80FF0000 for semi-transparent red + */ + void setColor(int argb); + + /** + * Get the warning phase color in ARGB format. + */ + int getWarningColor(); + + /** + * Set the warning phase color in ARGB format. + * This color is used during the final warning phase. + */ + void setWarningColor(int argb); + + /** + * Get the tick at which warning phase begins. + */ + int getWarningStartTick(); + + /** + * Set the tick at which warning phase begins. + * When remaining ticks falls below this value, the telegraph uses the warning color. + */ + void setWarningStartTick(int tick); + + // ═══════════════════════════════════════════════════════════════════════════ + // ANIMATION + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Check if pulsing animation is enabled. + */ + boolean isAnimated(); + + /** + * Enable or disable pulsing animation. + */ + void setAnimated(boolean animated); + + // ═══════════════════════════════════════════════════════════════════════════ + // POSITIONING + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the height offset from ground level. + */ + float getHeightOffset(); + + /** + * Set the height offset from ground level. + * Default is 0.1 to prevent z-fighting with ground blocks. + */ + void setHeightOffset(float offset); + + // ═══════════════════════════════════════════════════════════════════════════ + // SPAWN METHODS + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Spawn this telegraph at a position. + * + * @param world The world to spawn in + * @param x X position + * @param y Y position + * @param z Z position + * @return The spawned telegraph instance + */ + ITelegraphInstance spawn(IWorld world, double x, double y, double z); + + /** + * Spawn this telegraph at a position with rotation. + * + * @param world The world to spawn in + * @param x X position + * @param y Y position + * @param z Z position + * @param yaw Rotation yaw (for directional telegraphs like LINE/CONE) + * @return The spawned telegraph instance + */ + ITelegraphInstance spawn(IWorld world, double x, double y, double z, float yaw); + + /** + * Spawn this telegraph following an entity. + * The telegraph will update its position to follow the entity. + * + * @param entity The entity to follow + * @return The spawned telegraph instance + */ + ITelegraphInstance spawn(IEntity entity); + + /** + * Spawn this telegraph following an entity with rotation. + * + * @param entity The entity to follow + * @param yaw Rotation yaw + * @return The spawned telegraph instance + */ + ITelegraphInstance spawn(IEntity entity, float yaw); +} diff --git a/java/noppes/npcs/api/ITelegraphInstance.java b/java/noppes/npcs/api/ITelegraphInstance.java new file mode 100644 index 0000000..2421e1a --- /dev/null +++ b/java/noppes/npcs/api/ITelegraphInstance.java @@ -0,0 +1,114 @@ +package noppes.npcs.api; + +import noppes.npcs.api.entity.IEntity; + +/** + * A runtime instance of an active telegraph in the world. + * Represents a spawned telegraph with position, timing, and control methods. + *

    + * Instances are created when you call spawn() on an ITelegraph: + *

    + * var telegraph = API.getTelegraphs().createCircle(5.0);
    + * var instance = telegraph.spawn(world, x, y, z);
    + *
    + * // Later...
    + * instance.remove(); // Remove the telegraph early
    + * 
    + */ +public interface ITelegraphInstance { + + /** + * Get the unique instance ID. + */ + String getInstanceId(); + + // ═══════════════════════════════════════════════════════════════════════════ + // POSITION + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the current X position. + */ + double getX(); + + /** + * Get the current Y position. + */ + double getY(); + + /** + * Get the current Z position. + */ + double getZ(); + + /** + * Get the rotation yaw. + */ + float getYaw(); + + /** + * Set the position. + * Note: Only works for static telegraphs (not following an entity). + */ + void setPosition(double x, double y, double z); + + // ═══════════════════════════════════════════════════════════════════════════ + // ENTITY FOLLOWING + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Make this telegraph follow an entity. + * The telegraph position will update each tick to match the entity. + */ + void followEntity(IEntity entity); + + /** + * Stop following any entity and fix the current position. + */ + void stopFollowing(); + + /** + * Check if this telegraph is following an entity. + */ + boolean isFollowing(); + + // ═══════════════════════════════════════════════════════════════════════════ + // TIMING + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get the remaining ticks before the telegraph expires. + */ + int getRemainingTicks(); + + /** + * Get the total duration ticks. + */ + int getTotalTicks(); + + /** + * Get the progress from 0.0 (just started) to 1.0 (finished). + */ + float getProgress(); + + /** + * Check if the telegraph is in the warning phase. + */ + boolean isWarning(); + + // ═══════════════════════════════════════════════════════════════════════════ + // CONTROL + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Remove this telegraph immediately. + * Sends a removal packet to all clients tracking it. + */ + void remove(); + + /** + * Lock the telegraph at its current position. + * Equivalent to calling stopFollowing(). + */ + void lockPosition(); +} diff --git a/java/noppes/npcs/api/handler/ITelegraphHandler.java b/java/noppes/npcs/api/handler/ITelegraphHandler.java new file mode 100644 index 0000000..c73b2c6 --- /dev/null +++ b/java/noppes/npcs/api/handler/ITelegraphHandler.java @@ -0,0 +1,193 @@ +package noppes.npcs.api.handler; + +import noppes.npcs.api.ITelegraph; +import noppes.npcs.api.ITelegraphInstance; +import noppes.npcs.api.IWorld; +import noppes.npcs.api.entity.IEntity; + +/** + * Handler for creating and managing telegraphs. + * Access via API.getTelegraphs() + *

    + * Example usage: + *

    + * // Create a telegraph
    + * var telegraph = API.getTelegraphs().createCircle(5.0);
    + * telegraph.setDuration(60); // 3 seconds
    + * telegraph.setColor(0x80FF0000); // Semi-transparent red
    + *
    + * // Spawn it
    + * var instance = telegraph.spawn(world, x, y, z);
    + *
    + * // Or save as a preset for reuse
    + * API.getTelegraphs().save("myCircle", telegraph);
    + *
    + * // Load preset later
    + * var loaded = API.getTelegraphs().get("myCircle");
    + * loaded.spawn(world, x, y, z);
    + * 
    + */ +public interface ITelegraphHandler { + + // ═══════════════════════════════════════════════════════════════════════════ + // FACTORY METHODS + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Create a circle telegraph. + * + * @param radius The radius of the circle + * @return A new telegraph configuration + */ + ITelegraph createCircle(float radius); + + /** + * Create a ring telegraph. + * + * @param outerRadius The outer radius + * @param innerRadius The inner radius + * @return A new telegraph configuration + */ + ITelegraph createRing(float outerRadius, float innerRadius); + + /** + * Create a line telegraph. + * + * @param length The length of the line + * @param width The width of the line + * @return A new telegraph configuration + */ + ITelegraph createLine(float length, float width); + + /** + * Create a cone telegraph. + * + * @param length The length of the cone + * @param angle The angle of the cone in degrees + * @return A new telegraph configuration + */ + ITelegraph createCone(float length, float angle); + + /** + * Create a point telegraph. + * + * @return A new telegraph configuration + */ + ITelegraph createPoint(); + + /** + * Create a telegraph by type name. + * + * @param type Type name: "circle", "ring", "line", "cone", "point" (case insensitive) + * @return A new telegraph configuration, or null if type is invalid + */ + ITelegraph create(String type); + + // ═══════════════════════════════════════════════════════════════════════════ + // SPAWN METHODS + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Spawn a telegraph at a position. + * + * @param telegraph The telegraph configuration + * @param world The world + * @param x X position + * @param y Y position + * @param z Z position + * @return The spawned instance + */ + ITelegraphInstance spawn(ITelegraph telegraph, IWorld world, double x, double y, double z); + + /** + * Spawn a telegraph at a position with rotation. + * + * @param telegraph The telegraph configuration + * @param world The world + * @param x X position + * @param y Y position + * @param z Z position + * @param yaw Rotation yaw + * @return The spawned instance + */ + ITelegraphInstance spawn(ITelegraph telegraph, IWorld world, double x, double y, double z, float yaw); + + /** + * Spawn a telegraph following an entity. + * + * @param telegraph The telegraph configuration + * @param entity The entity to follow + * @return The spawned instance + */ + ITelegraphInstance spawn(ITelegraph telegraph, IEntity entity); + + /** + * Spawn a telegraph following an entity with rotation. + * + * @param telegraph The telegraph configuration + * @param entity The entity to follow + * @param yaw Rotation yaw + * @return The spawned instance + */ + ITelegraphInstance spawn(ITelegraph telegraph, IEntity entity, float yaw); + + // ═══════════════════════════════════════════════════════════════════════════ + // PRESET MANAGEMENT + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Get a saved telegraph preset by name. + * + * @param name The preset name + * @return The telegraph configuration, or null if not found + */ + ITelegraph get(String name); + + /** + * Save a telegraph as a preset. + * + * @param name The name for the preset + * @param telegraph The telegraph configuration to save + */ + void save(String name, ITelegraph telegraph); + + /** + * Delete a saved preset. + * + * @param name The preset name + */ + void delete(String name); + + /** + * Check if a preset exists. + * + * @param name The preset name + * @return True if the preset exists + */ + boolean has(String name); + + /** + * Get all saved preset names. + * + * @return Array of preset names + */ + String[] getSavedNames(); + + // ═══════════════════════════════════════════════════════════════════════════ + // REMOVAL + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Remove an active telegraph by instance ID. + * + * @param instanceId The instance ID to remove + */ + void remove(String instanceId); + + /** + * Remove an active telegraph instance. + * + * @param instance The instance to remove + */ + void remove(ITelegraphInstance instance); +} From 2e5d86993cd47e6df4572323514d4fe2166c570c Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 24 Jan 2026 15:11:38 -0500 Subject: [PATCH 20/93] Auction and Currency API --- java/noppes/npcs/api/AbstractNpcAPI.java | 7 + .../npcs/api/handler/IAuctionHandler.java | 129 ++++++++++++++++++ java/noppes/npcs/api/handler/IPlayerData.java | 2 +- ...urrencyData.java => IPlayerTradeData.java} | 30 +++- .../npcs/api/handler/data/IAuctionClaim.java | 99 ++++++++++++++ .../api/handler/data/IAuctionListing.java | 120 ++++++++++++++++ 6 files changed, 383 insertions(+), 4 deletions(-) create mode 100644 java/noppes/npcs/api/handler/IAuctionHandler.java rename java/noppes/npcs/api/handler/{IPlayerCurrencyData.java => IPlayerTradeData.java} (66%) create mode 100644 java/noppes/npcs/api/handler/data/IAuctionClaim.java create mode 100644 java/noppes/npcs/api/handler/data/IAuctionListing.java diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index f5dab48..585ccf2 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -19,6 +19,7 @@ import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IAbilityHandler; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IAnimationHandler; +import noppes.npcs.api.handler.IAuctionHandler; import noppes.npcs.api.handler.ICloneHandler; import noppes.npcs.api.handler.ICustomEffectHandler; import noppes.npcs.api.handler.IDialogHandler; @@ -180,6 +181,12 @@ public abstract class AbstractNpcAPI { public abstract ITelegraphHandler getTelegraphs(); + /** + * Get the auction handler for managing auctions via scripts. + * @return The auction handler, or null if auctions are disabled + */ + public abstract IAuctionHandler getAuctions(); + /** * Create a telegraph directly. * Convenience method equivalent to getTelegraphs().create(type). diff --git a/java/noppes/npcs/api/handler/IAuctionHandler.java b/java/noppes/npcs/api/handler/IAuctionHandler.java new file mode 100644 index 0000000..eaf8816 --- /dev/null +++ b/java/noppes/npcs/api/handler/IAuctionHandler.java @@ -0,0 +1,129 @@ +package noppes.npcs.api.handler; + +import noppes.npcs.api.entity.IPlayer; +import noppes.npcs.api.handler.data.IAuctionListing; +import noppes.npcs.api.item.IItemStack; + +/** + * Handler for the Auction system. + * Access via API.getAuctions() + */ +public interface IAuctionHandler { + + /** + * Check if the auction system is enabled. + */ + boolean isEnabled(); + + /** + * Get all active listings. + */ + IAuctionListing[] getActiveListings(); + + /** + * Get a specific listing by ID. + * @param listingId The listing ID + * @return The listing, or null if not found + */ + IAuctionListing getListing(String listingId); + + /** + * Get all active listings by a specific seller. + * @param sellerUUID The seller's UUID as a string + */ + IAuctionListing[] getListingsBySeller(String sellerUUID); + + /** + * Get all listings where a player is the current high bidder. + * @param bidderUUID The bidder's UUID as a string + */ + IAuctionListing[] getListingsByBidder(String bidderUUID); + + /** + * Get total count of active listings. + */ + int getActiveListingCount(); + + /** + * Create a new listing. + * @param player The seller + * @param item The item to sell + * @param startingPrice The starting bid price + * @param buyoutPrice The buyout price (0 for no buyout) + * @return The created listing, or null if failed + */ + IAuctionListing createListing(IPlayer player, IItemStack item, long startingPrice, long buyoutPrice); + + /** + * Place a bid on a listing. + * @param listingId The listing ID + * @param player The bidder + * @param amount The bid amount + * @return null on success, error message on failure + */ + String placeBid(String listingId, IPlayer player, long amount); + + /** + * Buyout a listing instantly. + * @param listingId The listing ID + * @param player The buyer + * @return null on success, error message on failure + */ + String buyout(String listingId, IPlayer player); + + /** + * Cancel a listing (seller only, unless admin). + * @param listingId The listing ID + * @param player The player cancelling + * @param isAdmin Whether to bypass ownership check + * @return null on success, error message on failure + */ + String cancelListing(String listingId, IPlayer player, boolean isAdmin); + + /** + * Get the listing fee amount. + */ + long getListingFee(); + + /** + * Get the sales tax percentage (0.0 to 1.0). + */ + double getSalesTaxPercent(); + + /** + * Get the minimum bid increment percentage (0.0 to 1.0). + */ + double getMinBidIncrementPercent(); + + /** + * Get the auction duration in hours. + */ + int getAuctionDurationHours(); + + /** + * Get the snipe protection time in minutes. + */ + int getSnipeProtectionMinutes(); + + /** + * Get the currency name used by the auction system. + */ + String getCurrencyName(); + + /** + * Get the minimum listing price. + */ + long getMinimumListingPrice(); + + /** + * Search listings by item name or seller name. + * @param searchText The search text + * @return Matching active listings + */ + IAuctionListing[] searchListings(String searchText); + + /** + * Force save auction data. + */ + void save(); +} diff --git a/java/noppes/npcs/api/handler/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index 9382a69..5118815 100644 --- a/java/noppes/npcs/api/handler/IPlayerData.java +++ b/java/noppes/npcs/api/handler/IPlayerData.java @@ -26,7 +26,7 @@ public interface IPlayerData { IPlayerMailData getMailData(); - IPlayerCurrencyData getCurrencyData(); + IPlayerTradeData getTradeData(); void save(); } diff --git a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java b/java/noppes/npcs/api/handler/IPlayerTradeData.java similarity index 66% rename from java/noppes/npcs/api/handler/IPlayerCurrencyData.java rename to java/noppes/npcs/api/handler/IPlayerTradeData.java index 0b9c84b..a9b560c 100644 --- a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java +++ b/java/noppes/npcs/api/handler/IPlayerTradeData.java @@ -1,11 +1,13 @@ package noppes.npcs.api.handler; +import noppes.npcs.api.handler.data.IAuctionClaim; + /** - * Interface for player currency data. - * Note: If Vault integration is enabled in config, these operations + * Interface for player trade data (currency and auction claims). + * Note: If Vault integration is enabled in config, currency operations * will use the Vault economy instead of CNPC+ built-in currency. */ -public interface IPlayerCurrencyData { +public interface IPlayerTradeData { /** * Get the current balance @@ -64,4 +66,26 @@ public interface IPlayerCurrencyData { * @return true if Vault is handling currency, false if using CNPC+ built-in */ boolean isUsingVault(); + + /** + * Get the number of pending auction claims + */ + int getClaimCount(); + + /** + * Check if player has any pending auction claims + */ + boolean hasClaims(); + + /** + * Get all pending auction claims for this player. + */ + IAuctionClaim[] getClaims(); + + /** + * Get a specific claim by ID. + * @param claimId The claim ID + * @return The claim, or null if not found + */ + IAuctionClaim getClaim(String claimId); } diff --git a/java/noppes/npcs/api/handler/data/IAuctionClaim.java b/java/noppes/npcs/api/handler/data/IAuctionClaim.java new file mode 100644 index 0000000..8d7c3f1 --- /dev/null +++ b/java/noppes/npcs/api/handler/data/IAuctionClaim.java @@ -0,0 +1,99 @@ +package noppes.npcs.api.handler.data; + +import noppes.npcs.api.item.IItemStack; + +/** + * Represents an auction claim (item or currency to be collected). + */ +public interface IAuctionClaim { + + /** + * Get the unique claim ID. + */ + String getId(); + + /** + * Get the player's UUID who can claim this. + */ + String getPlayerUUID(); + + /** + * Get the player's display name. + */ + String getPlayerName(); + + /** + * Get the related listing ID. + */ + String getListingId(); + + /** + * Get the claim type. + * @return 0 = Item, 1 = Currency (sale proceeds), 2 = Refund (outbid) + */ + int getType(); + + /** + * Check if this is an item claim. + */ + boolean isItemClaim(); + + /** + * Check if this is a currency claim (sale proceeds or refund). + */ + boolean isCurrencyClaim(); + + /** + * Check if this is a refund claim (outbid). + */ + boolean isRefundClaim(); + + /** + * Get the item to claim (for item claims only). + * @return The item, or null for currency claims + */ + IItemStack getItem(); + + /** + * Get the item display name (for currency/refund claims tooltip). + */ + String getItemName(); + + /** + * Get the currency amount (for currency/refund claims). + */ + long getCurrency(); + + /** + * Get the other player's name involved. + * For currency claims: the buyer's name. + * For refund claims: the player who outbid. + */ + String getOtherPlayerName(); + + /** + * Get when this claim was created (Unix timestamp in ms). + */ + long getCreatedTime(); + + /** + * Check if this claim has been claimed. + */ + boolean isClaimed(); + + /** + * Check if this is a returned item (expired/cancelled listing) vs won item. + * Only relevant for item claims. + */ + boolean isReturnedItem(); + + /** + * Get days until this claim expires. + */ + long getDaysUntilExpiration(); + + /** + * Check if this claim has expired. + */ + boolean isExpired(); +} diff --git a/java/noppes/npcs/api/handler/data/IAuctionListing.java b/java/noppes/npcs/api/handler/data/IAuctionListing.java new file mode 100644 index 0000000..65e766e --- /dev/null +++ b/java/noppes/npcs/api/handler/data/IAuctionListing.java @@ -0,0 +1,120 @@ +package noppes.npcs.api.handler.data; + +import noppes.npcs.api.item.IItemStack; + +/** + * Represents an auction listing. + */ +public interface IAuctionListing { + + /** + * Get the unique listing ID. + */ + String getId(); + + /** + * Get the seller's UUID as a string. + */ + String getSellerUUID(); + + /** + * Get the seller's display name. + */ + String getSellerName(); + + /** + * Get the item being sold. + */ + IItemStack getItem(); + + /** + * Get the starting price. + */ + long getStartingPrice(); + + /** + * Get the buyout price (0 if no buyout). + */ + long getBuyoutPrice(); + + /** + * Check if this listing has a buyout option. + */ + boolean hasBuyout(); + + /** + * Get the current highest bid. + */ + long getCurrentBid(); + + /** + * Get the high bidder's UUID as a string (null if no bids). + */ + String getHighBidderUUID(); + + /** + * Get the high bidder's display name (null if no bids). + */ + String getHighBidderName(); + + /** + * Check if there are any bids on this listing. + */ + boolean hasBids(); + + /** + * Get the total number of bids placed. + */ + int getBidCount(); + + /** + * Get when the listing was created (Unix timestamp in ms). + */ + long getCreatedTime(); + + /** + * Get when the auction ends (Unix timestamp in ms). + */ + long getEndTime(); + + /** + * Get the remaining time in milliseconds. + */ + long getRemainingTime(); + + /** + * Check if the auction has expired. + */ + boolean isExpired(); + + /** + * Check if the auction is still active (can be bid on). + */ + boolean isActive(); + + /** + * Get the auction status. + * @return 0 = Active, 1 = Ended, 2 = Cancelled, 3 = Claimed + */ + int getStatus(); + + /** + * Get the minimum bid amount (current bid + increment). + */ + long getMinimumBid(); + + /** + * Check if a player UUID is the seller. + */ + boolean isSeller(String playerUUID); + + /** + * Check if a player UUID is the current high bidder. + */ + boolean isHighBidder(String playerUUID); + + /** + * Get the remaining time formatted as a string (e.g., "2h 30m"). + */ + String getRemainingTimeFormatted(); +} From da15a36624c4b05b0aad02d107345cba1a0d6d50 Mon Sep 17 00:00:00 2001 From: Vidal Date: Sun, 25 Jan 2026 21:21:31 -0300 Subject: [PATCH 21/93] Player Dialog Event changes --- java/noppes/npcs/api/event/IDialogEvent.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/noppes/npcs/api/event/IDialogEvent.java b/java/noppes/npcs/api/event/IDialogEvent.java index eda5e7a..5b3d99a 100644 --- a/java/noppes/npcs/api/event/IDialogEvent.java +++ b/java/noppes/npcs/api/event/IDialogEvent.java @@ -7,6 +7,10 @@ public interface IDialogEvent extends IPlayerEvent { IDialog getDialog(); + int getDialogId(); + + int getOptionId(); + @Cancelable interface DialogOpen extends IDialogEvent { } From b84763a8eefdc0be7fb909888ac5ad6d22e3f987 Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 25 Jan 2026 20:38:47 -0500 Subject: [PATCH 22/93] Update IAbility.java --- java/noppes/npcs/api/ability/IAbility.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 9d9ac16..408199c 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -129,11 +129,6 @@ public interface IAbility { */ boolean isExecuting(); - /** - * Check if this ability is on cooldown. - */ - boolean isOnCooldown(); - /** * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=RECOVERY). */ From 2054012fae799fa233b99824b4f649d311eff86f Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 27 Jan 2026 04:12:32 -0500 Subject: [PATCH 23/93] Update IAbility.java --- java/noppes/npcs/api/ability/IAbility.java | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 408199c..36464be 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -95,24 +95,14 @@ public interface IAbility { void setWindUpTicks(int ticks); /** - * Get the active duration in ticks. + * Get the dazed time in ticks (stun after interrupt during WINDUP). */ - int getActiveTicks(); + int getDazedTicks(); /** - * Set the active duration in ticks. + * Set the dazed time in ticks. */ - void setActiveTicks(int ticks); - - /** - * Get the recovery time in ticks. - */ - int getRecoveryTicks(); - - /** - * Set the recovery time in ticks. - */ - void setRecoveryTicks(int ticks); + void setDazedTicks(int ticks); /** * Check if this ability can be interrupted by damage. @@ -130,7 +120,7 @@ public interface IAbility { boolean isExecuting(); /** - * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=RECOVERY). + * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=DAZED). */ int getPhaseInt(); From 3050910efbc6e301e4ef18fefc20529c507a7bae Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 28 Jan 2026 14:41:30 -0500 Subject: [PATCH 24/93] Add API Files --- .../npcs/api/ability/IDataAbilities.java | 49 +++++++++++ .../npcs/api/ability/type/IAbilityCharge.java | 22 +++++ .../npcs/api/ability/type/IAbilityCutter.java | 40 +++++++++ .../npcs/api/ability/type/IAbilityDash.java | 22 +++++ .../npcs/api/ability/type/IAbilityDisc.java | 85 +++++++++++++++++++ .../api/ability/type/IAbilityEnergyBeam.java | 79 +++++++++++++++++ .../npcs/api/ability/type/IAbilityGuard.java | 34 ++++++++ .../npcs/api/ability/type/IAbilityHazard.java | 64 ++++++++++++++ .../npcs/api/ability/type/IAbilityHeal.java | 31 +++++++ .../api/ability/type/IAbilityHeavyHit.java | 16 ++++ .../api/ability/type/IAbilityLaserShot.java | 61 +++++++++++++ .../npcs/api/ability/type/IAbilityOrb.java | 76 +++++++++++++++++ .../api/ability/type/IAbilityProjectile.java | 34 ++++++++ .../api/ability/type/IAbilityShockwave.java | 22 +++++ .../npcs/api/ability/type/IAbilitySlam.java | 25 ++++++ .../api/ability/type/IAbilitySweeper.java | 49 +++++++++++ .../api/ability/type/IAbilityTeleport.java | 43 ++++++++++ .../npcs/api/ability/type/IAbilityTrap.java | 46 ++++++++++ .../npcs/api/ability/type/IAbilityVortex.java | 34 ++++++++ java/noppes/npcs/api/entity/ICustomNpc.java | 9 ++ 20 files changed, 841 insertions(+) create mode 100644 java/noppes/npcs/api/ability/type/IAbilityCharge.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityCutter.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityDash.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityDisc.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityGuard.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityHazard.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityHeal.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityLaserShot.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityOrb.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityProjectile.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityShockwave.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilitySlam.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilitySweeper.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityTeleport.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityTrap.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityVortex.java diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index ff117b4..1997fe5 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -75,4 +75,53 @@ public interface IDataAbilities { * Reset all ability cooldowns. */ void resetCooldowns(); + + /** + * Force start an ability on this NPC. + * If an ability is currently executing, it will be cancelled. + * + * @param abilityId The ID of the ability to start + * @return true if the ability was started successfully + */ + boolean forceStartAbility(String abilityId); + + /** + * Force start an ability on this NPC with a specific target. + * If an ability is currently executing, it will be cancelled. + * + * @param abilityId The ID of the ability to start + * @param target The target entity (can be null for self-targeted abilities) + * @return true if the ability was started successfully + */ + boolean forceStartAbility(String abilityId, Object target); + + /** + * Execute a preset ability on this NPC by preset name. + * The NPC does NOT need to have this ability assigned. + * If an ability is currently executing, it will be cancelled. + * + * @param presetName The name of the saved ability preset + * @return true if the ability was started successfully + */ + boolean executePresetAbility(String presetName); + + /** + * Execute a preset ability on this NPC with a specific target. + * The NPC does NOT need to have this ability assigned. + * If an ability is currently executing, it will be cancelled. + * + * @param presetName The name of the saved ability preset + * @param target The target entity (can be null for self-targeted abilities) + * @return true if the ability was started successfully + */ + boolean executePresetAbility(String presetName, Object target); + + /** + * Create a new ability instance by type ID. + * The ability is not assigned to this NPC - use addAbility() to assign it. + * + * @param typeId The type ID (e.g., "cnpc:slam", "cnpc:projectile") + * @return The new ability, or null if the type is unknown + */ + IAbility createAbility(String typeId); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityCharge.java b/java/noppes/npcs/api/ability/type/IAbilityCharge.java new file mode 100644 index 0000000..a388598 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityCharge.java @@ -0,0 +1,22 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Charge abilities. + * Rush forward attack. + */ +public interface IAbilityCharge extends IAbility { + + float getChargeSpeed(); + void setChargeSpeed(float speed); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + float getHitWidth(); + void setHitWidth(float width); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityCutter.java b/java/noppes/npcs/api/ability/type/IAbilityCutter.java new file mode 100644 index 0000000..bd83cfb --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityCutter.java @@ -0,0 +1,40 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Cutter abilities. + * Sweeping fan attack in an arc. + */ +public interface IAbilityCutter extends IAbility { + + float getArcAngle(); + void setArcAngle(float angle); + + float getRange(); + void setRange(float range); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + /** + * Get the sweep mode (0 = SWIPE, 1 = SPIN). + */ + int getSweepMode(); + void setSweepMode(int mode); + + float getSweepSpeed(); + void setSweepSpeed(float speed); + + int getSpinDurationTicks(); + void setSpinDurationTicks(int ticks); + + boolean isPiercing(); + void setPiercing(boolean piercing); + + float getInnerRadius(); + void setInnerRadius(float radius); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityDash.java b/java/noppes/npcs/api/ability/type/IAbilityDash.java new file mode 100644 index 0000000..486eb1f --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityDash.java @@ -0,0 +1,22 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Dash abilities. + * Quick evasive sidestep movement. + */ +public interface IAbilityDash extends IAbility { + + /** + * Get the dash mode (0 = AGGRESSIVE, 1 = DEFENSIVE). + */ + int getDashMode(); + void setDashMode(int mode); + + float getDashDistance(); + void setDashDistance(float distance); + + float getDashSpeed(); + void setDashSpeed(float speed); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java new file mode 100644 index 0000000..6ad2089 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -0,0 +1,85 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Disc abilities. + * Flat spinning disc projectile with optional boomerang. + */ +public interface IAbilityDisc extends IAbility { + + float getSpeed(); + void setSpeed(float speed); + + float getDiscRadius(); + void setDiscRadius(float radius); + + float getDiscThickness(); + void setDiscThickness(float thickness); + + float getMaxDistance(); + void setMaxDistance(float distance); + + int getMaxLifetime(); + void setMaxLifetime(int ticks); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + float getKnockbackUp(); + void setKnockbackUp(float knockback); + + boolean isHoming(); + void setHoming(boolean homing); + + float getHomingStrength(); + void setHomingStrength(float strength); + + float getHomingRange(); + void setHomingRange(float range); + + boolean isBoomerang(); + void setBoomerang(boolean boomerang); + + int getBoomerangDelay(); + void setBoomerangDelay(int ticks); + + boolean isExplosive(); + void setExplosive(boolean explosive); + + float getExplosionRadius(); + void setExplosionRadius(float radius); + + int getStunDuration(); + void setStunDuration(int duration); + + int getSlowDuration(); + void setSlowDuration(int duration); + + int getSlowLevel(); + void setSlowLevel(int level); + + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + float getRotationSpeed(); + void setRotationSpeed(float speed); + + boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); + + /** + * Get the anchor point for charging (0-7, see AnchorPoint enum). + */ + int getAnchorPoint(); + void setAnchorPoint(int point); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java new file mode 100644 index 0000000..e52f709 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -0,0 +1,79 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Energy Beam abilities. + * Homing beam head with trailing path attached to origin. + */ +public interface IAbilityEnergyBeam extends IAbility { + + float getSpeed(); + void setSpeed(float speed); + + float getMaxDistance(); + void setMaxDistance(float distance); + + int getMaxLifetime(); + void setMaxLifetime(int ticks); + + float getBeamWidth(); + void setBeamWidth(float width); + + float getHeadSize(); + void setHeadSize(float size); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + float getKnockbackUp(); + void setKnockbackUp(float knockback); + + boolean isHoming(); + void setHoming(boolean homing); + + float getHomingStrength(); + void setHomingStrength(float strength); + + float getHomingRange(); + void setHomingRange(float range); + + boolean isExplosive(); + void setExplosive(boolean explosive); + + float getExplosionRadius(); + void setExplosionRadius(float radius); + + int getStunDuration(); + void setStunDuration(int duration); + + int getSlowDuration(); + void setSlowDuration(int duration); + + int getSlowLevel(); + void setSlowLevel(int level); + + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + float getRotationSpeed(); + void setRotationSpeed(float speed); + + boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); + + /** + * Get the anchor point for charging (0-7, see AnchorPoint enum). + */ + int getAnchorPoint(); + void setAnchorPoint(int point); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityGuard.java b/java/noppes/npcs/api/ability/type/IAbilityGuard.java new file mode 100644 index 0000000..a855cdd --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityGuard.java @@ -0,0 +1,34 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Guard abilities. + * Defensive stance with optional counter-attack. + */ +public interface IAbilityGuard extends IAbility { + + int getDurationTicks(); + void setDurationTicks(int ticks); + + float getDamageReduction(); + void setDamageReduction(float reduction); + + boolean canCounter(); + void setCanCounter(boolean canCounter); + + int getCounterType(); + void setCounterType(int type); + + float getCounterValue(); + void setCounterValue(float value); + + float getCounterChance(); + void setCounterChance(float chance); + + String getCounterSound(); + void setCounterSound(String sound); + + int getCounterAnimationId(); + void setCounterAnimationId(int animationId); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityHazard.java b/java/noppes/npcs/api/ability/type/IAbilityHazard.java new file mode 100644 index 0000000..8fbed33 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityHazard.java @@ -0,0 +1,64 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Hazard abilities. + * Persistent ground effect zones. + */ +public interface IAbilityHazard extends IAbility { + + int getDurationTicks(); + void setDurationTicks(int ticks); + + float getRadius(); + void setRadius(float radius); + + float getInnerRadius(); + void setInnerRadius(float radius); + + float getConeAngle(); + void setConeAngle(float angle); + + /** + * Get the hazard shape (0 = CIRCLE, 1 = RING, 2 = CONE). + */ + int getShape(); + void setShape(int shape); + + /** + * Get the placement mode (0 = AT_CASTER, 1 = AT_TARGET, 2 = FOLLOW_CASTER, 3 = FOLLOW_TARGET). + */ + int getPlacement(); + void setPlacement(int placement); + + float getDamagePerSecond(); + void setDamagePerSecond(float damage); + + int getDamageInterval(); + void setDamageInterval(int interval); + + boolean isIgnoreInvulnFrames(); + void setIgnoreInvulnFrames(boolean ignore); + + int getSlownessLevel(); + void setSlownessLevel(int level); + + int getWeaknessLevel(); + void setWeaknessLevel(int level); + + int getPoisonLevel(); + void setPoisonLevel(int level); + + int getWitherLevel(); + void setWitherLevel(int level); + + int getBlindnessLevel(); + void setBlindnessLevel(int level); + + int getDebuffDuration(); + void setDebuffDuration(int duration); + + boolean isAffectsCaster(); + void setAffectsCaster(boolean affects); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeal.java b/java/noppes/npcs/api/ability/type/IAbilityHeal.java new file mode 100644 index 0000000..e606e0b --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityHeal.java @@ -0,0 +1,31 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Heal abilities. + * Healing self and/or allies. + */ +public interface IAbilityHeal extends IAbility { + + int getDurationTicks(); + void setDurationTicks(int ticks); + + float getHealAmount(); + void setHealAmount(float amount); + + float getHealPercent(); + void setHealPercent(float percent); + + boolean isHealSelf(); + void setHealSelf(boolean healSelf); + + boolean isHealAllies(); + void setHealAllies(boolean healAllies); + + float getHealRadius(); + void setHealRadius(float radius); + + boolean isInstantHeal(); + void setInstantHeal(boolean instant); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java new file mode 100644 index 0000000..2893a3b --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java @@ -0,0 +1,16 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Heavy Hit abilities. + * Single-target high damage melee attack. + */ +public interface IAbilityHeavyHit extends IAbility { + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java new file mode 100644 index 0000000..2d96ea9 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java @@ -0,0 +1,61 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Laser Shot abilities. + * Fast expanding thin line that pierces through targets. + */ +public interface IAbilityLaserShot extends IAbility { + + float getLaserWidth(); + void setLaserWidth(float width); + + float getExpansionSpeed(); + void setExpansionSpeed(float speed); + + int getLingerTicks(); + void setLingerTicks(int ticks); + + float getMaxDistance(); + void setMaxDistance(float distance); + + int getMaxLifetime(); + void setMaxLifetime(int ticks); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + float getKnockbackUp(); + void setKnockbackUp(float knockback); + + boolean isExplosive(); + void setExplosive(boolean explosive); + + float getExplosionRadius(); + void setExplosionRadius(float radius); + + int getStunDuration(); + void setStunDuration(int duration); + + int getSlowDuration(); + void setSlowDuration(int duration); + + int getSlowLevel(); + void setSlowLevel(int level); + + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java new file mode 100644 index 0000000..d57445f --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -0,0 +1,76 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Orb abilities. + * Homing projectile sphere. + */ +public interface IAbilityOrb extends IAbility { + + float getOrbSpeed(); + void setOrbSpeed(float speed); + + float getOrbSize(); + void setOrbSize(float size); + + float getMaxDistance(); + void setMaxDistance(float distance); + + int getMaxLifetime(); + void setMaxLifetime(int ticks); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + float getKnockbackUp(); + void setKnockbackUp(float knockback); + + boolean isHoming(); + void setHoming(boolean homing); + + float getHomingStrength(); + void setHomingStrength(float strength); + + float getHomingRange(); + void setHomingRange(float range); + + boolean isExplosive(); + void setExplosive(boolean explosive); + + float getExplosionRadius(); + void setExplosionRadius(float radius); + + int getStunDuration(); + void setStunDuration(int duration); + + int getSlowDuration(); + void setSlowDuration(int duration); + + int getSlowLevel(); + void setSlowLevel(int level); + + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + float getRotationSpeed(); + void setRotationSpeed(float speed); + + boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); + + /** + * Get the anchor point for charging (0-7, see AnchorPoint enum). + */ + int getAnchorPoint(); + void setAnchorPoint(int point); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityProjectile.java new file mode 100644 index 0000000..fc0eb32 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityProjectile.java @@ -0,0 +1,34 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Projectile abilities. + * Ranged projectile attacks. + */ +public interface IAbilityProjectile extends IAbility { + + float getDamage(); + void setDamage(float damage); + + float getSpeed(); + void setSpeed(float speed); + + float getKnockback(); + void setKnockback(float knockback); + + String getProjectileType(); + void setProjectileType(String type); + + boolean isExplosive(); + void setExplosive(boolean explosive); + + float getExplosionRadius(); + void setExplosionRadius(float radius); + + boolean isHoming(); + void setHoming(boolean homing); + + float getHomingStrength(); + void setHomingStrength(float strength); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java new file mode 100644 index 0000000..56634cd --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java @@ -0,0 +1,22 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Shockwave abilities. + * Pushes targets away from the caster. + */ +public interface IAbilityShockwave extends IAbility { + + float getPushRadius(); + void setPushRadius(float radius); + + float getPushStrength(); + void setPushStrength(float strength); + + float getDamage(); + void setDamage(float damage); + + int getMaxTargets(); + void setMaxTargets(int max); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilitySlam.java b/java/noppes/npcs/api/ability/type/IAbilitySlam.java new file mode 100644 index 0000000..164ffd2 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilitySlam.java @@ -0,0 +1,25 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Slam abilities. + * Ground-pound AOE attack with leap. + */ +public interface IAbilitySlam extends IAbility { + + float getDamage(); + void setDamage(float damage); + + float getRadius(); + void setRadius(float radius); + + float getKnockbackStrength(); + void setKnockbackStrength(float knockback); + + float getLeapSpeed(); + void setLeapSpeed(float speed); + + float getLeapHeight(); + void setLeapHeight(float height); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilitySweeper.java b/java/noppes/npcs/api/ability/type/IAbilitySweeper.java new file mode 100644 index 0000000..1502637 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilitySweeper.java @@ -0,0 +1,49 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Sweeper abilities. + * Low sweeping beam that rotates around the NPC. + */ +public interface IAbilitySweeper extends IAbility { + + float getBeamLength(); + void setBeamLength(float length); + + float getBeamWidth(); + void setBeamWidth(float width); + + float getBeamHeight(); + void setBeamHeight(float height); + + float getDamage(); + void setDamage(float damage); + + int getDamageInterval(); + void setDamageInterval(int interval); + + boolean isPiercing(); + void setPiercing(boolean piercing); + + float getSweepSpeed(); + void setSweepSpeed(float speed); + + int getNumberOfRotations(); + void setNumberOfRotations(int rotations); + + boolean isLockOnTarget(); + void setLockOnTarget(boolean lock); + + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + float getOuterColorWidth(); + void setOuterColorWidth(float width); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityTeleport.java b/java/noppes/npcs/api/ability/type/IAbilityTeleport.java new file mode 100644 index 0000000..74b9ef8 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityTeleport.java @@ -0,0 +1,43 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Teleport abilities. + * Instant repositioning with various modes. + */ +public interface IAbilityTeleport extends IAbility { + + /** + * Get the teleport mode (0 = BLINK, 1 = BEHIND, 2 = SINGLE). + */ + int getMode(); + void setMode(int mode); + + int getBlinkCount(); + void setBlinkCount(int count); + + int getBlinkDelayTicks(); + void setBlinkDelayTicks(int ticks); + + float getBlinkRadius(); + void setBlinkRadius(float radius); + + float getBehindDistance(); + void setBehindDistance(float distance); + + boolean isRequireLineOfSight(); + void setRequireLineOfSight(boolean require); + + boolean isDamageAtStart(); + void setDamageAtStart(boolean damage); + + boolean isDamageAtEnd(); + void setDamageAtEnd(boolean damage); + + float getDamage(); + void setDamage(float damage); + + float getDamageRadius(); + void setDamageRadius(float radius); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityTrap.java b/java/noppes/npcs/api/ability/type/IAbilityTrap.java new file mode 100644 index 0000000..ff6fbec --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityTrap.java @@ -0,0 +1,46 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Trap abilities. + * Proximity-triggered traps. + */ +public interface IAbilityTrap extends IAbility { + + int getDurationTicks(); + void setDurationTicks(int ticks); + + /** + * Get the placement mode (0 = AT_CASTER, 1 = AT_TARGET, 2 = AHEAD_OF_CASTER). + */ + int getPlacement(); + void setPlacement(int placement); + + float getPlacementDistance(); + void setPlacementDistance(float distance); + + float getTriggerRadius(); + void setTriggerRadius(float radius); + + int getArmTime(); + void setArmTime(int ticks); + + int getMaxTriggers(); + void setMaxTriggers(int max); + + int getTriggerCooldown(); + void setTriggerCooldown(int cooldown); + + float getDamage(); + void setDamage(float damage); + + float getDamageRadius(); + void setDamageRadius(float radius); + + float getKnockback(); + void setKnockback(float knockback); + + boolean isVisible(); + void setVisible(boolean visible); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityVortex.java b/java/noppes/npcs/api/ability/type/IAbilityVortex.java new file mode 100644 index 0000000..91fb6a8 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityVortex.java @@ -0,0 +1,34 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Vortex abilities. + * Pulls targets toward the caster. + */ +public interface IAbilityVortex extends IAbility { + + float getPullRadius(); + void setPullRadius(float radius); + + float getPullStrength(); + void setPullStrength(float strength); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + boolean isAoe(); + void setAoe(boolean aoe); + + int getMaxTargets(); + void setMaxTargets(int max); + + boolean isDamageOnPull(); + void setDamageOnPull(boolean damage); + + float getPullDamage(); + void setPullDamage(float damage); +} diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index dd92407..c57a826 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -1505,4 +1505,13 @@ public interface ICustomNpc extends IEntityLiving, * @return Magic data */ IMagicData getMagicData(); + + /** + * Returns the Ability Data of an NPC. + * Allows access to the NPC's abilities system including + * force-starting abilities and executing preset abilities. + * + * @return Ability data + */ + noppes.npcs.api.ability.IDataAbilities getAbilityData(); } From 2b21264ada69ec5e800977a000e892bc82d7c61f Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 28 Jan 2026 15:16:19 -0500 Subject: [PATCH 25/93] Lock Movement Enum --- java/noppes/npcs/api/ability/IAbility.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 36464be..0049f6f 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -114,6 +114,28 @@ public interface IAbility { */ void setInterruptible(boolean interruptible); + /** + * Get the lock movement type for this ability. + * @return 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE + */ + int getLockMovementType(); + + /** + * Set the lock movement type for this ability. + * @param type 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE + */ + void setLockMovementType(int type); + + /** + * Check if movement is locked during the WINDUP phase. + */ + boolean isMovementLockedDuringWindup(); + + /** + * Check if movement is locked during the ACTIVE phase. + */ + boolean isMovementLockedDuringActive(); + /** * Check if this ability is currently being executed. */ From b8ba682e9dd4e542a5ccf0de231ab5e5ebdad448 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 28 Jan 2026 16:31:00 -0500 Subject: [PATCH 26/93] Update IAnimationHandler.java --- .../npcs/api/handler/IAnimationHandler.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/java/noppes/npcs/api/handler/IAnimationHandler.java b/java/noppes/npcs/api/handler/IAnimationHandler.java index af1ea9b..31dec79 100644 --- a/java/noppes/npcs/api/handler/IAnimationHandler.java +++ b/java/noppes/npcs/api/handler/IAnimationHandler.java @@ -16,4 +16,28 @@ public interface IAnimationHandler { IAnimation get(int id); IAnimation[] getAnimations(); + + /** + * Get all built-in animations. + * Built-in animations are read-only and cannot be modified or deleted. + */ + IAnimation[] getBuiltInAnimations(); + + /** + * Get all animations (both built-in and user-created). + */ + IAnimation[] getAllAnimations(); + + /** + * Check if an animation name is a built-in animation. + * + * @param name The animation name to check + * @return true if this is a built-in animation + */ + boolean isBuiltIn(String name); + + /** + * Get names of all built-in animations. + */ + String[] getBuiltInAnimationNames(); } From 06c9daf81be8df0138a992ca6bcabc05e37189cb Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 29 Jan 2026 14:20:07 -0500 Subject: [PATCH 27/93] Redundant --- java/noppes/npcs/api/ability/type/IAbilityDisc.java | 9 --------- .../noppes/npcs/api/ability/type/IAbilityEnergyBeam.java | 9 --------- java/noppes/npcs/api/ability/type/IAbilityLaserShot.java | 9 --------- java/noppes/npcs/api/ability/type/IAbilityOrb.java | 9 --------- 4 files changed, 36 deletions(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 6ad2089..f4a6b4f 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -53,15 +53,6 @@ public interface IAbilityDisc extends IAbility { float getExplosionRadius(); void setExplosionRadius(float radius); - int getStunDuration(); - void setStunDuration(int duration); - - int getSlowDuration(); - void setSlowDuration(int duration); - - int getSlowLevel(); - void setSlowLevel(int level); - int getInnerColor(); void setInnerColor(int color); diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index e52f709..ec4b396 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -47,15 +47,6 @@ public interface IAbilityEnergyBeam extends IAbility { float getExplosionRadius(); void setExplosionRadius(float radius); - int getStunDuration(); - void setStunDuration(int duration); - - int getSlowDuration(); - void setSlowDuration(int duration); - - int getSlowLevel(); - void setSlowLevel(int level); - int getInnerColor(); void setInnerColor(int color); diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java index 2d96ea9..d82afb7 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java +++ b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java @@ -38,15 +38,6 @@ public interface IAbilityLaserShot extends IAbility { float getExplosionRadius(); void setExplosionRadius(float radius); - int getStunDuration(); - void setStunDuration(int duration); - - int getSlowDuration(); - void setSlowDuration(int duration); - - int getSlowLevel(); - void setSlowLevel(int level); - int getInnerColor(); void setInnerColor(int color); diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index d57445f..81974f9 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -44,15 +44,6 @@ public interface IAbilityOrb extends IAbility { float getExplosionRadius(); void setExplosionRadius(float radius); - int getStunDuration(); - void setStunDuration(int duration); - - int getSlowDuration(); - void setSlowDuration(int duration); - - int getSlowLevel(); - void setSlowLevel(int level); - int getInnerColor(); void setInnerColor(int color); From db6a68e43073b2828ec05a3c2ede660453c4544e Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 30 Jan 2026 05:01:38 -0500 Subject: [PATCH 28/93] Player Abilities --- java/noppes/npcs/api/ability/IAbility.java | 22 ++++ .../npcs/api/ability/IAbilityHandler.java | 18 +++ .../npcs/api/ability/IDataAbilities.java | 32 +++-- .../npcs/api/ability/IPlayerAbilityData.java | 112 ++++++++++++++++++ .../npcs/api/event/IPlayerAbilityEvent.java | 64 ++++++++++ .../npcs/api/handler/IAbilityHandler.java | 38 +++--- java/noppes/npcs/api/handler/IPlayerData.java | 3 + 7 files changed, 261 insertions(+), 28 deletions(-) create mode 100644 java/noppes/npcs/api/ability/IPlayerAbilityData.java create mode 100644 java/noppes/npcs/api/event/IPlayerAbilityEvent.java diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 0049f6f..280a850 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -151,6 +151,28 @@ public interface IAbility { */ int getCurrentTick(); + /** + * Get the allowed user type for this ability. + * @return 0=NPC_ONLY, 1=PLAYER_ONLY, 2=BOTH + */ + int getAllowedByType(); + + /** + * Set the allowed user type for this ability. + * @param type 0=NPC_ONLY, 1=PLAYER_ONLY, 2=BOTH + */ + void setAllowedByType(int type); + + /** + * Check if this ability ignores cooldowns. + */ + boolean isIgnoreCooldown(); + + /** + * Set whether this ability ignores cooldowns. + */ + void setIgnoreCooldown(boolean ignore); + /** * Get this ability's data as NBT. */ diff --git a/java/noppes/npcs/api/ability/IAbilityHandler.java b/java/noppes/npcs/api/ability/IAbilityHandler.java index 1f0b689..b3ae328 100644 --- a/java/noppes/npcs/api/ability/IAbilityHandler.java +++ b/java/noppes/npcs/api/ability/IAbilityHandler.java @@ -30,4 +30,22 @@ public interface IAbilityHandler { * Returns null if the type is not registered. */ IAbility create(String typeId); + + /** + * Register a pre-configured ability by name. + * These abilities are resolved by name and can be referenced by NPCs and players. + * Call during FMLInitializationEvent. + * + * @param name The unique name for the ability + * @param ability The ability instance + */ + void registerAbility(String name, IAbility ability); + + /** + * Check if a registered ability exists by name. + * + * @param name The ability name + * @return true if the ability exists + */ + boolean hasAbility(String name); } diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index 1997fe5..ca692b7 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -17,15 +17,20 @@ public interface IDataAbilities { void setEnabled(boolean enabled); /** - * Get all abilities assigned to this NPC. + * Get all abilities assigned to this NPC (resolved from slots). */ IAbility[] getAbilities(); /** - * Add an ability to this NPC. + * Add an inline ability to this NPC. */ void addAbility(IAbility ability); + /** + * Add a reference ability by key (built-in name or custom UUID). + */ + void addAbilityReference(String key); + /** * Remove an ability by ID. */ @@ -41,6 +46,17 @@ public interface IDataAbilities { */ boolean hasAbility(String abilityId); + /** + * Check if a slot is a reference (by ability ID). + */ + boolean isAbilityReference(String abilityId); + + /** + * Convert a reference slot to inline (by ability ID). + * Returns false if the reference cannot be resolved. + */ + boolean convertToInline(String abilityId); + /** * Clear all abilities from this NPC. */ @@ -96,25 +112,25 @@ public interface IDataAbilities { boolean forceStartAbility(String abilityId, Object target); /** - * Execute a preset ability on this NPC by preset name. + * Execute an ability on this NPC by key (built-in name or custom UUID). * The NPC does NOT need to have this ability assigned. * If an ability is currently executing, it will be cancelled. * - * @param presetName The name of the saved ability preset + * @param key The ability key (built-in name or custom UUID) * @return true if the ability was started successfully */ - boolean executePresetAbility(String presetName); + boolean executeAbility(String key); /** - * Execute a preset ability on this NPC with a specific target. + * Execute an ability on this NPC with a specific target. * The NPC does NOT need to have this ability assigned. * If an ability is currently executing, it will be cancelled. * - * @param presetName The name of the saved ability preset + * @param key The ability key (built-in name or custom UUID) * @param target The target entity (can be null for self-targeted abilities) * @return true if the ability was started successfully */ - boolean executePresetAbility(String presetName, Object target); + boolean executeAbility(String key, Object target); /** * Create a new ability instance by type ID. diff --git a/java/noppes/npcs/api/ability/IPlayerAbilityData.java b/java/noppes/npcs/api/ability/IPlayerAbilityData.java new file mode 100644 index 0000000..ed3be8b --- /dev/null +++ b/java/noppes/npcs/api/ability/IPlayerAbilityData.java @@ -0,0 +1,112 @@ +package noppes.npcs.api.ability; + +/** + * Interface for managing player abilities. + * Players reference abilities by key (built-in names or custom UUIDs). + *

    + * Access via IPlayerData.getAbilityData() + */ +public interface IPlayerAbilityData { + + /** + * Get all unlocked ability keys. + */ + String[] getUnlockedAbilities(); + + /** + * Unlock an ability for this player. + * + * @param key The ability key (built-in name or custom UUID) + */ + void unlockAbility(String key); + + /** + * Lock (remove) an ability from this player. + */ + void lockAbility(String key); + + /** + * Check if the player has unlocked a specific ability. + */ + boolean hasUnlockedAbility(String key); + + /** + * Get the currently selected ability index. + */ + int getSelectedIndex(); + + /** + * Set the selected ability index. + */ + void setSelectedIndex(int index); + + /** + * Get the key of the currently selected ability. + */ + String getSelectedAbilityKey(); + + /** + * Select the next ability in the list. + */ + void selectNext(); + + /** + * Select the previous ability in the list. + */ + void selectPrevious(); + + /** + * Check if the player is currently executing an ability. + */ + boolean isExecutingAbility(); + + /** + * Get the currently executing ability. + */ + IAbility getCurrentAbility(); + + /** + * Interrupt the currently executing ability. + */ + void interruptCurrentAbility(); + + /** + * Check if the player is on universal cooldown. + */ + boolean isOnCooldown(); + + /** + * Check if a specific ability is on cooldown. + * + * @param key The ability key + * @return true if on cooldown + */ + boolean isOnCooldown(String key); + + /** + * Reset the universal cooldown. + */ + void resetCooldown(); + + /** + * Reset cooldown for a specific ability key. + * + * @param key The ability key + */ + void resetCooldown(String key); + + /** + * Reset all cooldowns. + */ + void resetAllCooldowns(); + + /** + * Activate the currently selected ability. + */ + boolean activateAbility(); + + /** + * Activate a specific ability by key. + */ + boolean activateAbility(String key); +} diff --git a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java new file mode 100644 index 0000000..621e217 --- /dev/null +++ b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java @@ -0,0 +1,64 @@ +package noppes.npcs.api.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import noppes.npcs.api.ability.IAbility; +import noppes.npcs.api.entity.IEntityLivingBase; + +/** + * Events related to player ability execution. + * These events are fired during the ability lifecycle when a player uses an ability. + */ +public interface IPlayerAbilityEvent extends IPlayerEvent { + + /** + * Get the ability involved in this event. + */ + IAbility getAbility(); + + /** + * Get the target of the ability, or null if no target. + */ + IEntityLivingBase getTarget(); + + /** + * Fired when a player's ability hits an entity with damage. + * Canceling this event prevents the damage from being applied. + */ + @Cancelable + interface HitEvent extends IPlayerAbilityEvent { + /** + * Get the entity that was hit by the ability. + */ + IEntityLivingBase getHitEntity(); + + /** + * Get the damage amount. + */ + float getDamage(); + + /** + * Set the damage amount. Allows scripts to modify damage. + */ + void setDamage(float damage); + + /** + * Get the horizontal knockback amount. + */ + float getKnockback(); + + /** + * Set the horizontal knockback amount. + */ + void setKnockback(float knockback); + + /** + * Get the vertical knockback (upward force) amount. + */ + float getKnockbackUp(); + + /** + * Set the vertical knockback (upward force) amount. + */ + void setKnockbackUp(float knockbackUp); + } +} diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java index f6e8670..5700b2b 100644 --- a/java/noppes/npcs/api/handler/IAbilityHandler.java +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -1,8 +1,8 @@ package noppes.npcs.api.handler; /** - * Handler for ability presets. Allows scripts to save, load, and manage - * reusable ability templates. + * Handler for ability management. Allows scripts to query ability types, + * built-in abilities, and custom ability presets. *

    * Access via API.getAbilities() */ @@ -10,40 +10,38 @@ public interface IAbilityHandler { /** * Get all registered ability type IDs. - * These are the types that can be used to create new abilities. - * - * @return Array of type IDs (e.g., "cnpc:slam", "cnpc:charge") */ String[] getTypes(); /** * Check if an ability type is registered. - * - * @param typeId The type ID to check - * @return true if the type exists */ boolean hasType(String typeId); /** - * Get all saved ability preset names. - * - * @return Array of saved ability names + * Get all built-in ability names. */ - String[] getSavedNames(); + String[] getAbilityNameArray(); /** - * Check if a saved ability preset exists. - * - * @param name The name of the ability - * @return true if the preset exists + * Check if a built-in ability exists by name. */ - boolean has(String name); + boolean hasAbilityName(String name); /** - * Delete a saved ability preset. + * Get all custom ability preset UUIDs. + */ + String[] getCustomAbilityIdArray(); + + /** + * Check if a custom ability preset exists by UUID. + */ + boolean hasCustomAbilityId(String uuid); + + /** + * Delete a custom ability preset by UUID. * - * @param name The name of the ability to delete * @return true if deleted successfully */ - boolean delete(String name); + boolean deleteCustomAbilityById(String uuid); } diff --git a/java/noppes/npcs/api/handler/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index 5118815..8927fef 100644 --- a/java/noppes/npcs/api/handler/IPlayerData.java +++ b/java/noppes/npcs/api/handler/IPlayerData.java @@ -1,5 +1,6 @@ package noppes.npcs.api.handler; +import noppes.npcs.api.ability.IPlayerAbilityData; import noppes.npcs.api.entity.ICustomNpc; public interface IPlayerData { @@ -28,5 +29,7 @@ public interface IPlayerData { IPlayerTradeData getTradeData(); + IPlayerAbilityData getAbilityData(); + void save(); } From bf650319da422790bff294d570dd879143fe8d4c Mon Sep 17 00:00:00 2001 From: Vidal Date: Sat, 31 Jan 2026 16:37:28 -0300 Subject: [PATCH 29/93] Fixed mysterious override stopping the game from running Kam let's please stop using claude for everything this BuiltInAbility is not even used --- java/noppes/npcs/api/entity/ICustomNpc.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index c57a826..d4b5161 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -3,6 +3,7 @@ package noppes.npcs.api.entity; import net.minecraft.entity.EntityCreature; import noppes.npcs.api.IPos; import noppes.npcs.api.ITimers; +import noppes.npcs.api.ability.IDataAbilities; import noppes.npcs.api.entity.data.IModelData; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; @@ -1513,5 +1514,5 @@ public interface ICustomNpc extends IEntityLiving, * * @return Ability data */ - noppes.npcs.api.ability.IDataAbilities getAbilityData(); + IDataAbilities getAbilityData(); } From f9de3f4f326d8e45750d28695a5f212db70bdfca Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 05:43:49 -0300 Subject: [PATCH 30/93] - Added onDamageTaken to Ability - Reworked AbilityGuard - Added AbilityOrbBarrage - Updated translation - Updated onDamageTaken method calls --- java/noppes/npcs/api/ability/type/IAbilityGuard.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityGuard.java b/java/noppes/npcs/api/ability/type/IAbilityGuard.java index a855cdd..36fd7a8 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityGuard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityGuard.java @@ -11,6 +11,9 @@ public interface IAbilityGuard extends IAbility { int getDurationTicks(); void setDurationTicks(int ticks); + int getCounterWindow(); + void setCounterWindow(int ticks); + float getDamageReduction(); void setDamageReduction(float reduction); @@ -23,9 +26,6 @@ public interface IAbilityGuard extends IAbility { float getCounterValue(); void setCounterValue(float value); - float getCounterChance(); - void setCounterChance(float chance); - String getCounterSound(); void setCounterSound(String sound); From 03be7a5cac601cd19509df9dc7bac17081aea591 Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 3 Feb 2026 04:27:15 -0500 Subject: [PATCH 31/93] Update IAbilityHeavyHit.java --- java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java index 2893a3b..467ec5b 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java @@ -4,7 +4,7 @@ import noppes.npcs.api.ability.IAbility; /** * API interface for Heavy Hit abilities. - * Single-target high damage melee attack. + * AOE rectangle melee attack in front of the caster. */ public interface IAbilityHeavyHit extends IAbility { @@ -13,4 +13,10 @@ public interface IAbilityHeavyHit extends IAbility { float getKnockback(); void setKnockback(float knockback); + + float getHitLength(); + void setHitLength(float hitLength); + + float getHitWidth(); + void setHitWidth(float hitWidth); } From 5fd3b7cb4044f1037fe2aae99868513dea347bda Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 15:45:45 -0300 Subject: [PATCH 32/93] Added interfaces to energy data, refactored names --- .../api/ability/data/IEnergyAnchorData.java | 21 +++++++++++++++ .../api/ability/data/IEnergyCombatData.java | 27 +++++++++++++++++++ .../api/ability/data/IEnergyDisplayData.java | 27 +++++++++++++++++++ .../api/ability/data/IEnergyLifespanData.java | 11 ++++++++ .../ability/data/IEnergyLightningData.java | 19 +++++++++++++ .../ability/data/IEnergyTrajectoryData.java | 19 +++++++++++++ .../npcs/api/entity/IEnergyProjectile.java | 10 +++++++ 7 files changed, 134 insertions(+) create mode 100644 java/noppes/npcs/api/ability/data/IEnergyAnchorData.java create mode 100644 java/noppes/npcs/api/ability/data/IEnergyCombatData.java create mode 100644 java/noppes/npcs/api/ability/data/IEnergyDisplayData.java create mode 100644 java/noppes/npcs/api/ability/data/IEnergyLifespanData.java create mode 100644 java/noppes/npcs/api/ability/data/IEnergyLightningData.java create mode 100644 java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java create mode 100644 java/noppes/npcs/api/entity/IEnergyProjectile.java diff --git a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java new file mode 100644 index 0000000..bf74843 --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java @@ -0,0 +1,21 @@ +package noppes.npcs.api.ability.data; + +import kamkeel.npcs.controllers.data.ability.AnchorPoint; + +public interface IEnergyAnchorData { + AnchorPoint getAnchorPoint(); + + void setAnchorPoint(AnchorPoint anchorPoint); + + float getAnchorOffsetX(); + + void setAnchorOffsetX(float anchorOffsetX); + + float getAnchorOffsetY(); + + void setAnchorOffsetY(float anchorOffsetY); + + float getAnchorOffsetZ(); + + void setAnchorOffsetZ(float anchorOffsetZ); +} diff --git a/java/noppes/npcs/api/ability/data/IEnergyCombatData.java b/java/noppes/npcs/api/ability/data/IEnergyCombatData.java new file mode 100644 index 0000000..dbe950e --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyCombatData.java @@ -0,0 +1,27 @@ +package noppes.npcs.api.ability.data; + +public interface IEnergyCombatData { + float getDamage(); + + void setDamage(float damage); + + float getKnockback(); + + void setKnockback(float knockback); + + float getKnockbackUp(); + + void setKnockbackUp(float knockbackUp); + + boolean isExplosive(); + + void setExplosive(boolean explosive); + + float getExplosionRadius(); + + void setExplosionRadius(float explosionRadius); + + float getExplosionDamageFalloff(); + + void setExplosionDamageFalloff(float explosionDamageFalloff); +} diff --git a/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java b/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java new file mode 100644 index 0000000..269f094 --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java @@ -0,0 +1,27 @@ +package noppes.npcs.api.ability.data; + +public interface IEnergyDisplayData { + int getInnerColor(); + + void setInnerColor(int innerColor); + + int getOuterColor(); + + void setOuterColor(int outerColor); + + boolean isOuterColorEnabled(); + + void setOuterColorEnabled(boolean outerColorEnabled); + + float getOuterColorWidth(); + + void setOuterColorWidth(float outerColorWidth); + + float getOuterColorAlpha(); + + void setOuterColorAlpha(float outerColorAlpha); + + float getRotationSpeed(); + + void setRotationSpeed(float rotationSpeed); +} diff --git a/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java b/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java new file mode 100644 index 0000000..feab13e --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java @@ -0,0 +1,11 @@ +package noppes.npcs.api.ability.data; + +public interface IEnergyLifespanData { + float getMaxDistance(); + + void setMaxDistance(float maxDistance); + + int getMaxLifetime(); + + void setMaxLifetime(int maxLifetime); +} diff --git a/java/noppes/npcs/api/ability/data/IEnergyLightningData.java b/java/noppes/npcs/api/ability/data/IEnergyLightningData.java new file mode 100644 index 0000000..41bfa3d --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyLightningData.java @@ -0,0 +1,19 @@ +package noppes.npcs.api.ability.data; + +public interface IEnergyLightningData { + boolean isLightningEffect(); + + void setLightningEffect(boolean lightningEffect); + + float getLightningDensity(); + + void setLightningDensity(float lightningDensity); + + float getLightningRadius(); + + void setLightningRadius(float lightningRadius); + + int getLightningFadeTime(); + + void setLightningFadeTime(int lightningFadeTime); +} diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java new file mode 100644 index 0000000..84fab3b --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java @@ -0,0 +1,19 @@ +package noppes.npcs.api.ability.data; + +public interface IEnergyTrajectoryData { + float getSpeed(); + + void setSpeed(float speed); + + boolean isHoming(); + + void setHoming(boolean homing); + + float getHomingStrength(); + + void setHomingStrength(float homingStrength); + + float getHomingRange(); + + void setHomingRange(float homingRange); +} diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java new file mode 100644 index 0000000..7438644 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -0,0 +1,10 @@ +package noppes.npcs.api.entity; + +public interface IEnergyProjectile { + + + float getSize(); + void setSize(float size); + + +} From 96b8d8a43cd7441f988f486dcc791c5f06771d8b Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 17:20:36 -0300 Subject: [PATCH 33/93] Added API classes to Energy Projectile --- .../api/ability/data/IEnergyAnchorData.java | 6 +- .../api/ability/data/IEnergyHomingData.java | 23 +++++ .../ability/data/IEnergyTrajectoryData.java | 15 ---- .../npcs/api/entity/IEnergyProjectile.java | 86 ++++++++++++++++++- 4 files changed, 109 insertions(+), 21 deletions(-) create mode 100644 java/noppes/npcs/api/ability/data/IEnergyHomingData.java diff --git a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java index bf74843..8715a7e 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java @@ -1,11 +1,9 @@ package noppes.npcs.api.ability.data; -import kamkeel.npcs.controllers.data.ability.AnchorPoint; - public interface IEnergyAnchorData { - AnchorPoint getAnchorPoint(); + int getAnchor(); - void setAnchorPoint(AnchorPoint anchorPoint); + void setAnchor(int anchor); float getAnchorOffsetX(); diff --git a/java/noppes/npcs/api/ability/data/IEnergyHomingData.java b/java/noppes/npcs/api/ability/data/IEnergyHomingData.java new file mode 100644 index 0000000..07d0c29 --- /dev/null +++ b/java/noppes/npcs/api/ability/data/IEnergyHomingData.java @@ -0,0 +1,23 @@ +package noppes.npcs.api.ability.data; + +public interface IEnergyHomingData { + float getSpeed(); + + void setSpeed(float speed); + + boolean isHoming(); + + void setHoming(boolean homing); + + float getHomingStrength(); + + void setHomingStrength(float homingStrength); + + float getHomingRange(); + + void setHomingRange(float homingRange); + + interface Trajectory { + + } +} diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java index 84fab3b..69df457 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java @@ -1,19 +1,4 @@ package noppes.npcs.api.ability.data; public interface IEnergyTrajectoryData { - float getSpeed(); - - void setSpeed(float speed); - - boolean isHoming(); - - void setHoming(boolean homing); - - float getHomingStrength(); - - void setHomingStrength(float homingStrength); - - float getHomingRange(); - - void setHomingRange(float homingRange); } diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 7438644..f01ebf3 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -1,10 +1,92 @@ package noppes.npcs.api.entity; -public interface IEnergyProjectile { +public interface IEnergyProjectile { + int getOwnerEntityId(); + + IEntity getOwner(); + + int getTargetEntityId(); + + IEntity getTarget(); + + int getSiblingEntityId(); + + void setSiblingEntityId(int siblingEntityId); + + IEnergyProjectile getSibling(); float getSize(); - void setSize(float size); + double getMotionX(); + double getMotionY(); + + double getMotionZ(); + + int getInnerColor(); + + int getOuterColor(); + + boolean isOuterColorEnabled(); + + float getOuterColorWidth(); + + float getOuterColorAlpha(); + + float getRotationSpeed(); + + float getInterpolatedRotationX(float partialTicks); + + float getInterpolatedRotationY(float partialTicks); + + float getInterpolatedRotationZ(float partialTicks); + + float getInterpolatedSize(float partialTicks); + + boolean hasLightningEffect(); + + float getLightningDensity(); + + float getLightningRadius(); + + int getLightningFadeTime(); + + float getMaxDistance(); + + int getMaxLifetime(); + + float getDamage(); + + float getKnockback(); + + float getKnockbackUp(); + + boolean isExplosive(); + + float getExplosionRadius(); + + float getExplosionDamageFalloff(); + + float getSpeed(); + + boolean isHoming(); + + float getHomingStrength(); + + float getHomingRange(); + + int getAnchor(); + + float getAnchorOffsetX(); + + float getAnchorOffsetY(); + + float getAnchorOffsetZ(); + + double getStartX(); + + double getStartY(); + + double getStartZ(); } From 78be0a51ebe72c7d1a8dd85e03d9d9f8067ed39b Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 18:00:51 -0300 Subject: [PATCH 34/93] Added EnergyTrajectoryData (WIP) --- java/noppes/npcs/api/ability/data/IEnergyHomingData.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/java/noppes/npcs/api/ability/data/IEnergyHomingData.java b/java/noppes/npcs/api/ability/data/IEnergyHomingData.java index 07d0c29..a908fc4 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyHomingData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyHomingData.java @@ -16,8 +16,4 @@ public interface IEnergyHomingData { float getHomingRange(); void setHomingRange(float homingRange); - - interface Trajectory { - - } } From 0a7aee1f8b3a03a6ac4ed0a66b7e83ceddcae1ea Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 18:08:07 -0300 Subject: [PATCH 35/93] Added API class to EnergyTrajectoryData --- .../ability/data/IEnergyTrajectoryData.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java index 69df457..f659113 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java @@ -1,4 +1,50 @@ package noppes.npcs.api.ability.data; +import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData; +import noppes.npcs.api.IPos; + public interface IEnergyTrajectoryData { + int getCurrentPath(); + + void setCurrentPath(int currentPath); + + int getDelay(int path); + + void setDelay(int path, int ticks); + + IPos getPos(int path); + + void setPos(int path, IPos coords); + + double getX(int path); + + void setX(int path, double x); + + double getY(int path); + + void setY(int path, double y); + + double getZ(int path); + + void setZ(int path, double z); + + void setPath(int path, IPos pos); + + void setPath(int path, IPos pos, int delay); + + void setPath(int path, double x, double y, double z); + + void setPath(int path, double x, double y, double z, int delay); + + IPath createPath(IPos coords); + + IPath createPath(IPos coords, int delay); + + IPath createPath(double x, double y, double z); + + IPath createPath(double x, double y, double z, int delay); + + interface IPath { + + } } From d70aefdd44dfeb227684f3dbb73954a8b11008d3 Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 20:03:36 -0300 Subject: [PATCH 36/93] Added more API methods --- .../ability/data/IEnergyTrajectoryData.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java index f659113..ae10c0a 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java @@ -1,8 +1,9 @@ package noppes.npcs.api.ability.data; -import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData; import noppes.npcs.api.IPos; +import java.util.function.BiConsumer; + public interface IEnergyTrajectoryData { int getCurrentPath(); @@ -44,7 +45,28 @@ public interface IEnergyTrajectoryData { IPath createPath(double x, double y, double z, int delay); + void forEach(BiConsumer lambda); + interface IPath { + IPos getPos(); + + void setPos(IPos pos); + + int getDelay(); + + void setDelay(int delayTicks); + + double getX(); + + void setX(double x); + + double getY(); + + void setY(double y); + + double getZ(); + + void setZ(double z); } } From 49ffa6a2085e4f60e5eefa8f38afe08843b33af5 Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 21:26:27 -0300 Subject: [PATCH 37/93] More trajectory changes --- .../ability/data/IEnergyTrajectoryData.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java index ae10c0a..1c973da 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java @@ -1,7 +1,5 @@ package noppes.npcs.api.ability.data; -import noppes.npcs.api.IPos; - import java.util.function.BiConsumer; public interface IEnergyTrajectoryData { @@ -13,9 +11,9 @@ public interface IEnergyTrajectoryData { void setDelay(int path, int ticks); - IPos getPos(int path); + boolean isConcluded(int path); - void setPos(int path, IPos coords); + void setConcluded(int path, boolean concluded); double getX(int path); @@ -29,18 +27,10 @@ public interface IEnergyTrajectoryData { void setZ(int path, double z); - void setPath(int path, IPos pos); - - void setPath(int path, IPos pos, int delay); - void setPath(int path, double x, double y, double z); void setPath(int path, double x, double y, double z, int delay); - IPath createPath(IPos coords); - - IPath createPath(IPos coords, int delay); - IPath createPath(double x, double y, double z); IPath createPath(double x, double y, double z, int delay); @@ -49,14 +39,14 @@ public interface IEnergyTrajectoryData { interface IPath { - IPos getPos(); - - void setPos(IPos pos); - int getDelay(); void setDelay(int delayTicks); + boolean isConcluded(); + + void setConcluded(boolean concluded); + double getX(); void setX(double x); From 29ad8637d68f12b3138c5b0c266088147432733b Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 3 Feb 2026 22:10:32 -0300 Subject: [PATCH 38/93] Added methods to trajectory --- .../ability/data/IEnergyTrajectoryData.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java index 1c973da..d8d2b46 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java @@ -1,5 +1,7 @@ package noppes.npcs.api.ability.data; +import noppes.npcs.api.IPos; + import java.util.function.BiConsumer; public interface IEnergyTrajectoryData { @@ -11,6 +13,10 @@ public interface IEnergyTrajectoryData { void setDelay(int path, int ticks); + IPos getPos(int path); + + void setPos(int path, IPos coords); + boolean isConcluded(int path); void setConcluded(int path, boolean concluded); @@ -27,10 +33,18 @@ public interface IEnergyTrajectoryData { void setZ(int path, double z); + void setPath(int path, IPos pos); + + void setPath(int path, IPos pos, int delay); + void setPath(int path, double x, double y, double z); void setPath(int path, double x, double y, double z, int delay); + IPath createPath(IPos coords); + + IPath createPath(IPos coords, int delay); + IPath createPath(double x, double y, double z); IPath createPath(double x, double y, double z, int delay); @@ -39,6 +53,10 @@ public interface IEnergyTrajectoryData { interface IPath { + IPos getPos(); + + void setPos(IPos pos); + int getDelay(); void setDelay(int delayTicks); From 3f8ccc087f781a43c2e5a2044f5d859be53d88c8 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 4 Feb 2026 01:18:25 -0500 Subject: [PATCH 39/93] Update ICloneHandler.java --- .../npcs/api/handler/ICloneHandler.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/java/noppes/npcs/api/handler/ICloneHandler.java b/java/noppes/npcs/api/handler/ICloneHandler.java index 90fecfb..805fd6c 100644 --- a/java/noppes/npcs/api/handler/ICloneHandler.java +++ b/java/noppes/npcs/api/handler/ICloneHandler.java @@ -23,4 +23,28 @@ public interface ICloneHandler { void set(int tab, String name, IEntity entity); void remove(int tab, String name); + + // --- Custom Folder Methods --- + + String[] getFolders(); + + boolean hasFolder(String folderName); + + IEntity spawn(double x, double y, double z, String folderName, String name, IWorld world, boolean ignoreProtection); + + IEntity spawn(IPos pos, String folderName, String name, IWorld world, boolean ignoreProtection); + + IEntity spawn(double x, double y, double z, String folderName, String name, IWorld world); + + IEntity spawn(IPos pos, String folderName, String name, IWorld world); + + IEntity[] getFolder(String folderName, IWorld world); + + IEntity get(String folderName, String name, IWorld world); + + boolean has(String folderName, String name); + + void set(String folderName, String name, IEntity entity); + + void remove(String folderName, String name); } From f383fc3037221791e2f22a272580df9be013810f Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 4 Feb 2026 14:44:53 -0500 Subject: [PATCH 40/93] Update IAbility.java --- java/noppes/npcs/api/ability/IAbility.java | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 280a850..6cc55f9 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -127,15 +127,37 @@ public interface IAbility { void setLockMovementType(int type); /** - * Check if movement is locked during the WINDUP phase. + * Get the lock type for this ability. + * @return 0=MOVEMENT, 1=ROTATION, 2=BOTH + */ + int getLockTypeOrdinal(); + + /** + * Set the lock type for this ability. + * @param type 0=MOVEMENT, 1=ROTATION, 2=BOTH + */ + void setLockTypeOrdinal(int type); + + /** + * Check if movement (pathfinding/motion) is locked during the WINDUP phase. */ boolean isMovementLockedDuringWindup(); /** - * Check if movement is locked during the ACTIVE phase. + * Check if movement (pathfinding/motion) is locked during the ACTIVE phase. */ boolean isMovementLockedDuringActive(); + /** + * Check if rotation (yaw/pitch) is locked during the WINDUP phase. + */ + boolean isRotationLockedDuringWindup(); + + /** + * Check if rotation (yaw/pitch) is locked during the ACTIVE phase. + */ + boolean isRotationLockedDuringActive(); + /** * Check if this ability is currently being executed. */ From fe1cec89814290a745ac708b309703125b5a3c15 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 6 Feb 2026 16:28:29 -0500 Subject: [PATCH 41/93] Update IAbility.java --- java/noppes/npcs/api/ability/IAbility.java | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 6cc55f9..aca46fe 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -127,16 +127,28 @@ public interface IAbility { void setLockMovementType(int type); /** - * Get the lock type for this ability. - * @return 0=MOVEMENT, 1=ROTATION, 2=BOTH + * Get the rotation mode for this ability. + * @return 0=FREE, 1=LOCKED, 2=TRACK */ - int getLockTypeOrdinal(); + int getRotationModeType(); /** - * Set the lock type for this ability. - * @param type 0=MOVEMENT, 1=ROTATION, 2=BOTH + * Set the rotation mode for this ability. + * @param type 0=FREE, 1=LOCKED, 2=TRACK */ - void setLockTypeOrdinal(int type); + void setRotationModeType(int type); + + /** + * Get the rotation phase for this ability (when rotation mode applies). + * @return 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE + */ + int getRotationPhaseType(); + + /** + * Set the rotation phase for this ability. + * @param type 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE + */ + void setRotationPhaseType(int type); /** * Check if movement (pathfinding/motion) is locked during the WINDUP phase. From 8917e37a6d35230a5c7b75ac8f89428edf1aabd2 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 6 Feb 2026 20:25:37 -0500 Subject: [PATCH 42/93] Dual Mode Support --- java/noppes/npcs/api/ability/IAbility.java | 17 +++++++++++++++++ .../npcs/api/ability/type/IAbilityDisc.java | 18 ++++++++++++++++++ .../api/ability/type/IAbilityEnergyBeam.java | 18 ++++++++++++++++++ .../npcs/api/ability/type/IAbilityOrb.java | 18 ++++++++++++++++++ 4 files changed, 71 insertions(+) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index aca46fe..6db00a6 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -216,4 +216,21 @@ public interface IAbility { * Set this ability's data from NBT. */ void setNbt(INbt nbt); + + // Burst system + + boolean isBurstEnabled(); + void setBurstEnabled(boolean enabled); + + int getBurstAmount(); + void setBurstAmount(int amount); + + int getBurstDelay(); + void setBurstDelay(int delay); + + boolean isBurstReplayAnimations(); + void setBurstReplayAnimations(boolean replay); + + boolean isBurstOverlap(); + void setBurstOverlap(boolean overlap); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index f4a6b4f..8460cbe 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -73,4 +73,22 @@ public interface IAbilityDisc extends IAbility { */ int getAnchorPoint(); void setAnchorPoint(int point); + + // Dual/Projectile count + + int getProjectileCount(); + void setProjectileCount(int count); + + int getDualFireDelay(); + void setDualFireDelay(int delay); + + // Indexed accessors (for dual mode) + int getInnerColor(int projectileIndex); + void setInnerColor(int projectileIndex, int color); + + int getOuterColor(int projectileIndex); + void setOuterColor(int projectileIndex, int color); + + int getAnchorPoint(int projectileIndex); + void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index ec4b396..e817541 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -67,4 +67,22 @@ public interface IAbilityEnergyBeam extends IAbility { */ int getAnchorPoint(); void setAnchorPoint(int point); + + // Dual/Projectile count + + int getProjectileCount(); + void setProjectileCount(int count); + + int getDualFireDelay(); + void setDualFireDelay(int delay); + + // Indexed accessors (for dual mode) + int getInnerColor(int projectileIndex); + void setInnerColor(int projectileIndex, int color); + + int getOuterColor(int projectileIndex); + void setOuterColor(int projectileIndex, int color); + + int getAnchorPoint(int projectileIndex); + void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index 81974f9..1ccccdc 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -64,4 +64,22 @@ public interface IAbilityOrb extends IAbility { */ int getAnchorPoint(); void setAnchorPoint(int point); + + // Dual/Projectile count + + int getProjectileCount(); + void setProjectileCount(int count); + + int getDualFireDelay(); + void setDualFireDelay(int delay); + + // Indexed accessors (for dual mode) + int getInnerColor(int projectileIndex); + void setInnerColor(int projectileIndex, int color); + + int getOuterColor(int projectileIndex); + void setOuterColor(int projectileIndex, int color); + + int getAnchorPoint(int projectileIndex); + void setAnchorPoint(int projectileIndex, int point); } From fd4c77d015add1f6f3012a1681561b2774f2f997 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 7 Feb 2026 01:53:58 -0500 Subject: [PATCH 43/93] Update IAbilityDisc.java --- java/noppes/npcs/api/ability/type/IAbilityDisc.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 8460cbe..2c86106 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -68,9 +68,6 @@ public interface IAbilityDisc extends IAbility { boolean hasLightningEffect(); void setLightningEffect(boolean enabled); - /** - * Get the anchor point for charging (0-7, see AnchorPoint enum). - */ int getAnchorPoint(); void setAnchorPoint(int point); From 092b18fe95d57353d16960411e5289ac3bbfa6ef Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 12 Feb 2026 13:55:42 -0500 Subject: [PATCH 44/93] Ability Zone API --- .../npcs/api/ability/type/IAbilityHazard.java | 45 +------- .../npcs/api/ability/type/IAbilityTrap.java | 18 +-- .../npcs/api/ability/type/IAbilityZone.java | 103 ++++++++++++++++++ 3 files changed, 107 insertions(+), 59 deletions(-) create mode 100644 java/noppes/npcs/api/ability/type/IAbilityZone.java diff --git a/java/noppes/npcs/api/ability/type/IAbilityHazard.java b/java/noppes/npcs/api/ability/type/IAbilityHazard.java index 8fbed33..b5118f2 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHazard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHazard.java @@ -1,37 +1,14 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Hazard abilities. - * Persistent ground effect zones. + * Persistent ground effect zones placed around the caster. */ -public interface IAbilityHazard extends IAbility { - - int getDurationTicks(); - void setDurationTicks(int ticks); +public interface IAbilityHazard extends IAbilityZone { float getRadius(); void setRadius(float radius); - float getInnerRadius(); - void setInnerRadius(float radius); - - float getConeAngle(); - void setConeAngle(float angle); - - /** - * Get the hazard shape (0 = CIRCLE, 1 = RING, 2 = CONE). - */ - int getShape(); - void setShape(int shape); - - /** - * Get the placement mode (0 = AT_CASTER, 1 = AT_TARGET, 2 = FOLLOW_CASTER, 3 = FOLLOW_TARGET). - */ - int getPlacement(); - void setPlacement(int placement); - float getDamagePerSecond(); void setDamagePerSecond(float damage); @@ -41,24 +18,6 @@ public interface IAbilityHazard extends IAbility { boolean isIgnoreInvulnFrames(); void setIgnoreInvulnFrames(boolean ignore); - int getSlownessLevel(); - void setSlownessLevel(int level); - - int getWeaknessLevel(); - void setWeaknessLevel(int level); - - int getPoisonLevel(); - void setPoisonLevel(int level); - - int getWitherLevel(); - void setWitherLevel(int level); - - int getBlindnessLevel(); - void setBlindnessLevel(int level); - - int getDebuffDuration(); - void setDebuffDuration(int duration); - boolean isAffectsCaster(); void setAffectsCaster(boolean affects); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityTrap.java b/java/noppes/npcs/api/ability/type/IAbilityTrap.java index ff6fbec..23ade92 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityTrap.java +++ b/java/noppes/npcs/api/ability/type/IAbilityTrap.java @@ -1,24 +1,10 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Trap abilities. - * Proximity-triggered traps. + * Proximity-triggered traps placed around the caster. */ -public interface IAbilityTrap extends IAbility { - - int getDurationTicks(); - void setDurationTicks(int ticks); - - /** - * Get the placement mode (0 = AT_CASTER, 1 = AT_TARGET, 2 = AHEAD_OF_CASTER). - */ - int getPlacement(); - void setPlacement(int placement); - - float getPlacementDistance(); - void setPlacementDistance(float distance); +public interface IAbilityTrap extends IAbilityZone { float getTriggerRadius(); void setTriggerRadius(float radius); diff --git a/java/noppes/npcs/api/ability/type/IAbilityZone.java b/java/noppes/npcs/api/ability/type/IAbilityZone.java new file mode 100644 index 0000000..eb2871d --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityZone.java @@ -0,0 +1,103 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for zone-based abilities (Trap, Hazard). + * Shared zone properties: duration, shape, spawn, visual layers, colors. + */ +public interface IAbilityZone extends IAbility { + + int getDurationTicks(); + void setDurationTicks(int ticks); + + /** + * Get the zone shape (0 = CIRCLE, 1 = SQUARE). + */ + int getZoneShapeOrdinal(); + void setZoneShapeOrdinal(int shape); + + float getSpawnRadius(); + void setSpawnRadius(float radius); + + float getTelegraphSize(); + void setTelegraphSize(float size); + + int getZoneCount(); + void setZoneCount(int count); + + float getZoneHeight(); + void setZoneHeight(float height); + + float getParticleDensity(); + void setParticleDensity(float density); + + float getParticleScale(); + void setParticleScale(float scale); + + float getAnimSpeed(); + void setAnimSpeed(float speed); + + float getLightningDensity(); + void setLightningDensity(float density); + + // Color controls + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + // Visual layer controls + + boolean isGroundFill(); + void setGroundFill(boolean enabled); + + float getGroundAlpha(); + void setGroundAlpha(float alpha); + + boolean isRings(); + void setRings(boolean enabled); + + int getRingCount(); + void setRingCount(int count); + + boolean isBorder(); + void setBorder(boolean enabled); + + float getBorderSpeed(); + void setBorderSpeed(float speed); + + boolean isAccents(); + void setAccents(boolean enabled); + + /** + * Get the accent style (0=STATIC, 1=SWAYING, 2=FLICKERING). + */ + int getAccentStyle(); + void setAccentStyle(int style); + + boolean isLightning(); + void setLightning(boolean enabled); + + boolean isParticles(); + void setParticles(boolean enabled); + + /** + * Get the particle motion style (0=RISING, 1=DRIFTING, 2=SPARKS). + */ + int getParticleMotion(); + void setParticleMotion(int motion); + + String getParticleDir(); + void setParticleDir(String directory); + + int getParticleSize(); + void setParticleSize(int size); + + boolean isParticleGlow(); + void setParticleGlow(boolean glow); +} From 456bb2cbfa7456d114bfc22caf49020353282e07 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 12 Feb 2026 15:01:07 -0500 Subject: [PATCH 45/93] Update IAbilityZone.java --- java/noppes/npcs/api/ability/type/IAbilityZone.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityZone.java b/java/noppes/npcs/api/ability/type/IAbilityZone.java index eb2871d..d66861a 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityZone.java +++ b/java/noppes/npcs/api/ability/type/IAbilityZone.java @@ -20,9 +20,6 @@ public interface IAbilityZone extends IAbility { float getSpawnRadius(); void setSpawnRadius(float radius); - float getTelegraphSize(); - void setTelegraphSize(float size); - int getZoneCount(); void setZoneCount(int count); From 2b95d3ca47558e804a09e4f7b7f45aeb69fa7861 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 14 Feb 2026 15:21:34 -0500 Subject: [PATCH 46/93] Projectile Handling APIs --- .../npcs/api/ability/type/IAbilityDisc.java | 58 ++++------------ .../api/ability/type/IAbilityEnergyBeam.java | 52 ++------------- .../type/IAbilityEnergyProjectile.java | 66 +++++++++++++++++++ .../api/ability/type/IAbilityLaserShot.java | 37 +---------- .../npcs/api/ability/type/IAbilityOrb.java | 52 ++------------- .../npcs/api/entity/IEnergyProjectile.java | 6 -- 6 files changed, 94 insertions(+), 177 deletions(-) create mode 100644 java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 2c86106..62567a6 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -1,12 +1,10 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Disc abilities. * Flat spinning disc projectile with optional boomerang. */ -public interface IAbilityDisc extends IAbility { +public interface IAbilityDisc extends IAbilityEnergyProjectile { float getSpeed(); void setSpeed(float speed); @@ -17,20 +15,14 @@ public interface IAbilityDisc extends IAbility { float getDiscThickness(); void setDiscThickness(float thickness); - float getMaxDistance(); - void setMaxDistance(float distance); + boolean isVertical(); + void setVertical(boolean vertical); - int getMaxLifetime(); - void setMaxLifetime(int ticks); + boolean isBoomerang(); + void setBoomerang(boolean boomerang); - float getDamage(); - void setDamage(float damage); - - float getKnockback(); - void setKnockback(float knockback); - - float getKnockbackUp(); - void setKnockbackUp(float knockback); + int getBoomerangDelay(); + void setBoomerangDelay(int ticks); boolean isHoming(); void setHoming(boolean homing); @@ -41,45 +33,21 @@ public interface IAbilityDisc extends IAbility { float getHomingRange(); void setHomingRange(float range); - boolean isBoomerang(); - void setBoomerang(boolean boomerang); - - int getBoomerangDelay(); - void setBoomerangDelay(int ticks); - - boolean isExplosive(); - void setExplosive(boolean explosive); - - float getExplosionRadius(); - void setExplosionRadius(float radius); - - int getInnerColor(); - void setInnerColor(int color); - - int getOuterColor(); - void setOuterColor(int color); - - boolean isOuterColorEnabled(); - void setOuterColorEnabled(boolean enabled); - float getRotationSpeed(); void setRotationSpeed(float speed); - boolean hasLightningEffect(); - void setLightningEffect(boolean enabled); - - int getAnchorPoint(); - void setAnchorPoint(int point); - - // Dual/Projectile count - int getProjectileCount(); void setProjectileCount(int count); + int getFireDelay(); + void setFireDelay(int delay); + + /** @deprecated Use {@link #getFireDelay()} */ int getDualFireDelay(); + /** @deprecated Use {@link #setFireDelay(int)} */ void setDualFireDelay(int delay); - // Indexed accessors (for dual mode) + // Indexed accessors int getInnerColor(int projectileIndex); void setInnerColor(int projectileIndex, int color); diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index e817541..42b0d23 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -1,37 +1,20 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Energy Beam abilities. * Homing beam head with trailing path attached to origin. */ -public interface IAbilityEnergyBeam extends IAbility { +public interface IAbilityEnergyBeam extends IAbilityEnergyProjectile { float getSpeed(); void setSpeed(float speed); - float getMaxDistance(); - void setMaxDistance(float distance); - - int getMaxLifetime(); - void setMaxLifetime(int ticks); - float getBeamWidth(); void setBeamWidth(float width); float getHeadSize(); void setHeadSize(float size); - float getDamage(); - void setDamage(float damage); - - float getKnockback(); - void setKnockback(float knockback); - - float getKnockbackUp(); - void setKnockbackUp(float knockback); - boolean isHoming(); void setHoming(boolean homing); @@ -41,42 +24,21 @@ public interface IAbilityEnergyBeam extends IAbility { float getHomingRange(); void setHomingRange(float range); - boolean isExplosive(); - void setExplosive(boolean explosive); - - float getExplosionRadius(); - void setExplosionRadius(float radius); - - int getInnerColor(); - void setInnerColor(int color); - - int getOuterColor(); - void setOuterColor(int color); - - boolean isOuterColorEnabled(); - void setOuterColorEnabled(boolean enabled); - float getRotationSpeed(); void setRotationSpeed(float speed); - boolean hasLightningEffect(); - void setLightningEffect(boolean enabled); - - /** - * Get the anchor point for charging (0-7, see AnchorPoint enum). - */ - int getAnchorPoint(); - void setAnchorPoint(int point); - - // Dual/Projectile count - int getProjectileCount(); void setProjectileCount(int count); + int getFireDelay(); + void setFireDelay(int delay); + + /** @deprecated Use {@link #getFireDelay()} */ int getDualFireDelay(); + /** @deprecated Use {@link #setFireDelay(int)} */ void setDualFireDelay(int delay); - // Indexed accessors (for dual mode) + // Indexed accessors int getInnerColor(int projectileIndex); void setInnerColor(int projectileIndex, int color); diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java new file mode 100644 index 0000000..f4793eb --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java @@ -0,0 +1,66 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * Shared API interface for energy projectile abilities (Orb, Disc, Beam, LaserShot). + * Contains methods common to all energy projectile types. + */ +public interface IAbilityEnergyProjectile extends IAbility { + + // Combat + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + float getKnockbackUp(); + void setKnockbackUp(float knockback); + + boolean isExplosive(); + void setExplosive(boolean explosive); + + float getExplosionRadius(); + void setExplosionRadius(float radius); + + float getExplosionDamageFalloff(); + void setExplosionDamageFalloff(float falloff); + + // Lifespan + float getMaxDistance(); + void setMaxDistance(float distance); + + int getMaxLifetime(); + void setMaxLifetime(int ticks); + + // Colors + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + float getOuterColorWidth(); + void setOuterColorWidth(float width); + + float getOuterColorAlpha(); + void setOuterColorAlpha(float alpha); + + // Lightning + boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); + + float getLightningDensity(); + void setLightningDensity(float density); + + float getLightningRadius(); + void setLightningRadius(float radius); + + // Anchor + int getAnchorPoint(); + void setAnchorPoint(int point); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java index d82afb7..4f02983 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java +++ b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java @@ -1,12 +1,10 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Laser Shot abilities. * Fast expanding thin line that pierces through targets. */ -public interface IAbilityLaserShot extends IAbility { +public interface IAbilityLaserShot extends IAbilityEnergyProjectile { float getLaserWidth(); void setLaserWidth(float width); @@ -16,37 +14,4 @@ public interface IAbilityLaserShot extends IAbility { int getLingerTicks(); void setLingerTicks(int ticks); - - float getMaxDistance(); - void setMaxDistance(float distance); - - int getMaxLifetime(); - void setMaxLifetime(int ticks); - - float getDamage(); - void setDamage(float damage); - - float getKnockback(); - void setKnockback(float knockback); - - float getKnockbackUp(); - void setKnockbackUp(float knockback); - - boolean isExplosive(); - void setExplosive(boolean explosive); - - float getExplosionRadius(); - void setExplosionRadius(float radius); - - int getInnerColor(); - void setInnerColor(int color); - - int getOuterColor(); - void setOuterColor(int color); - - boolean isOuterColorEnabled(); - void setOuterColorEnabled(boolean enabled); - - boolean hasLightningEffect(); - void setLightningEffect(boolean enabled); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index 1ccccdc..2aa451a 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -1,12 +1,10 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Orb abilities. * Homing projectile sphere. */ -public interface IAbilityOrb extends IAbility { +public interface IAbilityOrb extends IAbilityEnergyProjectile { float getOrbSpeed(); void setOrbSpeed(float speed); @@ -14,21 +12,6 @@ public interface IAbilityOrb extends IAbility { float getOrbSize(); void setOrbSize(float size); - float getMaxDistance(); - void setMaxDistance(float distance); - - int getMaxLifetime(); - void setMaxLifetime(int ticks); - - float getDamage(); - void setDamage(float damage); - - float getKnockback(); - void setKnockback(float knockback); - - float getKnockbackUp(); - void setKnockbackUp(float knockback); - boolean isHoming(); void setHoming(boolean homing); @@ -38,42 +21,21 @@ public interface IAbilityOrb extends IAbility { float getHomingRange(); void setHomingRange(float range); - boolean isExplosive(); - void setExplosive(boolean explosive); - - float getExplosionRadius(); - void setExplosionRadius(float radius); - - int getInnerColor(); - void setInnerColor(int color); - - int getOuterColor(); - void setOuterColor(int color); - - boolean isOuterColorEnabled(); - void setOuterColorEnabled(boolean enabled); - float getRotationSpeed(); void setRotationSpeed(float speed); - boolean hasLightningEffect(); - void setLightningEffect(boolean enabled); - - /** - * Get the anchor point for charging (0-7, see AnchorPoint enum). - */ - int getAnchorPoint(); - void setAnchorPoint(int point); - - // Dual/Projectile count - int getProjectileCount(); void setProjectileCount(int count); + int getFireDelay(); + void setFireDelay(int delay); + + /** @deprecated Use {@link #getFireDelay()} */ int getDualFireDelay(); + /** @deprecated Use {@link #setFireDelay(int)} */ void setDualFireDelay(int delay); - // Indexed accessors (for dual mode) + // Indexed accessors int getInnerColor(int projectileIndex); void setInnerColor(int projectileIndex, int color); diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index f01ebf3..7d40962 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -10,12 +10,6 @@ public interface IEnergyProjectile { IEntity getTarget(); - int getSiblingEntityId(); - - void setSiblingEntityId(int siblingEntityId); - - IEnergyProjectile getSibling(); - float getSize(); double getMotionX(); From 66fff09d2078a9d85a6ef27ef98c02a5944eb325 Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 15 Feb 2026 23:07:57 -0500 Subject: [PATCH 47/93] Enhance knockback mechanics: add methods for applying and forcefully applying knockback, respecting or ignoring knockback resistance --- .../npcs/api/entity/IEntityLivingBase.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/java/noppes/npcs/api/entity/IEntityLivingBase.java b/java/noppes/npcs/api/entity/IEntityLivingBase.java index d6928a8..fe5bb06 100644 --- a/java/noppes/npcs/api/entity/IEntityLivingBase.java +++ b/java/noppes/npcs/api/entity/IEntityLivingBase.java @@ -438,4 +438,48 @@ public interface IEntityLivingBase extends IEntity Date: Mon, 16 Feb 2026 01:03:05 -0500 Subject: [PATCH 48/93] Add energy projectile types and events: implement IEnergyOrb, IEnergyBeam, IEnergyDisc, and IEnergyLaser interfaces, along with their respective script handlers and event hooks --- java/noppes/npcs/api/IWorld.java | 46 +++++++ java/noppes/npcs/api/entity/ICustomNpc.java | 7 + java/noppes/npcs/api/entity/IEnergyBeam.java | 23 ++++ java/noppes/npcs/api/entity/IEnergyDisc.java | 31 +++++ java/noppes/npcs/api/entity/IEnergyLaser.java | 45 +++++++ java/noppes/npcs/api/entity/IEnergyOrb.java | 10 ++ .../npcs/api/entity/IEnergyProjectile.java | 123 +++++++++++++++++- java/noppes/npcs/api/entity/IPlayer.java | 7 + .../api/event/IEnergyProjectileEvent.java | 48 +++++++ .../npcs/api/event/IPlayerAbilityEvent.java | 67 ++++++++++ 10 files changed, 402 insertions(+), 5 deletions(-) create mode 100644 java/noppes/npcs/api/entity/IEnergyBeam.java create mode 100644 java/noppes/npcs/api/entity/IEnergyDisc.java create mode 100644 java/noppes/npcs/api/entity/IEnergyLaser.java create mode 100644 java/noppes/npcs/api/entity/IEnergyOrb.java create mode 100644 java/noppes/npcs/api/event/IEnergyProjectileEvent.java diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index b25d3a8..ae01d2e 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -1,6 +1,10 @@ package noppes.npcs.api; import net.minecraft.world.WorldServer; +import noppes.npcs.api.entity.IEnergyBeam; +import noppes.npcs.api.entity.IEnergyDisc; +import noppes.npcs.api.entity.IEnergyLaser; +import noppes.npcs.api.entity.IEnergyOrb; import noppes.npcs.api.entity.IEntity; import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.handler.data.ISound; @@ -445,5 +449,47 @@ public interface IWorld { */ int getDimensionID(); + /** + * Creates an energy orb projectile. Not spawned until fire() is called. + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position + * @param size Orb size + */ + IEnergyOrb createEnergyOrb(IEntity owner, double x, double y, double z, float size); + + /** + * Creates an energy beam projectile. Not spawned until fire() is called. + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position + * @param beamWidth Width of the beam + * @param headSize Size of the beam head + */ + IEnergyBeam createEnergyBeam(IEntity owner, double x, double y, double z, float beamWidth, float headSize); + + /** + * Creates an energy disc projectile. Not spawned until fire() is called. + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position + * @param radius Disc radius + * @param thickness Disc thickness + */ + IEnergyDisc createEnergyDisc(IEntity owner, double x, double y, double z, float radius, float thickness); + + /** + * Creates an energy laser projectile. Not spawned until fire() is called. + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position + * @param laserWidth Width of the laser + */ + IEnergyLaser createEnergyLaser(IEntity owner, double x, double y, double z, float laserWidth); + void broadcast(String message); } diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index d4b5161..18ca698 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -4,6 +4,7 @@ import net.minecraft.entity.EntityCreature; import noppes.npcs.api.IPos; import noppes.npcs.api.ITimers; import noppes.npcs.api.ability.IDataAbilities; +import noppes.npcs.api.entity.IEnergyProjectile; import noppes.npcs.api.entity.data.IModelData; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; @@ -1515,4 +1516,10 @@ public interface ICustomNpc extends IEntityLiving, * @return Ability data */ IDataAbilities getAbilityData(); + + /** + * Returns all active energy projectiles fired by this NPC. + * @return Array of active energy projectiles, empty array if none + */ + IEnergyProjectile[] getActiveEnergyProjectiles(); } diff --git a/java/noppes/npcs/api/entity/IEnergyBeam.java b/java/noppes/npcs/api/entity/IEnergyBeam.java new file mode 100644 index 0000000..f951dcb --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyBeam.java @@ -0,0 +1,23 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy beam projectile - a directional beam with a trailing path. + */ +public interface IEnergyBeam extends IEnergyProjectile { + + float getBeamWidth(); + + void setBeamWidth(float width); + + float getHeadSize(); + + void setHeadSize(float size); + + boolean isAttachedToOwner(); + + void setAttachedToOwner(boolean attached); + + boolean shouldRenderTailOrb(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyDisc.java b/java/noppes/npcs/api/entity/IEnergyDisc.java new file mode 100644 index 0000000..cfb772f --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyDisc.java @@ -0,0 +1,31 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy disc projectile - a flat spinning disc with optional boomerang behavior. + */ +public interface IEnergyDisc extends IEnergyProjectile { + + float getDiscRadius(); + + void setDiscRadius(float radius); + + float getDiscThickness(); + + void setDiscThickness(float thickness); + + boolean isVertical(); + + void setVertical(boolean vertical); + + boolean isBoomerang(); + + void setBoomerang(boolean boomerang); + + int getBoomerangDelay(); + + void setBoomerangDelay(int ticks); + + boolean isReturning(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyLaser.java b/java/noppes/npcs/api/entity/IEnergyLaser.java new file mode 100644 index 0000000..0327999 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyLaser.java @@ -0,0 +1,45 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy laser projectile - a fast expanding piercing line. + */ +public interface IEnergyLaser extends IEnergyProjectile { + + float getLaserWidth(); + + void setLaserWidth(float width); + + float getExpansionSpeed(); + + void setExpansionSpeed(float speed); + + int getLingerTicks(); + + void setLingerTicks(int ticks); + + float getCurrentLength(); + + boolean isFullyExtended(); + + double getDirX(); + + double getDirY(); + + double getDirZ(); + + void setDirection(double x, double y, double z); + + double getEndX(); + + double getEndY(); + + double getEndZ(); + + float getLingerAlpha(); + + boolean isLockVerticalDirection(); + + void setLockVerticalDirection(boolean lock); +} diff --git a/java/noppes/npcs/api/entity/IEnergyOrb.java b/java/noppes/npcs/api/entity/IEnergyOrb.java new file mode 100644 index 0000000..70af189 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyOrb.java @@ -0,0 +1,10 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy orb projectile - a spherical homing energy ball. + * Orbs use the base IEnergyProjectile properties with no additional methods. + */ +public interface IEnergyOrb extends IEnergyProjectile { +} diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 7d40962..b55ca94 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -1,35 +1,61 @@ package noppes.npcs.api.entity; +import net.minecraft.entity.Entity; + +/** + * Represents an energy projectile entity (Orb, Beam, Disc, Laser). + * Extends IEntity so scripts have full access to both entity and energy-specific methods. + */ +public interface IEnergyProjectile extends IEntity { + + // ==================== OWNER & TARGET ==================== -public interface IEnergyProjectile { int getOwnerEntityId(); IEntity getOwner(); + void setOwner(IEntity owner); + int getTargetEntityId(); IEntity getTarget(); + void setTarget(IEntity target); + + // ==================== SIZE ==================== + float getSize(); - double getMotionX(); + void setSize(float size); - double getMotionY(); - - double getMotionZ(); + // ==================== DISPLAY ==================== int getInnerColor(); + void setInnerColor(int color); + int getOuterColor(); + void setOuterColor(int color); + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + float getOuterColorWidth(); + void setOuterColorWidth(float width); + float getOuterColorAlpha(); + void setOuterColorAlpha(float alpha); + float getRotationSpeed(); + void setRotationSpeed(float speed); + + // ==================== INTERPOLATION (READ-ONLY) ==================== + float getInterpolatedRotationX(float partialTicks); float getInterpolatedRotationY(float partialTicks); @@ -38,38 +64,80 @@ public interface IEnergyProjectile { float getInterpolatedSize(float partialTicks); + // ==================== LIGHTNING ==================== + boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); + float getLightningDensity(); + void setLightningDensity(float density); + float getLightningRadius(); + void setLightningRadius(float radius); + int getLightningFadeTime(); + void setLightningFadeTime(int ticks); + + // ==================== LIFESPAN ==================== + float getMaxDistance(); + void setMaxDistance(float distance); + int getMaxLifetime(); + void setMaxLifetime(int ticks); + + // ==================== COMBAT ==================== + float getDamage(); + void setDamage(float damage); + float getKnockback(); + void setKnockback(float knockback); + float getKnockbackUp(); + void setKnockbackUp(float knockbackUp); + boolean isExplosive(); + void setExplosive(boolean explosive); + float getExplosionRadius(); + void setExplosionRadius(float radius); + float getExplosionDamageFalloff(); + void setExplosionDamageFalloff(float falloff); + + // ==================== MOVEMENT ==================== + float getSpeed(); + void setSpeed(float speed); + boolean isHoming(); + void setHoming(boolean homing); + float getHomingStrength(); + void setHomingStrength(float strength); + float getHomingRange(); + void setHomingRange(float range); + + // ==================== ANCHOR ==================== + int getAnchor(); float getAnchorOffsetX(); @@ -78,9 +146,54 @@ public interface IEnergyProjectile { float getAnchorOffsetZ(); + // ==================== POSITION ==================== + double getStartX(); double getStartY(); double getStartZ(); + + // ==================== STATE ==================== + + boolean hasHit(); + + boolean isCharging(); + + float getChargeProgress(); + + /** + * Returns the energy projectile sub-type. + * 0=Orb, 1=Beam, 2=Disc, 3=Laser + */ + int getEnergyType(); + + // ==================== FIRE / LAUNCH ==================== + + /** + * Spawns the projectile in the world (if not yet spawned) and starts it moving toward the target entity. + */ + void fire(IEntity target); + + /** + * Spawns the projectile in the world (if not yet spawned) and starts it moving toward the specified coordinates. + */ + void fire(double x, double y, double z); + + /** + * Spawns the projectile in the world (if not yet spawned) and starts it moving in the specified direction. + */ + void fire(float yaw, float pitch); + + /** + * Sets the owner, positions the projectile at the caster's eye level, and fires in the caster's look direction. + * Convenience method similar to how fireKiAttack works. + */ + void fire(IEntityLivingBase caster); + + /** + * Sets the owner, positions the projectile at the caster's eye level, and fires toward the target entity. + */ + void fire(IEntityLivingBase caster, IEntity target); + } diff --git a/java/noppes/npcs/api/entity/IPlayer.java b/java/noppes/npcs/api/entity/IPlayer.java index 9026f9a..765f013 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -9,6 +9,7 @@ import noppes.npcs.api.IPos; import noppes.npcs.api.IScreenSize; import noppes.npcs.api.ITimers; import noppes.npcs.api.IWorld; +import noppes.npcs.api.entity.IEnergyProjectile; import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; @@ -752,4 +753,10 @@ public interface IPlayer extends IEntityLivingBase, * @return The formatted balance string */ String getFormattedCurrencyBalance(); + + /** + * Returns all active energy projectiles fired by this player. + * @return Array of active energy projectiles, empty array if none + */ + IEnergyProjectile[] getActiveEnergyProjectiles(); } diff --git a/java/noppes/npcs/api/event/IEnergyProjectileEvent.java b/java/noppes/npcs/api/event/IEnergyProjectileEvent.java new file mode 100644 index 0000000..80461f2 --- /dev/null +++ b/java/noppes/npcs/api/event/IEnergyProjectileEvent.java @@ -0,0 +1,48 @@ +package noppes.npcs.api.event; + +import noppes.npcs.api.IBlock; +import noppes.npcs.api.entity.IEnergyProjectile; +import noppes.npcs.api.entity.IEntity; + +public interface IEnergyProjectileEvent extends ICustomNPCsEvent { + + IEnergyProjectile getProjectile(); + + IEntity getOwner(); + + /** + * @hookName energyProjectileFired + */ + interface FiredEvent extends IEnergyProjectileEvent { + } + + /** + * @hookName energyProjectileTick + */ + interface UpdateEvent extends IEnergyProjectileEvent { + } + + /** + * @hookName energyProjectileEntityImpact + */ + interface EntityImpactEvent extends IEnergyProjectileEvent { + IEntity getTarget(); + + float getDamage(); + + void setDamage(float damage); + } + + /** + * @hookName energyProjectileBlockImpact + */ + interface BlockImpactEvent extends IEnergyProjectileEvent { + IBlock getBlock(); + } + + /** + * @hookName energyProjectileExpired + */ + interface ExpiredEvent extends IEnergyProjectileEvent { + } +} diff --git a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java index 621e217..00c7a6b 100644 --- a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java +++ b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java @@ -1,6 +1,7 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; +import noppes.npcs.api.IDamageSource; import noppes.npcs.api.ability.IAbility; import noppes.npcs.api.entity.IEntityLivingBase; @@ -20,9 +21,75 @@ public interface IPlayerAbilityEvent extends IPlayerEvent { */ IEntityLivingBase getTarget(); + /** + * Fired when a player's ability starts executing (enters WINDUP phase). + * Canceling prevents the ability from starting. + * + * @hookName abilityStart + */ + @Cancelable + interface StartEvent extends IPlayerAbilityEvent { + } + + /** + * Fired when a player's ability enters the ACTIVE phase and performs its effect. + * Canceling prevents the ability effect from occurring. + * + * @hookName abilityExecute + */ + @Cancelable + interface ExecuteEvent extends IPlayerAbilityEvent { + } + + /** + * Fired when a player's ability is interrupted by damage. + * + * @hookName abilityInterrupt + */ + interface InterruptEvent extends IPlayerAbilityEvent { + /** + * Get the damage source that caused the interruption, or null if not damage-triggered. + */ + IDamageSource getDamageSource(); + + /** + * Get the amount of damage that caused the interruption. + */ + float getDamage(); + } + + /** + * Fired when a player's ability completes its full execution cycle. + * + * @hookName abilityComplete + */ + interface CompleteEvent extends IPlayerAbilityEvent { + } + + /** + * Fired every tick while a player's ability is executing. + * Provides the current phase and tick count. + * + * @hookName abilityTick + */ + interface TickEvent extends IPlayerAbilityEvent { + /** + * Get the current phase of the ability. + * 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = RECOVERY + */ + int getAbilityPhase(); + + /** + * Get the current tick count within the phase. + */ + int getTick(); + } + /** * Fired when a player's ability hits an entity with damage. * Canceling this event prevents the damage from being applied. + * + * @hookName abilityHit */ @Cancelable interface HitEvent extends IPlayerAbilityEvent { From 3d648425fabfd28ba74fc9743e6c3c19609d90bc Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 17 Feb 2026 14:31:52 -0500 Subject: [PATCH 49/93] IEnergy + IBarriers --- .../api/ability/data/IEnergyDisplayData.java | 4 ++ .../npcs/api/entity/IEnergyAbility.java | 66 +++++++++++++++++++ .../npcs/api/entity/IEnergyBarrier.java | 64 ++++++++++++++++++ java/noppes/npcs/api/entity/IEnergyDome.java | 13 ++++ java/noppes/npcs/api/entity/IEnergyPanel.java | 26 ++++++++ .../npcs/api/entity/IEnergyProjectile.java | 52 +-------------- .../noppes/npcs/api/entity/IEnergySlicer.java | 18 +++++ .../npcs/api/event/IEnergyBarrierEvent.java | 41 ++++++++++++ 8 files changed, 235 insertions(+), 49 deletions(-) create mode 100644 java/noppes/npcs/api/entity/IEnergyAbility.java create mode 100644 java/noppes/npcs/api/entity/IEnergyBarrier.java create mode 100644 java/noppes/npcs/api/entity/IEnergyDome.java create mode 100644 java/noppes/npcs/api/entity/IEnergyPanel.java create mode 100644 java/noppes/npcs/api/entity/IEnergySlicer.java create mode 100644 java/noppes/npcs/api/event/IEnergyBarrierEvent.java diff --git a/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java b/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java index 269f094..e1b9097 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java @@ -21,6 +21,10 @@ public interface IEnergyDisplayData { void setOuterColorAlpha(float outerColorAlpha); + float getInnerAlpha(); + + void setInnerAlpha(float innerAlpha); + float getRotationSpeed(); void setRotationSpeed(float rotationSpeed); diff --git a/java/noppes/npcs/api/entity/IEnergyAbility.java b/java/noppes/npcs/api/entity/IEnergyAbility.java new file mode 100644 index 0000000..b4b18b9 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyAbility.java @@ -0,0 +1,66 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Base interface for all energy ability entities (Projectiles, Barriers). + * Contains shared display, lightning, owner, and charging properties. + */ +public interface IEnergyAbility extends IEntity { + + // ==================== OWNER ==================== + + int getOwnerEntityId(); + + IEntity getOwner(); + + // ==================== DISPLAY ==================== + + int getInnerColor(); + + void setInnerColor(int color); + + float getInnerAlpha(); + + void setInnerAlpha(float alpha); + + int getOuterColor(); + + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + + void setOuterColorEnabled(boolean enabled); + + float getOuterColorWidth(); + + void setOuterColorWidth(float width); + + float getOuterColorAlpha(); + + void setOuterColorAlpha(float alpha); + + // ==================== LIGHTNING ==================== + + boolean hasLightningEffect(); + + void setLightningEffect(boolean enabled); + + float getLightningDensity(); + + void setLightningDensity(float density); + + float getLightningRadius(); + + void setLightningRadius(float radius); + + int getLightningFadeTime(); + + void setLightningFadeTime(int ticks); + + // ==================== STATE ==================== + + boolean isCharging(); + + float getChargeProgress(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyBarrier.java b/java/noppes/npcs/api/entity/IEnergyBarrier.java new file mode 100644 index 0000000..ddce946 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyBarrier.java @@ -0,0 +1,64 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Base interface for energy barrier entities (Dome, Panel). + * Barriers are defensive structures that block incoming energy projectiles. + * Extends IEnergyAbility for shared display/lightning/owner/charging methods. + */ +public interface IEnergyBarrier extends IEnergyAbility { + + // ==================== HEALTH ==================== + + float getCurrentHealth(); + + void setCurrentHealth(float health); + + float getHealthPercent(); + + float getMaxHealth(); + + void setMaxHealth(float maxHealth); + + boolean isUseHealth(); + + void setUseHealth(boolean useHealth); + + // ==================== DURATION ==================== + + int getDuration(); + + void setDuration(int ticks); + + boolean isUseDuration(); + + void setUseDuration(boolean useDuration); + + // ==================== STATE (BARRIER-SPECIFIC) ==================== + + int getTicksAlive(); + + // ==================== BARRIER ==================== + + float getDefaultMultiplier(); + + void setDefaultMultiplier(float multiplier); + + boolean isKnockbackEnabled(); + + void setKnockbackEnabled(boolean enabled); + + float getKnockbackStrength(); + + void setKnockbackStrength(float strength); + + int getKnockbackTarget(); + + void setKnockbackTarget(int target); + + /** + * Returns the barrier type: 0=Dome, 1=Panel + */ + int getBarrierType(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyDome.java b/java/noppes/npcs/api/entity/IEnergyDome.java new file mode 100644 index 0000000..0a6fcbf --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyDome.java @@ -0,0 +1,13 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy dome barrier - a spherical shield centered on the caster. + */ +public interface IEnergyDome extends IEnergyBarrier { + + float getDomeRadius(); + + void setDomeRadius(float radius); +} diff --git a/java/noppes/npcs/api/entity/IEnergyPanel.java b/java/noppes/npcs/api/entity/IEnergyPanel.java new file mode 100644 index 0000000..122dab3 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyPanel.java @@ -0,0 +1,26 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy panel barrier - a flat rectangular shield (Wall or Shield mode). + */ +public interface IEnergyPanel extends IEnergyBarrier { + + float getPanelWidth(); + + void setPanelWidth(float width); + + float getPanelHeight(); + + void setPanelHeight(float height); + + float getPanelYaw(); + + /** + * Panel mode: 0=PLACED, 1=HELD, 2=LAUNCHED + */ + int getPanelMode(); + + boolean isLaunched(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index b55ca94..36e6575 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -4,16 +4,12 @@ import net.minecraft.entity.Entity; /** * Represents an energy projectile entity (Orb, Beam, Disc, Laser). - * Extends IEntity so scripts have full access to both entity and energy-specific methods. + * Extends IEnergyAbility for shared display/lightning/owner/charging methods. */ -public interface IEnergyProjectile extends IEntity { +public interface IEnergyProjectile extends IEnergyAbility { // ==================== OWNER & TARGET ==================== - int getOwnerEntityId(); - - IEntity getOwner(); - void setOwner(IEntity owner); int getTargetEntityId(); @@ -28,27 +24,7 @@ public interface IEnergyProjectile extends IEntity { void setSize(float size); - // ==================== DISPLAY ==================== - - int getInnerColor(); - - void setInnerColor(int color); - - int getOuterColor(); - - void setOuterColor(int color); - - boolean isOuterColorEnabled(); - - void setOuterColorEnabled(boolean enabled); - - float getOuterColorWidth(); - - void setOuterColorWidth(float width); - - float getOuterColorAlpha(); - - void setOuterColorAlpha(float alpha); + // ==================== DISPLAY (PROJECTILE-SPECIFIC) ==================== float getRotationSpeed(); @@ -64,24 +40,6 @@ public interface IEnergyProjectile extends IEntity { float getInterpolatedSize(float partialTicks); - // ==================== LIGHTNING ==================== - - boolean hasLightningEffect(); - - void setLightningEffect(boolean enabled); - - float getLightningDensity(); - - void setLightningDensity(float density); - - float getLightningRadius(); - - void setLightningRadius(float radius); - - int getLightningFadeTime(); - - void setLightningFadeTime(int ticks); - // ==================== LIFESPAN ==================== float getMaxDistance(); @@ -158,10 +116,6 @@ public interface IEnergyProjectile extends IEntity { boolean hasHit(); - boolean isCharging(); - - float getChargeProgress(); - /** * Returns the energy projectile sub-type. * 0=Orb, 1=Beam, 2=Disc, 3=Laser diff --git a/java/noppes/npcs/api/entity/IEnergySlicer.java b/java/noppes/npcs/api/entity/IEnergySlicer.java new file mode 100644 index 0000000..b3fec49 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergySlicer.java @@ -0,0 +1,18 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Represents an energy slicer projectile - a thin, wide blade that slices through targets. + */ +public interface IEnergySlicer extends IEnergyProjectile { + + float getSliceWidth(); + void setSliceWidth(float width); + + float getSliceThickness(); + void setSliceThickness(float thickness); + + boolean isPiercing(); + void setPiercing(boolean piercing); +} diff --git a/java/noppes/npcs/api/event/IEnergyBarrierEvent.java b/java/noppes/npcs/api/event/IEnergyBarrierEvent.java new file mode 100644 index 0000000..3b7f602 --- /dev/null +++ b/java/noppes/npcs/api/event/IEnergyBarrierEvent.java @@ -0,0 +1,41 @@ +package noppes.npcs.api.event; + +import noppes.npcs.api.entity.IEnergyBarrier; +import noppes.npcs.api.entity.IEnergyProjectile; +import noppes.npcs.api.entity.IEntity; + +public interface IEnergyBarrierEvent extends ICustomNPCsEvent { + + IEnergyBarrier getBarrier(); + + IEntity getOwner(); + + /** + * @hookName energyBarrierSpawned + */ + interface SpawnedEvent extends IEnergyBarrierEvent { + } + + /** + * @hookName energyBarrierTick + */ + interface UpdateEvent extends IEnergyBarrierEvent { + } + + /** + * @hookName energyBarrierHit + */ + interface HitEvent extends IEnergyBarrierEvent { + IEnergyProjectile getProjectile(); + + float getDamage(); + + void setDamage(float damage); + } + + /** + * @hookName energyBarrierDestroyed + */ + interface DestroyedEvent extends IEnergyBarrierEvent { + } +} From 22bce4b2acc9cf9a120a7fdddbb62cc4e567c796 Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 17 Feb 2026 20:44:26 -0500 Subject: [PATCH 50/93] Abilities are now Stored by Name not UUID --- java/noppes/npcs/api/handler/IAbilityHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java index 5700b2b..c7ccda5 100644 --- a/java/noppes/npcs/api/handler/IAbilityHandler.java +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -29,19 +29,19 @@ public interface IAbilityHandler { boolean hasAbilityName(String name); /** - * Get all custom ability preset UUIDs. + * Get all custom ability preset names. */ - String[] getCustomAbilityIdArray(); + String[] getCustomAbilityNameArray(); /** - * Check if a custom ability preset exists by UUID. + * Check if a custom ability preset exists by name. */ - boolean hasCustomAbilityId(String uuid); + boolean hasCustomAbilityName(String name); /** - * Delete a custom ability preset by UUID. + * Delete a custom ability preset by name. * * @return true if deleted successfully */ - boolean deleteCustomAbilityById(String uuid); + boolean deleteCustomAbilityByName(String name); } From 010849fe8fb67c0359d7ebdb7bcd5c3c957fe3db Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 17 Feb 2026 23:08:11 -0500 Subject: [PATCH 51/93] Abilities are now Stored by Name not UUID. Refactor Built In and Toggleable Abilities --- java/noppes/npcs/api/ability/IAbility.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 6db00a6..7a178f5 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -9,7 +9,8 @@ import noppes.npcs.api.INbt; public interface IAbility { /** - * Get the unique ID of this ability instance. + * Get the unique ID (UUID for custom abilities, registry key for built-in). + * This is the stable reference that never changes after creation. */ String getId(); @@ -19,15 +20,25 @@ public interface IAbility { void setId(String id); /** - * Get the display name of this ability. + * Get the unique identifier/name of this ability (used for file naming, commands, search). */ String getName(); /** - * Set the display name of this ability. + * Set the unique identifier/name of this ability. */ void setName(String name); + /** + * Get the display name (cosmetic). Falls back to getName() if not set. + */ + String getDisplayName(); + + /** + * Set the display name (cosmetic). Pass empty string to use getName() as display. + */ + void setDisplayName(String displayName); + /** * Get the type ID of this ability (e.g., "cnpc:slam", "cnpc:beam"). */ From 28c0ca840f3d726c07b47aafa29d97b51a69a0cd Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 18 Feb 2026 04:00:07 -0500 Subject: [PATCH 52/93] IAbilityAction for Abilities and Chained Actions --- java/noppes/npcs/api/ability/IAbility.java | 2 +- .../npcs/api/ability/IAbilityAction.java | 25 ++++++++++++++ .../npcs/api/ability/IChainedAbility.java | 18 ++++++++++ .../npcs/api/handler/IAbilityHandler.java | 33 +++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 java/noppes/npcs/api/ability/IAbilityAction.java create mode 100644 java/noppes/npcs/api/ability/IChainedAbility.java diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 7a178f5..bd43061 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -6,7 +6,7 @@ import noppes.npcs.api.INbt; * Interface for NPC abilities. * Abilities are special attacks or actions that NPCs can perform during combat. */ -public interface IAbility { +public interface IAbility extends IAbilityAction { /** * Get the unique ID (UUID for custom abilities, registry key for built-in). diff --git a/java/noppes/npcs/api/ability/IAbilityAction.java b/java/noppes/npcs/api/ability/IAbilityAction.java new file mode 100644 index 0000000..560b04e --- /dev/null +++ b/java/noppes/npcs/api/ability/IAbilityAction.java @@ -0,0 +1,25 @@ +package noppes.npcs.api.ability; + +/** + * Common API interface for all combat actions (abilities and chained abilities). + * Both {@link IAbility} and {@link IChainedAbility} extend this interface. + */ +public interface IAbilityAction { + + String getName(); + + boolean isEnabled(); + + int getWeight(); + + int getCooldownTicks(); + + float getMinRange(); + + float getMaxRange(); + + /** + * Whether this action is a chained ability (sequence) vs an individual ability. + */ + boolean isChain(); +} diff --git a/java/noppes/npcs/api/ability/IChainedAbility.java b/java/noppes/npcs/api/ability/IChainedAbility.java new file mode 100644 index 0000000..4d6e111 --- /dev/null +++ b/java/noppes/npcs/api/ability/IChainedAbility.java @@ -0,0 +1,18 @@ +package noppes.npcs.api.ability; + +/** + * API interface for chained abilities - ordered sequences of ability references + * that execute one after another with configurable delays. + */ +public interface IChainedAbility extends IAbilityAction { + + boolean isWindUpAll(); + + int getEntryCount(); + + String getEntryReference(int index); + + int getEntryDelay(int index); + + boolean isEntryInline(int index); +} diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java index c7ccda5..2c51777 100644 --- a/java/noppes/npcs/api/handler/IAbilityHandler.java +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -1,5 +1,7 @@ package noppes.npcs.api.handler; +import noppes.npcs.api.ability.IChainedAbility; + /** * Handler for ability management. Allows scripts to query ability types, * built-in abilities, and custom ability presets. @@ -44,4 +46,35 @@ public interface IAbilityHandler { * @return true if deleted successfully */ boolean deleteCustomAbilityByName(String name); + + /** + * Get all chained ability names. + */ + String[] getChainedAbilityNames(); + + /** + * Check if a chained ability exists by name. + */ + boolean hasChainedAbilityName(String name); + + /** + * Delete a chained ability by name. + * + * @return true if deleted successfully + */ + boolean deleteChainedAbilityByName(String name); + + /** + * Get a chained ability by name. + * + * @return the chained ability, or null if not found + */ + IChainedAbility getChainedAbility(String name); + + /** + * Save a chained ability. If a chain with the same name exists, it is overwritten. + * + * @return true if saved successfully + */ + boolean saveChainedAbility(IChainedAbility chain); } From ae4b84f3baf19c2998449e4b40ac33bc6a92555f Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 18 Feb 2026 04:54:08 -0500 Subject: [PATCH 53/93] Create IAuctionEvent.java --- java/noppes/npcs/api/event/IAuctionEvent.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 java/noppes/npcs/api/event/IAuctionEvent.java diff --git a/java/noppes/npcs/api/event/IAuctionEvent.java b/java/noppes/npcs/api/event/IAuctionEvent.java new file mode 100644 index 0000000..8da9c3e --- /dev/null +++ b/java/noppes/npcs/api/event/IAuctionEvent.java @@ -0,0 +1,75 @@ +package noppes.npcs.api.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import noppes.npcs.api.handler.data.IAuctionClaim; +import noppes.npcs.api.handler.data.IAuctionListing; +import noppes.npcs.api.item.IItemStack; + +/** + * Events related to auction actions. + * These events are fired when players interact with the auction system. + */ +public interface IAuctionEvent extends IPlayerEvent { + + /** + * Fired before a player creates a new auction listing. + * Cancel to prevent the listing from being created. + * The listing fee has NOT yet been deducted when this fires. + * + * @hookName auctionCreate + */ + @Cancelable + interface CreateEvent extends IAuctionEvent { + IItemStack getItem(); + long getStartingPrice(); + long getBuyoutPrice(); + } + + /** + * Fired before a player places a bid on an auction. + * Cancel to prevent the bid from being placed. + * Currency has NOT yet been deducted when this fires. + * + * @hookName auctionBid + */ + @Cancelable + interface BidEvent extends IAuctionEvent { + IAuctionListing getListing(); + long getBidAmount(); + } + + /** + * Fired before a player buys out an auction. + * Cancel to prevent the buyout. + * Currency has NOT yet been deducted when this fires. + * + * @hookName auctionBuyout + */ + @Cancelable + interface BuyoutEvent extends IAuctionEvent { + IAuctionListing getListing(); + } + + /** + * Fired before a player cancels an auction listing. + * Cancel to prevent the cancellation. + * + * @hookName auctionCancel + */ + @Cancelable + interface CancelEvent extends IAuctionEvent { + IAuctionListing getListing(); + boolean isAdmin(); + } + + /** + * Fired before a player claims an item or currency from an auction. + * Cancel to prevent the claim. + * + * @hookName auctionClaim + */ + @Cancelable + interface ClaimEvent extends IAuctionEvent { + IAuctionClaim getClaim(); + } +} From ca2980909ee597fa5b062ca945a2cce533277afc Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 18 Feb 2026 05:13:49 -0500 Subject: [PATCH 54/93] Reformat Code --- java/noppes/npcs/api/AbstractNpcAPI.java | 1 + java/noppes/npcs/api/IWorld.java | 40 ++++++++++--------- java/noppes/npcs/api/ability/IAbility.java | 13 ++++++ .../npcs/api/ability/IDataAbilities.java | 4 +- .../npcs/api/ability/type/IAbilityCharge.java | 4 ++ .../npcs/api/ability/type/IAbilityCutter.java | 9 +++++ .../npcs/api/ability/type/IAbilityDash.java | 3 ++ .../npcs/api/ability/type/IAbilityDisc.java | 24 ++++++++++- .../api/ability/type/IAbilityEnergyBeam.java | 21 +++++++++- .../type/IAbilityEnergyProjectile.java | 17 ++++++++ .../npcs/api/ability/type/IAbilityGuard.java | 8 ++++ .../npcs/api/ability/type/IAbilityHazard.java | 5 +++ .../npcs/api/ability/type/IAbilityHeal.java | 7 ++++ .../api/ability/type/IAbilityHeavyHit.java | 4 ++ .../api/ability/type/IAbilityLaserShot.java | 3 ++ .../npcs/api/ability/type/IAbilityOrb.java | 20 +++++++++- .../api/ability/type/IAbilityProjectile.java | 8 ++++ .../api/ability/type/IAbilityShockwave.java | 4 ++ .../npcs/api/ability/type/IAbilitySlam.java | 5 +++ .../api/ability/type/IAbilitySweeper.java | 13 ++++++ .../api/ability/type/IAbilityTeleport.java | 10 +++++ .../npcs/api/ability/type/IAbilityTrap.java | 8 ++++ .../npcs/api/ability/type/IAbilityVortex.java | 8 ++++ .../npcs/api/ability/type/IAbilityZone.java | 26 ++++++++++++ java/noppes/npcs/api/entity/ICustomNpc.java | 2 +- .../noppes/npcs/api/entity/IEnergySlicer.java | 3 ++ java/noppes/npcs/api/entity/IPlayer.java | 2 +- java/noppes/npcs/api/event/IAuctionEvent.java | 4 ++ .../npcs/api/handler/IAuctionHandler.java | 24 +++++++---- .../npcs/api/handler/IPlayerTradeData.java | 1 + .../npcs/api/handler/data/IAuctionClaim.java | 2 + .../api/handler/data/IAuctionListing.java | 1 + 32 files changed, 268 insertions(+), 36 deletions(-) diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 585ccf2..62523e4 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -183,6 +183,7 @@ public abstract class AbstractNpcAPI { /** * Get the auction handler for managing auctions via scripts. + * * @return The auction handler, or null if auctions are disabled */ public abstract IAuctionHandler getAuctions(); diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index ae01d2e..591b1e6 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -451,42 +451,46 @@ public interface IWorld { /** * Creates an energy orb projectile. Not spawned until fire() is called. + * * @param owner The entity that owns this projectile - * @param x Spawn X position - * @param y Spawn Y position - * @param z Spawn Z position - * @param size Orb size + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position + * @param size Orb size */ IEnergyOrb createEnergyOrb(IEntity owner, double x, double y, double z, float size); /** * Creates an energy beam projectile. Not spawned until fire() is called. - * @param owner The entity that owns this projectile - * @param x Spawn X position - * @param y Spawn Y position - * @param z Spawn Z position + * + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position * @param beamWidth Width of the beam - * @param headSize Size of the beam head + * @param headSize Size of the beam head */ IEnergyBeam createEnergyBeam(IEntity owner, double x, double y, double z, float beamWidth, float headSize); /** * Creates an energy disc projectile. Not spawned until fire() is called. - * @param owner The entity that owns this projectile - * @param x Spawn X position - * @param y Spawn Y position - * @param z Spawn Z position - * @param radius Disc radius + * + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position + * @param radius Disc radius * @param thickness Disc thickness */ IEnergyDisc createEnergyDisc(IEntity owner, double x, double y, double z, float radius, float thickness); /** * Creates an energy laser projectile. Not spawned until fire() is called. - * @param owner The entity that owns this projectile - * @param x Spawn X position - * @param y Spawn Y position - * @param z Spawn Z position + * + * @param owner The entity that owns this projectile + * @param x Spawn X position + * @param y Spawn Y position + * @param z Spawn Z position * @param laserWidth Width of the laser */ IEnergyLaser createEnergyLaser(IEntity owner, double x, double y, double z, float laserWidth); diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index bd43061..e66ab3f 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -127,36 +127,42 @@ public interface IAbility extends IAbilityAction { /** * Get the lock movement type for this ability. + * * @return 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE */ int getLockMovementType(); /** * Set the lock movement type for this ability. + * * @param type 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE */ void setLockMovementType(int type); /** * Get the rotation mode for this ability. + * * @return 0=FREE, 1=LOCKED, 2=TRACK */ int getRotationModeType(); /** * Set the rotation mode for this ability. + * * @param type 0=FREE, 1=LOCKED, 2=TRACK */ void setRotationModeType(int type); /** * Get the rotation phase for this ability (when rotation mode applies). + * * @return 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE */ int getRotationPhaseType(); /** * Set the rotation phase for this ability. + * * @param type 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE */ void setRotationPhaseType(int type); @@ -198,12 +204,14 @@ public interface IAbility extends IAbilityAction { /** * Get the allowed user type for this ability. + * * @return 0=NPC_ONLY, 1=PLAYER_ONLY, 2=BOTH */ int getAllowedByType(); /** * Set the allowed user type for this ability. + * * @param type 0=NPC_ONLY, 1=PLAYER_ONLY, 2=BOTH */ void setAllowedByType(int type); @@ -231,17 +239,22 @@ public interface IAbility extends IAbilityAction { // Burst system boolean isBurstEnabled(); + void setBurstEnabled(boolean enabled); int getBurstAmount(); + void setBurstAmount(int amount); int getBurstDelay(); + void setBurstDelay(int delay); boolean isBurstReplayAnimations(); + void setBurstReplayAnimations(boolean replay); boolean isBurstOverlap(); + void setBurstOverlap(boolean overlap); } diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index ca692b7..7e8b94f 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -106,7 +106,7 @@ public interface IDataAbilities { * If an ability is currently executing, it will be cancelled. * * @param abilityId The ID of the ability to start - * @param target The target entity (can be null for self-targeted abilities) + * @param target The target entity (can be null for self-targeted abilities) * @return true if the ability was started successfully */ boolean forceStartAbility(String abilityId, Object target); @@ -126,7 +126,7 @@ public interface IDataAbilities { * The NPC does NOT need to have this ability assigned. * If an ability is currently executing, it will be cancelled. * - * @param key The ability key (built-in name or custom UUID) + * @param key The ability key (built-in name or custom UUID) * @param target The target entity (can be null for self-targeted abilities) * @return true if the ability was started successfully */ diff --git a/java/noppes/npcs/api/ability/type/IAbilityCharge.java b/java/noppes/npcs/api/ability/type/IAbilityCharge.java index a388598..b864f4a 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityCharge.java +++ b/java/noppes/npcs/api/ability/type/IAbilityCharge.java @@ -9,14 +9,18 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityCharge extends IAbility { float getChargeSpeed(); + void setChargeSpeed(float speed); float getDamage(); + void setDamage(float damage); float getKnockback(); + void setKnockback(float knockback); float getHitWidth(); + void setHitWidth(float width); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityCutter.java b/java/noppes/npcs/api/ability/type/IAbilityCutter.java index bd83cfb..d451f27 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityCutter.java +++ b/java/noppes/npcs/api/ability/type/IAbilityCutter.java @@ -9,32 +9,41 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityCutter extends IAbility { float getArcAngle(); + void setArcAngle(float angle); float getRange(); + void setRange(float range); float getDamage(); + void setDamage(float damage); float getKnockback(); + void setKnockback(float knockback); /** * Get the sweep mode (0 = SWIPE, 1 = SPIN). */ int getSweepMode(); + void setSweepMode(int mode); float getSweepSpeed(); + void setSweepSpeed(float speed); int getSpinDurationTicks(); + void setSpinDurationTicks(int ticks); boolean isPiercing(); + void setPiercing(boolean piercing); float getInnerRadius(); + void setInnerRadius(float radius); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDash.java b/java/noppes/npcs/api/ability/type/IAbilityDash.java index 486eb1f..81074b8 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDash.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDash.java @@ -12,11 +12,14 @@ public interface IAbilityDash extends IAbility { * Get the dash mode (0 = AGGRESSIVE, 1 = DEFENSIVE). */ int getDashMode(); + void setDashMode(int mode); float getDashDistance(); + void setDashDistance(float distance); float getDashSpeed(); + void setDashSpeed(float speed); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 62567a6..807d410 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -7,53 +7,73 @@ package noppes.npcs.api.ability.type; public interface IAbilityDisc extends IAbilityEnergyProjectile { float getSpeed(); + void setSpeed(float speed); float getDiscRadius(); + void setDiscRadius(float radius); float getDiscThickness(); + void setDiscThickness(float thickness); boolean isVertical(); + void setVertical(boolean vertical); boolean isBoomerang(); + void setBoomerang(boolean boomerang); int getBoomerangDelay(); + void setBoomerangDelay(int ticks); boolean isHoming(); + void setHoming(boolean homing); float getHomingStrength(); + void setHomingStrength(float strength); float getHomingRange(); + void setHomingRange(float range); float getRotationSpeed(); + void setRotationSpeed(float speed); int getProjectileCount(); + void setProjectileCount(int count); int getFireDelay(); + void setFireDelay(int delay); - /** @deprecated Use {@link #getFireDelay()} */ + /** + * @deprecated Use {@link #getFireDelay()} + */ int getDualFireDelay(); - /** @deprecated Use {@link #setFireDelay(int)} */ + + /** + * @deprecated Use {@link #setFireDelay(int)} + */ void setDualFireDelay(int delay); // Indexed accessors int getInnerColor(int projectileIndex); + void setInnerColor(int projectileIndex, int color); int getOuterColor(int projectileIndex); + void setOuterColor(int projectileIndex, int color); int getAnchorPoint(int projectileIndex); + void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index 42b0d23..ace857f 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -7,44 +7,61 @@ package noppes.npcs.api.ability.type; public interface IAbilityEnergyBeam extends IAbilityEnergyProjectile { float getSpeed(); + void setSpeed(float speed); float getBeamWidth(); + void setBeamWidth(float width); float getHeadSize(); + void setHeadSize(float size); boolean isHoming(); + void setHoming(boolean homing); float getHomingStrength(); + void setHomingStrength(float strength); float getHomingRange(); + void setHomingRange(float range); float getRotationSpeed(); + void setRotationSpeed(float speed); int getProjectileCount(); + void setProjectileCount(int count); int getFireDelay(); + void setFireDelay(int delay); - /** @deprecated Use {@link #getFireDelay()} */ + /** + * @deprecated Use {@link #getFireDelay()} + */ int getDualFireDelay(); - /** @deprecated Use {@link #setFireDelay(int)} */ + + /** + * @deprecated Use {@link #setFireDelay(int)} + */ void setDualFireDelay(int delay); // Indexed accessors int getInnerColor(int projectileIndex); + void setInnerColor(int projectileIndex, int color); int getOuterColor(int projectileIndex); + void setOuterColor(int projectileIndex, int color); int getAnchorPoint(int projectileIndex); + void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java index f4793eb..9ebddc6 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java @@ -10,57 +10,74 @@ public interface IAbilityEnergyProjectile extends IAbility { // Combat float getDamage(); + void setDamage(float damage); float getKnockback(); + void setKnockback(float knockback); float getKnockbackUp(); + void setKnockbackUp(float knockback); boolean isExplosive(); + void setExplosive(boolean explosive); float getExplosionRadius(); + void setExplosionRadius(float radius); float getExplosionDamageFalloff(); + void setExplosionDamageFalloff(float falloff); // Lifespan float getMaxDistance(); + void setMaxDistance(float distance); int getMaxLifetime(); + void setMaxLifetime(int ticks); // Colors int getInnerColor(); + void setInnerColor(int color); int getOuterColor(); + void setOuterColor(int color); boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); float getOuterColorWidth(); + void setOuterColorWidth(float width); float getOuterColorAlpha(); + void setOuterColorAlpha(float alpha); // Lightning boolean hasLightningEffect(); + void setLightningEffect(boolean enabled); float getLightningDensity(); + void setLightningDensity(float density); float getLightningRadius(); + void setLightningRadius(float radius); // Anchor int getAnchorPoint(); + void setAnchorPoint(int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityGuard.java b/java/noppes/npcs/api/ability/type/IAbilityGuard.java index 36fd7a8..bde5a1d 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityGuard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityGuard.java @@ -9,26 +9,34 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityGuard extends IAbility { int getDurationTicks(); + void setDurationTicks(int ticks); int getCounterWindow(); + void setCounterWindow(int ticks); float getDamageReduction(); + void setDamageReduction(float reduction); boolean canCounter(); + void setCanCounter(boolean canCounter); int getCounterType(); + void setCounterType(int type); float getCounterValue(); + void setCounterValue(float value); String getCounterSound(); + void setCounterSound(String sound); int getCounterAnimationId(); + void setCounterAnimationId(int animationId); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityHazard.java b/java/noppes/npcs/api/ability/type/IAbilityHazard.java index b5118f2..a70900d 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHazard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHazard.java @@ -7,17 +7,22 @@ package noppes.npcs.api.ability.type; public interface IAbilityHazard extends IAbilityZone { float getRadius(); + void setRadius(float radius); float getDamagePerSecond(); + void setDamagePerSecond(float damage); int getDamageInterval(); + void setDamageInterval(int interval); boolean isIgnoreInvulnFrames(); + void setIgnoreInvulnFrames(boolean ignore); boolean isAffectsCaster(); + void setAffectsCaster(boolean affects); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeal.java b/java/noppes/npcs/api/ability/type/IAbilityHeal.java index e606e0b..994d813 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHeal.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHeal.java @@ -9,23 +9,30 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityHeal extends IAbility { int getDurationTicks(); + void setDurationTicks(int ticks); float getHealAmount(); + void setHealAmount(float amount); float getHealPercent(); + void setHealPercent(float percent); boolean isHealSelf(); + void setHealSelf(boolean healSelf); boolean isHealAllies(); + void setHealAllies(boolean healAllies); float getHealRadius(); + void setHealRadius(float radius); boolean isInstantHeal(); + void setInstantHeal(boolean instant); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java index 467ec5b..711fec0 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java @@ -9,14 +9,18 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityHeavyHit extends IAbility { float getDamage(); + void setDamage(float damage); float getKnockback(); + void setKnockback(float knockback); float getHitLength(); + void setHitLength(float hitLength); float getHitWidth(); + void setHitWidth(float hitWidth); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java index 4f02983..fc9fc3b 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java +++ b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java @@ -7,11 +7,14 @@ package noppes.npcs.api.ability.type; public interface IAbilityLaserShot extends IAbilityEnergyProjectile { float getLaserWidth(); + void setLaserWidth(float width); float getExpansionSpeed(); + void setExpansionSpeed(float speed); int getLingerTicks(); + void setLingerTicks(int ticks); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index 2aa451a..9cbc606 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -7,41 +7,57 @@ package noppes.npcs.api.ability.type; public interface IAbilityOrb extends IAbilityEnergyProjectile { float getOrbSpeed(); + void setOrbSpeed(float speed); float getOrbSize(); + void setOrbSize(float size); boolean isHoming(); + void setHoming(boolean homing); float getHomingStrength(); + void setHomingStrength(float strength); float getHomingRange(); + void setHomingRange(float range); float getRotationSpeed(); + void setRotationSpeed(float speed); int getProjectileCount(); + void setProjectileCount(int count); int getFireDelay(); + void setFireDelay(int delay); - /** @deprecated Use {@link #getFireDelay()} */ + /** + * @deprecated Use {@link #getFireDelay()} + */ int getDualFireDelay(); - /** @deprecated Use {@link #setFireDelay(int)} */ + + /** + * @deprecated Use {@link #setFireDelay(int)} + */ void setDualFireDelay(int delay); // Indexed accessors int getInnerColor(int projectileIndex); + void setInnerColor(int projectileIndex, int color); int getOuterColor(int projectileIndex); + void setOuterColor(int projectileIndex, int color); int getAnchorPoint(int projectileIndex); + void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityProjectile.java index fc0eb32..c09f5f8 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityProjectile.java @@ -9,26 +9,34 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityProjectile extends IAbility { float getDamage(); + void setDamage(float damage); float getSpeed(); + void setSpeed(float speed); float getKnockback(); + void setKnockback(float knockback); String getProjectileType(); + void setProjectileType(String type); boolean isExplosive(); + void setExplosive(boolean explosive); float getExplosionRadius(); + void setExplosionRadius(float radius); boolean isHoming(); + void setHoming(boolean homing); float getHomingStrength(); + void setHomingStrength(float strength); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java index 56634cd..93bc849 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java +++ b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java @@ -9,14 +9,18 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityShockwave extends IAbility { float getPushRadius(); + void setPushRadius(float radius); float getPushStrength(); + void setPushStrength(float strength); float getDamage(); + void setDamage(float damage); int getMaxTargets(); + void setMaxTargets(int max); } diff --git a/java/noppes/npcs/api/ability/type/IAbilitySlam.java b/java/noppes/npcs/api/ability/type/IAbilitySlam.java index 164ffd2..9933cde 100644 --- a/java/noppes/npcs/api/ability/type/IAbilitySlam.java +++ b/java/noppes/npcs/api/ability/type/IAbilitySlam.java @@ -9,17 +9,22 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilitySlam extends IAbility { float getDamage(); + void setDamage(float damage); float getRadius(); + void setRadius(float radius); float getKnockbackStrength(); + void setKnockbackStrength(float knockback); float getLeapSpeed(); + void setLeapSpeed(float speed); float getLeapHeight(); + void setLeapHeight(float height); } diff --git a/java/noppes/npcs/api/ability/type/IAbilitySweeper.java b/java/noppes/npcs/api/ability/type/IAbilitySweeper.java index 1502637..a04ba85 100644 --- a/java/noppes/npcs/api/ability/type/IAbilitySweeper.java +++ b/java/noppes/npcs/api/ability/type/IAbilitySweeper.java @@ -9,41 +9,54 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilitySweeper extends IAbility { float getBeamLength(); + void setBeamLength(float length); float getBeamWidth(); + void setBeamWidth(float width); float getBeamHeight(); + void setBeamHeight(float height); float getDamage(); + void setDamage(float damage); int getDamageInterval(); + void setDamageInterval(int interval); boolean isPiercing(); + void setPiercing(boolean piercing); float getSweepSpeed(); + void setSweepSpeed(float speed); int getNumberOfRotations(); + void setNumberOfRotations(int rotations); boolean isLockOnTarget(); + void setLockOnTarget(boolean lock); int getInnerColor(); + void setInnerColor(int color); int getOuterColor(); + void setOuterColor(int color); float getOuterColorWidth(); + void setOuterColorWidth(float width); boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityTeleport.java b/java/noppes/npcs/api/ability/type/IAbilityTeleport.java index 74b9ef8..b0fe4e6 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityTeleport.java +++ b/java/noppes/npcs/api/ability/type/IAbilityTeleport.java @@ -12,32 +12,42 @@ public interface IAbilityTeleport extends IAbility { * Get the teleport mode (0 = BLINK, 1 = BEHIND, 2 = SINGLE). */ int getMode(); + void setMode(int mode); int getBlinkCount(); + void setBlinkCount(int count); int getBlinkDelayTicks(); + void setBlinkDelayTicks(int ticks); float getBlinkRadius(); + void setBlinkRadius(float radius); float getBehindDistance(); + void setBehindDistance(float distance); boolean isRequireLineOfSight(); + void setRequireLineOfSight(boolean require); boolean isDamageAtStart(); + void setDamageAtStart(boolean damage); boolean isDamageAtEnd(); + void setDamageAtEnd(boolean damage); float getDamage(); + void setDamage(float damage); float getDamageRadius(); + void setDamageRadius(float radius); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityTrap.java b/java/noppes/npcs/api/ability/type/IAbilityTrap.java index 23ade92..9c1fc13 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityTrap.java +++ b/java/noppes/npcs/api/ability/type/IAbilityTrap.java @@ -7,26 +7,34 @@ package noppes.npcs.api.ability.type; public interface IAbilityTrap extends IAbilityZone { float getTriggerRadius(); + void setTriggerRadius(float radius); int getArmTime(); + void setArmTime(int ticks); int getMaxTriggers(); + void setMaxTriggers(int max); int getTriggerCooldown(); + void setTriggerCooldown(int cooldown); float getDamage(); + void setDamage(float damage); float getDamageRadius(); + void setDamageRadius(float radius); float getKnockback(); + void setKnockback(float knockback); boolean isVisible(); + void setVisible(boolean visible); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityVortex.java b/java/noppes/npcs/api/ability/type/IAbilityVortex.java index 91fb6a8..b2ff165 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityVortex.java +++ b/java/noppes/npcs/api/ability/type/IAbilityVortex.java @@ -9,26 +9,34 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityVortex extends IAbility { float getPullRadius(); + void setPullRadius(float radius); float getPullStrength(); + void setPullStrength(float strength); float getDamage(); + void setDamage(float damage); float getKnockback(); + void setKnockback(float knockback); boolean isAoe(); + void setAoe(boolean aoe); int getMaxTargets(); + void setMaxTargets(int max); boolean isDamageOnPull(); + void setDamageOnPull(boolean damage); float getPullDamage(); + void setPullDamage(float damage); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityZone.java b/java/noppes/npcs/api/ability/type/IAbilityZone.java index d66861a..2799539 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityZone.java +++ b/java/noppes/npcs/api/ability/type/IAbilityZone.java @@ -9,92 +9,118 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityZone extends IAbility { int getDurationTicks(); + void setDurationTicks(int ticks); /** * Get the zone shape (0 = CIRCLE, 1 = SQUARE). */ int getZoneShapeOrdinal(); + void setZoneShapeOrdinal(int shape); float getSpawnRadius(); + void setSpawnRadius(float radius); int getZoneCount(); + void setZoneCount(int count); float getZoneHeight(); + void setZoneHeight(float height); float getParticleDensity(); + void setParticleDensity(float density); float getParticleScale(); + void setParticleScale(float scale); float getAnimSpeed(); + void setAnimSpeed(float speed); float getLightningDensity(); + void setLightningDensity(float density); // Color controls int getInnerColor(); + void setInnerColor(int color); int getOuterColor(); + void setOuterColor(int color); boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); // Visual layer controls boolean isGroundFill(); + void setGroundFill(boolean enabled); float getGroundAlpha(); + void setGroundAlpha(float alpha); boolean isRings(); + void setRings(boolean enabled); int getRingCount(); + void setRingCount(int count); boolean isBorder(); + void setBorder(boolean enabled); float getBorderSpeed(); + void setBorderSpeed(float speed); boolean isAccents(); + void setAccents(boolean enabled); /** * Get the accent style (0=STATIC, 1=SWAYING, 2=FLICKERING). */ int getAccentStyle(); + void setAccentStyle(int style); boolean isLightning(); + void setLightning(boolean enabled); boolean isParticles(); + void setParticles(boolean enabled); /** * Get the particle motion style (0=RISING, 1=DRIFTING, 2=SPARKS). */ int getParticleMotion(); + void setParticleMotion(int motion); String getParticleDir(); + void setParticleDir(String directory); int getParticleSize(); + void setParticleSize(int size); boolean isParticleGlow(); + void setParticleGlow(boolean glow); } diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index 18ca698..1ca5c48 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -4,7 +4,6 @@ import net.minecraft.entity.EntityCreature; import noppes.npcs.api.IPos; import noppes.npcs.api.ITimers; import noppes.npcs.api.ability.IDataAbilities; -import noppes.npcs.api.entity.IEnergyProjectile; import noppes.npcs.api.entity.data.IModelData; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; @@ -1519,6 +1518,7 @@ public interface ICustomNpc extends IEntityLiving, /** * Returns all active energy projectiles fired by this NPC. + * * @return Array of active energy projectiles, empty array if none */ IEnergyProjectile[] getActiveEnergyProjectiles(); diff --git a/java/noppes/npcs/api/entity/IEnergySlicer.java b/java/noppes/npcs/api/entity/IEnergySlicer.java index b3fec49..e03101a 100644 --- a/java/noppes/npcs/api/entity/IEnergySlicer.java +++ b/java/noppes/npcs/api/entity/IEnergySlicer.java @@ -8,11 +8,14 @@ import net.minecraft.entity.Entity; public interface IEnergySlicer extends IEnergyProjectile { float getSliceWidth(); + void setSliceWidth(float width); float getSliceThickness(); + void setSliceThickness(float thickness); boolean isPiercing(); + void setPiercing(boolean piercing); } diff --git a/java/noppes/npcs/api/entity/IPlayer.java b/java/noppes/npcs/api/entity/IPlayer.java index 765f013..328555a 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -9,7 +9,6 @@ import noppes.npcs.api.IPos; import noppes.npcs.api.IScreenSize; import noppes.npcs.api.ITimers; import noppes.npcs.api.IWorld; -import noppes.npcs.api.entity.IEnergyProjectile; import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; @@ -756,6 +755,7 @@ public interface IPlayer extends IEntityLivingBase, /** * Returns all active energy projectiles fired by this player. + * * @return Array of active energy projectiles, empty array if none */ IEnergyProjectile[] getActiveEnergyProjectiles(); diff --git a/java/noppes/npcs/api/event/IAuctionEvent.java b/java/noppes/npcs/api/event/IAuctionEvent.java index 8da9c3e..a92875d 100644 --- a/java/noppes/npcs/api/event/IAuctionEvent.java +++ b/java/noppes/npcs/api/event/IAuctionEvent.java @@ -21,7 +21,9 @@ public interface IAuctionEvent extends IPlayerEvent { @Cancelable interface CreateEvent extends IAuctionEvent { IItemStack getItem(); + long getStartingPrice(); + long getBuyoutPrice(); } @@ -35,6 +37,7 @@ public interface IAuctionEvent extends IPlayerEvent { @Cancelable interface BidEvent extends IAuctionEvent { IAuctionListing getListing(); + long getBidAmount(); } @@ -59,6 +62,7 @@ public interface IAuctionEvent extends IPlayerEvent { @Cancelable interface CancelEvent extends IAuctionEvent { IAuctionListing getListing(); + boolean isAdmin(); } diff --git a/java/noppes/npcs/api/handler/IAuctionHandler.java b/java/noppes/npcs/api/handler/IAuctionHandler.java index eaf8816..8b00df9 100644 --- a/java/noppes/npcs/api/handler/IAuctionHandler.java +++ b/java/noppes/npcs/api/handler/IAuctionHandler.java @@ -22,6 +22,7 @@ public interface IAuctionHandler { /** * Get a specific listing by ID. + * * @param listingId The listing ID * @return The listing, or null if not found */ @@ -29,12 +30,14 @@ public interface IAuctionHandler { /** * Get all active listings by a specific seller. + * * @param sellerUUID The seller's UUID as a string */ IAuctionListing[] getListingsBySeller(String sellerUUID); /** * Get all listings where a player is the current high bidder. + * * @param bidderUUID The bidder's UUID as a string */ IAuctionListing[] getListingsByBidder(String bidderUUID); @@ -46,36 +49,40 @@ public interface IAuctionHandler { /** * Create a new listing. - * @param player The seller - * @param item The item to sell + * + * @param player The seller + * @param item The item to sell * @param startingPrice The starting bid price - * @param buyoutPrice The buyout price (0 for no buyout) + * @param buyoutPrice The buyout price (0 for no buyout) * @return The created listing, or null if failed */ IAuctionListing createListing(IPlayer player, IItemStack item, long startingPrice, long buyoutPrice); /** * Place a bid on a listing. + * * @param listingId The listing ID - * @param player The bidder - * @param amount The bid amount + * @param player The bidder + * @param amount The bid amount * @return null on success, error message on failure */ String placeBid(String listingId, IPlayer player, long amount); /** * Buyout a listing instantly. + * * @param listingId The listing ID - * @param player The buyer + * @param player The buyer * @return null on success, error message on failure */ String buyout(String listingId, IPlayer player); /** * Cancel a listing (seller only, unless admin). + * * @param listingId The listing ID - * @param player The player cancelling - * @param isAdmin Whether to bypass ownership check + * @param player The player cancelling + * @param isAdmin Whether to bypass ownership check * @return null on success, error message on failure */ String cancelListing(String listingId, IPlayer player, boolean isAdmin); @@ -117,6 +124,7 @@ public interface IAuctionHandler { /** * Search listings by item name or seller name. + * * @param searchText The search text * @return Matching active listings */ diff --git a/java/noppes/npcs/api/handler/IPlayerTradeData.java b/java/noppes/npcs/api/handler/IPlayerTradeData.java index a9b560c..ef8086e 100644 --- a/java/noppes/npcs/api/handler/IPlayerTradeData.java +++ b/java/noppes/npcs/api/handler/IPlayerTradeData.java @@ -84,6 +84,7 @@ public interface IPlayerTradeData { /** * Get a specific claim by ID. + * * @param claimId The claim ID * @return The claim, or null if not found */ diff --git a/java/noppes/npcs/api/handler/data/IAuctionClaim.java b/java/noppes/npcs/api/handler/data/IAuctionClaim.java index 8d7c3f1..92b0331 100644 --- a/java/noppes/npcs/api/handler/data/IAuctionClaim.java +++ b/java/noppes/npcs/api/handler/data/IAuctionClaim.java @@ -29,6 +29,7 @@ public interface IAuctionClaim { /** * Get the claim type. + * * @return 0 = Item, 1 = Currency (sale proceeds), 2 = Refund (outbid) */ int getType(); @@ -50,6 +51,7 @@ public interface IAuctionClaim { /** * Get the item to claim (for item claims only). + * * @return The item, or null for currency claims */ IItemStack getItem(); diff --git a/java/noppes/npcs/api/handler/data/IAuctionListing.java b/java/noppes/npcs/api/handler/data/IAuctionListing.java index 65e766e..a49496e 100644 --- a/java/noppes/npcs/api/handler/data/IAuctionListing.java +++ b/java/noppes/npcs/api/handler/data/IAuctionListing.java @@ -94,6 +94,7 @@ public interface IAuctionListing { /** * Get the auction status. + * * @return 0 = Active, 1 = Ended, 2 = Cancelled, 3 = Claimed */ int getStatus(); From 2c2f0c0d8f21f0ab3a3bc6bea168b3d3b85aa806 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 18 Feb 2026 22:19:18 -0500 Subject: [PATCH 55/93] Fix DBC Toggle Abilities and Wheel System --- java/noppes/npcs/api/ability/IAbility.java | 25 +++++++++ .../npcs/api/ability/IPlayerAbilityData.java | 25 +++++++++ java/noppes/npcs/api/event/IAbilityEvent.java | 22 ++++++++ .../npcs/api/event/IPlayerAbilityEvent.java | 52 +++++++++++++++++++ 4 files changed, 124 insertions(+) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index e66ab3f..1adf685 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -257,4 +257,29 @@ public interface IAbility extends IAbilityAction { boolean isBurstOverlap(); void setBurstOverlap(boolean overlap); + + // Toggle system + + /** + * Check if this ability is toggleable (has at least 1 toggle state). + */ + boolean isToggleable(); + + /** + * Get the number of toggle states. + * 0 = not toggleable, 1 = binary on/off, 2+ = multi-state cycling. + */ + int getToggleStates(); + + /** + * Set the number of toggle states. + * 0 = not toggleable, 1 = binary on/off, 2+ = multi-state cycling. + */ + void setToggleStates(int states); + + /** + * Get the display label for a specific toggle state (1-indexed). + * @return the label, or null if none set + */ + String getToggleStateLabel(int state); } diff --git a/java/noppes/npcs/api/ability/IPlayerAbilityData.java b/java/noppes/npcs/api/ability/IPlayerAbilityData.java index ed3be8b..7c5ea64 100644 --- a/java/noppes/npcs/api/ability/IPlayerAbilityData.java +++ b/java/noppes/npcs/api/ability/IPlayerAbilityData.java @@ -109,4 +109,29 @@ public interface IPlayerAbilityData { * Activate a specific ability by key. */ boolean activateAbility(String key); + + // Toggle system + + /** + * Cycle a toggle ability to its next state. + * Off -> State 1 -> State 2 -> ... -> State N -> Off + * @return The new state (0 = off, 1+ = active state number) + */ + int toggleAbility(String key); + + /** + * Get the current toggle state for an ability. + * @return 0 if not active, 1+ for active state + */ + int getToggleState(String key); + + /** + * Set a toggle to a specific state. 0 = deactivate, 1+ = specific state. + */ + void setToggleState(String key, int state); + + /** + * Check if a toggle ability is currently active (any state > 0). + */ + boolean isAbilityToggled(String key); } diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 21c9cd3..1c43278 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -58,6 +58,28 @@ public interface IAbilityEvent extends INpcEvent { interface CompleteEvent extends IAbilityEvent { } + /** + * Fired when a toggle ability is switched ON or OFF. + * Canceling prevents the toggle from changing state. + */ + @Cancelable + interface ToggleEvent extends IAbilityEvent { + boolean isTogglingOn(); + int getOldState(); + int getNewState(); + } + + /** + * Fired every 10 ticks for each active toggle ability. + * Scripts can call setEnabled(false) to force-deactivate. + */ + interface ToggleUpdateEvent extends IAbilityEvent { + int getTick(); + int getState(); + boolean isEnabled(); + void setEnabled(boolean enabled); + } + /** * Fired when an ability hits an entity with damage. * Canceling this event prevents the damage from being applied. diff --git a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java index 00c7a6b..6162f87 100644 --- a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java +++ b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java @@ -85,6 +85,58 @@ public interface IPlayerAbilityEvent extends IPlayerEvent { int getTick(); } + /** + * Fired when a toggle ability is switched ON or OFF. + * Canceling prevents the toggle from changing state. + * + * @hookName abilityToggle + */ + @Cancelable + interface ToggleEvent extends IPlayerAbilityEvent { + /** + * @return true if the toggle is being turned ON (any state), false if being turned OFF + */ + boolean isTogglingOn(); + + /** + * @return the previous state (0 = was off, 1+ = previous active state) + */ + int getOldState(); + + /** + * @return the new state (0 = turning off, 1+ = new active state) + */ + int getNewState(); + } + + /** + * Fired every 10 ticks for each active toggle ability. + * Scripts can call {@link #setEnabled(boolean)} with false to force-deactivate the toggle. + * + * @hookName abilityToggleUpdate + */ + interface ToggleUpdateEvent extends IPlayerAbilityEvent { + /** + * @return the tick count since the toggle was activated + */ + int getTick(); + + /** + * @return the current toggle state (1+) + */ + int getState(); + + /** + * @return whether the toggle should remain active + */ + boolean isEnabled(); + + /** + * Set to false to force-deactivate the toggle after this event completes. + */ + void setEnabled(boolean enabled); + } + /** * Fired when a player's ability hits an entity with damage. * Canceling this event prevents the damage from being applied. From a27e1159508c799c1b7b612ee09574f207bd64e0 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 19 Feb 2026 12:55:06 -0500 Subject: [PATCH 56/93] IAbilityEffect --- .../npcs/api/ability/type/IAbilityEffect.java | 49 +++++++++++++++++++ .../npcs/api/ability/type/IAbilityHeal.java | 38 -------------- 2 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 java/noppes/npcs/api/ability/type/IAbilityEffect.java delete mode 100644 java/noppes/npcs/api/ability/type/IAbilityHeal.java diff --git a/java/noppes/npcs/api/ability/type/IAbilityEffect.java b/java/noppes/npcs/api/ability/type/IAbilityEffect.java new file mode 100644 index 0000000..d0e66f6 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityEffect.java @@ -0,0 +1,49 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for Effect abilities. + * Applies healing, potion effects, custom effects, and mod-registered effect actions + * to self or nearby entities. + */ +public interface IAbilityEffect extends IAbility { + + int getDurationTicks(); + void setDurationTicks(int ticks); + + float getHealAmount(); + void setHealAmount(float amount); + + float getHealPercent(); + void setHealPercent(float percent); + + boolean isIncludeSelf(); + void setIncludeSelf(boolean includeSelf); + + float getRadius(); + void setRadius(float radius); + + boolean isInstantHeal(); + void setInstantHeal(boolean instant); + + /** + * @return Target filter type ordinal: 0=ALLIES, 1=ENEMIES, 2=ALL + */ + int getTargetFilterType(); + + /** + * @param filter Target filter type ordinal: 0=ALLIES, 1=ENEMIES, 2=ALL + */ + void setTargetFilterType(int filter); + + /** + * @return Number of configured custom effects (from CustomEffectController) + */ + int getCustomEffectCount(); + + /** + * @return Number of configured mod-registered effect actions + */ + int getEffectActionCount(); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeal.java b/java/noppes/npcs/api/ability/type/IAbilityHeal.java deleted file mode 100644 index 994d813..0000000 --- a/java/noppes/npcs/api/ability/type/IAbilityHeal.java +++ /dev/null @@ -1,38 +0,0 @@ -package noppes.npcs.api.ability.type; - -import noppes.npcs.api.ability.IAbility; - -/** - * API interface for Heal abilities. - * Healing self and/or allies. - */ -public interface IAbilityHeal extends IAbility { - - int getDurationTicks(); - - void setDurationTicks(int ticks); - - float getHealAmount(); - - void setHealAmount(float amount); - - float getHealPercent(); - - void setHealPercent(float percent); - - boolean isHealSelf(); - - void setHealSelf(boolean healSelf); - - boolean isHealAllies(); - - void setHealAllies(boolean healAllies); - - float getHealRadius(); - - void setHealRadius(float radius); - - boolean isInstantHeal(); - - void setInstantHeal(boolean instant); -} From 72718c36016c526b00681ea2ba8c506030aca555 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 20 Feb 2026 03:47:11 -0500 Subject: [PATCH 57/93] Complete Ability Hud System + Added-Per-Ability Cooldown System to be Reflected in Hud and Hud GUI --- java/noppes/npcs/api/ability/IAbility.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 1adf685..dae7097 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -226,6 +226,17 @@ public interface IAbility extends IAbilityAction { */ void setIgnoreCooldown(boolean ignore); + /** + * Check if this ability uses per-ability cooldown instead of global cooldown. + * When true, using this ability only puts THIS ability on cooldown, not all abilities. + */ + boolean isPerAbilityCooldown(); + + /** + * Set whether this ability uses per-ability cooldown. + */ + void setPerAbilityCooldown(boolean perAbility); + /** * Get this ability's data as NBT. */ From 96799f68ecc1f529ab287b426052048695332e87 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 21 Feb 2026 01:09:43 -0500 Subject: [PATCH 58/93] Update IEnergyBarrier.java --- java/noppes/npcs/api/entity/IEnergyBarrier.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/noppes/npcs/api/entity/IEnergyBarrier.java b/java/noppes/npcs/api/entity/IEnergyBarrier.java index ddce946..44f2ddd 100644 --- a/java/noppes/npcs/api/entity/IEnergyBarrier.java +++ b/java/noppes/npcs/api/entity/IEnergyBarrier.java @@ -45,6 +45,10 @@ public interface IEnergyBarrier extends IEnergyAbility { void setDefaultMultiplier(float multiplier); + boolean isSolid(); + + void setSolid(boolean solid); + boolean isKnockbackEnabled(); void setKnockbackEnabled(boolean enabled); @@ -53,9 +57,9 @@ public interface IEnergyBarrier extends IEnergyAbility { void setKnockbackStrength(float strength); - int getKnockbackTarget(); + boolean isAbsorbing(); - void setKnockbackTarget(int target); + void setAbsorbing(boolean absorbing); /** * Returns the barrier type: 0=Dome, 1=Panel From a9c77d20eb83be6a3168480c0d62fa78419e9469 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 21 Feb 2026 04:11:39 -0500 Subject: [PATCH 59/93] Add New Dash Directional --- java/noppes/npcs/api/ability/type/IAbilityDash.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityDash.java b/java/noppes/npcs/api/ability/type/IAbilityDash.java index 81074b8..50f9bf2 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDash.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDash.java @@ -9,7 +9,7 @@ import noppes.npcs.api.ability.IAbility; public interface IAbilityDash extends IAbility { /** - * Get the dash mode (0 = AGGRESSIVE, 1 = DEFENSIVE). + * Get the dash mode (0 = AGGRESSIVE, 1 = DEFENSIVE, 2 = DIRECTIONAL). */ int getDashMode(); From 0d31b56a12dd18f611505047402d2251a6dd0906 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 21 Feb 2026 20:39:15 -0500 Subject: [PATCH 60/93] Add Hit Type to Projectiles --- .../npcs/api/ability/type/IAbilityEnergyProjectile.java | 8 ++++++++ java/noppes/npcs/api/entity/IEnergyLaser.java | 2 +- java/noppes/npcs/api/entity/IEnergyProjectile.java | 8 ++++++++ java/noppes/npcs/api/entity/IEnergySlicer.java | 4 ---- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java index 9ebddc6..b7bd38c 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java @@ -33,6 +33,14 @@ public interface IAbilityEnergyProjectile extends IAbility { void setExplosionDamageFalloff(float falloff); + int getHitType(); + + void setHitType(int hitType); + + int getMultiHitDelayTicks(); + + void setMultiHitDelayTicks(int delayTicks); + // Lifespan float getMaxDistance(); diff --git a/java/noppes/npcs/api/entity/IEnergyLaser.java b/java/noppes/npcs/api/entity/IEnergyLaser.java index 0327999..32a3f66 100644 --- a/java/noppes/npcs/api/entity/IEnergyLaser.java +++ b/java/noppes/npcs/api/entity/IEnergyLaser.java @@ -3,7 +3,7 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy laser projectile - a fast expanding piercing line. + * Represents an energy laser projectile - a fast expanding line. */ public interface IEnergyLaser extends IEnergyProjectile { diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 36e6575..a53cea3 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -76,6 +76,14 @@ public interface IEnergyProjectile extends IEnergyAbility { void setExplosionDamageFalloff(float falloff); + int getHitType(); + + void setHitType(int hitType); + + int getMultiHitDelayTicks(); + + void setMultiHitDelayTicks(int delayTicks); + // ==================== MOVEMENT ==================== float getSpeed(); diff --git a/java/noppes/npcs/api/entity/IEnergySlicer.java b/java/noppes/npcs/api/entity/IEnergySlicer.java index e03101a..ed547a8 100644 --- a/java/noppes/npcs/api/entity/IEnergySlicer.java +++ b/java/noppes/npcs/api/entity/IEnergySlicer.java @@ -14,8 +14,4 @@ public interface IEnergySlicer extends IEnergyProjectile { float getSliceThickness(); void setSliceThickness(float thickness); - - boolean isPiercing(); - - void setPiercing(boolean piercing); } From 658da549eec622ed7bcfb331f655938e8841520a Mon Sep 17 00:00:00 2001 From: Vidal Date: Sun, 22 Feb 2026 18:03:36 -0300 Subject: [PATCH 61/93] getColor and setColor to skin overlays --- java/noppes/npcs/api/ISkinOverlay.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/noppes/npcs/api/ISkinOverlay.java b/java/noppes/npcs/api/ISkinOverlay.java index 04b43c6..1f15a85 100644 --- a/java/noppes/npcs/api/ISkinOverlay.java +++ b/java/noppes/npcs/api/ISkinOverlay.java @@ -43,6 +43,10 @@ public interface ISkinOverlay { float getSize(); + void setColor(int color); + + int getColor(); + /** * Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more. */ From 2438b2110e74bfd49125cf74254d98c8b18e2331 Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 22 Feb 2026 21:18:42 -0500 Subject: [PATCH 62/93] IsAoe for Vortex and Shockwave --- java/noppes/npcs/api/ability/type/IAbilityShockwave.java | 4 ++-- java/noppes/npcs/api/ability/type/IAbilityVortex.java | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java index 93bc849..13c3595 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java +++ b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java @@ -20,7 +20,7 @@ public interface IAbilityShockwave extends IAbility { void setDamage(float damage); - int getMaxTargets(); + boolean isAoe(); - void setMaxTargets(int max); + void setAoe(boolean aoe); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityVortex.java b/java/noppes/npcs/api/ability/type/IAbilityVortex.java index b2ff165..89b46e8 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityVortex.java +++ b/java/noppes/npcs/api/ability/type/IAbilityVortex.java @@ -28,10 +28,6 @@ public interface IAbilityVortex extends IAbility { void setAoe(boolean aoe); - int getMaxTargets(); - - void setMaxTargets(int max); - boolean isDamageOnPull(); void setDamageOnPull(boolean damage); From db7173c4ec6b01ffb4ab23fad130164c5815f7dc Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 23 Feb 2026 05:20:54 -0500 Subject: [PATCH 63/93] Natural Spawns PR2 --- .../npcs/api/handler/data/INaturalSpawn.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/java/noppes/npcs/api/handler/data/INaturalSpawn.java b/java/noppes/npcs/api/handler/data/INaturalSpawn.java index 3201ada..92601de 100644 --- a/java/noppes/npcs/api/handler/data/INaturalSpawn.java +++ b/java/noppes/npcs/api/handler/data/INaturalSpawn.java @@ -4,6 +4,9 @@ import noppes.npcs.api.IWorld; import noppes.npcs.api.entity.IEntity; public interface INaturalSpawn { + int DESPAWN_FORCE_NATURAL = 0; + int DESPAWN_PRESERVE_TEMPLATE = 1; + int DESPAWN_FORCE_PERSISTENT = 2; void setName(String name); @@ -46,4 +49,24 @@ public interface INaturalSpawn { String[] getBiomes(); void setBiomes(String[] biomes); + + void setMaxAlive(int maxAlive); + + int getMaxAlive(); + + void setCooldownTicks(int ticks); + + int getCooldownTicks(); + + void setAttemptsPerCycle(int attempts); + + int getAttemptsPerCycle(); + + void setPlayerMinDistance(int distance); + + int getPlayerMinDistance(); + + void setDespawnMode(int mode); + + int getDespawnMode(); } From 788cd08264f226953571b0aa737b98a4e2d6d19c Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 23 Feb 2026 14:21:25 -0500 Subject: [PATCH 64/93] Max Hits for Piece and Multi --- .../npcs/api/ability/type/IAbilityEnergyProjectile.java | 4 ++++ java/noppes/npcs/api/entity/IEnergyProjectile.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java index b7bd38c..8da57c7 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java @@ -41,6 +41,10 @@ public interface IAbilityEnergyProjectile extends IAbility { void setMultiHitDelayTicks(int delayTicks); + int getMaxHits(); + + void setMaxHits(int maxHits); + // Lifespan float getMaxDistance(); diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index a53cea3..136c815 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -84,6 +84,10 @@ public interface IEnergyProjectile extends IEnergyAbility { void setMultiHitDelayTicks(int delayTicks); + int getMaxHits(); + + void setMaxHits(int maxHits); + // ==================== MOVEMENT ==================== float getSpeed(); From 3c063d8bc1c27d06107488768fa89357e80bb40d Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 24 Feb 2026 01:14:47 -0500 Subject: [PATCH 65/93] Delete IEnergyTrajectoryData.java --- .../ability/data/IEnergyTrajectoryData.java | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java diff --git a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java b/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java deleted file mode 100644 index d8d2b46..0000000 --- a/java/noppes/npcs/api/ability/data/IEnergyTrajectoryData.java +++ /dev/null @@ -1,80 +0,0 @@ -package noppes.npcs.api.ability.data; - -import noppes.npcs.api.IPos; - -import java.util.function.BiConsumer; - -public interface IEnergyTrajectoryData { - int getCurrentPath(); - - void setCurrentPath(int currentPath); - - int getDelay(int path); - - void setDelay(int path, int ticks); - - IPos getPos(int path); - - void setPos(int path, IPos coords); - - boolean isConcluded(int path); - - void setConcluded(int path, boolean concluded); - - double getX(int path); - - void setX(int path, double x); - - double getY(int path); - - void setY(int path, double y); - - double getZ(int path); - - void setZ(int path, double z); - - void setPath(int path, IPos pos); - - void setPath(int path, IPos pos, int delay); - - void setPath(int path, double x, double y, double z); - - void setPath(int path, double x, double y, double z, int delay); - - IPath createPath(IPos coords); - - IPath createPath(IPos coords, int delay); - - IPath createPath(double x, double y, double z); - - IPath createPath(double x, double y, double z, int delay); - - void forEach(BiConsumer lambda); - - interface IPath { - - IPos getPos(); - - void setPos(IPos pos); - - int getDelay(); - - void setDelay(int delayTicks); - - boolean isConcluded(); - - void setConcluded(boolean concluded); - - double getX(); - - void setX(double x); - - double getY(); - - void setY(double y); - - double getZ(); - - void setZ(double z); - } -} From 253ef7329814f37578a771363e4bde0b61bc6fcd Mon Sep 17 00:00:00 2001 From: Vidal Date: Tue, 24 Feb 2026 20:23:43 -0300 Subject: [PATCH 66/93] Linked Item API methods --- java/noppes/npcs/api/AbstractNpcAPI.java | 20 +++--------------- .../npcs/api/handler/ILinkedItemHandler.java | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 java/noppes/npcs/api/handler/ILinkedItemHandler.java diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 62523e4..9344a3d 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -16,23 +16,7 @@ import noppes.npcs.api.entity.ICustomNpc; import noppes.npcs.api.entity.IEntity; import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.gui.ICustomGui; -import noppes.npcs.api.handler.IAbilityHandler; -import noppes.npcs.api.handler.IActionManager; -import noppes.npcs.api.handler.IAnimationHandler; -import noppes.npcs.api.handler.IAuctionHandler; -import noppes.npcs.api.handler.ICloneHandler; -import noppes.npcs.api.handler.ICustomEffectHandler; -import noppes.npcs.api.handler.IDialogHandler; -import noppes.npcs.api.handler.IFactionHandler; -import noppes.npcs.api.handler.IMagicHandler; -import noppes.npcs.api.handler.INaturalSpawnsHandler; -import noppes.npcs.api.handler.IPartyHandler; -import noppes.npcs.api.handler.IProfileHandler; -import noppes.npcs.api.handler.IQuestHandler; -import noppes.npcs.api.handler.IRecipeHandler; -import noppes.npcs.api.handler.IScriptHookHandler; -import noppes.npcs.api.handler.ITelegraphHandler; -import noppes.npcs.api.handler.ITransportHandler; +import noppes.npcs.api.handler.*; import noppes.npcs.api.handler.data.IAnimation; import noppes.npcs.api.handler.data.IFrame; import noppes.npcs.api.handler.data.IFramePart; @@ -169,6 +153,8 @@ public abstract class AbstractNpcAPI { public abstract IAnimationHandler getAnimations(); + public abstract ILinkedItemHandler getLinkedItems(); + /** * Get the script hook handler for registering custom hooks. * Addon mods can use this to register hooks that will appear in script editor GUIs. diff --git a/java/noppes/npcs/api/handler/ILinkedItemHandler.java b/java/noppes/npcs/api/handler/ILinkedItemHandler.java new file mode 100644 index 0000000..f0864c6 --- /dev/null +++ b/java/noppes/npcs/api/handler/ILinkedItemHandler.java @@ -0,0 +1,21 @@ +package noppes.npcs.api.handler; + +import noppes.npcs.api.handler.data.ILinkedItem; +import noppes.npcs.api.item.IItemStack; +import noppes.npcs.controllers.data.LinkedItem; + +public interface ILinkedItemHandler { + ILinkedItem createItem(String name); + + IItemStack createItemStack(int id); + + void add(ILinkedItem linkedItem); + + ILinkedItem remove(int id); + + ILinkedItem get(int id); + + boolean contains(int id); + + boolean contains(ILinkedItem linkedItem); +} From 7f95b90fc2ff1238df3e902fd55c804ffbdaacbc Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 24 Feb 2026 18:35:40 -0500 Subject: [PATCH 67/93] Small Linked Item Building Fix --- java/noppes/npcs/api/handler/ILinkedItemHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/noppes/npcs/api/handler/ILinkedItemHandler.java b/java/noppes/npcs/api/handler/ILinkedItemHandler.java index f0864c6..056be78 100644 --- a/java/noppes/npcs/api/handler/ILinkedItemHandler.java +++ b/java/noppes/npcs/api/handler/ILinkedItemHandler.java @@ -2,7 +2,6 @@ package noppes.npcs.api.handler; import noppes.npcs.api.handler.data.ILinkedItem; import noppes.npcs.api.item.IItemStack; -import noppes.npcs.controllers.data.LinkedItem; public interface ILinkedItemHandler { ILinkedItem createItem(String name); From 34a7ea020b380358c5f64a2e6d371f343942c6ef Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 24 Feb 2026 21:23:39 -0500 Subject: [PATCH 68/93] Scripting Ability Handling Improvement and Copy Data --- .../npcs/api/ability/IDataAbilities.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index 7e8b94f..081400a 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -18,6 +18,7 @@ public interface IDataAbilities { /** * Get all abilities assigned to this NPC (resolved from slots). + * Returns safe deep copies. Use {@link #getSourceAbility(String)} for live references. */ IAbility[] getAbilities(); @@ -38,6 +39,7 @@ public interface IDataAbilities { /** * Get an ability by ID. + * Returns a safe deep copy. Use {@link #getSourceAbility(String)} for the live reference. */ IAbility getAbility(String abilityId); @@ -64,6 +66,7 @@ public interface IDataAbilities { /** * Get the currently executing ability, or null if none. + * Returns a safe deep copy. Use {@link #getSourceCurrentAbility()} for the live reference. */ IAbility getCurrentAbility(); @@ -140,4 +143,25 @@ public interface IDataAbilities { * @return The new ability, or null if the type is unknown */ IAbility createAbility(String typeId); + + /** + * Get the live source reference of an ability by ID. + * Unlike {@link #getAbility(String)} which returns a safe copy, + * this returns the actual ability object. Modifications will permanently + * affect the NPC's ability configuration. + * + * @param abilityId The ID of the ability + * @return The live ability reference, or null if not found + */ + IAbility getSourceAbility(String abilityId); + + /** + * Get the live source reference of the currently executing ability. + * Unlike {@link #getCurrentAbility()} which returns a safe copy, + * this returns the actual ability object. Modifications will permanently + * affect the NPC's ability configuration. + * + * @return The live ability reference, or null if no ability is executing + */ + IAbility getSourceCurrentAbility(); } From 52cfe77bb776f10db17137ddb623503d8fe52ad0 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 25 Feb 2026 03:52:19 -0500 Subject: [PATCH 69/93] Complete Overhaul to Laser Shot -> Ability Laser --- .../npcs/api/ability/type/IAbilityLaser.java | 20 +++++++++++++++++++ .../api/ability/type/IAbilityLaserShot.java | 20 ------------------- java/noppes/npcs/api/entity/IEnergyLaser.java | 12 +++-------- 3 files changed, 23 insertions(+), 29 deletions(-) create mode 100644 java/noppes/npcs/api/ability/type/IAbilityLaser.java delete mode 100644 java/noppes/npcs/api/ability/type/IAbilityLaserShot.java diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaser.java b/java/noppes/npcs/api/ability/type/IAbilityLaser.java new file mode 100644 index 0000000..af26095 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityLaser.java @@ -0,0 +1,20 @@ +package noppes.npcs.api.ability.type; + +/** + * API interface for Laser abilities. + * Sweeping beam that follows the caster's look vector. + */ +public interface IAbilityLaser extends IAbilityEnergyProjectile { + + float getLaserWidth(); + + void setLaserWidth(float width); + + float getExpansionSpeed(); + + void setExpansionSpeed(float speed); + + float getMaxLength(); + + void setMaxLength(float maxLength); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java b/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java deleted file mode 100644 index fc9fc3b..0000000 --- a/java/noppes/npcs/api/ability/type/IAbilityLaserShot.java +++ /dev/null @@ -1,20 +0,0 @@ -package noppes.npcs.api.ability.type; - -/** - * API interface for Laser Shot abilities. - * Fast expanding thin line that pierces through targets. - */ -public interface IAbilityLaserShot extends IAbilityEnergyProjectile { - - float getLaserWidth(); - - void setLaserWidth(float width); - - float getExpansionSpeed(); - - void setExpansionSpeed(float speed); - - int getLingerTicks(); - - void setLingerTicks(int ticks); -} diff --git a/java/noppes/npcs/api/entity/IEnergyLaser.java b/java/noppes/npcs/api/entity/IEnergyLaser.java index 32a3f66..6433086 100644 --- a/java/noppes/npcs/api/entity/IEnergyLaser.java +++ b/java/noppes/npcs/api/entity/IEnergyLaser.java @@ -3,7 +3,7 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy laser projectile - a fast expanding line. + * Represents an energy laser entity - a sweeping beam that follows the caster's look vector. */ public interface IEnergyLaser extends IEnergyProjectile { @@ -15,9 +15,9 @@ public interface IEnergyLaser extends IEnergyProjectile { void setExpansionSpeed(float speed); - int getLingerTicks(); + float getMaxLength(); - void setLingerTicks(int ticks); + void setMaxLength(float maxLength); float getCurrentLength(); @@ -36,10 +36,4 @@ public interface IEnergyLaser extends IEnergyProjectile { double getEndY(); double getEndZ(); - - float getLingerAlpha(); - - boolean isLockVerticalDirection(); - - void setLockVerticalDirection(boolean lock); } From aac5f98be85b2004f61733c1c97bdae26329a714 Mon Sep 17 00:00:00 2001 From: Vidal Date: Thu, 26 Feb 2026 01:03:21 -0300 Subject: [PATCH 70/93] Pushed Dash API methods to the right branch now lmao --- java/noppes/npcs/api/ability/type/IAbilityDash.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/noppes/npcs/api/ability/type/IAbilityDash.java b/java/noppes/npcs/api/ability/type/IAbilityDash.java index 50f9bf2..d8c2954 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDash.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDash.java @@ -22,4 +22,12 @@ public interface IAbilityDash extends IAbility { float getDashSpeed(); void setDashSpeed(float speed); + + float getDashAngle(); + + void setDashAngle(float dashAngle); + + int getDashDirection(); + + void setDashDirection(int mode); } From ae98d12fafa29f48656f8bc9d2ad998a7fd2c3d3 Mon Sep 17 00:00:00 2001 From: Kam Date: Fri, 27 Feb 2026 16:43:34 -0500 Subject: [PATCH 71/93] Remove all Legacy Ability Content, cleanup API. - Add Script Tab to Abilities - Add Custom Ability - Add Icon Support for Abilities / Default Icon Support - Remove Icon Tab and throw it into Effects with allowed Override - Removed Deprecated API Sources --- .../npcs/api/ability/ICustomAbility.java | 42 ++++++++++ .../npcs/api/ability/IDataAbilities.java | 5 ++ .../npcs/api/ability/IPlayerAbilityData.java | 5 ++ .../npcs/api/ability/type/IAbilityDisc.java | 10 --- .../api/ability/type/IAbilityEnergyBeam.java | 10 --- .../npcs/api/ability/type/IAbilityOrb.java | 10 --- java/noppes/npcs/api/event/IAbilityEvent.java | 17 ++++ java/noppes/npcs/api/event/IChainEvent.java | 80 +++++++++++++++++++ 8 files changed, 149 insertions(+), 30 deletions(-) create mode 100644 java/noppes/npcs/api/ability/ICustomAbility.java create mode 100644 java/noppes/npcs/api/event/IChainEvent.java diff --git a/java/noppes/npcs/api/ability/ICustomAbility.java b/java/noppes/npcs/api/ability/ICustomAbility.java new file mode 100644 index 0000000..eb8ebfa --- /dev/null +++ b/java/noppes/npcs/api/ability/ICustomAbility.java @@ -0,0 +1,42 @@ +package noppes.npcs.api.ability; + +/** + * A custom (script-driven) ability whose behavior is entirely defined by script event hooks. + * Supports both instant execution mode and toggle mode. + */ +public interface ICustomAbility extends IAbility { + + /** + * Get the duration in ticks for instant mode (non-toggle). + */ + int getDurationTicks(); + + /** + * Set the duration in ticks for instant mode. + */ + void setDurationTicks(int ticks); + + /** + * Get the telegraph shape type ordinal. + * @return ordinal of TelegraphType: 0=CIRCLE, 1=RING, 2=LINE, 3=CONE, 4=POINT, 5=SQUARE, 6=NONE + */ + int getTelegraphShapeType(); + + /** + * Set the telegraph shape type by ordinal. + * @param type ordinal of TelegraphType + */ + void setTelegraphShapeType(int type); + + /** + * Get the targeting mode ordinal. + * @return ordinal of TargetingMode: 0=AGGRO_TARGET, 1=SELF, 2=AOE_SELF, 3=AOE_TARGET + */ + int getTargetingModeType(); + + /** + * Set the targeting mode by ordinal. + * @param type ordinal of TargetingMode + */ + void setTargetingModeType(int type); +} diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index 081400a..9a3feb0 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -80,6 +80,11 @@ public interface IDataAbilities { */ void interruptCurrentAbility(); + /** + * Signal the current ability to complete immediately. + */ + void completeCurrentAbility(); + /** * Get the global cooldown timer in ticks. */ diff --git a/java/noppes/npcs/api/ability/IPlayerAbilityData.java b/java/noppes/npcs/api/ability/IPlayerAbilityData.java index 7c5ea64..ece63ee 100644 --- a/java/noppes/npcs/api/ability/IPlayerAbilityData.java +++ b/java/noppes/npcs/api/ability/IPlayerAbilityData.java @@ -70,6 +70,11 @@ public interface IPlayerAbilityData { */ void interruptCurrentAbility(); + /** + * Signal the current ability to complete immediately. + */ + void completeCurrentAbility(); + /** * Check if the player is on universal cooldown. */ diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 807d410..6dbff7e 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -54,16 +54,6 @@ public interface IAbilityDisc extends IAbilityEnergyProjectile { void setFireDelay(int delay); - /** - * @deprecated Use {@link #getFireDelay()} - */ - int getDualFireDelay(); - - /** - * @deprecated Use {@link #setFireDelay(int)} - */ - void setDualFireDelay(int delay); - // Indexed accessors int getInnerColor(int projectileIndex); diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index ace857f..45bc822 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -42,16 +42,6 @@ public interface IAbilityEnergyBeam extends IAbilityEnergyProjectile { void setFireDelay(int delay); - /** - * @deprecated Use {@link #getFireDelay()} - */ - int getDualFireDelay(); - - /** - * @deprecated Use {@link #setFireDelay(int)} - */ - void setDualFireDelay(int delay); - // Indexed accessors int getInnerColor(int projectileIndex); diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index 9cbc606..1079478 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -38,16 +38,6 @@ public interface IAbilityOrb extends IAbilityEnergyProjectile { void setFireDelay(int delay); - /** - * @deprecated Use {@link #getFireDelay()} - */ - int getDualFireDelay(); - - /** - * @deprecated Use {@link #setFireDelay(int)} - */ - void setDualFireDelay(int delay); - // Indexed accessors int getInnerColor(int projectileIndex); diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 1c43278..0f28d33 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -3,7 +3,9 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.IDamageSource; import noppes.npcs.api.ability.IAbility; +import noppes.npcs.api.entity.ICustomNpc; import noppes.npcs.api.entity.IEntityLivingBase; +import noppes.npcs.api.entity.IPlayer; /** * Events related to NPC ability execution. @@ -11,6 +13,21 @@ import noppes.npcs.api.entity.IEntityLivingBase; */ public interface IAbilityEvent extends INpcEvent { + /** + * Get the entity executing the ability (NPC or Player). + */ + IEntityLivingBase getEntity(); + + /** + * Get the player executing the ability, or null if the caster is an NPC. + */ + IPlayer getPlayer(); + + /** + * Whether the entity executing the ability is an NPC. + */ + boolean isNPC(); + /** * Get the ability involved in this event. */ diff --git a/java/noppes/npcs/api/event/IChainEvent.java b/java/noppes/npcs/api/event/IChainEvent.java new file mode 100644 index 0000000..7ab8fae --- /dev/null +++ b/java/noppes/npcs/api/event/IChainEvent.java @@ -0,0 +1,80 @@ +package noppes.npcs.api.event; + +import noppes.npcs.api.IDamageSource; +import noppes.npcs.api.ability.IChainedAbility; +import noppes.npcs.api.entity.ICustomNpc; +import noppes.npcs.api.entity.IEntityLivingBase; +import noppes.npcs.api.entity.IPlayer; + +/** + * Events related to chained ability execution lifecycle. + * These fire at chain-level transitions, not per-ability. + * Unified for both NPCs and Players. + */ +public interface IChainEvent extends ICustomNPCsEvent { + + /** + * Get the entity executing the chain (NPC or Player). + */ + IEntityLivingBase getEntity(); + + /** + * Get the player executing the chain, or null if the caster is an NPC. + */ + IPlayer getPlayer(); + + /** + * Get the NPC executing the chain, or null if the caster is a player. + */ + ICustomNpc getNpc(); + + /** + * Whether the entity executing the chain is an NPC. + */ + boolean isNPC(); + + /** + * Get the chained ability being executed. + */ + IChainedAbility getChain(); + + /** + * Get the target of the chain, or null if no target. + */ + IEntityLivingBase getTarget(); + + /** + * Get the current entry index within the chain (0-based). + */ + int getEntryIndex(); + + /** + * Fired when a chained ability sequence starts executing. + */ + interface StartEvent extends IChainEvent {} + + /** + * Fired when the chain advances to the next entry in the sequence. + */ + interface NextEvent extends IChainEvent {} + + /** + * Fired when a chained ability sequence completes all entries. + */ + interface CompleteEvent extends IChainEvent {} + + /** + * Fired when a chained ability is interrupted by damage. + */ + interface InterruptEvent extends IChainEvent { + /** + * Get the damage source that caused the interruption. + */ + IDamageSource getDamageSource(); + + /** + * Get the amount of damage that caused the interruption. + */ + float getDamage(); + } +} From e504fc4b4acd97e97e5c3f5b0850498d7b1fdd95 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 28 Feb 2026 18:34:10 -0500 Subject: [PATCH 72/93] Animated Texture Support for Custom GUI, Custom Effects, Script Items, Abilities --- java/noppes/npcs/api/gui/ITexturedRect.java | 31 ++++++++++++++ .../npcs/api/handler/data/ICustomEffect.java | 12 ++++++ .../npcs/api/item/IItemCustomizable.java | 42 +++++++++++++++++++ 3 files changed, 85 insertions(+) diff --git a/java/noppes/npcs/api/gui/ITexturedRect.java b/java/noppes/npcs/api/gui/ITexturedRect.java index 75f6f63..98553d8 100644 --- a/java/noppes/npcs/api/gui/ITexturedRect.java +++ b/java/noppes/npcs/api/gui/ITexturedRect.java @@ -81,4 +81,35 @@ public interface ITexturedRect extends ICustomGuiComponent { * @return this textured rectangle instance. */ ITexturedRect setTextureOffset(int textureX, int textureY); + + /** + * Returns whether this textured rect has animation enabled. + * + * @return true if animated. + */ + boolean isAnimated(); + + /** + * Returns the number of animation frames. + * + * @return the frame count. + */ + int getFrameCount(); + + /** + * Returns the ticks per animation frame. + * + * @return the frame time in ticks. + */ + int getFrameTime(); + + /** + * Enables animation on this textured rect using a vertical sprite strip. + * The texture PNG should contain frames stacked vertically. + * + * @param frameCount number of frames in the strip. + * @param frametime ticks per frame (1 tick = 50ms). + * @return this textured rectangle instance. + */ + ITexturedRect setAnimation(int frameCount, int frametime); } diff --git a/java/noppes/npcs/api/handler/data/ICustomEffect.java b/java/noppes/npcs/api/handler/data/ICustomEffect.java index 6b0b6fd..e180049 100644 --- a/java/noppes/npcs/api/handler/data/ICustomEffect.java +++ b/java/noppes/npcs/api/handler/data/ICustomEffect.java @@ -51,6 +51,18 @@ public interface ICustomEffect { * Index: 1 - DBC Addon */ int getIndex(); + + boolean isAnimated(); + + void setAnimated(boolean animated); + + int getFrameCount(); + + void setFrameCount(int frameCount); + + int getFrameTime(); + + void setFrameTime(int frametime); } diff --git a/java/noppes/npcs/api/item/IItemCustomizable.java b/java/noppes/npcs/api/item/IItemCustomizable.java index c085052..29faa50 100644 --- a/java/noppes/npcs/api/item/IItemCustomizable.java +++ b/java/noppes/npcs/api/item/IItemCustomizable.java @@ -245,4 +245,46 @@ public interface IItemCustomizable extends IItemStack { * @return The Z-axis translation */ Float getTranslateZ(); + + /** + * Returns whether the item texture has animation enabled. + * + * @return True if the texture is animated, false otherwise + */ + Boolean isTextureAnimated(); + + /** + * Sets whether the item texture should be animated. + * + * @param animated True to enable animation + */ + void setTextureAnimated(Boolean animated); + + /** + * Gets the number of animation frames in the texture strip. + * + * @return The frame count + */ + Integer getFrameCount(); + + /** + * Sets the number of animation frames. + * + * @param frameCount The frame count + */ + void setFrameCount(Integer frameCount); + + /** + * Gets the ticks per animation frame. + * + * @return The frame time in ticks + */ + Integer getFrameTime(); + + /** + * Sets the ticks per animation frame. + * + * @param frametime The frame time in ticks + */ + void setFrameTime(Integer frametime); } From 27a41e3a8e55c853ac40242064ee0417102243f6 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 28 Feb 2026 23:23:52 -0500 Subject: [PATCH 73/93] Counter, Dodge, Guard Abilities [WIP] --- .../api/ability/type/IAbilityCounter.java | 20 +++++++++++ .../npcs/api/ability/type/IAbilityDefend.java | 19 +++++++++++ .../npcs/api/ability/type/IAbilityDodge.java | 20 +++++++++++ .../npcs/api/ability/type/IAbilityGuard.java | 34 ++----------------- 4 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 java/noppes/npcs/api/ability/type/IAbilityCounter.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityDefend.java create mode 100644 java/noppes/npcs/api/ability/type/IAbilityDodge.java diff --git a/java/noppes/npcs/api/ability/type/IAbilityCounter.java b/java/noppes/npcs/api/ability/type/IAbilityCounter.java new file mode 100644 index 0000000..77988fc --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityCounter.java @@ -0,0 +1,20 @@ +package noppes.npcs.api.ability.type; + +/** + * API interface for Counter abilities. + * Absorbs incoming damage and counter-attacks the attacker. + */ +public interface IAbilityCounter extends IAbilityDefend { + + int getCounterType(); + + void setCounterType(int type); + + float getCounterValue(); + + void setCounterValue(float value); + + int getCounterAnimationId(); + + void setCounterAnimationId(int animationId); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityDefend.java b/java/noppes/npcs/api/ability/type/IAbilityDefend.java new file mode 100644 index 0000000..0b91b20 --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityDefend.java @@ -0,0 +1,19 @@ +package noppes.npcs.api.ability.type; + +import noppes.npcs.api.ability.IAbility; + +/** + * API interface for defensive abilities (Guard, Counter, Dodge). + */ +public interface IAbilityDefend extends IAbility { + + int getDurationTicks(); + + void setDurationTicks(int ticks); + + int getMaxHitAmount(); + + void setMaxHitAmount(int amount); + + boolean isDefending(); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityDodge.java b/java/noppes/npcs/api/ability/type/IAbilityDodge.java new file mode 100644 index 0000000..e9cf52a --- /dev/null +++ b/java/noppes/npcs/api/ability/type/IAbilityDodge.java @@ -0,0 +1,20 @@ +package noppes.npcs.api.ability.type; + +/** + * API interface for Dodge abilities. + * Cancels the incoming attack event entirely and plays a random dodge animation. + */ +public interface IAbilityDodge extends IAbilityDefend { + + int getDodgeAnimation1Id(); + + void setDodgeAnimation1Id(int animationId); + + int getDodgeAnimation2Id(); + + void setDodgeAnimation2Id(int animationId); + + int getDodgeAnimation3Id(); + + void setDodgeAnimation3Id(int animationId); +} diff --git a/java/noppes/npcs/api/ability/type/IAbilityGuard.java b/java/noppes/npcs/api/ability/type/IAbilityGuard.java index bde5a1d..5fd54e9 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityGuard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityGuard.java @@ -1,42 +1,12 @@ package noppes.npcs.api.ability.type; -import noppes.npcs.api.ability.IAbility; - /** * API interface for Guard abilities. - * Defensive stance with optional counter-attack. + * Defensive stance that reduces incoming damage. */ -public interface IAbilityGuard extends IAbility { - - int getDurationTicks(); - - void setDurationTicks(int ticks); - - int getCounterWindow(); - - void setCounterWindow(int ticks); +public interface IAbilityGuard extends IAbilityDefend { float getDamageReduction(); void setDamageReduction(float reduction); - - boolean canCounter(); - - void setCanCounter(boolean canCounter); - - int getCounterType(); - - void setCounterType(int type); - - float getCounterValue(); - - void setCounterValue(float value); - - String getCounterSound(); - - void setCounterSound(String sound); - - int getCounterAnimationId(); - - void setCounterAnimationId(int animationId); } From b28a7a5c4d025ec3d5207cd8d4714f14c3a5de72 Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 1 Mar 2026 02:50:44 -0500 Subject: [PATCH 74/93] Update API and Cleanup Unused Code --- java/noppes/npcs/api/ability/IAbility.java | 28 +++++++- .../npcs/api/ability/IAbilityAction.java | 10 ++- .../npcs/api/ability/IChainedAbility.java | 14 ++++ .../api/ability/data/IEnergyAnchorData.java | 12 ++++ .../api/ability/data/IEnergyCombatData.java | 16 +++++ .../api/ability/data/IEnergyDisplayData.java | 18 +++++ .../api/ability/data/IEnergyHomingData.java | 12 ++++ .../api/ability/data/IEnergyLifespanData.java | 8 +++ .../ability/data/IEnergyLightningData.java | 12 ++++ .../npcs/api/ability/type/IAbilityCharge.java | 8 +++ .../api/ability/type/IAbilityCounter.java | 6 ++ .../npcs/api/ability/type/IAbilityCutter.java | 21 +++++- .../npcs/api/ability/type/IAbilityDash.java | 13 +++- .../npcs/api/ability/type/IAbilityDefend.java | 5 ++ .../npcs/api/ability/type/IAbilityDisc.java | 51 +++++++++++++- .../npcs/api/ability/type/IAbilityDodge.java | 6 ++ .../npcs/api/ability/type/IAbilityEffect.java | 12 ++++ .../api/ability/type/IAbilityEnergyBeam.java | 45 ++++++++++++- .../type/IAbilityEnergyProjectile.java | 55 ++++++++++++++-- .../npcs/api/ability/type/IAbilityGuard.java | 2 + .../npcs/api/ability/type/IAbilityHazard.java | 10 +++ .../api/ability/type/IAbilityHeavyHit.java | 8 +++ .../npcs/api/ability/type/IAbilityLaser.java | 6 ++ .../npcs/api/ability/type/IAbilityOrb.java | 43 +++++++++++- .../api/ability/type/IAbilityProjectile.java | 16 +++++ .../api/ability/type/IAbilityShockwave.java | 8 +++ .../npcs/api/ability/type/IAbilitySlam.java | 10 +++ .../api/ability/type/IAbilitySweeper.java | 26 ++++++++ .../api/ability/type/IAbilityTeleport.java | 23 ++++++- .../npcs/api/ability/type/IAbilityTrap.java | 16 +++++ .../npcs/api/ability/type/IAbilityVortex.java | 14 ++++ .../npcs/api/ability/type/IAbilityZone.java | 66 +++++++++++++++---- .../npcs/api/entity/IEnergyAbility.java | 24 +++++++ 33 files changed, 592 insertions(+), 32 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index dae7097..07a9dc6 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -16,6 +16,7 @@ public interface IAbility extends IAbilityAction { /** * Set the unique ID of this ability instance. + * @param id Unique ability ID. */ void setId(String id); @@ -26,6 +27,7 @@ public interface IAbility extends IAbilityAction { /** * Set the unique identifier/name of this ability. + * @param name Unique identifier. */ void setName(String name); @@ -36,6 +38,7 @@ public interface IAbility extends IAbilityAction { /** * Set the display name (cosmetic). Pass empty string to use getName() as display. + * @param displayName Display name, or empty string for default. */ void setDisplayName(String displayName); @@ -51,6 +54,7 @@ public interface IAbility extends IAbilityAction { /** * Enable or disable this ability. + * @param enabled Whether the ability is enabled. */ void setEnabled(boolean enabled); @@ -62,6 +66,7 @@ public interface IAbility extends IAbilityAction { /** * Set the selection weight. + * @param weight Selection weight (higher = more likely). */ void setWeight(int weight); @@ -72,6 +77,7 @@ public interface IAbility extends IAbilityAction { /** * Set the minimum range. + * @param range Minimum range in blocks. */ void setMinRange(float range); @@ -82,6 +88,7 @@ public interface IAbility extends IAbilityAction { /** * Set the maximum range. + * @param range Maximum range in blocks. */ void setMaxRange(float range); @@ -92,6 +99,7 @@ public interface IAbility extends IAbilityAction { /** * Set the cooldown time in ticks. + * @param ticks Cooldown duration in ticks. */ void setCooldownTicks(int ticks); @@ -102,6 +110,7 @@ public interface IAbility extends IAbilityAction { /** * Set the wind-up time in ticks. + * @param ticks Wind-up duration in ticks. */ void setWindUpTicks(int ticks); @@ -112,6 +121,7 @@ public interface IAbility extends IAbilityAction { /** * Set the dazed time in ticks. + * @param ticks Dazed duration in ticks. */ void setDazedTicks(int ticks); @@ -122,6 +132,7 @@ public interface IAbility extends IAbilityAction { /** * Set whether this ability can be interrupted. + * @param interruptible Whether the ability is interruptible. */ void setInterruptible(boolean interruptible); @@ -223,6 +234,7 @@ public interface IAbility extends IAbilityAction { /** * Set whether this ability ignores cooldowns. + * @param ignore Whether to ignore cooldowns. */ void setIgnoreCooldown(boolean ignore); @@ -234,6 +246,7 @@ public interface IAbility extends IAbilityAction { /** * Set whether this ability uses per-ability cooldown. + * @param perAbility Whether to use per-ability cooldown. */ void setPerAbilityCooldown(boolean perAbility); @@ -244,29 +257,40 @@ public interface IAbility extends IAbilityAction { /** * Set this ability's data from NBT. + * @param nbt NBT data to load. */ void setNbt(INbt nbt); // Burst system + /** @return Whether burst firing is enabled (fires multiple instances in rapid succession). */ boolean isBurstEnabled(); + /** @param enabled Whether burst firing is enabled. */ void setBurstEnabled(boolean enabled); + /** @return Number of times the ability fires per burst. */ int getBurstAmount(); + /** @param amount Number of shots per burst. */ void setBurstAmount(int amount); + /** @return Delay in ticks between each burst shot. */ int getBurstDelay(); + /** @param delay Delay in ticks between burst shots. */ void setBurstDelay(int delay); + /** @return Whether animations replay for each burst shot. */ boolean isBurstReplayAnimations(); + /** @param replay Whether to replay animations per burst shot. */ void setBurstReplayAnimations(boolean replay); + /** @return Whether burst shots can overlap (fire before previous shot ends). */ boolean isBurstOverlap(); + /** @param overlap Whether burst shots can overlap. */ void setBurstOverlap(boolean overlap); // Toggle system @@ -285,12 +309,14 @@ public interface IAbility extends IAbilityAction { /** * Set the number of toggle states. * 0 = not toggleable, 1 = binary on/off, 2+ = multi-state cycling. + * @param states Number of toggle states. */ void setToggleStates(int states); /** * Get the display label for a specific toggle state (1-indexed). - * @return the label, or null if none set + * @param state Toggle state number (1-indexed). + * @return the label, or null if none set. */ String getToggleStateLabel(int state); } diff --git a/java/noppes/npcs/api/ability/IAbilityAction.java b/java/noppes/npcs/api/ability/IAbilityAction.java index 560b04e..6f4cf4c 100644 --- a/java/noppes/npcs/api/ability/IAbilityAction.java +++ b/java/noppes/npcs/api/ability/IAbilityAction.java @@ -6,20 +6,24 @@ package noppes.npcs.api.ability; */ public interface IAbilityAction { + /** @return The unique identifier/name of this action. */ String getName(); + /** @return Whether this action is enabled. */ boolean isEnabled(); + /** @return Selection weight for random ability selection (higher = more likely). */ int getWeight(); + /** @return Cooldown duration in ticks after this action is used. */ int getCooldownTicks(); + /** @return Minimum range in blocks at which this action can be used. */ float getMinRange(); + /** @return Maximum range in blocks at which this action can be used. */ float getMaxRange(); - /** - * Whether this action is a chained ability (sequence) vs an individual ability. - */ + /** @return Whether this action is a chained ability (sequence) vs an individual ability. */ boolean isChain(); } diff --git a/java/noppes/npcs/api/ability/IChainedAbility.java b/java/noppes/npcs/api/ability/IChainedAbility.java index 4d6e111..ee55555 100644 --- a/java/noppes/npcs/api/ability/IChainedAbility.java +++ b/java/noppes/npcs/api/ability/IChainedAbility.java @@ -6,13 +6,27 @@ package noppes.npcs.api.ability; */ public interface IChainedAbility extends IAbilityAction { + /** @return Whether all entries wind up simultaneously before execution begins. */ boolean isWindUpAll(); + /** @return The number of ability entries in this chain. */ int getEntryCount(); + /** + * @param index Entry index in the chain. + * @return The ability reference ID at the given index. + */ String getEntryReference(int index); + /** + * @param index Entry index in the chain. + * @return The delay in ticks before executing this entry. + */ int getEntryDelay(int index); + /** + * @param index Entry index in the chain. + * @return Whether this entry executes inline (overlapping with previous). + */ boolean isEntryInline(int index); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java index 8715a7e..6d3fc0f 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java @@ -1,19 +1,31 @@ package noppes.npcs.api.ability.data; +/** + * Configuration for the anchor point of an energy ability projectile. + * Controls where the projectile spawns relative to the caster. + */ public interface IEnergyAnchorData { + /** @return Anchor point ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ int getAnchor(); + /** Set the anchor point. @param anchor Anchor ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ void setAnchor(int anchor); + /** @return X offset from the anchor point (positive = right). */ float getAnchorOffsetX(); + /** @param anchorOffsetX X offset from anchor (positive = right). */ void setAnchorOffsetX(float anchorOffsetX); + /** @return Y offset from the anchor point (positive = up). */ float getAnchorOffsetY(); + /** @param anchorOffsetY Y offset from anchor (positive = up). */ void setAnchorOffsetY(float anchorOffsetY); + /** @return Z offset from the anchor point (positive = forward). */ float getAnchorOffsetZ(); + /** @param anchorOffsetZ Z offset from anchor (positive = forward). */ void setAnchorOffsetZ(float anchorOffsetZ); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyCombatData.java b/java/noppes/npcs/api/ability/data/IEnergyCombatData.java index dbe950e..644c4d1 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyCombatData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyCombatData.java @@ -1,27 +1,43 @@ package noppes.npcs.api.ability.data; +/** + * Combat properties for energy ability projectiles. + * Controls damage, knockback, and explosion behavior. + */ public interface IEnergyCombatData { + /** @return Base damage dealt on hit. */ float getDamage(); + /** @param damage Base damage on hit. */ void setDamage(float damage); + /** @return Horizontal knockback strength applied on hit. */ float getKnockback(); + /** @param knockback Horizontal knockback strength. */ void setKnockback(float knockback); + /** @return Vertical knockback strength applied on hit. */ float getKnockbackUp(); + /** @param knockbackUp Vertical knockback strength. */ void setKnockbackUp(float knockbackUp); + /** @return Whether the projectile explodes on impact. */ boolean isExplosive(); + /** @param explosive Whether to explode on impact. */ void setExplosive(boolean explosive); + /** @return Explosion radius in blocks. */ float getExplosionRadius(); + /** @param explosionRadius Explosion radius in blocks. */ void setExplosionRadius(float explosionRadius); + /** @return Damage falloff multiplier over distance (0.0-1.0). */ float getExplosionDamageFalloff(); + /** @param explosionDamageFalloff Damage falloff multiplier (0.0-1.0). */ void setExplosionDamageFalloff(float explosionDamageFalloff); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java b/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java index e1b9097..e479ad5 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyDisplayData.java @@ -1,31 +1,49 @@ package noppes.npcs.api.ability.data; +/** + * Visual display properties for energy ability projectiles. + * Controls colors, transparency, and rotation speed. + */ public interface IEnergyDisplayData { + /** @return Inner (core) color as a packed RGB integer. */ int getInnerColor(); + /** @param innerColor Inner color as a packed RGB integer. */ void setInnerColor(int innerColor); + /** @return Outer (glow) color as a packed RGB integer. */ int getOuterColor(); + /** @param outerColor Outer color as a packed RGB integer. */ void setOuterColor(int outerColor); + /** @return Whether the outer color layer is rendered. */ boolean isOuterColorEnabled(); + /** @param outerColorEnabled Whether to render the outer color layer. */ void setOuterColorEnabled(boolean outerColorEnabled); + /** @return Width of the outer color layer relative to the projectile size. */ float getOuterColorWidth(); + /** @param outerColorWidth Outer color layer width. */ void setOuterColorWidth(float outerColorWidth); + /** @return Alpha (opacity) of the outer color layer (0.0-1.0). */ float getOuterColorAlpha(); + /** @param outerColorAlpha Outer color opacity (0.0-1.0). */ void setOuterColorAlpha(float outerColorAlpha); + /** @return Alpha (opacity) of the inner color layer (0.0-1.0). */ float getInnerAlpha(); + /** @param innerAlpha Inner color opacity (0.0-1.0). */ void setInnerAlpha(float innerAlpha); + /** @return Visual rotation speed in degrees per tick. */ float getRotationSpeed(); + /** @param rotationSpeed Rotation speed in degrees per tick. */ void setRotationSpeed(float rotationSpeed); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyHomingData.java b/java/noppes/npcs/api/ability/data/IEnergyHomingData.java index a908fc4..b7a868f 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyHomingData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyHomingData.java @@ -1,19 +1,31 @@ package noppes.npcs.api.ability.data; +/** + * Homing and speed properties for energy ability projectiles. + * Controls projectile velocity and target-seeking behavior. + */ public interface IEnergyHomingData { + /** @return Projectile travel speed in blocks per tick. */ float getSpeed(); + /** @param speed Travel speed in blocks per tick. */ void setSpeed(float speed); + /** @return Whether the projectile tracks its target. */ boolean isHoming(); + /** @param homing Whether to track the target. */ void setHoming(boolean homing); + /** @return Homing turn strength (higher = tighter turns). */ float getHomingStrength(); + /** @param homingStrength Homing turn strength. */ void setHomingStrength(float homingStrength); + /** @return Maximum distance at which homing activates, in blocks. */ float getHomingRange(); + /** @param homingRange Maximum homing activation range in blocks. */ void setHomingRange(float homingRange); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java b/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java index feab13e..e14c2eb 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyLifespanData.java @@ -1,11 +1,19 @@ package noppes.npcs.api.ability.data; +/** + * Lifespan properties for energy ability projectiles. + * Controls how far and how long a projectile can travel before expiring. + */ public interface IEnergyLifespanData { + /** @return Maximum travel distance in blocks before the projectile expires. */ float getMaxDistance(); + /** @param maxDistance Maximum travel distance in blocks. */ void setMaxDistance(float maxDistance); + /** @return Maximum lifetime in ticks before the projectile expires. */ int getMaxLifetime(); + /** @param maxLifetime Maximum lifetime in ticks. */ void setMaxLifetime(int maxLifetime); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyLightningData.java b/java/noppes/npcs/api/ability/data/IEnergyLightningData.java index 41bfa3d..1dcda8f 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyLightningData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyLightningData.java @@ -1,19 +1,31 @@ package noppes.npcs.api.ability.data; +/** + * Lightning visual effect properties for energy ability projectiles. + * Controls the electric arc effect rendered around the projectile. + */ public interface IEnergyLightningData { + /** @return Whether the lightning visual effect is enabled. */ boolean isLightningEffect(); + /** @param lightningEffect Whether to enable the lightning effect. */ void setLightningEffect(boolean lightningEffect); + /** @return Density of lightning arcs (higher = more arcs). */ float getLightningDensity(); + /** @param lightningDensity Lightning arc density. */ void setLightningDensity(float lightningDensity); + /** @return Radius of the lightning effect around the projectile, in blocks. */ float getLightningRadius(); + /** @param lightningRadius Lightning effect radius in blocks. */ void setLightningRadius(float lightningRadius); + /** @return Fade-out time for lightning arcs in ticks. */ int getLightningFadeTime(); + /** @param lightningFadeTime Fade-out time in ticks. */ void setLightningFadeTime(int lightningFadeTime); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityCharge.java b/java/noppes/npcs/api/ability/type/IAbilityCharge.java index b864f4a..985a248 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityCharge.java +++ b/java/noppes/npcs/api/ability/type/IAbilityCharge.java @@ -8,19 +8,27 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityCharge extends IAbility { + /** @return Movement speed during the charge in blocks per tick. */ float getChargeSpeed(); + /** @param speed Movement speed in blocks per tick. */ void setChargeSpeed(float speed); + /** @return Damage dealt to entities hit during the charge. */ float getDamage(); + /** @param damage Damage on charge impact. */ void setDamage(float damage); + /** @return Knockback strength applied to entities hit during the charge. */ float getKnockback(); + /** @param knockback Knockback strength on impact. */ void setKnockback(float knockback); + /** @return Width of the charge hit area in blocks. */ float getHitWidth(); + /** @param width Hit area width in blocks. */ void setHitWidth(float width); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityCounter.java b/java/noppes/npcs/api/ability/type/IAbilityCounter.java index 77988fc..4a32718 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityCounter.java +++ b/java/noppes/npcs/api/ability/type/IAbilityCounter.java @@ -6,15 +6,21 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityCounter extends IAbilityDefend { + /** @return Counter-attack type ordinal (determines how counter damage is calculated). */ int getCounterType(); + /** @param type Counter-attack type ordinal. */ void setCounterType(int type); + /** @return Counter-attack value (meaning depends on counter type, e.g. flat damage or multiplier). */ float getCounterValue(); + /** @param value Counter-attack value (flat damage or multiplier). */ void setCounterValue(float value); + /** @return Animation ID played when the counter-attack triggers, or -1 for none. */ int getCounterAnimationId(); + /** @param animationId Animation ID for the counter-attack, or -1 for none. */ void setCounterAnimationId(int animationId); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityCutter.java b/java/noppes/npcs/api/ability/type/IAbilityCutter.java index d451f27..5fb3590 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityCutter.java +++ b/java/noppes/npcs/api/ability/type/IAbilityCutter.java @@ -8,42 +8,57 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityCutter extends IAbility { + /** @return Arc angle of the sweep in degrees. */ float getArcAngle(); + /** @param angle Arc angle in degrees. */ void setArcAngle(float angle); + /** @return Range of the sweep attack in blocks. */ float getRange(); + /** @param range Sweep range in blocks. */ void setRange(float range); + /** @return Damage dealt to entities hit by the sweep. */ float getDamage(); + /** @param damage Sweep damage amount. */ void setDamage(float damage); + /** @return Knockback strength applied to entities hit. */ float getKnockback(); + /** @param knockback Knockback strength. */ void setKnockback(float knockback); - /** - * Get the sweep mode (0 = SWIPE, 1 = SPIN). - */ + /** @return Sweep mode ordinal (0=SWIPE, 1=SPIN). */ int getSweepMode(); + /** @param mode Sweep mode ordinal (0=SWIPE, 1=SPIN). */ void setSweepMode(int mode); + /** @return Speed of the sweep animation. */ float getSweepSpeed(); + /** @param speed Sweep animation speed. */ void setSweepSpeed(float speed); + /** @return Duration of the spin in ticks (only used in SPIN mode). */ int getSpinDurationTicks(); + /** @param ticks Spin duration in ticks. */ void setSpinDurationTicks(int ticks); + /** @return Whether the sweep hits through multiple targets. */ boolean isPiercing(); + /** @param piercing Whether the sweep pierces through targets. */ void setPiercing(boolean piercing); + /** @return Inner radius of the sweep arc in blocks (creates a donut-shaped hitbox). */ float getInnerRadius(); + /** @param radius Inner radius in blocks. */ void setInnerRadius(float radius); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDash.java b/java/noppes/npcs/api/ability/type/IAbilityDash.java index d8c2954..0db33a6 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDash.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDash.java @@ -8,26 +8,33 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityDash extends IAbility { - /** - * Get the dash mode (0 = AGGRESSIVE, 1 = DEFENSIVE, 2 = DIRECTIONAL). - */ + /** @return Dash mode ordinal (0=AGGRESSIVE, 1=DEFENSIVE, 2=DIRECTIONAL). */ int getDashMode(); + /** @param mode Dash mode ordinal (0=AGGRESSIVE, 1=DEFENSIVE, 2=DIRECTIONAL). */ void setDashMode(int mode); + /** @return Distance covered by the dash in blocks. */ float getDashDistance(); + /** @param distance Dash distance in blocks. */ void setDashDistance(float distance); + /** @return Speed of the dash movement. */ float getDashSpeed(); + /** @param speed Dash movement speed. */ void setDashSpeed(float speed); + /** @return Angle offset of the dash direction in degrees. */ float getDashAngle(); + /** @param dashAngle Direction angle offset in degrees. */ void setDashAngle(float dashAngle); + /** @return Dash direction ordinal (determines lateral movement direction). */ int getDashDirection(); + /** @param mode Dash direction ordinal. */ void setDashDirection(int mode); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDefend.java b/java/noppes/npcs/api/ability/type/IAbilityDefend.java index 0b91b20..6e3e232 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDefend.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDefend.java @@ -7,13 +7,18 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityDefend extends IAbility { + /** @return Maximum duration of the defensive stance in ticks. */ int getDurationTicks(); + /** @param ticks Maximum duration in ticks. */ void setDurationTicks(int ticks); + /** @return Maximum number of hits that can be absorbed before the defense breaks. */ int getMaxHitAmount(); + /** @param amount Maximum hit count before breaking. */ void setMaxHitAmount(int amount); + /** @return Whether the entity is currently in a defensive stance. */ boolean isDefending(); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDisc.java b/java/noppes/npcs/api/ability/type/IAbilityDisc.java index 6dbff7e..574b300 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDisc.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDisc.java @@ -6,64 +6,113 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityDisc extends IAbilityEnergyProjectile { + /** @return Travel speed of the disc in blocks per tick. */ float getSpeed(); + /** @param speed Travel speed in blocks per tick. */ void setSpeed(float speed); + /** @return Visual radius of the disc in blocks. */ float getDiscRadius(); + /** @param radius Disc radius in blocks. */ void setDiscRadius(float radius); + /** @return Thickness of the disc in blocks. */ float getDiscThickness(); + /** @param thickness Disc thickness in blocks. */ void setDiscThickness(float thickness); + /** @return Whether the disc spins on a vertical axis (blade-like). */ boolean isVertical(); + /** @param vertical Whether the disc spins vertically. */ void setVertical(boolean vertical); + /** @return Whether the disc returns to the caster after reaching max distance. */ boolean isBoomerang(); + /** @param boomerang Whether the disc returns to the caster. */ void setBoomerang(boolean boomerang); + /** @return Delay in ticks before the disc begins returning. */ int getBoomerangDelay(); + /** @param ticks Boomerang return delay in ticks. */ void setBoomerangDelay(int ticks); + /** @return Whether the disc tracks its target. */ boolean isHoming(); + /** @param homing Whether to track the target. */ void setHoming(boolean homing); + /** @return Homing turn strength (higher = tighter turns). */ float getHomingStrength(); + /** @param strength Homing turn strength. */ void setHomingStrength(float strength); + /** @return Maximum distance at which homing activates, in blocks. */ float getHomingRange(); + /** @param range Maximum homing activation range in blocks. */ void setHomingRange(float range); + /** @return Visual rotation speed of the disc in degrees per tick. */ float getRotationSpeed(); + /** @param speed Rotation speed in degrees per tick. */ void setRotationSpeed(float speed); + /** @return Number of disc projectiles fired per use. */ int getProjectileCount(); + /** @param count Number of projectiles per use. */ void setProjectileCount(int count); + /** @return Delay in ticks between each projectile in a multi-projectile volley. */ int getFireDelay(); + /** @param delay Delay in ticks between projectiles. */ void setFireDelay(int delay); - // Indexed accessors + // Indexed accessors (per-projectile overrides) + + /** + * @param projectileIndex Projectile index. + * @return Inner color as a packed RGB integer. + */ int getInnerColor(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param color Inner color as a packed RGB integer. + */ void setInnerColor(int projectileIndex, int color); + /** + * @param projectileIndex Projectile index. + * @return Outer color as a packed RGB integer. + */ int getOuterColor(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param color Outer color as a packed RGB integer. + */ void setOuterColor(int projectileIndex, int color); + /** + * @param projectileIndex Projectile index. + * @return Anchor point ordinal. + */ int getAnchorPoint(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param point Anchor point ordinal. + */ void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityDodge.java b/java/noppes/npcs/api/ability/type/IAbilityDodge.java index e9cf52a..204f4f0 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityDodge.java +++ b/java/noppes/npcs/api/ability/type/IAbilityDodge.java @@ -6,15 +6,21 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityDodge extends IAbilityDefend { + /** @return Animation ID for dodge variant 1, or -1 for none. */ int getDodgeAnimation1Id(); + /** @param animationId Animation ID, or -1 for none. */ void setDodgeAnimation1Id(int animationId); + /** @return Animation ID for dodge variant 2, or -1 for none. */ int getDodgeAnimation2Id(); + /** @param animationId Animation ID, or -1 for none. */ void setDodgeAnimation2Id(int animationId); + /** @return Animation ID for dodge variant 3, or -1 for none. */ int getDodgeAnimation3Id(); + /** @param animationId Animation ID, or -1 for none. */ void setDodgeAnimation3Id(int animationId); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityEffect.java b/java/noppes/npcs/api/ability/type/IAbilityEffect.java index d0e66f6..0eff3fa 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEffect.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEffect.java @@ -9,22 +9,34 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityEffect extends IAbility { + /** @return Duration of the effect in ticks. */ int getDurationTicks(); + /** @param ticks Effect duration in ticks. */ void setDurationTicks(int ticks); + /** @return Flat heal amount per tick (body HP). */ float getHealAmount(); + /** @param amount Flat heal amount per tick. */ void setHealAmount(float amount); + /** @return Heal amount as a percentage of max health per tick (0.0-100.0). */ float getHealPercent(); + /** @param percent Heal percentage per tick (0.0-100.0). */ void setHealPercent(float percent); + /** @return Whether the caster is also affected by the effect. */ boolean isIncludeSelf(); + /** @param includeSelf Whether to include the caster. */ void setIncludeSelf(boolean includeSelf); + /** @return Area-of-effect radius in blocks. */ float getRadius(); + /** @param radius AoE radius in blocks. */ void setRadius(float radius); + /** @return Whether healing is applied all at once instead of over time. */ boolean isInstantHeal(); + /** @param instant Whether healing is instant. */ void setInstantHeal(boolean instant); /** diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java index 45bc822..68e2f3e 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyBeam.java @@ -6,52 +6,95 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityEnergyBeam extends IAbilityEnergyProjectile { + /** @return Travel speed of the beam head in blocks per tick. */ float getSpeed(); + /** @param speed Travel speed in blocks per tick. */ void setSpeed(float speed); + /** @return Width of the beam trail in blocks. */ float getBeamWidth(); + /** @param width Beam trail width in blocks. */ void setBeamWidth(float width); + /** @return Size of the beam head sphere in blocks. */ float getHeadSize(); + /** @param size Beam head size in blocks. */ void setHeadSize(float size); + /** @return Whether the beam head tracks its target. */ boolean isHoming(); + /** @param homing Whether to track the target. */ void setHoming(boolean homing); + /** @return Homing turn strength (higher = tighter turns). */ float getHomingStrength(); + /** @param strength Homing turn strength. */ void setHomingStrength(float strength); + /** @return Maximum distance at which homing activates, in blocks. */ float getHomingRange(); + /** @param range Maximum homing activation range in blocks. */ void setHomingRange(float range); + /** @return Visual rotation speed of the beam head in degrees per tick. */ float getRotationSpeed(); + /** @param speed Rotation speed in degrees per tick. */ void setRotationSpeed(float speed); + /** @return Number of beam projectiles fired per use. */ int getProjectileCount(); + /** @param count Number of projectiles per use. */ void setProjectileCount(int count); + /** @return Delay in ticks between each projectile in a multi-projectile volley. */ int getFireDelay(); + /** @param delay Delay in ticks between projectiles. */ void setFireDelay(int delay); - // Indexed accessors + // Indexed accessors (per-projectile overrides) + + /** + * @param projectileIndex Projectile index. + * @return Inner color as a packed RGB integer. + */ int getInnerColor(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param color Inner color as a packed RGB integer. + */ void setInnerColor(int projectileIndex, int color); + /** + * @param projectileIndex Projectile index. + * @return Outer color as a packed RGB integer. + */ int getOuterColor(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param color Outer color as a packed RGB integer. + */ void setOuterColor(int projectileIndex, int color); + /** + * @param projectileIndex Projectile index. + * @return Anchor point ordinal. + */ int getAnchorPoint(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param point Anchor point ordinal. + */ void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java index 8da57c7..8498874 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java @@ -8,88 +8,133 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityEnergyProjectile extends IAbility { - // Combat + // ==================== COMBAT ==================== + + /** @return Base damage dealt on hit. */ float getDamage(); + /** @param damage Base damage on hit. */ void setDamage(float damage); + /** @return Horizontal knockback strength applied on hit. */ float getKnockback(); + /** @param knockback Horizontal knockback strength. */ void setKnockback(float knockback); + /** @return Vertical knockback strength applied on hit. */ float getKnockbackUp(); + /** @param knockback Vertical knockback strength. */ void setKnockbackUp(float knockback); + /** @return Whether the projectile explodes on impact. */ boolean isExplosive(); + /** @param explosive Whether to explode on impact. */ void setExplosive(boolean explosive); + /** @return Explosion radius in blocks. */ float getExplosionRadius(); + /** @param radius Explosion radius in blocks. */ void setExplosionRadius(float radius); + /** @return Damage falloff multiplier over explosion distance (0.0-1.0). */ float getExplosionDamageFalloff(); + /** @param falloff Damage falloff multiplier (0.0-1.0). */ void setExplosionDamageFalloff(float falloff); + /** @return Hit type ordinal (determines how repeated hits are handled). */ int getHitType(); + /** @param hitType Hit type ordinal. */ void setHitType(int hitType); + /** @return Delay in ticks between repeated hits on the same target. */ int getMultiHitDelayTicks(); + /** @param delayTicks Delay in ticks between repeated hits. */ void setMultiHitDelayTicks(int delayTicks); + /** @return Maximum number of times this projectile can hit the same target. */ int getMaxHits(); + /** @param maxHits Maximum hit count per target. */ void setMaxHits(int maxHits); - // Lifespan + // ==================== LIFESPAN ==================== + + /** @return Maximum travel distance in blocks before the projectile expires. */ float getMaxDistance(); + /** @param distance Maximum travel distance in blocks. */ void setMaxDistance(float distance); + /** @return Maximum lifetime in ticks before the projectile expires. */ int getMaxLifetime(); + /** @param ticks Maximum lifetime in ticks. */ void setMaxLifetime(int ticks); - // Colors + // ==================== COLORS ==================== + + /** @return Inner (core) color as a packed RGB integer. */ int getInnerColor(); + /** @param color Inner color as a packed RGB integer. */ void setInnerColor(int color); + /** @return Outer (glow) color as a packed RGB integer. */ int getOuterColor(); + /** @param color Outer color as a packed RGB integer. */ void setOuterColor(int color); + /** @return Whether the outer color layer is rendered. */ boolean isOuterColorEnabled(); + /** @param enabled Whether to render the outer color layer. */ void setOuterColorEnabled(boolean enabled); + /** @return Width of the outer color layer relative to the projectile size. */ float getOuterColorWidth(); + /** @param width Outer color layer width. */ void setOuterColorWidth(float width); + /** @return Alpha (opacity) of the outer color layer (0.0-1.0). */ float getOuterColorAlpha(); + /** @param alpha Outer color opacity (0.0-1.0). */ void setOuterColorAlpha(float alpha); - // Lightning + // ==================== LIGHTNING ==================== + + /** @return Whether the lightning visual effect is enabled. */ boolean hasLightningEffect(); + /** @param enabled Whether to enable the lightning effect. */ void setLightningEffect(boolean enabled); + /** @return Density of lightning arcs (higher = more arcs). */ float getLightningDensity(); + /** @param density Lightning arc density. */ void setLightningDensity(float density); + /** @return Radius of the lightning effect around the projectile, in blocks. */ float getLightningRadius(); + /** @param radius Lightning effect radius in blocks. */ void setLightningRadius(float radius); - // Anchor + // ==================== ANCHOR ==================== + + /** @return Anchor point ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ int getAnchorPoint(); + /** @param point Anchor point ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ void setAnchorPoint(int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityGuard.java b/java/noppes/npcs/api/ability/type/IAbilityGuard.java index 5fd54e9..115d692 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityGuard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityGuard.java @@ -6,7 +6,9 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityGuard extends IAbilityDefend { + /** @return Damage reduction multiplier while guarding (0.0 = full block, 1.0 = no reduction). */ float getDamageReduction(); + /** @param reduction Damage reduction multiplier (0.0 = full block, 1.0 = no reduction). */ void setDamageReduction(float reduction); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityHazard.java b/java/noppes/npcs/api/ability/type/IAbilityHazard.java index a70900d..b112ff3 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHazard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHazard.java @@ -6,23 +6,33 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityHazard extends IAbilityZone { + /** @return Damage radius of the hazard zone in blocks. */ float getRadius(); + /** @param radius Damage radius in blocks. */ void setRadius(float radius); + /** @return Damage dealt per damage interval tick. */ float getDamagePerSecond(); + /** @param damage Damage per interval. */ void setDamagePerSecond(float damage); + /** @return Interval in ticks between damage applications. */ int getDamageInterval(); + /** @param interval Damage interval in ticks. */ void setDamageInterval(int interval); + /** @return Whether damage ignores entity invulnerability frames. */ boolean isIgnoreInvulnFrames(); + /** @param ignore Whether to ignore invulnerability frames. */ void setIgnoreInvulnFrames(boolean ignore); + /** @return Whether the hazard also damages the caster. */ boolean isAffectsCaster(); + /** @param affects Whether the hazard affects the caster. */ void setAffectsCaster(boolean affects); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java index 711fec0..f713dcb 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHeavyHit.java @@ -8,19 +8,27 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityHeavyHit extends IAbility { + /** @return Damage dealt to entities in the hit area. */ float getDamage(); + /** @param damage Damage amount. */ void setDamage(float damage); + /** @return Knockback strength applied to entities hit. */ float getKnockback(); + /** @param knockback Knockback strength. */ void setKnockback(float knockback); + /** @return Length of the rectangular hit area in blocks (forward from caster). */ float getHitLength(); + /** @param hitLength Hit area length in blocks. */ void setHitLength(float hitLength); + /** @return Width of the rectangular hit area in blocks. */ float getHitWidth(); + /** @param hitWidth Hit area width in blocks. */ void setHitWidth(float hitWidth); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityLaser.java b/java/noppes/npcs/api/ability/type/IAbilityLaser.java index af26095..fdabcfd 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityLaser.java +++ b/java/noppes/npcs/api/ability/type/IAbilityLaser.java @@ -6,15 +6,21 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityLaser extends IAbilityEnergyProjectile { + /** @return Width of the laser beam in blocks. */ float getLaserWidth(); + /** @param width Laser beam width in blocks. */ void setLaserWidth(float width); + /** @return Speed at which the laser extends to its max length, in blocks per tick. */ float getExpansionSpeed(); + /** @param speed Expansion speed in blocks per tick. */ void setExpansionSpeed(float speed); + /** @return Maximum length the laser can reach in blocks. */ float getMaxLength(); + /** @param maxLength Maximum laser length in blocks. */ void setMaxLength(float maxLength); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityOrb.java b/java/noppes/npcs/api/ability/type/IAbilityOrb.java index 1079478..b59e57a 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityOrb.java +++ b/java/noppes/npcs/api/ability/type/IAbilityOrb.java @@ -6,48 +6,89 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityOrb extends IAbilityEnergyProjectile { + /** @return Travel speed of the orb in blocks per tick. */ float getOrbSpeed(); + /** @param speed Travel speed in blocks per tick. */ void setOrbSpeed(float speed); + /** @return Visual size (radius) of the orb in blocks. */ float getOrbSize(); + /** @param size Orb size in blocks. */ void setOrbSize(float size); + /** @return Whether the orb tracks its target. */ boolean isHoming(); + /** @param homing Whether to track the target. */ void setHoming(boolean homing); + /** @return Homing turn strength (higher = tighter turns). */ float getHomingStrength(); + /** @param strength Homing turn strength. */ void setHomingStrength(float strength); + /** @return Maximum distance at which homing activates, in blocks. */ float getHomingRange(); + /** @param range Maximum homing activation range in blocks. */ void setHomingRange(float range); + /** @return Visual rotation speed of the orb in degrees per tick. */ float getRotationSpeed(); + /** @param speed Rotation speed in degrees per tick. */ void setRotationSpeed(float speed); + /** @return Number of orb projectiles fired per use. */ int getProjectileCount(); + /** @param count Number of projectiles per use. */ void setProjectileCount(int count); + /** @return Delay in ticks between each projectile in a multi-projectile volley. */ int getFireDelay(); + /** @param delay Delay in ticks between projectiles. */ void setFireDelay(int delay); - // Indexed accessors + // Indexed accessors (per-projectile overrides) + + /** + * @param projectileIndex Projectile index. + * @return Inner color as a packed RGB integer. + */ int getInnerColor(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param color Inner color as a packed RGB integer. + */ void setInnerColor(int projectileIndex, int color); + /** + * @param projectileIndex Projectile index. + * @return Outer color as a packed RGB integer. + */ int getOuterColor(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param color Outer color as a packed RGB integer. + */ void setOuterColor(int projectileIndex, int color); + /** + * @param projectileIndex Projectile index. + * @return Anchor point ordinal. + */ int getAnchorPoint(int projectileIndex); + /** + * @param projectileIndex Projectile index. + * @param point Anchor point ordinal. + */ void setAnchorPoint(int projectileIndex, int point); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityProjectile.java index c09f5f8..062dcd2 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityProjectile.java @@ -8,35 +8,51 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityProjectile extends IAbility { + /** @return Base damage dealt on hit. */ float getDamage(); + /** @param damage Base damage on hit. */ void setDamage(float damage); + /** @return Travel speed of the projectile in blocks per tick. */ float getSpeed(); + /** @param speed Travel speed in blocks per tick. */ void setSpeed(float speed); + /** @return Knockback strength applied on hit. */ float getKnockback(); + /** @param knockback Knockback strength. */ void setKnockback(float knockback); + /** @return The projectile type identifier (e.g. arrow, snowball). */ String getProjectileType(); + /** @param type Projectile type identifier. */ void setProjectileType(String type); + /** @return Whether the projectile explodes on impact. */ boolean isExplosive(); + /** @param explosive Whether to explode on impact. */ void setExplosive(boolean explosive); + /** @return Explosion radius in blocks. */ float getExplosionRadius(); + /** @param radius Explosion radius in blocks. */ void setExplosionRadius(float radius); + /** @return Whether the projectile tracks its target. */ boolean isHoming(); + /** @param homing Whether to track the target. */ void setHoming(boolean homing); + /** @return Homing turn strength (higher = tighter turns). */ float getHomingStrength(); + /** @param strength Homing turn strength. */ void setHomingStrength(float strength); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java index 13c3595..6b51e0e 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityShockwave.java +++ b/java/noppes/npcs/api/ability/type/IAbilityShockwave.java @@ -8,19 +8,27 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityShockwave extends IAbility { + /** @return Radius of the push effect in blocks. */ float getPushRadius(); + /** @param radius Push radius in blocks. */ void setPushRadius(float radius); + /** @return Strength of the outward push force. */ float getPushStrength(); + /** @param strength Push force strength. */ void setPushStrength(float strength); + /** @return Damage dealt to entities caught in the shockwave. */ float getDamage(); + /** @param damage Shockwave damage. */ void setDamage(float damage); + /** @return Whether the shockwave hits all entities in radius (true) or only the target (false). */ boolean isAoe(); + /** @param aoe Whether the shockwave is area-of-effect. */ void setAoe(boolean aoe); } diff --git a/java/noppes/npcs/api/ability/type/IAbilitySlam.java b/java/noppes/npcs/api/ability/type/IAbilitySlam.java index 9933cde..47764d7 100644 --- a/java/noppes/npcs/api/ability/type/IAbilitySlam.java +++ b/java/noppes/npcs/api/ability/type/IAbilitySlam.java @@ -8,23 +8,33 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilitySlam extends IAbility { + /** @return Damage dealt on ground impact. */ float getDamage(); + /** @param damage Impact damage amount. */ void setDamage(float damage); + /** @return Radius of the impact area in blocks. */ float getRadius(); + /** @param radius Impact radius in blocks. */ void setRadius(float radius); + /** @return Knockback strength applied to entities in the impact area. */ float getKnockbackStrength(); + /** @param knockback Knockback strength. */ void setKnockbackStrength(float knockback); + /** @return Horizontal speed of the leap toward the target. */ float getLeapSpeed(); + /** @param speed Leap speed. */ void setLeapSpeed(float speed); + /** @return Vertical height of the leap in blocks. */ float getLeapHeight(); + /** @param height Leap height in blocks. */ void setLeapHeight(float height); } diff --git a/java/noppes/npcs/api/ability/type/IAbilitySweeper.java b/java/noppes/npcs/api/ability/type/IAbilitySweeper.java index a04ba85..6916c46 100644 --- a/java/noppes/npcs/api/ability/type/IAbilitySweeper.java +++ b/java/noppes/npcs/api/ability/type/IAbilitySweeper.java @@ -8,55 +8,81 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilitySweeper extends IAbility { + /** @return Length of the sweeping beam in blocks. */ float getBeamLength(); + /** @param length Beam length in blocks. */ void setBeamLength(float length); + /** @return Width of the sweeping beam in blocks. */ float getBeamWidth(); + /** @param width Beam width in blocks. */ void setBeamWidth(float width); + /** @return Height of the sweeping beam in blocks. */ float getBeamHeight(); + /** @param height Beam height in blocks. */ void setBeamHeight(float height); + /** @return Damage dealt per hit to entities caught in the beam. */ float getDamage(); + /** @param damage Damage per hit. */ void setDamage(float damage); + /** @return Interval in ticks between damage applications to the same target. */ int getDamageInterval(); + /** @param interval Damage interval in ticks. */ void setDamageInterval(int interval); + /** @return Whether the beam can hit through multiple targets. */ boolean isPiercing(); + /** @param piercing Whether the beam pierces through targets. */ void setPiercing(boolean piercing); + /** @return Rotation speed of the sweep in degrees per tick. */ float getSweepSpeed(); + /** @param speed Sweep rotation speed in degrees per tick. */ void setSweepSpeed(float speed); + /** @return Number of full rotations the beam completes before stopping. */ int getNumberOfRotations(); + /** @param rotations Number of full rotations. */ void setNumberOfRotations(int rotations); + /** @return Whether the beam pivot tracks the target instead of rotating freely. */ boolean isLockOnTarget(); + /** @param lock Whether the beam locks on to the target. */ void setLockOnTarget(boolean lock); + /** @return Inner (core) color of the beam as a packed RGB integer. */ int getInnerColor(); + /** @param color Inner color as a packed RGB integer. */ void setInnerColor(int color); + /** @return Outer (glow) color of the beam as a packed RGB integer. */ int getOuterColor(); + /** @param color Outer color as a packed RGB integer. */ void setOuterColor(int color); + /** @return Width of the outer color layer relative to the beam width. */ float getOuterColorWidth(); + /** @param width Outer color layer width. */ void setOuterColorWidth(float width); + /** @return Whether the outer color layer is rendered. */ boolean isOuterColorEnabled(); + /** @param enabled Whether to render the outer color layer. */ void setOuterColorEnabled(boolean enabled); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityTeleport.java b/java/noppes/npcs/api/ability/type/IAbilityTeleport.java index b0fe4e6..1455501 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityTeleport.java +++ b/java/noppes/npcs/api/ability/type/IAbilityTeleport.java @@ -8,46 +8,63 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityTeleport extends IAbility { - /** - * Get the teleport mode (0 = BLINK, 1 = BEHIND, 2 = SINGLE). - */ + /** @return Teleport mode ordinal (0=BLINK, 1=BEHIND, 2=SINGLE). */ int getMode(); + /** @param mode Teleport mode ordinal (0=BLINK, 1=BEHIND, 2=SINGLE). */ void setMode(int mode); + /** @return Number of rapid blink teleports in BLINK mode. */ int getBlinkCount(); + /** @param count Number of blink teleports. */ void setBlinkCount(int count); + /** @return Delay in ticks between blink teleports. */ int getBlinkDelayTicks(); + /** @param ticks Delay in ticks between blinks. */ void setBlinkDelayTicks(int ticks); + /** @return Maximum random offset radius for blink teleports in blocks. */ float getBlinkRadius(); + /** @param radius Blink offset radius in blocks. */ void setBlinkRadius(float radius); + /** @return Distance behind the target to teleport to in BEHIND mode. */ float getBehindDistance(); + /** @param distance Behind-target distance in blocks. */ void setBehindDistance(float distance); + /** @return Whether the teleport requires clear line of sight to the destination. */ boolean isRequireLineOfSight(); + /** @param require Whether line of sight is required. */ void setRequireLineOfSight(boolean require); + /** @return Whether damage is dealt at the departure location. */ boolean isDamageAtStart(); + /** @param damage Whether to deal damage at departure. */ void setDamageAtStart(boolean damage); + /** @return Whether damage is dealt at the arrival location. */ boolean isDamageAtEnd(); + /** @param damage Whether to deal damage at arrival. */ void setDamageAtEnd(boolean damage); + /** @return Damage dealt at teleport locations. */ float getDamage(); + /** @param damage Teleport damage amount. */ void setDamage(float damage); + /** @return Radius of the damage area at teleport locations in blocks. */ float getDamageRadius(); + /** @param radius Damage area radius in blocks. */ void setDamageRadius(float radius); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityTrap.java b/java/noppes/npcs/api/ability/type/IAbilityTrap.java index 9c1fc13..49f293a 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityTrap.java +++ b/java/noppes/npcs/api/ability/type/IAbilityTrap.java @@ -6,35 +6,51 @@ package noppes.npcs.api.ability.type; */ public interface IAbilityTrap extends IAbilityZone { + /** @return Radius in blocks at which entities trigger the trap. */ float getTriggerRadius(); + /** @param radius Trigger detection radius in blocks. */ void setTriggerRadius(float radius); + /** @return Time in ticks before the trap becomes active after placement. */ int getArmTime(); + /** @param ticks Arming time in ticks. */ void setArmTime(int ticks); + /** @return Maximum number of times the trap can trigger before expiring. */ int getMaxTriggers(); + /** @param max Maximum trigger count. */ void setMaxTriggers(int max); + /** @return Cooldown in ticks between consecutive triggers. */ int getTriggerCooldown(); + /** @param cooldown Trigger cooldown in ticks. */ void setTriggerCooldown(int cooldown); + /** @return Damage dealt when the trap triggers. */ float getDamage(); + /** @param damage Trigger damage amount. */ void setDamage(float damage); + /** @return Radius of the damage area when triggered, in blocks. */ float getDamageRadius(); + /** @param radius Damage area radius in blocks. */ void setDamageRadius(float radius); + /** @return Knockback strength applied to entities caught in the trigger. */ float getKnockback(); + /** @param knockback Knockback strength. */ void setKnockback(float knockback); + /** @return Whether the trap is visible to entities. */ boolean isVisible(); + /** @param visible Whether the trap is visible. */ void setVisible(boolean visible); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityVortex.java b/java/noppes/npcs/api/ability/type/IAbilityVortex.java index 89b46e8..e2a0545 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityVortex.java +++ b/java/noppes/npcs/api/ability/type/IAbilityVortex.java @@ -8,31 +8,45 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityVortex extends IAbility { + /** @return Radius of the pull effect in blocks. */ float getPullRadius(); + /** @param radius Pull effect radius in blocks. */ void setPullRadius(float radius); + /** @return Strength of the inward pull force. */ float getPullStrength(); + /** @param strength Pull force strength. */ void setPullStrength(float strength); + /** @return Damage dealt on initial vortex hit. */ float getDamage(); + /** @param damage Initial hit damage. */ void setDamage(float damage); + /** @return Knockback strength applied on initial hit. */ float getKnockback(); + /** @param knockback Knockback strength. */ void setKnockback(float knockback); + /** @return Whether the vortex hits all entities in radius (true) or only the target (false). */ boolean isAoe(); + /** @param aoe Whether the vortex is area-of-effect. */ void setAoe(boolean aoe); + /** @return Whether continuous damage is dealt while pulling entities. */ boolean isDamageOnPull(); + /** @param damage Whether to deal damage during pull. */ void setDamageOnPull(boolean damage); + /** @return Damage dealt per tick while pulling entities. */ float getPullDamage(); + /** @param damage Per-tick pull damage. */ void setPullDamage(float damage); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityZone.java b/java/noppes/npcs/api/ability/type/IAbilityZone.java index 2799539..ee58976 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityZone.java +++ b/java/noppes/npcs/api/ability/type/IAbilityZone.java @@ -8,119 +8,163 @@ import noppes.npcs.api.ability.IAbility; */ public interface IAbilityZone extends IAbility { + /** @return Duration of the zone in ticks. */ int getDurationTicks(); + /** @param ticks Zone duration in ticks. */ void setDurationTicks(int ticks); - /** - * Get the zone shape (0 = CIRCLE, 1 = SQUARE). - */ + /** @return Zone shape ordinal (0=CIRCLE, 1=SQUARE). */ int getZoneShapeOrdinal(); + /** @param shape Zone shape ordinal (0=CIRCLE, 1=SQUARE). */ void setZoneShapeOrdinal(int shape); + /** @return Spawn offset radius from the caster in blocks. */ float getSpawnRadius(); + /** @param radius Spawn offset radius in blocks. */ void setSpawnRadius(float radius); + /** @return Number of zones spawned per use. */ int getZoneCount(); + /** @param count Number of zones to spawn. */ void setZoneCount(int count); + /** @return Visual height of the zone in blocks. */ float getZoneHeight(); + /** @param height Zone height in blocks. */ void setZoneHeight(float height); + /** @return Density of particles in the zone effect. */ float getParticleDensity(); + /** @param density Particle density. */ void setParticleDensity(float density); + /** @return Scale of individual particles. */ float getParticleScale(); + /** @param scale Particle scale. */ void setParticleScale(float scale); + /** @return Animation speed multiplier for zone visual effects. */ float getAnimSpeed(); + /** @param speed Animation speed multiplier. */ void setAnimSpeed(float speed); + /** @return Density of lightning arcs in the zone. */ float getLightningDensity(); + /** @param density Lightning arc density. */ void setLightningDensity(float density); - // Color controls + // ==================== COLORS ==================== + + /** @return Inner (core) color as a packed RGB integer. */ int getInnerColor(); + /** @param color Inner color as a packed RGB integer. */ void setInnerColor(int color); + /** @return Outer (glow) color as a packed RGB integer. */ int getOuterColor(); + /** @param color Outer color as a packed RGB integer. */ void setOuterColor(int color); + /** @return Whether the outer color layer is rendered. */ boolean isOuterColorEnabled(); + /** @param enabled Whether to render the outer color layer. */ void setOuterColorEnabled(boolean enabled); - // Visual layer controls + // ==================== VISUAL LAYERS ==================== + /** @return Whether the ground fill layer is rendered. */ boolean isGroundFill(); + /** @param enabled Whether to render the ground fill. */ void setGroundFill(boolean enabled); + /** @return Alpha (opacity) of the ground fill layer (0.0-1.0). */ float getGroundAlpha(); + /** @param alpha Ground fill opacity (0.0-1.0). */ void setGroundAlpha(float alpha); + /** @return Whether ring decorations are rendered. */ boolean isRings(); + /** @param enabled Whether to render rings. */ void setRings(boolean enabled); + /** @return Number of concentric rings in the zone. */ int getRingCount(); + /** @param count Number of rings. */ void setRingCount(int count); + /** @return Whether the border outline is rendered. */ boolean isBorder(); + /** @param enabled Whether to render the border. */ void setBorder(boolean enabled); + /** @return Rotation speed of the border in degrees per tick. */ float getBorderSpeed(); + /** @param speed Border rotation speed. */ void setBorderSpeed(float speed); + /** @return Whether accent decorations are rendered. */ boolean isAccents(); + /** @param enabled Whether to render accents. */ void setAccents(boolean enabled); - /** - * Get the accent style (0=STATIC, 1=SWAYING, 2=FLICKERING). - */ + /** @return Accent style ordinal (0=STATIC, 1=SWAYING, 2=FLICKERING). */ int getAccentStyle(); + /** @param style Accent style ordinal (0=STATIC, 1=SWAYING, 2=FLICKERING). */ void setAccentStyle(int style); + /** @return Whether lightning arcs are rendered in the zone. */ boolean isLightning(); + /** @param enabled Whether to render lightning. */ void setLightning(boolean enabled); + /** @return Whether particles are rendered in the zone. */ boolean isParticles(); + /** @param enabled Whether to render particles. */ void setParticles(boolean enabled); - /** - * Get the particle motion style (0=RISING, 1=DRIFTING, 2=SPARKS). - */ + /** @return Particle motion style ordinal (0=RISING, 1=DRIFTING, 2=SPARKS). */ int getParticleMotion(); + /** @param motion Particle motion style ordinal (0=RISING, 1=DRIFTING, 2=SPARKS). */ void setParticleMotion(int motion); + /** @return Resource directory path for custom particle textures. */ String getParticleDir(); + /** @param directory Resource directory path for particle textures. */ void setParticleDir(String directory); + /** @return Size of individual particles in pixels. */ int getParticleSize(); + /** @param size Particle size in pixels. */ void setParticleSize(int size); + /** @return Whether particles use the glow (fullbright) render mode. */ boolean isParticleGlow(); + /** @param glow Whether particles glow. */ void setParticleGlow(boolean glow); } diff --git a/java/noppes/npcs/api/entity/IEnergyAbility.java b/java/noppes/npcs/api/entity/IEnergyAbility.java index b4b18b9..b7cf08c 100644 --- a/java/noppes/npcs/api/entity/IEnergyAbility.java +++ b/java/noppes/npcs/api/entity/IEnergyAbility.java @@ -10,57 +10,81 @@ public interface IEnergyAbility extends IEntity { // ==================== OWNER ==================== + /** @return Entity ID of the caster who spawned this energy ability. */ int getOwnerEntityId(); + /** @return The caster entity who spawned this energy ability, or null if not found. */ IEntity getOwner(); // ==================== DISPLAY ==================== + /** @return Inner (core) color as a packed RGB integer. */ int getInnerColor(); + /** @param color Inner color as a packed RGB integer. */ void setInnerColor(int color); + /** @return Alpha (opacity) of the inner color layer (0.0-1.0). */ float getInnerAlpha(); + /** @param alpha Inner color opacity (0.0-1.0). */ void setInnerAlpha(float alpha); + /** @return Outer (glow) color as a packed RGB integer. */ int getOuterColor(); + /** @param color Outer color as a packed RGB integer. */ void setOuterColor(int color); + /** @return Whether the outer color layer is rendered. */ boolean isOuterColorEnabled(); + /** @param enabled Whether to render the outer color layer. */ void setOuterColorEnabled(boolean enabled); + /** @return Width of the outer color layer relative to the entity size. */ float getOuterColorWidth(); + /** @param width Outer color layer width. */ void setOuterColorWidth(float width); + /** @return Alpha (opacity) of the outer color layer (0.0-1.0). */ float getOuterColorAlpha(); + /** @param alpha Outer color opacity (0.0-1.0). */ void setOuterColorAlpha(float alpha); // ==================== LIGHTNING ==================== + /** @return Whether the lightning visual effect is enabled. */ boolean hasLightningEffect(); + /** @param enabled Whether to render the lightning effect. */ void setLightningEffect(boolean enabled); + /** @return Density of lightning arcs (higher = more arcs). */ float getLightningDensity(); + /** @param density Lightning arc density. */ void setLightningDensity(float density); + /** @return Radius of the lightning effect around the entity, in blocks. */ float getLightningRadius(); + /** @param radius Lightning effect radius in blocks. */ void setLightningRadius(float radius); + /** @return Fade-out time for lightning arcs in ticks. */ int getLightningFadeTime(); + /** @param ticks Lightning fade-out time in ticks. */ void setLightningFadeTime(int ticks); // ==================== STATE ==================== + /** @return Whether this energy ability is currently in its charging phase. */ boolean isCharging(); + /** @return Charge progress as a fraction (0.0-1.0). */ float getChargeProgress(); } From 17e883360462326c04e3c9651e777346b34d47ec Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 1 Mar 2026 04:11:20 -0500 Subject: [PATCH 75/93] Launch from Anchor Point Setting --- java/noppes/npcs/api/ability/data/IEnergyAnchorData.java | 6 ++++++ .../npcs/api/ability/type/IAbilityEnergyProjectile.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java index 6d3fc0f..fb8b1c2 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java @@ -28,4 +28,10 @@ public interface IEnergyAnchorData { /** @param anchorOffsetZ Z offset from anchor (positive = forward). */ void setAnchorOffsetZ(float anchorOffsetZ); + + /** @return Whether the projectile launches from the anchor position instead of the default eye/look-vector position. */ + boolean getLaunchFromAnchor(); + + /** @param launchFromAnchor When true, the projectile launches from its anchor position; when false, it snaps to the default eye/look-vector position. */ + void setLaunchFromAnchor(boolean launchFromAnchor); } diff --git a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java index 8498874..1e5bc77 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java +++ b/java/noppes/npcs/api/ability/type/IAbilityEnergyProjectile.java @@ -137,4 +137,10 @@ public interface IAbilityEnergyProjectile extends IAbility { /** @param point Anchor point ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ void setAnchorPoint(int point); + + /** @return Whether the projectile launches from its anchor position instead of the default eye/look-vector position. */ + boolean getLaunchFromAnchor(); + + /** @param launchFromAnchor When true, the projectile launches from its configured anchor position. */ + void setLaunchFromAnchor(boolean launchFromAnchor); } From f969b9f5403836489c815cef025d0a55b821eaf3 Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 1 Mar 2026 04:27:11 -0500 Subject: [PATCH 76/93] Bunch of API Additions - ITintData - IHitboxData - Sound Management APIS - Tactical Chance - Swimming - Fire Reactions - Sprint - Door Interact - Walking Range --- java/noppes/npcs/api/entity/ICustomNpc.java | 528 ++++++++++++++++++ .../npcs/api/entity/data/IHitboxData.java | 54 ++ .../npcs/api/entity/data/ITintData.java | 94 ++++ 3 files changed, 676 insertions(+) create mode 100644 java/noppes/npcs/api/entity/data/IHitboxData.java create mode 100644 java/noppes/npcs/api/entity/data/ITintData.java diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index 1ca5c48..4ec34b3 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -4,7 +4,9 @@ import net.minecraft.entity.EntityCreature; import noppes.npcs.api.IPos; import noppes.npcs.api.ITimers; import noppes.npcs.api.ability.IDataAbilities; +import noppes.npcs.api.entity.data.IHitboxData; import noppes.npcs.api.entity.data.IModelData; +import noppes.npcs.api.entity.data.ITintData; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; import noppes.npcs.api.handler.data.IAnimationData; @@ -296,6 +298,20 @@ public interface ICustomNpc extends IEntityLiving, */ boolean getProjectilesKeepTerrain(); + /** + * Sets whether the NPC has projectile invincibility frames. + * + * @param invincible true to enable projectile invincibility, false to disable. + */ + void setProjectileInvincibility(boolean invincible); + + /** + * Returns whether the NPC has projectile invincibility frames. + * + * @return true if projectile invincibility is enabled, false otherwise. + */ + boolean getProjectileInvincibility(); + /** * Makes the NPC broadcast a message. * @@ -378,6 +394,104 @@ public interface ICustomNpc extends IEntityLiving, */ ILines getKillLines(); + /** + * Returns whether NPC dialog lines are played in order. + * + * @return true if lines are ordered, false if random. + */ + boolean getOrderedLines(); + + /** + * Sets whether NPC dialog lines are played in order. + * + * @param ordered true for ordered, false for random. + */ + void setOrderedLines(boolean ordered); + + /** + * Returns the NPC's idle sound resource path. + * + * @return the idle sound path, or empty string if none. + */ + String getIdleSound(); + + /** + * Sets the NPC's idle sound resource path. + * + * @param sound the idle sound path. + */ + void setIdleSound(String sound); + + /** + * Returns the NPC's angry/aggro sound resource path. + * + * @return the angry sound path, or empty string if none. + */ + String getAngrySound(); + + /** + * Sets the NPC's angry/aggro sound resource path. + * + * @param sound the angry sound path. + */ + void setAngrySound(String sound); + + /** + * Returns the NPC's hurt sound resource path. + * + * @return the hurt sound path. + */ + String getHurtSound(); + + /** + * Sets the NPC's hurt sound resource path. + * + * @param sound the hurt sound path. + */ + void setHurtSound(String sound); + + /** + * Returns the NPC's death sound resource path. + * + * @return the death sound path. + */ + String getDeathSound(); + + /** + * Sets the NPC's death sound resource path. + * + * @param sound the death sound path. + */ + void setDeathSound(String sound); + + /** + * Returns the NPC's step/footstep sound resource path. + * + * @return the step sound path, or empty string if none. + */ + String getStepSound(); + + /** + * Sets the NPC's step/footstep sound resource path. + * + * @param sound the step sound path. + */ + void setStepSound(String sound); + + /** + * Returns whether pitch variation is disabled for NPC sounds. + * + * @return true if pitch is disabled (fixed pitch), false otherwise. + */ + boolean getDisablePitch(); + + /** + * Sets whether pitch variation is disabled for NPC sounds. + * + * @param disablePitch true to disable pitch variation, false to allow. + */ + void setDisablePitch(boolean disablePitch); + /** * Kills the NPC without despawning it. */ @@ -712,6 +826,14 @@ public interface ICustomNpc extends IEntityLiving, */ boolean getCanDrown(); + /** + * Sets whether the NPC can drown. + * Shorthand: sets drowning type to 1 (drowns in water) if true, 0 (never drowns) if false. + * + * @param canDrown true to allow drowning, false to prevent. + */ + void setCanDrown(boolean canDrown); + /** * Sets the drowning behavior of the NPC. * @@ -803,6 +925,286 @@ public interface ICustomNpc extends IEntityLiving, */ int getTacticalRadius(); + /** + * Returns the tactical behavior chance (1 in N). + * + * @return the tactical chance. + */ + int getTacticalChance(); + + /** + * Sets the tactical behavior chance (1 in N). + * + * @param chance the tactical chance. + */ + void setTacticalChance(int chance); + + /** + * Returns whether the NPC can swim. + * + * @return true if the NPC can swim, false otherwise. + */ + boolean getCanSwim(); + + /** + * Sets whether the NPC can swim. + * + * @param canSwim true to enable swimming, false to disable. + */ + void setCanSwim(boolean canSwim); + + /** + * Returns whether the NPC reacts to fire. + * + * @return true if the NPC reacts to fire, false otherwise. + */ + boolean getReactsToFire(); + + /** + * Sets whether the NPC reacts to fire. + * + * @param reactsToFire true to react, false otherwise. + */ + void setReactsToFire(boolean reactsToFire); + + /** + * Returns whether the NPC avoids water. + * + * @return true if the NPC avoids water, false otherwise. + */ + boolean getAvoidsWater(); + + /** + * Sets whether the NPC avoids water. + * + * @param avoidsWater true to avoid water, false otherwise. + */ + void setAvoidsWater(boolean avoidsWater); + + /** + * Returns whether the NPC avoids sunlight. + * + * @return true if the NPC avoids the sun, false otherwise. + */ + boolean getAvoidsSun(); + + /** + * Sets whether the NPC avoids sunlight. + * + * @param avoidsSun true to avoid sunlight, false otherwise. + */ + void setAvoidsSun(boolean avoidsSun); + + /** + * Returns whether the NPC requires direct line-of-sight to attack. + * + * @return true if direct LOS is required, false otherwise. + */ + boolean getDirectLOS(); + + /** + * Sets whether the NPC requires direct line-of-sight to attack. + * + * @param directLOS true to require LOS, false otherwise. + */ + void setDirectLOS(boolean directLOS); + + /** + * Returns the NPC's leap attack type. + * + * @return the leap type. + */ + int getLeapType(); + + /** + * Sets the NPC's leap attack type. + * + * @param leapType the leap type. + */ + void setLeapType(int leapType); + + /** + * Returns whether the NPC can sprint. + * + * @return true if sprinting is enabled, false otherwise. + */ + boolean getCanSprint(); + + /** + * Sets whether the NPC can sprint. + * + * @param canSprint true to enable sprinting, false to disable. + */ + void setCanSprint(boolean canSprint); + + /** + * Returns whether the NPC stops moving to interact with players. + * + * @return true if the NPC stops to interact, false otherwise. + */ + boolean getStopAndInteract(); + + /** + * Sets whether the NPC stops moving to interact with players. + * + * @param stopAndInteract true to stop and interact, false otherwise. + */ + void setStopAndInteract(boolean stopAndInteract); + + /** + * Returns the NPC's door interaction behavior. + * + * @return the door interaction mode (0: Break, 1: Open, 2: Disabled). + */ + int getDoorInteract(); + + /** + * Sets the NPC's door interaction behavior. + * + * @param doorInteract the door interaction mode (0: Break, 1: Open, 2: Disabled). + */ + void setDoorInteract(int doorInteract); + + /** + * Returns the NPC's walking range (wander radius). + * + * @return the walking range. + */ + int getWalkingRange(); + + /** + * Sets the NPC's walking range (wander radius). + * + * @param range the walking range. + */ + void setWalkingRange(int range); + + /** + * Returns whether the NPC interacts with other NPCs. + * + * @return true if NPC interaction is enabled, false otherwise. + */ + boolean getNpcInteracting(); + + /** + * Sets whether the NPC interacts with other NPCs. + * + * @param npcInteracting true to enable, false to disable. + */ + void setNpcInteracting(boolean npcInteracting); + + /** + * Returns whether the NPC pauses at path points. + * + * @return true if the NPC pauses at path points, false otherwise. + */ + boolean getMovingPause(); + + /** + * Sets whether the NPC pauses at path points. + * + * @param movingPause true to pause, false otherwise. + */ + void setMovingPause(boolean movingPause); + + /** + * Returns the NPC's path movement pattern. + * + * @return the moving pattern (0: Looping, 1: Backtracking). + */ + int getMovingPattern(); + + /** + * Sets the NPC's path movement pattern. + * + * @param pattern the moving pattern (0: Looping, 1: Backtracking). + */ + void setMovingPattern(int pattern); + + /** + * Returns whether the NPC fires indirect (arcing) projectiles. + * + * @return the indirect fire mode. + */ + int getCanFireIndirect(); + + /** + * Sets whether the NPC fires indirect (arcing) projectiles. + * + * @param canFireIndirect the indirect fire mode. + */ + void setCanFireIndirect(int canFireIndirect); + + /** + * Returns the NPC's use-range-melee mode. + * + * @return the use-range-melee mode. + */ + int getUseRangeMelee(); + + /** + * Sets the NPC's use-range-melee mode. + * + * @param useRangeMelee the use-range-melee mode. + */ + void setUseRangeMelee(int useRangeMelee); + + /** + * Returns the distance at which the NPC switches from ranged to melee. + * + * @return the distance to melee. + */ + int getDistanceToMelee(); + + /** + * Sets the distance at which the NPC switches from ranged to melee. + * + * @param distance the distance to melee. + */ + void setDistanceToMelee(int distance); + + /** + * Returns the NPC's body X offset. + * + * @return the body X offset. + */ + float getBodyOffsetX(); + + /** + * Sets the NPC's body X offset. + * + * @param offsetX the body X offset. + */ + void setBodyOffsetX(float offsetX); + + /** + * Returns the NPC's body Y offset. + * + * @return the body Y offset. + */ + float getBodyOffsetY(); + + /** + * Sets the NPC's body Y offset. + * + * @param offsetY the body Y offset. + */ + void setBodyOffsetY(float offsetY); + + /** + * Returns the NPC's body Z offset. + * + * @return the body Z offset. + */ + float getBodyOffsetZ(); + + /** + * Sets the NPC's body Z offset. + * + * @param offsetZ the body Z offset. + */ + void setBodyOffsetZ(float offsetZ); + /** * Sets whether the NPC ignores cobwebs. * @@ -1173,6 +1575,20 @@ public interface ICustomNpc extends IEntityLiving, */ IModelData getModelData(); + /** + * Returns the hitbox data associated with the NPC. + * + * @return the hitbox data. + */ + IHitboxData getHitboxData(); + + /** + * Returns the tint data associated with the NPC. + * + * @return the tint data. + */ + ITintData getTintData(); + /** * (Deprecated) Sets the head scale of the NPC. * @@ -1269,6 +1685,104 @@ public interface ICustomNpc extends IEntityLiving, */ double getKnockbackResistance(); + /** + * Returns whether all damage to this NPC is disabled. + * + * @return true if damage is disabled, false otherwise. + */ + boolean getDamageDisabled(); + + /** + * Sets whether all damage to this NPC is disabled. + * + * @param disabled true to disable all damage, false otherwise. + */ + void setDamageDisabled(boolean disabled); + + /** + * Returns whether the NPC takes no fall damage. + * + * @return true if fall damage is disabled, false otherwise. + */ + boolean getNoFallDamage(); + + /** + * Sets whether the NPC takes no fall damage. + * + * @param noFallDamage true to disable fall damage, false to enable. + */ + void setNoFallDamage(boolean noFallDamage); + + /** + * Returns whether the NPC is immune to fire. + * + * @return true if immune to fire, false otherwise. + */ + boolean getImmuneToFire(); + + /** + * Sets whether the NPC is immune to fire. + * + * @param immuneToFire true to make immune, false otherwise. + */ + void setImmuneToFire(boolean immuneToFire); + + /** + * Returns whether the NPC is immune to potion effects. + * + * @return true if potion immune, false otherwise. + */ + boolean getPotionImmune(); + + /** + * Sets whether the NPC is immune to potion effects. + * + * @param potionImmune true to make immune, false otherwise. + */ + void setPotionImmune(boolean potionImmune); + + /** + * Returns whether the NPC burns in sunlight. + * + * @return true if the NPC burns in the sun, false otherwise. + */ + boolean getBurnInSun(); + + /** + * Sets whether the NPC burns in sunlight. + * + * @param burnInSun true to burn in sunlight, false otherwise. + */ + void setBurnInSun(boolean burnInSun); + + /** + * Returns whether the NPC can attack invisible targets. + * + * @return true if the NPC attacks invisible entities, false otherwise. + */ + boolean getAttackInvisible(); + + /** + * Sets whether the NPC can attack invisible targets. + * + * @param attackInvisible true to allow attacking invisible entities, false otherwise. + */ + void setAttackInvisible(boolean attackInvisible); + + /** + * Returns the NPC's creature type. + * + * @return the creature type ordinal (0: Undefined, 1: Undead, 2: Arthropod). + */ + int getCreatureType(); + + /** + * Sets the NPC's creature type. + * + * @param type the creature type ordinal (0: Undefined, 1: Undead, 2: Arthropod). + */ + void setCreatureType(int type); + /** * Sets the NPC's retaliation type. * @@ -1462,6 +1976,20 @@ public interface ICustomNpc extends IEntityLiving, */ String getOverlayTexture(); + /** + * Returns the NPC's glow texture path. + * + * @return the glow texture path, or empty string if none. + */ + String getGlowTexture(); + + /** + * Sets the NPC's glow texture path. + * + * @param texture the glow texture path. + */ + void setGlowTexture(String texture); + /** * Returns the NPC's overlay handler. * diff --git a/java/noppes/npcs/api/entity/data/IHitboxData.java b/java/noppes/npcs/api/entity/data/IHitboxData.java new file mode 100644 index 0000000..eb5a244 --- /dev/null +++ b/java/noppes/npcs/api/entity/data/IHitboxData.java @@ -0,0 +1,54 @@ +package noppes.npcs.api.entity.data; + +/** + * Provides configuration data for an NPC's custom hitbox dimensions. + *

    + * When enabled, allows independent scaling of the NPC's collision box + * width and height beyond the default model-based sizing. + */ +public interface IHitboxData { + + /** + * Returns whether the custom hitbox is enabled. + * + * @return true if the custom hitbox is enabled, false otherwise. + */ + boolean isHitboxEnabled(); + + /** + * Sets whether the custom hitbox is enabled. + * + * @param enabled true to enable, false to disable. + */ + void setHitboxEnabled(boolean enabled); + + /** + * Returns the width scale factor for the hitbox. + * + * @return the width scale factor (1.0 = default). + */ + float getWidthScale(); + + /** + * Sets the width scale factor for the hitbox. + * Clamped to the server-configured maximum. + * + * @param widthScale the width scale factor. + */ + void setWidthScale(float widthScale); + + /** + * Returns the height scale factor for the hitbox. + * + * @return the height scale factor (1.0 = default). + */ + float getHeightScale(); + + /** + * Sets the height scale factor for the hitbox. + * Clamped to the server-configured maximum. + * + * @param heightScale the height scale factor. + */ + void setHeightScale(float heightScale); +} diff --git a/java/noppes/npcs/api/entity/data/ITintData.java b/java/noppes/npcs/api/entity/data/ITintData.java new file mode 100644 index 0000000..1787b18 --- /dev/null +++ b/java/noppes/npcs/api/entity/data/ITintData.java @@ -0,0 +1,94 @@ +package noppes.npcs.api.entity.data; + +/** + * Provides configuration data for an NPC's color tinting effects. + *

    + * Controls both the hurt tint (flash color when damaged) and a persistent + * general tint overlay applied to the NPC's model. + */ +public interface ITintData { + + /** + * Returns whether the tint system is enabled. + * + * @return true if tinting is enabled, false otherwise. + */ + boolean isTintEnabled(); + + /** + * Sets whether the tint system is enabled. + * + * @param enabled true to enable, false to disable. + */ + void setTintEnabled(boolean enabled); + + /** + * Returns whether the hurt tint effect is enabled. + * + * @return true if hurt tint is enabled, false otherwise. + */ + boolean isHurtTintEnabled(); + + /** + * Sets whether the hurt tint effect is enabled. + * + * @param enabled true to enable, false to disable. + */ + void setHurtTintEnabled(boolean enabled); + + /** + * Returns whether the general (persistent) tint is enabled. + * + * @return true if general tint is enabled, false otherwise. + */ + boolean isGeneralTintEnabled(); + + /** + * Sets whether the general (persistent) tint is enabled. + * + * @param enabled true to enable, false to disable. + */ + void setGeneralTintEnabled(boolean enabled); + + /** + * Returns the hurt tint color as an RGB integer (e.g. 0xff0000 for red). + * + * @return the hurt tint color. + */ + int getHurtTint(); + + /** + * Sets the hurt tint color as an RGB integer. + * + * @param color the hurt tint color (e.g. 0xff0000 for red). + */ + void setHurtTint(int color); + + /** + * Returns the general tint color as an RGB integer. + * + * @return the general tint color. + */ + int getGeneralTint(); + + /** + * Sets the general tint color as an RGB integer. + * + * @param color the general tint color. + */ + void setGeneralTint(int color); + + /** + * Returns the alpha (opacity) of the general tint overlay (0-255). + * + * @return the general tint alpha value. + */ + int getGeneralAlpha(); + + /** + * Sets the alpha (opacity) of the general tint overlay (0-255). + * + * @param alpha the general tint alpha value. + */ + void setGeneralAlpha(int alpha); +} From 22135344e85a368af2cacc622bc7f50f32505b72 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 2 Mar 2026 03:58:18 -0500 Subject: [PATCH 77/93] Add Ignore I-Frames to Abilities --- java/noppes/npcs/api/ability/IAbility.java | 11 +++++++++++ java/noppes/npcs/api/ability/type/IAbilityHazard.java | 6 ------ java/noppes/npcs/api/entity/IEnergyAbility.java | 6 ++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 07a9dc6..e4601b3 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -136,6 +136,17 @@ public interface IAbility extends IAbilityAction { */ void setInterruptible(boolean interruptible); + /** + * Check if this ability ignores target invulnerability frames (hurt resistance). + */ + boolean isIgnoreIFrames(); + + /** + * Set whether this ability ignores target invulnerability frames (hurt resistance). + * @param ignore Whether to ignore invulnerability frames. + */ + void setIgnoreIFrames(boolean ignore); + /** * Get the lock movement type for this ability. * diff --git a/java/noppes/npcs/api/ability/type/IAbilityHazard.java b/java/noppes/npcs/api/ability/type/IAbilityHazard.java index b112ff3..9291ebd 100644 --- a/java/noppes/npcs/api/ability/type/IAbilityHazard.java +++ b/java/noppes/npcs/api/ability/type/IAbilityHazard.java @@ -24,12 +24,6 @@ public interface IAbilityHazard extends IAbilityZone { /** @param interval Damage interval in ticks. */ void setDamageInterval(int interval); - /** @return Whether damage ignores entity invulnerability frames. */ - boolean isIgnoreInvulnFrames(); - - /** @param ignore Whether to ignore invulnerability frames. */ - void setIgnoreInvulnFrames(boolean ignore); - /** @return Whether the hazard also damages the caster. */ boolean isAffectsCaster(); diff --git a/java/noppes/npcs/api/entity/IEnergyAbility.java b/java/noppes/npcs/api/entity/IEnergyAbility.java index b7cf08c..d37219e 100644 --- a/java/noppes/npcs/api/entity/IEnergyAbility.java +++ b/java/noppes/npcs/api/entity/IEnergyAbility.java @@ -87,4 +87,10 @@ public interface IEnergyAbility extends IEntity { /** @return Charge progress as a fraction (0.0-1.0). */ float getChargeProgress(); + + /** @return Whether this entity ignores target invulnerability frames when dealing damage. */ + boolean isIgnoreIFrames(); + + /** @param ignore Whether this entity should ignore target invulnerability frames when dealing damage. */ + void setIgnoreIFrames(boolean ignore); } From 9fbd1eceffaa32f088676ff89d13fe3ca4ba1155 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 2 Mar 2026 15:23:53 -0500 Subject: [PATCH 78/93] Small Bug Fixes to Flight, Command Handling, Linked Items --- java/noppes/npcs/api/item/IItemLinked.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/noppes/npcs/api/item/IItemLinked.java b/java/noppes/npcs/api/item/IItemLinked.java index b3285bd..8bdbe38 100644 --- a/java/noppes/npcs/api/item/IItemLinked.java +++ b/java/noppes/npcs/api/item/IItemLinked.java @@ -6,4 +6,12 @@ public interface IItemLinked extends IItemCustomizable { public ILinkedItem getLinkedItem(); + /** + * Sets the current durability value for this linked item stack. + * This is a per-stack override, not changing the linked item template. + * + * @param durabilityValue The durability value + */ + void setDurabilityValue(float durabilityValue); + } From e4ddefb2578a5fed9f45578600f4089f08cdf3b2 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 2 Mar 2026 20:09:21 -0500 Subject: [PATCH 79/93] Track Delay --- java/noppes/npcs/api/ability/IAbility.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index e4601b3..9fe7fee 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -189,6 +189,19 @@ public interface IAbility extends IAbilityAction { */ void setRotationPhaseType(int type); + /** + * Get track delay for TRACK rotation mode. + * 0 = instant tracking (legacy). Higher values = slower lerp toward target. + */ + float getTrackDelayValue(); + + /** + * Set track delay for TRACK rotation mode. + * + * @param delay 0 = instant tracking. Higher values = slower lerp toward target. + */ + void setTrackDelayValue(float delay); + /** * Check if movement (pathfinding/motion) is locked during the WINDUP phase. */ From 465075c63167b29960569915db8b7d0ba6cd053d Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 3 Mar 2026 02:02:04 -0500 Subject: [PATCH 80/93] Better API Handling for Scripting Energy Utilitizes / Damage Handling --- java/noppes/npcs/api/AbstractNpcAPI.java | 2 ++ java/noppes/npcs/api/entity/IEnergyAbility.java | 17 +++++++++++++++++ java/noppes/npcs/api/entity/IEnergyPanel.java | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 9344a3d..e5b377f 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -276,6 +276,8 @@ public abstract class AbstractNpcAPI { public abstract IDamageSource getIDamageSource(IEntity entity); + public abstract IEnergyController getEnergyController(); + public abstract EventBus events(); public abstract File getGlobalDir(); diff --git a/java/noppes/npcs/api/entity/IEnergyAbility.java b/java/noppes/npcs/api/entity/IEnergyAbility.java index d37219e..f0e37e4 100644 --- a/java/noppes/npcs/api/entity/IEnergyAbility.java +++ b/java/noppes/npcs/api/entity/IEnergyAbility.java @@ -1,6 +1,7 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; +import noppes.npcs.api.INbt; /** * Base interface for all energy ability entities (Projectiles, Barriers). @@ -93,4 +94,20 @@ public interface IEnergyAbility extends IEntity { /** @param ignore Whether this entity should ignore target invulnerability frames when dealing damage. */ void setIgnoreIFrames(boolean ignore); + + // ==================== CUSTOM DAMAGE DATA ==================== + + /** + * Get the custom damage data attached to this energy entity. + * Used by addon handlers (e.g. DBC Addon) to carry damage configuration + * directly on the entity, enabling DBC damage scaling without a sourceAbility. + * @return Custom damage data as INbt, or null if none set. + */ + INbt getDamageData(); + + /** + * Set custom damage data on this energy entity. + * @param data Custom damage data as INbt. Pass null to clear. + */ + void setDamageData(INbt data); } diff --git a/java/noppes/npcs/api/entity/IEnergyPanel.java b/java/noppes/npcs/api/entity/IEnergyPanel.java index 122dab3..6371973 100644 --- a/java/noppes/npcs/api/entity/IEnergyPanel.java +++ b/java/noppes/npcs/api/entity/IEnergyPanel.java @@ -17,10 +17,17 @@ public interface IEnergyPanel extends IEnergyBarrier { float getPanelYaw(); + void setPanelYaw(float yaw); + /** * Panel mode: 0=PLACED, 1=HELD, 2=LAUNCHED */ int getPanelMode(); + void setPanelMode(int mode); + boolean isLaunched(); + + /** Spawn this panel entity into the world. */ + void spawn(); } From b3dc23a23e4c5ea21c67f67ab5aecb1a17f841f4 Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 3 Mar 2026 02:02:12 -0500 Subject: [PATCH 81/93] Better API Handling for Scripting Energy Utilitizes / Damage Handling --- java/noppes/npcs/api/IEnergyController.java | 66 +++++++++++ .../npcs/api/entity/IEnergySweeper.java | 49 +++++++++ java/noppes/npcs/api/entity/IEnergyZone.java | 103 ++++++++++++++++++ 3 files changed, 218 insertions(+) create mode 100644 java/noppes/npcs/api/IEnergyController.java create mode 100644 java/noppes/npcs/api/entity/IEnergySweeper.java create mode 100644 java/noppes/npcs/api/entity/IEnergyZone.java diff --git a/java/noppes/npcs/api/IEnergyController.java b/java/noppes/npcs/api/IEnergyController.java new file mode 100644 index 0000000..d6fc769 --- /dev/null +++ b/java/noppes/npcs/api/IEnergyController.java @@ -0,0 +1,66 @@ +package noppes.npcs.api; + +import noppes.npcs.api.entity.*; + +/** + * Central controller for creating energy entities and routing energy damage. + * Access via API.getEnergyController(). + * + * All factory methods create entities that are NOT spawned in the world. + * Configure the entity, then call fire() (projectiles) or spawn() (zones/sweepers/panels) + * to place it in the world. + */ +public interface IEnergyController { + + // ==================== PROJECTILE CREATION ==================== + + /** + * Create an energy orb projectile. Not spawned until fire() is called. + */ + IEnergyOrb createOrb(IWorld world, IEntity owner, double x, double y, double z, float size); + + /** + * Create an energy beam projectile. Not spawned until fire() is called. + */ + IEnergyBeam createBeam(IWorld world, IEntity owner, double x, double y, double z, float beamWidth, float headSize); + + /** + * Create an energy disc projectile. Not spawned until fire() is called. + */ + IEnergyDisc createDisc(IWorld world, IEntity owner, double x, double y, double z, float radius, float thickness); + + /** + * Create an energy laser projectile. Not spawned until fire() is called. + */ + IEnergyLaser createLaser(IWorld world, IEntity owner, double x, double y, double z, float laserWidth); + + // ==================== ZONE CREATION ==================== + + /** + * Create a hazard zone entity with defaults. Not spawned until spawn() is called. + * Hazards deal continuous damage to entities within the zone. + */ + IEnergyZone createHazard(IWorld world, IEntity owner, double x, double y, double z); + + /** + * Create a trap zone entity with defaults. Not spawned until spawn() is called. + * Traps trigger when entities enter and deal burst damage. + */ + IEnergyZone createTrap(IWorld world, IEntity owner, double x, double y, double z); + + // ==================== SWEEPER CREATION ==================== + + /** + * Create a sweeper entity with defaults. Not spawned until spawn() is called. + * Sweepers rotate a beam that damages entities in its path. + */ + IEnergySweeper createSweeper(IWorld world, IEntity owner, double x, double y, double z); + + // ==================== PANEL CREATION ==================== + + /** + * Create a panel entity with defaults. Not spawned until spawn() is called. + * Panels are flat energy barriers that can deal damage on contact. + */ + IEnergyPanel createPanel(IWorld world, IEntity owner, double x, double y, double z); +} diff --git a/java/noppes/npcs/api/entity/IEnergySweeper.java b/java/noppes/npcs/api/entity/IEnergySweeper.java new file mode 100644 index 0000000..334679e --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergySweeper.java @@ -0,0 +1,49 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Entity-level interface for sweeper beam entities. + * Created via IEnergyController.createSweeper(). + * Configure properties, then call spawn() to place in the world. + */ +public interface IEnergySweeper extends IEnergyAbility { + + // ==================== BEAM DIMENSIONS ==================== + + float getBeamLength(); + void setBeamLength(float length); + + float getBeamWidth(); + void setBeamWidth(float width); + + float getBeamHeight(); + void setBeamHeight(float height); + + // ==================== ROTATION ==================== + + float getSweepSpeed(); + void setSweepSpeed(float degreesPerTick); + + int getNumberOfRotations(); + void setNumberOfRotations(int rotations); + + boolean isLockOnTarget(); + void setLockOnTarget(boolean lock); + + // ==================== DAMAGE ==================== + + float getDamage(); + void setDamage(float damage); + + int getDamageInterval(); + void setDamageInterval(int ticks); + + boolean isPiercing(); + void setPiercing(boolean piercing); + + // ==================== SPAWNING ==================== + + /** Spawn this sweeper entity into the world. */ + void spawn(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyZone.java b/java/noppes/npcs/api/entity/IEnergyZone.java new file mode 100644 index 0000000..35235fc --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyZone.java @@ -0,0 +1,103 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; + +/** + * Entity-level interface for zone entities (Hazard and Trap). + * Created via IEnergyController.createHazard() or createTrap(). + * Configure properties, then call spawn() to place in the world. + */ +public interface IEnergyZone extends IEntity { + + // ==================== ZONE TYPE ==================== + + /** @return Zone type: 0=Trap, 1=Hazard */ + int getZoneType(); + + // ==================== COMMON ZONE PROPERTIES ==================== + + /** @return Zone shape: 0=Circle, 1=Square */ + int getZoneShape(); + void setZoneShape(int shape); + + float getRadius(); + void setRadius(float radius); + + float getZoneHeight(); + void setZoneHeight(float height); + + int getDuration(); + void setDuration(int ticks); + + // ==================== COLORS ==================== + + int getInnerColor(); + void setInnerColor(int color); + + int getOuterColor(); + void setOuterColor(int color); + + boolean isOuterColorEnabled(); + void setOuterColorEnabled(boolean enabled); + + // ==================== VISUALS ==================== + + float getParticleDensity(); + void setParticleDensity(float density); + + float getParticleScale(); + void setParticleScale(float scale); + + float getAnimSpeed(); + void setAnimSpeed(float speed); + + boolean isIgnoreIFrames(); + void setIgnoreIFrames(boolean ignore); + + // ==================== HAZARD-SPECIFIC ==================== + + float getDamagePerSecond(); + void setDamagePerSecond(float dps); + + int getDamageInterval(); + void setDamageInterval(int ticks); + + boolean isAffectsCaster(); + void setAffectsCaster(boolean affects); + + // ==================== TRAP-SPECIFIC ==================== + + float getTriggerRadius(); + void setTriggerRadius(float radius); + + int getArmTime(); + void setArmTime(int ticks); + + int getMaxTriggers(); + void setMaxTriggers(int max); + + int getTriggerCooldown(); + void setTriggerCooldown(int ticks); + + float getDamage(); + void setDamage(float damage); + + float getKnockback(); + void setKnockback(float knockback); + + boolean isVisible(); + void setVisible(boolean visible); + + // ==================== CUSTOM DAMAGE DATA ==================== + + /** Get custom damage data for addon handler routing (e.g. DBC damage stats). */ + noppes.npcs.api.INbt getDamageData(); + + /** Set custom damage data for addon handler routing. */ + void setDamageData(noppes.npcs.api.INbt data); + + // ==================== SPAWNING ==================== + + /** Spawn this zone entity into the world. */ + void spawn(); +} From e4e2466a6ee5b7cc61243eb805627b767bfb5ea3 Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 3 Mar 2026 14:55:49 -0500 Subject: [PATCH 82/93] Cleanup Damage Handling Logic for CNPC+ and DBC Addon for better readability / context. Added Magic Data Support to Abilities --- java/noppes/npcs/api/ability/IAbility.java | 8 ++++++++ java/noppes/npcs/api/entity/IEnergyAbility.java | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 9fe7fee..1b0197e 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -1,6 +1,7 @@ package noppes.npcs.api.ability; import noppes.npcs.api.INbt; +import noppes.npcs.api.handler.data.IMagicData; /** * Interface for NPC abilities. @@ -343,4 +344,11 @@ public interface IAbility extends IAbilityAction { * @return the label, or null if none set. */ String getToggleStateLabel(int state); + + /** + * Get this ability's magic data. Defines magic types, damage splits, + * and flat magic damage for this ability. Inherited by spawned energy entities. + * @return the ability's magic data + */ + IMagicData getMagicData(); } diff --git a/java/noppes/npcs/api/entity/IEnergyAbility.java b/java/noppes/npcs/api/entity/IEnergyAbility.java index f0e37e4..32d2237 100644 --- a/java/noppes/npcs/api/entity/IEnergyAbility.java +++ b/java/noppes/npcs/api/entity/IEnergyAbility.java @@ -2,6 +2,7 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; import noppes.npcs.api.INbt; +import noppes.npcs.api.handler.data.IMagicData; /** * Base interface for all energy ability entities (Projectiles, Barriers). @@ -110,4 +111,17 @@ public interface IEnergyAbility extends IEntity { * @param data Custom damage data as INbt. Pass null to clear. */ void setDamageData(INbt data); + + /** + * Get this entity's magic data. Defines magic types for outgoing damage splits + * or barrier defense interactions. Inherited from the source ability on spawn. + * @return the entity's magic data + */ + IMagicData getMagicData(); + + /** + * Set magic data on this energy entity. Overrides any inherited ability magic. + * @param data Magic data to set. + */ + void setMagicData(IMagicData data); } From 4e96425314a9fd2d3e48f68cff5fc7ee69f87213 Mon Sep 17 00:00:00 2001 From: Kam Date: Tue, 3 Mar 2026 17:11:12 -0500 Subject: [PATCH 83/93] Energy Explosion API and some changes to Energy Projectile API --- java/noppes/npcs/api/IEnergyController.java | 9 +++ .../npcs/api/entity/IEnergyExplosion.java | 60 +++++++++++++++++++ .../npcs/api/entity/IEnergyProjectile.java | 10 ++-- 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 java/noppes/npcs/api/entity/IEnergyExplosion.java diff --git a/java/noppes/npcs/api/IEnergyController.java b/java/noppes/npcs/api/IEnergyController.java index d6fc769..5c3156f 100644 --- a/java/noppes/npcs/api/IEnergyController.java +++ b/java/noppes/npcs/api/IEnergyController.java @@ -1,6 +1,7 @@ package noppes.npcs.api; import noppes.npcs.api.entity.*; +import noppes.npcs.api.entity.IEnergyExplosion; /** * Central controller for creating energy entities and routing energy damage. @@ -63,4 +64,12 @@ public interface IEnergyController { * Panels are flat energy barriers that can deal damage on contact. */ IEnergyPanel createPanel(IWorld world, IEntity owner, double x, double y, double z); + + // ==================== EXPLOSION CREATION ==================== + + /** + * Create an energy explosion entity. Not spawned until spawn() is called. + * Visual-only by default. Set damage > 0 to enable area damage with falloff. + */ + IEnergyExplosion createExplosion(IWorld world, IEntity owner, double x, double y, double z, float radius); } diff --git a/java/noppes/npcs/api/entity/IEnergyExplosion.java b/java/noppes/npcs/api/entity/IEnergyExplosion.java new file mode 100644 index 0000000..6121dc9 --- /dev/null +++ b/java/noppes/npcs/api/entity/IEnergyExplosion.java @@ -0,0 +1,60 @@ +package noppes.npcs.api.entity; + +import net.minecraft.entity.Entity; +import noppes.npcs.api.INbt; + +/** + * Represents a standalone energy explosion entity. + * Created via {@link noppes.npcs.api.IEnergyController#createExplosion}. + * Configure visual/damage properties, then call {@link #spawn()} to place in the world. + * + * When damage is set (> 0), the explosion will deal area damage on the first tick + * with distance-based falloff, routing through energy damage handlers for addon integration. + */ +public interface IEnergyExplosion extends IEnergyAbility { + + // ==================== RADIUS & DURATION ==================== + + /** @return The maximum explosion radius in blocks. */ + float getRadius(); + + /** @param radius Maximum explosion radius in blocks (clamped 0.5-50). Duration auto-scales. */ + void setRadius(float radius); + + /** @return Duration of the explosion visual in ticks (auto-calculated from radius). */ + int getDuration(); + + // ==================== DAMAGE ==================== + + /** @return Base damage dealt at the center. 0 means visual-only. */ + float getDamage(); + + /** @param damage Base damage at the center. Setting > 0 enables damage. */ + void setDamage(float damage); + + /** @return Base knockback strength. */ + float getKnockback(); + + /** @param knockback Base knockback strength. */ + void setKnockback(float knockback); + + /** @return Upward knockback component. */ + float getKnockbackUp(); + + /** @param knockbackUp Upward knockback component. */ + void setKnockbackUp(float knockbackUp); + + /** @return Damage falloff factor (0=no falloff, 1=full falloff at edge). */ + float getDamageFalloff(); + + /** @param falloff Damage falloff factor (0-1). At 0.5, edge damage = 50% of center. */ + void setDamageFalloff(float falloff); + + // ==================== SPAWNING ==================== + + /** + * Spawn this explosion entity into the world. + * Sends the visual to nearby clients and, if damage > 0, applies area damage on the first tick. + */ + void spawn(); +} diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 136c815..6f1a3ca 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -139,27 +139,27 @@ public interface IEnergyProjectile extends IEnergyAbility { /** * Spawns the projectile in the world (if not yet spawned) and starts it moving toward the target entity. */ - void fire(IEntity target); + void fireAt(IEntity target); /** * Spawns the projectile in the world (if not yet spawned) and starts it moving toward the specified coordinates. */ - void fire(double x, double y, double z); + void fireAt(double x, double y, double z); /** * Spawns the projectile in the world (if not yet spawned) and starts it moving in the specified direction. */ - void fire(float yaw, float pitch); + void fireDirection(float yaw, float pitch); /** * Sets the owner, positions the projectile at the caster's eye level, and fires in the caster's look direction. * Convenience method similar to how fireKiAttack works. */ - void fire(IEntityLivingBase caster); + void fireFrom(IEntityLivingBase caster); /** * Sets the owner, positions the projectile at the caster's eye level, and fires toward the target entity. */ - void fire(IEntityLivingBase caster, IEntity target); + void fireFrom(IEntityLivingBase caster, IEntity target); } From 5eb98d172eedfa0727e8ec9769bc2edad36a1ce4 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 02:18:18 -0500 Subject: [PATCH 84/93] Update ICustomAbility.java --- .../npcs/api/ability/ICustomAbility.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/java/noppes/npcs/api/ability/ICustomAbility.java b/java/noppes/npcs/api/ability/ICustomAbility.java index eb8ebfa..631dcf4 100644 --- a/java/noppes/npcs/api/ability/ICustomAbility.java +++ b/java/noppes/npcs/api/ability/ICustomAbility.java @@ -39,4 +39,76 @@ public interface ICustomAbility extends IAbility { * @param type ordinal of TargetingMode */ void setTargetingModeType(int type); + + /** + * Get how many ticks the telegraph persists during the active phase. + * When syncTelegraphWithDuration is true, this returns the duration ticks. + */ + int getTelegraphActiveTicks(); + + /** + * Set how many ticks the telegraph persists during the active phase. + * Only used when syncTelegraphWithDuration is false. + */ + void setTelegraphActiveTicks(int ticks); + + /** + * Whether telegraph active ticks are synced to the ability duration. + */ + boolean isSyncTelegraphWithDuration(); + + /** + * Set whether telegraph active ticks should sync to the ability duration. + */ + void setSyncTelegraphWithDuration(boolean sync); + + /** + * Get the telegraph radius (used by CIRCLE, RING, SQUARE shapes). + */ + float getTelegraphRadius(); + + /** + * Set the telegraph radius. + */ + void setTelegraphRadius(float radius); + + /** + * Get the telegraph inner radius (used by RING, CONE shapes). + */ + float getTelegraphInnerRadius(); + + /** + * Set the telegraph inner radius. + */ + void setTelegraphInnerRadius(float innerRadius); + + /** + * Get the telegraph length (used by LINE, CONE shapes). + */ + float getTelegraphLength(); + + /** + * Set the telegraph length. + */ + void setTelegraphLength(float length); + + /** + * Get the telegraph width (used by LINE shape). + */ + float getTelegraphWidth(); + + /** + * Set the telegraph width. + */ + void setTelegraphWidth(float width); + + /** + * Get the telegraph angle in degrees (used by CONE shape). + */ + float getTelegraphAngle(); + + /** + * Set the telegraph angle in degrees. + */ + void setTelegraphAngle(float angle); } From 6faa544f6f481690dfcbf55af130978a9402c35f Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 7 Mar 2026 15:30:11 -0500 Subject: [PATCH 85/93] Fix some Firing Script Behavior for Energy Projectiles --- java/noppes/npcs/api/entity/IEnergyBeam.java | 9 +- java/noppes/npcs/api/entity/IEnergyDisc.java | 6 +- java/noppes/npcs/api/entity/IEnergyLaser.java | 10 +- java/noppes/npcs/api/entity/IEnergyOrb.java | 19 +++- .../npcs/api/entity/IEnergyProjectile.java | 99 +++++++++++++++++-- .../noppes/npcs/api/entity/IEnergySlicer.java | 5 +- 6 files changed, 133 insertions(+), 15 deletions(-) diff --git a/java/noppes/npcs/api/entity/IEnergyBeam.java b/java/noppes/npcs/api/entity/IEnergyBeam.java index f951dcb..7d9d739 100644 --- a/java/noppes/npcs/api/entity/IEnergyBeam.java +++ b/java/noppes/npcs/api/entity/IEnergyBeam.java @@ -3,10 +3,17 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy beam projectile - a directional beam with a trailing path. + * A directional beam projectile with a trailing path and optional head orb. + *

    + * Beams travel forward from their origin, dealing damage along their length. + * They can optionally stay attached to their owner and follow the owner's movement. + *

    + * Beams use {@code startFiring} internally rather than {@code startMoving} — + * this is handled automatically by the fire methods. */ public interface IEnergyBeam extends IEnergyProjectile { + /** Width of the beam trail. */ float getBeamWidth(); void setBeamWidth(float width); diff --git a/java/noppes/npcs/api/entity/IEnergyDisc.java b/java/noppes/npcs/api/entity/IEnergyDisc.java index cfb772f..17b27df 100644 --- a/java/noppes/npcs/api/entity/IEnergyDisc.java +++ b/java/noppes/npcs/api/entity/IEnergyDisc.java @@ -3,10 +3,14 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy disc projectile - a flat spinning disc with optional boomerang behavior. + * A flat spinning disc projectile with optional boomerang behavior. + *

    + * Discs can be oriented vertically or horizontally, and can return to their owner + * like a boomerang after a configurable delay. */ public interface IEnergyDisc extends IEnergyProjectile { + /** Radius of the disc. */ float getDiscRadius(); void setDiscRadius(float radius); diff --git a/java/noppes/npcs/api/entity/IEnergyLaser.java b/java/noppes/npcs/api/entity/IEnergyLaser.java index 6433086..844b1c0 100644 --- a/java/noppes/npcs/api/entity/IEnergyLaser.java +++ b/java/noppes/npcs/api/entity/IEnergyLaser.java @@ -3,10 +3,18 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy laser entity - a sweeping beam that follows the caster's look vector. + * A continuous laser beam that extends outward from its origin along a direction vector. + *

    + * Unlike other projectiles, lasers don't move through the world — they extend from their + * origin point along a direction, hitting everything in their path up to {@link #getMaxLength()}. + * The direction can be set explicitly via {@link #setDirection(double, double, double)}. + *

    + * The coordinate-based {@code fireAt(x, y, z)} calculates and sets the direction vector + * automatically, then uses the laser's internal launch sequence. */ public interface IEnergyLaser extends IEnergyProjectile { + /** Width of the laser beam. */ float getLaserWidth(); void setLaserWidth(float width); diff --git a/java/noppes/npcs/api/entity/IEnergyOrb.java b/java/noppes/npcs/api/entity/IEnergyOrb.java index 70af189..7205b72 100644 --- a/java/noppes/npcs/api/entity/IEnergyOrb.java +++ b/java/noppes/npcs/api/entity/IEnergyOrb.java @@ -3,8 +3,23 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy orb projectile - a spherical homing energy ball. - * Orbs use the base IEnergyProjectile properties with no additional methods. + * A spherical homing energy ball. + *

    + * Orbs travel in a straight line toward their target and can optionally home in on living entities. + * Use the base {@link IEnergyProjectile} methods for size, speed, damage, homing, and launch control. + *

    + * Example usage: + *

    + * // Fire from a specific position toward a target
    + * var orb = API.getEnergyController().createOrb(world, player, x, y, z, 1.0);
    + * orb.setDamage(10);
    + * orb.setHoming(true);
    + * orb.fireAt(target);           // launches from (x,y,z) toward target
    + *
    + * // Fire from the caster's eye position using look-vector snap
    + * var orb2 = API.getEnergyController().createOrb(world, player, 0, 0, 0, 1.0);
    + * orb2.fireFrom(player, target); // repositions to player's eye, then fires toward target
    + * 
    */ public interface IEnergyOrb extends IEnergyProjectile { } diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 6f1a3ca..4168f9d 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -3,29 +3,49 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy projectile entity (Orb, Beam, Disc, Laser). - * Extends IEnergyAbility for shared display/lightning/owner/charging methods. + * Base interface for all energy projectile entities (Orb, Beam, Disc, Laser, Slicer). + *

    + * Extends {@link IEnergyAbility} for shared display, lightning, owner, and charging methods. + *

    + * Fire methods — launch from current position (no repositioning): + *

      + *
    • {@link #fireAt(IEntity)} — toward an entity
    • + *
    • {@link #fireAt(double, double, double)} — toward world coordinates
    • + *
    • {@link #fireDirection(float, float)} — in a yaw/pitch direction
    • + *
    + * FireFrom methods — reposition to caster's eye, then launch (look-vector snap): + *
      + *
    • {@link #fireFrom(IEntityLivingBase)} — fire along caster's look direction
    • + *
    • {@link #fireFrom(IEntityLivingBase, IEntity)} — fire toward a target entity
    • + *
    */ public interface IEnergyProjectile extends IEnergyAbility { // ==================== OWNER & TARGET ==================== + /** Sets the owner entity (used for homing return, damage attribution, etc.). */ void setOwner(IEntity owner); + /** @return the entity ID of the current homing/tracking target, or -1 if none */ int getTargetEntityId(); + /** @return the current homing/tracking target entity, or null if none */ IEntity getTarget(); + /** Sets the homing/tracking target entity. Pass null to clear. */ void setTarget(IEntity target); // ==================== SIZE ==================== + /** @return the projectile's visual and collision size */ float getSize(); + /** Sets the projectile's visual and collision size. */ void setSize(float size); // ==================== DISPLAY (PROJECTILE-SPECIFIC) ==================== + /** @return the visual rotation speed (degrees per tick) */ float getRotationSpeed(); void setRotationSpeed(float speed); @@ -42,72 +62,88 @@ public interface IEnergyProjectile extends IEnergyAbility { // ==================== LIFESPAN ==================== + /** @return maximum travel distance before the projectile despawns (0 = unlimited) */ float getMaxDistance(); void setMaxDistance(float distance); + /** @return maximum lifetime in ticks before the projectile despawns (0 = unlimited) */ int getMaxLifetime(); void setMaxLifetime(int ticks); // ==================== COMBAT ==================== + /** @return base damage dealt on hit */ float getDamage(); void setDamage(float damage); + /** @return horizontal knockback strength */ float getKnockback(); void setKnockback(float knockback); + /** @return upward knockback strength */ float getKnockbackUp(); void setKnockbackUp(float knockbackUp); + /** @return true if the projectile explodes on impact */ boolean isExplosive(); void setExplosive(boolean explosive); + /** @return explosion radius (only used if {@link #isExplosive()} is true) */ float getExplosionRadius(); void setExplosionRadius(float radius); + /** @return damage falloff multiplier over explosion radius (0 = no falloff, 1 = full falloff) */ float getExplosionDamageFalloff(); void setExplosionDamageFalloff(float falloff); + /** @return hit behavior type (0 = single hit, 1 = pierce, 2 = multi-hit with delay) */ int getHitType(); void setHitType(int hitType); + /** @return ticks between multi-hit damage ticks on the same entity */ int getMultiHitDelayTicks(); void setMultiHitDelayTicks(int delayTicks); + /** @return maximum number of entities this projectile can hit (0 = unlimited) */ int getMaxHits(); void setMaxHits(int maxHits); // ==================== MOVEMENT ==================== + /** @return travel speed (blocks per tick) */ float getSpeed(); void setSpeed(float speed); + /** @return true if the projectile homes toward its target */ boolean isHoming(); void setHoming(boolean homing); + /** @return how aggressively the projectile turns toward its target (higher = tighter turns) */ float getHomingStrength(); void setHomingStrength(float strength); + /** @return maximum range at which homing will acquire/track a target */ float getHomingRange(); void setHomingRange(float range); // ==================== ANCHOR ==================== + /** @return anchor point type used during the charge/windup phase */ int getAnchor(); float getAnchorOffsetX(); @@ -118,47 +154,92 @@ public interface IEnergyProjectile extends IEnergyAbility { // ==================== POSITION ==================== + /** @return X coordinate where the projectile was launched from */ double getStartX(); + /** @return Y coordinate where the projectile was launched from */ double getStartY(); + /** @return Z coordinate where the projectile was launched from */ double getStartZ(); // ==================== STATE ==================== + /** @return true if the projectile has hit something */ boolean hasHit(); /** * Returns the energy projectile sub-type. - * 0=Orb, 1=Beam, 2=Disc, 3=Laser + * @return 0=Orb, 1=Beam, 2=Disc, 3=Laser, 4=Slicer */ int getEnergyType(); // ==================== FIRE / LAUNCH ==================== /** - * Spawns the projectile in the world (if not yet spawned) and starts it moving toward the target entity. + * Spawns the projectile and launches it from its current position toward the target entity. + *

    + * No look-vector repositioning occurs — the projectile fires from exactly where it was + * placed by {@code createOrb}/{@code createBeam}/etc. If the target is a living entity, + * it is also set as the homing target for projectiles with homing enabled. + *

    + * To launch from the owner's eye position with look-vector snapping, use + * {@link #fireFrom(IEntityLivingBase, IEntity)} instead. + * + * @param target the entity to fire toward (can be null for untargeted launch) */ void fireAt(IEntity target); /** - * Spawns the projectile in the world (if not yet spawned) and starts it moving toward the specified coordinates. + * Spawns the projectile and launches it toward the specified world coordinates. + *

    + * The projectile fires from its current position — no look-vector repositioning occurs. + * Motion is calculated as a normalized direction vector scaled by the projectile's speed. + * + * @param x target X coordinate + * @param y target Y coordinate + * @param z target Z coordinate */ void fireAt(double x, double y, double z); /** - * Spawns the projectile in the world (if not yet spawned) and starts it moving in the specified direction. + * Spawns the projectile and launches it in the specified yaw/pitch direction. + *

    + * The projectile fires from its current position — no look-vector repositioning occurs. + * + * @param yaw horizontal angle in degrees (0 = south, 90 = west, like Minecraft yaw) + * @param pitch vertical angle in degrees (negative = up, positive = down) */ void fireDirection(float yaw, float pitch); /** - * Sets the owner, positions the projectile at the caster's eye level, and fires in the caster's look direction. - * Convenience method similar to how fireKiAttack works. + * Sets the owner, positions the projectile at the caster's eye level, and launches it + * using the entity's full launch sequence ({@code startMoving}/{@code startFiring}). + *

    + * For player-owned projectiles, this snaps the projectile to the owner's look-vector + * position and fires in the caster's look direction. This is the intended method for + * "cast from self" behavior. The projectile's position set by {@code createOrb}/etc. is + * overridden. + *

    + * Use {@link #fireAt(IEntity)} or {@link #fireAt(double, double, double)} instead if you + * want to launch from a specific custom position. + * + * @param caster the entity to fire from */ void fireFrom(IEntityLivingBase caster); /** - * Sets the owner, positions the projectile at the caster's eye level, and fires toward the target entity. + * Sets the owner, positions the projectile at the caster's eye level, and launches it + * toward the target entity using the entity's full launch sequence. + *

    + * For player-owned projectiles, this snaps the projectile to the owner's look-vector + * position before firing toward the target. The projectile's position set by + * {@code createOrb}/etc. is overridden. + *

    + * Use {@link #fireAt(IEntity)} instead if you want to launch from a specific custom position. + * + * @param caster the entity to fire from + * @param target the entity to fire toward */ void fireFrom(IEntityLivingBase caster, IEntity target); diff --git a/java/noppes/npcs/api/entity/IEnergySlicer.java b/java/noppes/npcs/api/entity/IEnergySlicer.java index ed547a8..7a20182 100644 --- a/java/noppes/npcs/api/entity/IEnergySlicer.java +++ b/java/noppes/npcs/api/entity/IEnergySlicer.java @@ -3,10 +3,13 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; /** - * Represents an energy slicer projectile - a thin, wide blade that slices through targets. + * A thin, wide blade projectile that slices through targets. + *

    + * Slicers travel in a straight line, cutting through entities in their path. */ public interface IEnergySlicer extends IEnergyProjectile { + /** Width of the slicer blade. */ float getSliceWidth(); void setSliceWidth(float width); From c46ca506830a012345d37bb3dccdec862fdf0734 Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 7 Mar 2026 18:26:38 -0500 Subject: [PATCH 86/93] Fixed / Improved Track Speed Handling on NPCs --- java/noppes/npcs/api/ability/IAbility.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 1b0197e..b943dab 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -191,17 +191,17 @@ public interface IAbility extends IAbilityAction { void setRotationPhaseType(int type); /** - * Get track delay for TRACK rotation mode. - * 0 = instant tracking (legacy). Higher values = slower lerp toward target. + * Get track speed for TRACK rotation mode (blocks/second). + * 0 = instant tracking. Comparable to player sprint speed (~5.6 blocks/sec). */ - float getTrackDelayValue(); + float getTrackSpeedValue(); /** - * Set track delay for TRACK rotation mode. + * Set track speed for TRACK rotation mode (blocks/second). * - * @param delay 0 = instant tracking. Higher values = slower lerp toward target. + * @param speed 0 = instant tracking. ~4 = dodgeable while sprinting. ~6 = barely undodgeable. */ - void setTrackDelayValue(float delay); + void setTrackSpeedValue(float speed); /** * Check if movement (pathfinding/motion) is locked during the WINDUP phase. From fff8a25e0edfb4557b8ff1afa3b2fefeed94aa9f Mon Sep 17 00:00:00 2001 From: Kam Date: Sat, 7 Mar 2026 19:12:01 -0500 Subject: [PATCH 87/93] OOOOGGAAAA BOOOGAAA --- java/noppes/npcs/api/ability/IAbility.java | 2 +- java/noppes/npcs/api/event/IAbilityEvent.java | 2 +- .../npcs/api/event/IPlayerAbilityEvent.java | 183 ------------------ 3 files changed, 2 insertions(+), 185 deletions(-) delete mode 100644 java/noppes/npcs/api/event/IPlayerAbilityEvent.java diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index b943dab..6c5dcbb 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -229,7 +229,7 @@ public interface IAbility extends IAbilityAction { boolean isExecuting(); /** - * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=DAZED). + * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=DAZED, 4=BURST_DELAY). */ int getPhaseInt(); diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 0f28d33..ee47885 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -146,7 +146,7 @@ public interface IAbilityEvent extends INpcEvent { interface TickEvent extends IAbilityEvent { /** * Get the current phase of the ability. - * 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = RECOVERY + * 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = DAZED, 4 = BURST_DELAY */ int getAbilityPhase(); diff --git a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java b/java/noppes/npcs/api/event/IPlayerAbilityEvent.java deleted file mode 100644 index 6162f87..0000000 --- a/java/noppes/npcs/api/event/IPlayerAbilityEvent.java +++ /dev/null @@ -1,183 +0,0 @@ -package noppes.npcs.api.event; - -import cpw.mods.fml.common.eventhandler.Cancelable; -import noppes.npcs.api.IDamageSource; -import noppes.npcs.api.ability.IAbility; -import noppes.npcs.api.entity.IEntityLivingBase; - -/** - * Events related to player ability execution. - * These events are fired during the ability lifecycle when a player uses an ability. - */ -public interface IPlayerAbilityEvent extends IPlayerEvent { - - /** - * Get the ability involved in this event. - */ - IAbility getAbility(); - - /** - * Get the target of the ability, or null if no target. - */ - IEntityLivingBase getTarget(); - - /** - * Fired when a player's ability starts executing (enters WINDUP phase). - * Canceling prevents the ability from starting. - * - * @hookName abilityStart - */ - @Cancelable - interface StartEvent extends IPlayerAbilityEvent { - } - - /** - * Fired when a player's ability enters the ACTIVE phase and performs its effect. - * Canceling prevents the ability effect from occurring. - * - * @hookName abilityExecute - */ - @Cancelable - interface ExecuteEvent extends IPlayerAbilityEvent { - } - - /** - * Fired when a player's ability is interrupted by damage. - * - * @hookName abilityInterrupt - */ - interface InterruptEvent extends IPlayerAbilityEvent { - /** - * Get the damage source that caused the interruption, or null if not damage-triggered. - */ - IDamageSource getDamageSource(); - - /** - * Get the amount of damage that caused the interruption. - */ - float getDamage(); - } - - /** - * Fired when a player's ability completes its full execution cycle. - * - * @hookName abilityComplete - */ - interface CompleteEvent extends IPlayerAbilityEvent { - } - - /** - * Fired every tick while a player's ability is executing. - * Provides the current phase and tick count. - * - * @hookName abilityTick - */ - interface TickEvent extends IPlayerAbilityEvent { - /** - * Get the current phase of the ability. - * 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = RECOVERY - */ - int getAbilityPhase(); - - /** - * Get the current tick count within the phase. - */ - int getTick(); - } - - /** - * Fired when a toggle ability is switched ON or OFF. - * Canceling prevents the toggle from changing state. - * - * @hookName abilityToggle - */ - @Cancelable - interface ToggleEvent extends IPlayerAbilityEvent { - /** - * @return true if the toggle is being turned ON (any state), false if being turned OFF - */ - boolean isTogglingOn(); - - /** - * @return the previous state (0 = was off, 1+ = previous active state) - */ - int getOldState(); - - /** - * @return the new state (0 = turning off, 1+ = new active state) - */ - int getNewState(); - } - - /** - * Fired every 10 ticks for each active toggle ability. - * Scripts can call {@link #setEnabled(boolean)} with false to force-deactivate the toggle. - * - * @hookName abilityToggleUpdate - */ - interface ToggleUpdateEvent extends IPlayerAbilityEvent { - /** - * @return the tick count since the toggle was activated - */ - int getTick(); - - /** - * @return the current toggle state (1+) - */ - int getState(); - - /** - * @return whether the toggle should remain active - */ - boolean isEnabled(); - - /** - * Set to false to force-deactivate the toggle after this event completes. - */ - void setEnabled(boolean enabled); - } - - /** - * Fired when a player's ability hits an entity with damage. - * Canceling this event prevents the damage from being applied. - * - * @hookName abilityHit - */ - @Cancelable - interface HitEvent extends IPlayerAbilityEvent { - /** - * Get the entity that was hit by the ability. - */ - IEntityLivingBase getHitEntity(); - - /** - * Get the damage amount. - */ - float getDamage(); - - /** - * Set the damage amount. Allows scripts to modify damage. - */ - void setDamage(float damage); - - /** - * Get the horizontal knockback amount. - */ - float getKnockback(); - - /** - * Set the horizontal knockback amount. - */ - void setKnockback(float knockback); - - /** - * Get the vertical knockback (upward force) amount. - */ - float getKnockbackUp(); - - /** - * Set the vertical knockback (upward force) amount. - */ - void setKnockbackUp(float knockbackUp); - } -} From a6c55ca331112d8bbb55161a6070806213a1613b Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 8 Mar 2026 22:49:34 -0400 Subject: [PATCH 88/93] Added Scripting Projectile and Barrier Syncing --- .../npcs/api/entity/IEnergyBarrier.java | 18 +++++++++++++ .../npcs/api/entity/IEnergyProjectile.java | 25 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/java/noppes/npcs/api/entity/IEnergyBarrier.java b/java/noppes/npcs/api/entity/IEnergyBarrier.java index 44f2ddd..36999cf 100644 --- a/java/noppes/npcs/api/entity/IEnergyBarrier.java +++ b/java/noppes/npcs/api/entity/IEnergyBarrier.java @@ -65,4 +65,22 @@ public interface IEnergyBarrier extends IEnergyAbility { * Returns the barrier type: 0=Dome, 1=Panel */ int getBarrierType(); + + // ==================== SYNC ==================== + + /** + * Sends all current visual and barrier-specific data to tracking clients. + *

    + * Call this after making batch changes to properties like colors, alpha, + * lightning, dome radius, panel dimensions, etc. This sends a single packet + * instead of one per setter call. + *

    + * Example: + *

    +     * dome.setInnerColor(0xFF0000);
    +     * dome.setDomeRadius(5.0);
    +     * dome.syncClient(); // one packet for all changes
    +     * 
    + */ + void syncClient(); } diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 4168f9d..0a339e3 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -174,6 +174,31 @@ public interface IEnergyProjectile extends IEnergyAbility { */ int getEnergyType(); + // ==================== SYNC ==================== + + /** + * Sends all current visual, movement, and position data to tracking clients. + *

    + * Call this after making batch changes to properties like size, speed, + * homing, colors, or type-specific fields (beam width, disc radius, etc.). + * This avoids sending a separate packet for every setter call. + *

    + * Note: {@code fireAt()}, {@code fireDirection()}, and {@code fireFrom()} + * automatically sync motion when called on an already-spawned projectile, + * so you do not need to call {@code syncClient()} after firing. + * Use this method when changing properties that affect rendering or movement + * behavior without re-firing. + *

    + * Example: + *

    +     * orb.setSize(2.0);
    +     * orb.setSpeed(0.5);
    +     * orb.setInnerColor(0xFF0000);
    +     * orb.syncClient(); // one packet for all changes
    +     * 
    + */ + void syncClient(); + // ==================== FIRE / LAUNCH ==================== /** From 319e77451862a113b156c988a1234b2acbadfb2b Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 9 Mar 2026 16:20:07 -0400 Subject: [PATCH 89/93] A lot of GOOD API DOCUMENTATION --- java/net/minecraft/util/Vec3i.java | 8 + java/net/minecraft/util/math/BlockPos.java | 74 +++++- java/net/minecraft/util/math/IntHashMap.java | 35 ++- java/noppes/npcs/api/AbstractNpcAPI.java | 13 + java/noppes/npcs/api/ICommand.java | 44 +++ java/noppes/npcs/api/IEnergyController.java | 63 ++++- java/noppes/npcs/api/INbt.java | 7 + java/noppes/npcs/api/IPixelmonPlayerData.java | 12 + java/noppes/npcs/api/IPos.java | 11 + java/noppes/npcs/api/IScreenSize.java | 21 ++ java/noppes/npcs/api/ISkinOverlay.java | 12 + java/noppes/npcs/api/ITelegraph.java | 50 +++- java/noppes/npcs/api/ITelegraphInstance.java | 30 ++- java/noppes/npcs/api/ITileEntity.java | 5 + java/noppes/npcs/api/ITimers.java | 11 + java/noppes/npcs/api/IWorld.java | 54 +++- java/noppes/npcs/api/ability/IAbility.java | 20 ++ .../npcs/api/ability/IAbilityHandler.java | 8 + .../npcs/api/ability/ICustomAbility.java | 16 ++ .../npcs/api/ability/IDataAbilities.java | 32 +++ .../npcs/api/ability/IPlayerAbilityData.java | 37 ++- .../api/ability/data/IEnergyAnchorData.java | 7 +- .../noppes/npcs/api/block/IBlockScripted.java | 2 + java/noppes/npcs/api/block/ITextPlane.java | 65 ++++- java/noppes/npcs/api/entity/IArrow.java | 11 + .../npcs/api/entity/IEnergyBarrier.java | 1 + java/noppes/npcs/api/entity/IEnergyBeam.java | 5 +- java/noppes/npcs/api/entity/IEnergyDisc.java | 5 +- java/noppes/npcs/api/entity/IEnergyDome.java | 2 + .../npcs/api/entity/IEnergyExplosion.java | 6 +- java/noppes/npcs/api/entity/IEnergyLaser.java | 5 +- java/noppes/npcs/api/entity/IEnergyPanel.java | 1 + .../npcs/api/entity/IEnergyProjectile.java | 15 +- .../noppes/npcs/api/entity/IEnergySlicer.java | 5 +- .../npcs/api/entity/IEnergySweeper.java | 18 ++ java/noppes/npcs/api/entity/IEnergyZone.java | 10 +- .../npcs/api/entity/IEntityLivingBase.java | 5 + java/noppes/npcs/api/entity/IFishHook.java | 8 + java/noppes/npcs/api/entity/IPlayer.java | 5 + java/noppes/npcs/api/entity/IThrowable.java | 8 + java/noppes/npcs/api/event/IAbilityEvent.java | 16 ++ .../npcs/api/event/IAnimationEvent.java | 11 + java/noppes/npcs/api/event/IBlockEvent.java | 4 + java/noppes/npcs/api/event/IChainEvent.java | 9 + .../npcs/api/event/ICustomGuiEvent.java | 5 + .../npcs/api/event/ICustomNPCsEvent.java | 4 + java/noppes/npcs/api/event/IDialogEvent.java | 15 ++ .../npcs/api/event/IEnergyBarrierEvent.java | 12 + .../api/event/IEnergyProjectileEvent.java | 14 + java/noppes/npcs/api/event/IFactionEvent.java | 10 + java/noppes/npcs/api/event/IForgeEvent.java | 9 + java/noppes/npcs/api/event/IItemEvent.java | 92 ++++++- .../npcs/api/event/ILinkedItemEvent.java | 8 +- java/noppes/npcs/api/event/INpcEvent.java | 107 +++++++- java/noppes/npcs/api/event/IPartyEvent.java | 41 ++- java/noppes/npcs/api/event/IPlayerEvent.java | 251 +++++++++++++++++- .../npcs/api/event/IProjectileEvent.java | 10 + java/noppes/npcs/api/event/IQuestEvent.java | 17 ++ java/noppes/npcs/api/event/IRecipeEvent.java | 17 ++ java/noppes/npcs/api/gui/ICustomGui.java | 7 + .../npcs/api/handler/IAbilityHandler.java | 24 ++ .../npcs/api/handler/IActionManager.java | 24 +- .../npcs/api/handler/IAnimationHandler.java | 6 + .../npcs/api/handler/IAuctionHandler.java | 12 + .../npcs/api/handler/ICloneHandler.java | 169 ++++++++++++ .../npcs/api/handler/IDialogHandler.java | 17 +- .../npcs/api/handler/IFactionHandler.java | 34 ++- .../npcs/api/handler/ILinkedItemHandler.java | 46 ++++ .../api/handler/INaturalSpawnsHandler.java | 32 +++ .../npcs/api/handler/IOverlayHandler.java | 36 +++ .../npcs/api/handler/IPlayerBankData.java | 4 + java/noppes/npcs/api/handler/IPlayerData.java | 32 +++ .../npcs/api/handler/IPlayerDialogData.java | 19 ++ .../npcs/api/handler/IPlayerFactionData.java | 22 ++ .../api/handler/IPlayerItemGiverData.java | 22 ++ .../npcs/api/handler/IPlayerMailData.java | 29 ++ .../npcs/api/handler/IPlayerQuestData.java | 48 +++- .../npcs/api/handler/IPlayerTradeData.java | 14 + .../api/handler/IPlayerTransportData.java | 33 +++ .../npcs/api/handler/IProfileHandler.java | 43 +++ .../npcs/api/handler/IQuestHandler.java | 17 +- .../npcs/api/handler/IRecipeHandler.java | 55 +++- java/noppes/npcs/api/handler/ITagHandler.java | 35 ++- .../npcs/api/handler/ITelegraphHandler.java | 16 +- .../npcs/api/handler/ITransportHandler.java | 24 ++ .../noppes/npcs/api/handler/data/IAction.java | 38 ++- .../npcs/api/handler/data/IActionChain.java | 6 +- .../api/handler/data/IActionListener.java | 4 + .../npcs/api/handler/data/IActionQueue.java | 8 +- .../npcs/api/handler/data/IAnimation.java | 2 + .../npcs/api/handler/data/IAnvilRecipe.java | 6 + .../npcs/api/handler/data/IAuctionClaim.java | 15 ++ .../api/handler/data/IAuctionListing.java | 23 ++ .../npcs/api/handler/data/ICustomEffect.java | 140 ++++++++++ .../noppes/npcs/api/handler/data/IDialog.java | 241 +++++++++++++++++ .../api/handler/data/IDialogCategory.java | 13 + .../npcs/api/handler/data/IDialogImage.java | 92 +++++++ .../npcs/api/handler/data/IDialogOption.java | 9 + .../npcs/api/handler/data/IFaction.java | 88 ++++++ java/noppes/npcs/api/handler/data/IFrame.java | 54 ++++ .../npcs/api/handler/data/IFramePart.java | 56 ++++ java/noppes/npcs/api/handler/data/ILine.java | 27 ++ java/noppes/npcs/api/handler/data/ILines.java | 37 +++ .../npcs/api/handler/data/ILinkedItem.java | 50 +++- .../npcs/api/handler/data/INaturalSpawn.java | 55 ++++ java/noppes/npcs/api/handler/data/IParty.java | 2 + .../npcs/api/handler/data/IPartyOptions.java | 30 ++- .../api/handler/data/IPlayerAttributes.java | 2 + .../npcs/api/handler/data/IPlayerEffect.java | 17 ++ .../npcs/api/handler/data/IPlayerMail.java | 21 ++ java/noppes/npcs/api/handler/data/IQuest.java | 58 +++- .../npcs/api/handler/data/IQuestCategory.java | 12 + .../npcs/api/handler/data/IQuestDialog.java | 4 + .../api/handler/data/IQuestInterface.java | 3 + .../npcs/api/handler/data/IQuestItem.java | 11 + .../npcs/api/handler/data/IQuestKill.java | 13 + .../npcs/api/handler/data/IQuestLocation.java | 11 + .../api/handler/data/IQuestObjective.java | 4 + .../noppes/npcs/api/handler/data/IRecipe.java | 23 +- java/noppes/npcs/api/handler/data/ISlot.java | 6 + java/noppes/npcs/api/handler/data/ISound.java | 33 +++ java/noppes/npcs/api/handler/data/ITag.java | 13 + .../api/handler/data/ITransportCategory.java | 22 ++ .../api/handler/data/ITransportLocation.java | 30 +++ .../data/actions/IConditionalAction.java | 2 +- java/noppes/npcs/api/roles/IRole.java | 8 + java/noppes/npcs/api/roles/IRoleBank.java | 3 + java/noppes/npcs/api/roles/IRoleFollower.java | 2 + java/noppes/npcs/api/roles/IRoleMailman.java | 3 + java/noppes/npcs/api/roles/IRoleTrader.java | 2 +- .../npcs/api/roles/IRoleTransporter.java | 20 ++ 131 files changed, 3363 insertions(+), 175 deletions(-) diff --git a/java/net/minecraft/util/Vec3i.java b/java/net/minecraft/util/Vec3i.java index 9c7bdef..9000e6a 100644 --- a/java/net/minecraft/util/Vec3i.java +++ b/java/net/minecraft/util/Vec3i.java @@ -67,6 +67,7 @@ public class Vec3i implements Comparable { /** * Get the X coordinate + * @return the X component */ public int getX() { return this.x; @@ -74,6 +75,7 @@ public class Vec3i implements Comparable { /** * Get the Y coordinate + * @return the Y component */ public int getY() { return this.y; @@ -81,6 +83,7 @@ public class Vec3i implements Comparable { /** * Get the Z coordinate + * @return the Z component */ public int getZ() { return this.z; @@ -89,6 +92,7 @@ public class Vec3i implements Comparable { /** * Get the X coordinate as a double + * @return the X component as a double */ public double getXD() { return this.xd; @@ -96,6 +100,7 @@ public class Vec3i implements Comparable { /** * Get the Y coordinate as a double + * @return the Y component as a double */ public double getYD() { return this.yd; @@ -103,6 +108,7 @@ public class Vec3i implements Comparable { /** * Get the Z coordinate as a double + * @return the Z component as a double */ public double getZD() { return this.zd; @@ -110,6 +116,8 @@ public class Vec3i implements Comparable { /** * Calculate the cross product of this and the given Vector + * @param vec the other vector + * @return the cross product of this vector and the given vector */ public Vec3i crossProduct(Vec3i vec) { return new Vec3i(this.getYD() * vec.getZD() - this.getZD() * vec.getYD(), this.getZD() * vec.getXD() - this.getXD() * vec.getZD(), this.getXD() * vec.getYD() - this.getYD() * vec.getXD()); diff --git a/java/net/minecraft/util/math/BlockPos.java b/java/net/minecraft/util/math/BlockPos.java index 131e037..963c775 100644 --- a/java/net/minecraft/util/math/BlockPos.java +++ b/java/net/minecraft/util/math/BlockPos.java @@ -50,6 +50,11 @@ public class BlockPos extends Vec3i { /** * Add the given coordinates to the coordinates of this BlockPos + * + * @param x X offset + * @param y Y offset + * @param z Z offset + * @return a new BlockPos offset by the given values */ public BlockPos add(double x, double y, double z) { return x == 0.0D && y == 0.0D && z == 0.0D ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z); @@ -57,6 +62,11 @@ public class BlockPos extends Vec3i { /** * Add the given coordinates to the coordinates of this BlockPos + * + * @param x X offset + * @param y Y offset + * @param z Z offset + * @return a new BlockPos offset by the given values */ public BlockPos add(int x, int y, int z) { return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z); @@ -64,6 +74,9 @@ public class BlockPos extends Vec3i { /** * Add the given Vector to this BlockPos + * + * @param vec the vector to add + * @return a new BlockPos offset by the vector */ public BlockPos add(Vec3i vec) { return vec.getXD() == 0 && vec.getYD() == 0 && vec.getZD() == 0 ? this : new BlockPos(this.getXD() + vec.getXD(), this.getYD() + vec.getYD(), this.getZD() + vec.getZD()); @@ -71,6 +84,8 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block up + * + * @return the BlockPos one block above */ public BlockPos up() { return this.up(1); @@ -78,6 +93,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos n blocks up + * + * @param n the distance upward + * @return the BlockPos n blocks above */ public BlockPos up(double n) { return this.offset(EnumFacing.UP, n); @@ -85,6 +103,8 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block down + * + * @return the BlockPos one block below */ public BlockPos down() { return this.down(1); @@ -92,6 +112,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos n blocks down + * + * @param n the distance downward + * @return the BlockPos n blocks below */ public BlockPos down(double n) { return this.offset(EnumFacing.DOWN, n); @@ -99,6 +122,8 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block in northern direction + * + * @return the BlockPos one block to the north */ public BlockPos north() { return this.north(1); @@ -106,6 +131,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos n blocks in northern direction + * + * @param n the distance northward + * @return the BlockPos n blocks to the north */ public BlockPos north(double n) { return this.offset(EnumFacing.NORTH, n); @@ -113,6 +141,8 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block in southern direction + * + * @return the BlockPos one block to the south */ public BlockPos south() { return this.south(1); @@ -120,6 +150,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos n blocks in southern direction + * + * @param n the distance southward + * @return the BlockPos n blocks to the south */ public BlockPos south(double n) { return this.offset(EnumFacing.SOUTH, n); @@ -127,6 +160,8 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block in western direction + * + * @return the BlockPos one block to the west */ public BlockPos west() { return this.west(1); @@ -134,6 +169,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos n blocks in western direction + * + * @param n the distance westward + * @return the BlockPos n blocks to the west */ public BlockPos west(double n) { return this.offset(EnumFacing.WEST, n); @@ -141,6 +179,8 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block in eastern direction + * + * @return the BlockPos one block to the east */ public BlockPos east() { return this.east(1); @@ -148,6 +188,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos n blocks in eastern direction + * + * @param n the distance eastward + * @return the BlockPos n blocks to the east */ public BlockPos east(double n) { return this.offset(EnumFacing.EAST, n); @@ -155,6 +198,9 @@ public class BlockPos extends Vec3i { /** * Offset this BlockPos 1 block in the given direction + * + * @param facing the direction to offset + * @return the BlockPos one block in the given direction */ public BlockPos offset(EnumFacing facing) { return this.offset(facing, 1); @@ -162,6 +208,10 @@ public class BlockPos extends Vec3i { /** * Offsets this BlockPos n blocks in the given direction + * + * @param facing the direction to offset + * @param n the distance + * @return the BlockPos n blocks in the given direction */ public BlockPos offset(EnumFacing facing, double n) { return n == 0 ? this : new BlockPos(this.getXD() + facing.getFrontOffsetX() * n, this.getYD() + facing.getFrontOffsetY() * n, this.getZD() + facing.getFrontOffsetZ() * n); @@ -176,6 +226,8 @@ public class BlockPos extends Vec3i { /** * Serialize this BlockPos into a long value + * + * @return this position serialized as a long */ public long toLong() { return ((long) this.getX() & X_MASK) << X_SHIFT | ((long) this.getY() & Y_MASK) << Y_SHIFT | ((long) this.getZ() & Z_MASK) << 0; @@ -183,6 +235,9 @@ public class BlockPos extends Vec3i { /** * Create a BlockPos from a serialized long value (created by toLong) + * + * @param serialized the serialized position + * @return a BlockPos decoded from the long */ public static BlockPos fromLong(long serialized) { int i = (int) (serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); @@ -193,6 +248,10 @@ public class BlockPos extends Vec3i { /** * Create an Iterable that returns all positions in the box specified by the given corners + * + * @param from the starting corner + * @param to the ending corner + * @return an iterable of all BlockPos within the bounding box */ public static Iterable getAllInBox(BlockPos from, BlockPos to) { final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ())); @@ -285,11 +344,16 @@ public class BlockPos extends Vec3i { /** * Sets the position, MUST not be name 'set' as that causes obfusication conflicts with func_185343_d + * + * @param x the X coordinate + * @param y the Y coordinate + * @param z the Z coordinate + * @return this mutable position */ - public BlockPos.MutableBlockPos setPos(int xIn, int yIn, int zIn) { - this.x = xIn; - this.y = yIn; - this.z = zIn; + public BlockPos.MutableBlockPos setPos(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; return this; } @@ -318,6 +382,8 @@ public class BlockPos extends Vec3i { * *

    When storing a BlockPos given to you for an extended period of time, make sure you * use this in case the value is changed internally.

    + * + * @return an immutable copy of this position */ public BlockPos toImmutable() { return new BlockPos(this); diff --git a/java/net/minecraft/util/math/IntHashMap.java b/java/net/minecraft/util/math/IntHashMap.java index 797013d..783c17f 100644 --- a/java/net/minecraft/util/math/IntHashMap.java +++ b/java/net/minecraft/util/math/IntHashMap.java @@ -32,12 +32,15 @@ public class IntHashMap { /** * Returns the object associated to a key + * + * @param key the integer key to look up + * @return the value associated with the key, or null if not found */ - public V lookup(int p_76041_1_) { - int i = computeHash(p_76041_1_); + public V lookup(int key) { + int i = computeHash(key); for (IntHashMap.Entry entry = this.slots[getSlotIndex(i, this.slots.length)]; entry != null; entry = entry.nextEntry) { - if (entry.hashEntry == p_76041_1_) { + if (entry.hashEntry == key) { return entry.valueEntry; } } @@ -47,9 +50,12 @@ public class IntHashMap { /** * Returns true if this hash table contains the specified item. + * + * @param key the integer key to check + * @return true if the map contains this key */ - public boolean containsItem(int p_76037_1_) { - return this.lookupEntry(p_76037_1_) != null; + public boolean containsItem(int key) { + return this.lookupEntry(key) != null; } final IntHashMap.Entry lookupEntry(int p_76045_1_) { @@ -66,19 +72,22 @@ public class IntHashMap { /** * Adds a key and associated value to this map + * + * @param key the integer key + * @param value the value to associate with the key */ - public void addKey(int p_76038_1_, V p_76038_2_) { - int i = computeHash(p_76038_1_); + public void addKey(int key, V value) { + int i = computeHash(key); int j = getSlotIndex(i, this.slots.length); for (IntHashMap.Entry entry = this.slots[j]; entry != null; entry = entry.nextEntry) { - if (entry.hashEntry == p_76038_1_) { - entry.valueEntry = p_76038_2_; + if (entry.hashEntry == key) { + entry.valueEntry = value; return; } } - this.insert(i, p_76038_1_, p_76038_2_, j); + this.insert(i, key, value, j); } /** @@ -128,9 +137,11 @@ public class IntHashMap { /** * Removes the specified object from the map and returns it + * + * @param key the integer key to remove */ - public V removeObject(int p_76049_1_) { - IntHashMap.Entry entry = this.removeEntry(p_76049_1_); + public V removeObject(int key) { + IntHashMap.Entry entry = this.removeEntry(key); return (V) (entry == null ? null : entry.valueEntry); } diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index e5b377f..75fcfba 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -190,6 +190,12 @@ public abstract class AbstractNpcAPI { /** * * Spawns a new NPC in the world at the given coordinates and returns an ICustomNpc object of it. + * + * @param var1 the world + * @param var2 X position + * @param var3 Y position + * @param var4 Z position + * @return the spawned NPC */ public abstract ICustomNpc spawnNPC(IWorld var1, int var2, int var3, int var4); @@ -243,11 +249,13 @@ public abstract class AbstractNpcAPI { public abstract IItemStack getIItemStack(ItemStack var1); /** + * @param var1 the Minecraft world * @return A single IWorld from Loaded IWorlds */ public abstract IWorld getIWorld(World var1); /** + * @param var1 the dimension ID * @return A single IWorld from Loaded IWorlds */ public abstract IWorld getIWorld(int var1); @@ -257,6 +265,7 @@ public abstract class AbstractNpcAPI { * Forge sometimes automatically, unloads the End when all players * are no longer present. * + * @param var1 the dimension ID * @return A single IWorld from Loaded/Unloaded IWorlds */ public abstract IWorld getIWorldLoad(int var1); @@ -325,6 +334,7 @@ public abstract class AbstractNpcAPI { * 0: Random * 1: Male * 2: Female + * @return a random name */ public abstract String getRandomName(int dictionary, int gender); @@ -357,6 +367,7 @@ public abstract class AbstractNpcAPI { /** * + * @param directory the particle texture directory * @return A new IParticle object initialized with the given texture. */ public abstract IParticle createParticle(String directory); @@ -408,12 +419,14 @@ public abstract class AbstractNpcAPI { /** * + * @param id the overlay ID * @return A new ICustomOverlay overlay object with the given ID. */ public abstract ICustomOverlay createCustomOverlay(int id); /** * + * @param texture the texture path * @return A new ISkinOverlay object initialized with the given texture. */ public abstract ISkinOverlay createSkinOverlay(String texture); diff --git a/java/noppes/npcs/api/ICommand.java b/java/noppes/npcs/api/ICommand.java index 444c909..b59833a 100644 --- a/java/noppes/npcs/api/ICommand.java +++ b/java/noppes/npcs/api/ICommand.java @@ -1,23 +1,67 @@ package noppes.npcs.api; +/** + * Represents a custom command that can be registered and executed. + */ public interface ICommand { + /** + * Gets the name of this command. + * @return the command name + */ String getCommandName(); + /** + * Gets the usage string for this command. + * @return the command usage description + */ String getCommandUsage(); + /** + * Gets the permission level required to execute this command. + * @return the permission level (0 = all, 1 = moderator, 2 = gamemaster, 3 = admin, 4 = owner) + */ int getPermissionLevel(); + /** + * Sets the name of this command. + * @param commandName the command name to set + */ void setCommandName(String commandName); + /** + * Sets the usage string for this command. + * @param commandUsage the command usage description to set + */ void setCommandUsage(String commandUsage); + /** + * Sets the permission level required to execute this command. + * @param permissionLevel the permission level (0 = all, 1 = moderator, 2 = gamemaster, 3 = admin, 4 = owner) + */ void setPermissionLevel(int permissionLevel); + /** + * Gets all aliases for this command. + * @return an array of alias strings + */ String[] getAliases(); + /** + * Adds one or more aliases for this command. + * @param aliases the alias(es) to add + */ void addAliases(String... aliases); + /** + * Checks whether this command has a specific alias. + * @param alias the alias to check for + * @return true if the alias exists + */ boolean hasAlias(String alias); + /** + * Removes an alias from this command. + * @param alias the alias to remove + */ void removeAlias(String alias); } diff --git a/java/noppes/npcs/api/IEnergyController.java b/java/noppes/npcs/api/IEnergyController.java index 5c3156f..a3cd8f7 100644 --- a/java/noppes/npcs/api/IEnergyController.java +++ b/java/noppes/npcs/api/IEnergyController.java @@ -17,21 +17,51 @@ public interface IEnergyController { /** * Create an energy orb projectile. Not spawned until fire() is called. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @param size the orb size + * @return the energy orb entity */ IEnergyOrb createOrb(IWorld world, IEntity owner, double x, double y, double z, float size); /** * Create an energy beam projectile. Not spawned until fire() is called. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @param beamWidth the beam width + * @param headSize the head size + * @return the energy beam entity */ IEnergyBeam createBeam(IWorld world, IEntity owner, double x, double y, double z, float beamWidth, float headSize); /** * Create an energy disc projectile. Not spawned until fire() is called. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @param radius the disc radius + * @param thickness the disc thickness + * @return the energy disc entity */ IEnergyDisc createDisc(IWorld world, IEntity owner, double x, double y, double z, float radius, float thickness); /** * Create an energy laser projectile. Not spawned until fire() is called. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @param laserWidth the laser width + * @return the energy laser entity */ IEnergyLaser createLaser(IWorld world, IEntity owner, double x, double y, double z, float laserWidth); @@ -40,12 +70,24 @@ public interface IEnergyController { /** * Create a hazard zone entity with defaults. Not spawned until spawn() is called. * Hazards deal continuous damage to entities within the zone. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @return the energy zone entity */ IEnergyZone createHazard(IWorld world, IEntity owner, double x, double y, double z); /** * Create a trap zone entity with defaults. Not spawned until spawn() is called. * Traps trigger when entities enter and deal burst damage. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @return the energy zone entity */ IEnergyZone createTrap(IWorld world, IEntity owner, double x, double y, double z); @@ -54,6 +96,12 @@ public interface IEnergyController { /** * Create a sweeper entity with defaults. Not spawned until spawn() is called. * Sweepers rotate a beam that damages entities in its path. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @return the energy sweeper entity */ IEnergySweeper createSweeper(IWorld world, IEntity owner, double x, double y, double z); @@ -62,6 +110,12 @@ public interface IEnergyController { /** * Create a panel entity with defaults. Not spawned until spawn() is called. * Panels are flat energy barriers that can deal damage on contact. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @return the energy panel entity */ IEnergyPanel createPanel(IWorld world, IEntity owner, double x, double y, double z); @@ -69,7 +123,14 @@ public interface IEnergyController { /** * Create an energy explosion entity. Not spawned until spawn() is called. - * Visual-only by default. Set damage > 0 to enable area damage with falloff. + * Visual-only by default. Set damage > 0 to enable area damage with falloff. + * @param world the world + * @param owner the owning entity + * @param x X position + * @param y Y position + * @param z Z position + * @param radius the explosion radius + * @return the energy explosion entity */ IEnergyExplosion createExplosion(IWorld world, IEntity owner, double x, double y, double z, float radius); } diff --git a/java/noppes/npcs/api/INbt.java b/java/noppes/npcs/api/INbt.java index 234befa..485e3f5 100644 --- a/java/noppes/npcs/api/INbt.java +++ b/java/noppes/npcs/api/INbt.java @@ -30,10 +30,12 @@ import net.minecraft.nbt.NBTTagCompound; public interface INbt { /** * Returns the tag with the given key from the compound tag. + * @param key the NBT key */ void remove(String key); /** + * @param key the NBT key * @return True if the compound tag has a tag with the given key. */ boolean has(String key); @@ -82,12 +84,16 @@ public interface INbt { * Returns a tag list of objects with this key in the compound tag. All the objects in the list * will always be of the same type. * + * @param key the NBT key + * @param value the list type * @return The tag list of objects, depending on the tag type. */ Object[] getList(String key, int value); /** * Returns the type of the tag list with this key, as an integer. + * @param key the NBT key + * @return the list element type */ int getListType(String key); @@ -112,6 +118,7 @@ public interface INbt { /** * + * @param key the NBT key * @return The type of the tag with the input key as an integer. */ int getType(String key); diff --git a/java/noppes/npcs/api/IPixelmonPlayerData.java b/java/noppes/npcs/api/IPixelmonPlayerData.java index 63abb2c..0d224ef 100644 --- a/java/noppes/npcs/api/IPixelmonPlayerData.java +++ b/java/noppes/npcs/api/IPixelmonPlayerData.java @@ -2,9 +2,21 @@ package noppes.npcs.api; import noppes.npcs.api.entity.IPixelmon; +/** + * Provides access to a player's Pixelmon data, including party and PC storage. + */ public interface IPixelmonPlayerData { + /** + * Gets the Pixelmon in the specified party slot. + * @param slot the party slot index (0-5) + * @return the Pixelmon in that slot, or null if empty + */ IPixelmon getPartySlot(int slot); + /** + * Gets the total number of Pixelmon stored in the player's PC. + * @return the PC Pixelmon count + */ int countPCPixelmon(); } diff --git a/java/noppes/npcs/api/IPos.java b/java/noppes/npcs/api/IPos.java index 45ba39e..dd69b03 100644 --- a/java/noppes/npcs/api/IPos.java +++ b/java/noppes/npcs/api/IPos.java @@ -19,6 +19,7 @@ public interface IPos { /** * Shifts the IPos up by 1 block and returns the new object. * + * @return the position above */ IPos up(); @@ -32,6 +33,7 @@ public interface IPos { /** * Shifts the IPos down by 1 block and returns the new object. * + * @return the position below */ IPos down(); @@ -45,6 +47,7 @@ public interface IPos { /** * Shifts the IPos north by 1 block and returns the new object. * + * @return the position to the north */ IPos north(); @@ -58,6 +61,7 @@ public interface IPos { /** * Shifts the IPos east by 1 block and returns the new object. * + * @return the position to the east */ IPos east(); @@ -71,6 +75,7 @@ public interface IPos { /** * Shifts the IPos south by 1 block and returns the new object. * + * @return the position to the south */ IPos south(); @@ -84,6 +89,7 @@ public interface IPos { /** * Shifts the IPos west by 1 block and returns the new object. * + * @return the position to the west */ IPos west(); @@ -146,12 +152,17 @@ public interface IPos { /** * Offsets the block by 1 block in the given direction and returns the resulting IPos object * + * @param direction the direction ordinal + * @return the offset position */ IPos offset(int direction); /** * Offsets the block by n blocks in the given direction and returns the resulting IPos object * + * @param direction the direction ordinal + * @param n the distance + * @return the offset position */ IPos offset(int direction, double n); diff --git a/java/noppes/npcs/api/IScreenSize.java b/java/noppes/npcs/api/IScreenSize.java index 07d98af..9f8d281 100644 --- a/java/noppes/npcs/api/IScreenSize.java +++ b/java/noppes/npcs/api/IScreenSize.java @@ -1,12 +1,33 @@ package noppes.npcs.api; +/** + * Represents the scaled screen dimensions of the client display. + */ public interface IScreenSize { + /** + * Gets the scaled screen width in pixels. + * @return the screen width + */ public int getWidth(); + /** + * Gets the scaled screen height in pixels. + * @return the screen height + */ public int getHeight(); + /** + * Gets a pixel value representing the given percentage of the screen width. + * @param percent the percentage of the width (0.0 to 100.0) + * @return the corresponding pixel value + */ public int getWidthPercent(double percent); + /** + * Gets a pixel value representing the given percentage of the screen height. + * @param percent the percentage of the height (0.0 to 100.0) + * @return the corresponding pixel value + */ public int getHeightPercent(double percent); } diff --git a/java/noppes/npcs/api/ISkinOverlay.java b/java/noppes/npcs/api/ISkinOverlay.java index 1f15a85..5d7834d 100644 --- a/java/noppes/npcs/api/ISkinOverlay.java +++ b/java/noppes/npcs/api/ISkinOverlay.java @@ -9,6 +9,7 @@ package noppes.npcs.api; public interface ISkinOverlay { /** * Sets the directory texture of the overlay. Does not support URLs. + * @param texture the texture path */ void setTexture(String texture); @@ -16,6 +17,7 @@ public interface ISkinOverlay { /** * Sets whether this overlay glows in the dark or not. + * @param glow whether to glow */ void setGlow(boolean glow); @@ -23,6 +25,7 @@ public interface ISkinOverlay { /** * Sets whether this overlay blends on top of bottom textures at any alpha value. + * @param blend whether to blend */ void setBlend(boolean blend); @@ -30,6 +33,7 @@ public interface ISkinOverlay { /** * Sets the transparency of the overlay, from 0 to 1. + * @param alpha the alpha value */ void setAlpha(float alpha); @@ -38,6 +42,7 @@ public interface ISkinOverlay { /** * Sets the size of the entire overlay when rendered on the entity. By default, overlays render slightly on top of * the entity's model. + * @param size the overlay size */ void setSize(float size); @@ -49,6 +54,8 @@ public interface ISkinOverlay { /** * Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more. + * @param scaleX horizontal scale + * @param scaleY vertical scale */ void setTextureScale(float scaleX, float scaleY); @@ -59,6 +66,8 @@ public interface ISkinOverlay { /** * Sets the "texture speed" by which the texture shifts on each render tick. Used to create a powered creeper effect! * This does not move the entire overlay, it just moves the position at which the texture begins rendering. + * @param speedX horizontal speed + * @param speedY vertical speed */ void setSpeed(float speedX, float speedY); @@ -68,6 +77,9 @@ public interface ISkinOverlay { /** * Sets the amount in each direction by which the overlay will be offset from the entity. + * @param offsetX horizontal render offset + * @param offsetY vertical render offset + * @param offsetZ depth render offset */ void setOffset(float offsetX, float offsetY, float offsetZ); diff --git a/java/noppes/npcs/api/ITelegraph.java b/java/noppes/npcs/api/ITelegraph.java index 389cddc..63fe339 100644 --- a/java/noppes/npcs/api/ITelegraph.java +++ b/java/noppes/npcs/api/ITelegraph.java @@ -25,9 +25,9 @@ import noppes.npcs.api.entity.IEntity; */ public interface ITelegraph { - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // TYPE - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the telegraph type. @@ -43,143 +43,165 @@ public interface ITelegraph { */ void setType(String type); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // SHAPE PARAMETERS - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the radius (for CIRCLE and RING types). + * @return the circle/ring radius in blocks */ float getRadius(); /** * Set the radius (for CIRCLE and RING types). + * @param radius circle/ring radius in blocks */ void setRadius(float radius); /** * Get the inner radius (for RING type). + * @return the inner radius for RING type in blocks */ float getInnerRadius(); /** * Set the inner radius (for RING type). + * @param innerRadius inner radius for RING type in blocks */ void setInnerRadius(float innerRadius); /** * Get the length (for LINE and CONE types). + * @return the length for LINE/CONE types in blocks */ float getLength(); /** * Set the length (for LINE and CONE types). + * @param length length for LINE/CONE types in blocks */ void setLength(float length); /** * Get the width (for LINE type). + * @return the width for LINE type in blocks */ float getWidth(); /** * Set the width (for LINE type). + * @param width width for LINE type in blocks */ void setWidth(float width); /** * Get the angle in degrees (for CONE type). + * @return the arc angle for CONE type in degrees */ float getAngle(); /** * Set the angle in degrees (for CONE type). + * @param angle arc angle for CONE type in degrees */ void setAngle(float angle); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // TIMING - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the duration in ticks. + * @return duration in ticks (20 ticks = 1 second) */ int getDuration(); /** * Set the duration in ticks (20 ticks = 1 second). + * @param ticks duration in ticks (20 ticks = 1 second) */ void setDuration(int ticks); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // COLORS - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the primary color in ARGB format. + * @return the primary color in ARGB format */ int getColor(); /** * Set the primary color in ARGB format. * Example: 0x80FF0000 for semi-transparent red + * @param argb primary color in ARGB format (e.g. 0x80FF0000) */ void setColor(int argb); /** * Get the warning phase color in ARGB format. + * @return the warning phase color in ARGB format */ int getWarningColor(); /** * Set the warning phase color in ARGB format. * This color is used during the final warning phase. + * @param argb warning phase color in ARGB format */ void setWarningColor(int argb); /** * Get the tick at which warning phase begins. + * @return the tick at which warning phase begins */ int getWarningStartTick(); /** * Set the tick at which warning phase begins. * When remaining ticks falls below this value, the telegraph uses the warning color. + * @param tick tick at which warning phase begins */ void setWarningStartTick(int tick); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // ANIMATION - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Check if pulsing animation is enabled. + * @return true if pulsing animation is enabled */ boolean isAnimated(); /** * Enable or disable pulsing animation. + * @param animated whether pulsing animation is enabled */ void setAnimated(boolean animated); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // POSITIONING - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the height offset from ground level. + * @return the height offset from ground level in blocks */ float getHeightOffset(); /** * Set the height offset from ground level. * Default is 0.1 to prevent z-fighting with ground blocks. + * @param offset height offset from ground level in blocks */ void setHeightOffset(float offset); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // SPAWN METHODS - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Spawn this telegraph at a position. diff --git a/java/noppes/npcs/api/ITelegraphInstance.java b/java/noppes/npcs/api/ITelegraphInstance.java index 2421e1a..a21c93e 100644 --- a/java/noppes/npcs/api/ITelegraphInstance.java +++ b/java/noppes/npcs/api/ITelegraphInstance.java @@ -19,46 +19,55 @@ public interface ITelegraphInstance { /** * Get the unique instance ID. + * @return the unique instance identifier */ String getInstanceId(); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // POSITION - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the current X position. + * @return the current X coordinate */ double getX(); /** * Get the current Y position. + * @return the current Y coordinate */ double getY(); /** * Get the current Z position. + * @return the current Z coordinate */ double getZ(); /** * Get the rotation yaw. + * @return the rotation yaw in degrees */ float getYaw(); /** * Set the position. * Note: Only works for static telegraphs (not following an entity). + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate */ void setPosition(double x, double y, double z); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // ENTITY FOLLOWING - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Make this telegraph follow an entity. * The telegraph position will update each tick to match the entity. + * @param entity the entity to follow */ void followEntity(IEntity entity); @@ -69,36 +78,41 @@ public interface ITelegraphInstance { /** * Check if this telegraph is following an entity. + * @return true if currently following an entity */ boolean isFollowing(); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // TIMING - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Get the remaining ticks before the telegraph expires. + * @return remaining ticks before expiration */ int getRemainingTicks(); /** * Get the total duration ticks. + * @return the total duration in ticks */ int getTotalTicks(); /** * Get the progress from 0.0 (just started) to 1.0 (finished). + * @return progress from 0.0 (just started) to 1.0 (finished) */ float getProgress(); /** * Check if the telegraph is in the warning phase. + * @return true if in the warning phase */ boolean isWarning(); - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== // CONTROL - // ═══════════════════════════════════════════════════════════════════════════ + // ========================================================================== /** * Remove this telegraph immediately. diff --git a/java/noppes/npcs/api/ITileEntity.java b/java/noppes/npcs/api/ITileEntity.java index 4443c85..bb2e738 100644 --- a/java/noppes/npcs/api/ITileEntity.java +++ b/java/noppes/npcs/api/ITileEntity.java @@ -29,10 +29,14 @@ public interface ITileEntity { /** * Reads an INbt compound tag, creates a tile entity based on the data, and replaces this entity with the new one. + * @param nbt the NBT data to read from */ void readFromNBT(INbt nbt); /** + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate * @return The distance of this tile entity from the point given by the x, y, and z parameters. */ double getDistanceFrom(double x, double y, double z); @@ -67,6 +71,7 @@ public interface ITileEntity { /** * Writes the tile entity to NBT and returns the compound tag. + * @return the tile entity's NBT data */ INbt getNBT(); } diff --git a/java/noppes/npcs/api/ITimers.java b/java/noppes/npcs/api/ITimers.java index b0da686..2a509ab 100644 --- a/java/noppes/npcs/api/ITimers.java +++ b/java/noppes/npcs/api/ITimers.java @@ -26,6 +26,7 @@ public interface ITimers { /** * + * @param id the timer ID * @return True if the set of timers contains a timer with the given id, false otherwise. */ boolean has(int id); @@ -33,12 +34,14 @@ public interface ITimers { /** * Stops the timer with the given id * + * @param id the timer ID * @return True if there was a timer with the given id. */ boolean stop(int id); /** * Resets the ticks elapsed in the timer with the given id to 0. + * @param id the timer ID */ void reset(int id); @@ -48,6 +51,7 @@ public interface ITimers { void clear(); /** + * @param id the timer ID * @return The amount of ticks elapsed in the timer. */ int ticks(int id); @@ -55,27 +59,34 @@ public interface ITimers { /** * Sets the amount of ticks elapsed in the timer with the given id to a different value. * + * @param id the timer ID * @param ticks The new ticks elapsed by the timer. */ void setTicks(int id, int ticks); /** + * @param id the timer ID * @return The maximum amount of ticks the timer with the given id runs for before it stops. */ int maxTicks(int id); /** * Sets the maximum amount of ticks the timer with the given id can run for before it stops. + * @param id the timer ID + * @param maxTicks the maximum tick count */ void setMaxTicks(int id, int maxTicks); /** + * @param id the timer ID * @return True if the timer with the given id repeats, false otherwise. */ boolean repeats(int id); /** * Sets whether the timer with the given id repeats or not. + * @param id the timer ID + * @param repeat whether the timer repeats */ void setRepeats(int id, boolean repeat); diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index 591b1e6..23a327f 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -33,13 +33,14 @@ public interface IWorld { public IBlock getBlock(int x, int y, int z); /** - * @param pos + * @param pos the block position * @return The block at the given position. Returns null if there isn't a block */ public IBlock getBlock(IPos pos); /** - * + * @param x X coordinate + * @param z Z coordinate * @return The top-most block in the world as an IBlock object. */ IBlock getTopBlock(int x, int z); @@ -71,20 +72,27 @@ public interface IWorld { boolean canSnowAtBody(int x, int y, int z, boolean checkLight); /** - * @return The Y-value of the world at this x & z value based on the height map of the world. + * @param x X coordinate + * @param z Z coordinate + * @return The Y-value of the world at this x & z value based on the height map of the world. */ int getHeightValue(int x, int z); int getHeightValue(IPos pos); /** - * @return The minimum Y-value of the world at this x & z value based on the height map of the world. + * @param x X coordinate + * @param z Z coordinate + * @return The minimum Y-value of the world at this x & z value based on the height map of the world. */ int getChunkHeightMapMinimum(int x, int z); int getChunkHeightMapMinimum(IPos pos); /** + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate * @return The metadata of the block at this position. */ int getBlockMetadata(int x, int y, int z); @@ -96,15 +104,15 @@ public interface IWorld { boolean setBlockMetadataWithNotify(IPos pos, int metadata, int flag); /** - * @param x - * @param y - * @param z + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate * @return can the block at this position see the sky or are there no blocks above this one */ boolean canSeeSky(int x, int y, int z); /** - * @param pos + * @param pos the block position * @return can the block at this position see the sky or are there no blocks above this one */ boolean canSeeSky(IPos pos); @@ -162,6 +170,11 @@ public interface IWorld { /** * Sets the block's tile entity at the given position. + * + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate + * @param tileEntity the tile entity to place */ void setTileEntity(int x, int y, int z, ITileEntity tileEntity); @@ -169,13 +182,19 @@ public interface IWorld { /** * Removes the block's tile entity at the given position. + * + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate */ void removeTileEntity(int x, int y, int z); void removeTileEntity(IPos pos); /** - * + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate * @return True if the block at this position is of cubic shape. (Not a stair, slab, etc.) */ boolean isBlockFullCube(int x, int y, int z); @@ -212,6 +231,7 @@ public interface IWorld { * @param y World position y * @param z World position z * @param item The block to be set + * @return true if the block was successfully placed */ boolean setBlock(int x, int y, int z, IItemStack item); @@ -222,6 +242,7 @@ public interface IWorld { * @param y World position y * @param z World position z * @param block The block to be set + * @return true if the block was successfully placed */ boolean setBlock(int x, int y, int z, IBlock block); @@ -255,9 +276,12 @@ public interface IWorld { /** * starting at the start position, draw a line in the lookVector direction until a block is detected * - * @param startPos + * @param startPos the ray origin as [x, y, z] * @param lookVector should be a normalized direction vector - * @param maxDistance + * @param maxDistance maximum ray distance in blocks + * @param stopOnBlock whether to stop on solid blocks + * @param stopOnLiquid whether to stop on liquid blocks + * @param stopOnCollision whether to stop on collision boundaries * @return the first detected block but null if maxDistance is reached */ IBlock rayCastBlock(double[] startPos, double[] lookVector, int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision); @@ -269,8 +293,8 @@ public interface IWorld { IBlock rayCastBlock(IPos startPos, IPos lookVector, int maxDistance); /** - * @param startPos - * @param maxHeight + * @param startPos the start position as [x, y, z] + * @param maxHeight maximum search height * @return the position of the closest block of air to startPos */ public IPos getNearestAir(IPos startPos, int maxHeight); @@ -457,6 +481,7 @@ public interface IWorld { * @param y Spawn Y position * @param z Spawn Z position * @param size Orb size + * @return the energy orb entity */ IEnergyOrb createEnergyOrb(IEntity owner, double x, double y, double z, float size); @@ -469,6 +494,7 @@ public interface IWorld { * @param z Spawn Z position * @param beamWidth Width of the beam * @param headSize Size of the beam head + * @return the energy beam entity */ IEnergyBeam createEnergyBeam(IEntity owner, double x, double y, double z, float beamWidth, float headSize); @@ -481,6 +507,7 @@ public interface IWorld { * @param z Spawn Z position * @param radius Disc radius * @param thickness Disc thickness + * @return the energy disc entity */ IEnergyDisc createEnergyDisc(IEntity owner, double x, double y, double z, float radius, float thickness); @@ -492,6 +519,7 @@ public interface IWorld { * @param y Spawn Y position * @param z Spawn Z position * @param laserWidth Width of the laser + * @return the energy laser entity */ IEnergyLaser createEnergyLaser(IEntity owner, double x, double y, double z, float laserWidth); diff --git a/java/noppes/npcs/api/ability/IAbility.java b/java/noppes/npcs/api/ability/IAbility.java index 6c5dcbb..456db39 100644 --- a/java/noppes/npcs/api/ability/IAbility.java +++ b/java/noppes/npcs/api/ability/IAbility.java @@ -12,6 +12,7 @@ public interface IAbility extends IAbilityAction { /** * Get the unique ID (UUID for custom abilities, registry key for built-in). * This is the stable reference that never changes after creation. + * @return the unique ability ID */ String getId(); @@ -34,6 +35,7 @@ public interface IAbility extends IAbilityAction { /** * Get the display name (cosmetic). Falls back to getName() if not set. + * @return the display name */ String getDisplayName(); @@ -45,6 +47,7 @@ public interface IAbility extends IAbilityAction { /** * Get the type ID of this ability (e.g., "cnpc:slam", "cnpc:beam"). + * @return the type ID */ String getTypeId(); @@ -106,6 +109,7 @@ public interface IAbility extends IAbilityAction { /** * Get the wind-up time in ticks (telegraph phase). + * @return wind-up time in ticks */ int getWindUpTicks(); @@ -117,6 +121,7 @@ public interface IAbility extends IAbilityAction { /** * Get the dazed time in ticks (stun after interrupt during WINDUP). + * @return dazed time in ticks */ int getDazedTicks(); @@ -128,6 +133,7 @@ public interface IAbility extends IAbilityAction { /** * Check if this ability can be interrupted by damage. + * @return true if interruptible */ boolean isInterruptible(); @@ -139,6 +145,7 @@ public interface IAbility extends IAbilityAction { /** * Check if this ability ignores target invulnerability frames (hurt resistance). + * @return true if ignoring invulnerability frames */ boolean isIgnoreIFrames(); @@ -193,6 +200,7 @@ public interface IAbility extends IAbilityAction { /** * Get track speed for TRACK rotation mode (blocks/second). * 0 = instant tracking. Comparable to player sprint speed (~5.6 blocks/sec). + * @return track speed in blocks/second */ float getTrackSpeedValue(); @@ -205,36 +213,43 @@ public interface IAbility extends IAbilityAction { /** * Check if movement (pathfinding/motion) is locked during the WINDUP phase. + * @return true if movement is locked during windup */ boolean isMovementLockedDuringWindup(); /** * Check if movement (pathfinding/motion) is locked during the ACTIVE phase. + * @return true if movement is locked during active phase */ boolean isMovementLockedDuringActive(); /** * Check if rotation (yaw/pitch) is locked during the WINDUP phase. + * @return true if rotation is locked during windup */ boolean isRotationLockedDuringWindup(); /** * Check if rotation (yaw/pitch) is locked during the ACTIVE phase. + * @return true if rotation is locked during active phase */ boolean isRotationLockedDuringActive(); /** * Check if this ability is currently being executed. + * @return true if currently executing */ boolean isExecuting(); /** * Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=DAZED, 4=BURST_DELAY). + * @return the current phase ordinal */ int getPhaseInt(); /** * Get the current tick within the current phase. + * @return the current tick within the phase */ int getCurrentTick(); @@ -254,6 +269,7 @@ public interface IAbility extends IAbilityAction { /** * Check if this ability ignores cooldowns. + * @return true if ignoring cooldowns */ boolean isIgnoreCooldown(); @@ -266,6 +282,7 @@ public interface IAbility extends IAbilityAction { /** * Check if this ability uses per-ability cooldown instead of global cooldown. * When true, using this ability only puts THIS ability on cooldown, not all abilities. + * @return true if using per-ability cooldown */ boolean isPerAbilityCooldown(); @@ -277,6 +294,7 @@ public interface IAbility extends IAbilityAction { /** * Get this ability's data as NBT. + * @return the ability's NBT data */ INbt getNbt(); @@ -322,12 +340,14 @@ public interface IAbility extends IAbilityAction { /** * Check if this ability is toggleable (has at least 1 toggle state). + * @return true if toggleable */ boolean isToggleable(); /** * Get the number of toggle states. * 0 = not toggleable, 1 = binary on/off, 2+ = multi-state cycling. + * @return number of toggle states */ int getToggleStates(); diff --git a/java/noppes/npcs/api/ability/IAbilityHandler.java b/java/noppes/npcs/api/ability/IAbilityHandler.java index b3ae328..0ccacf1 100644 --- a/java/noppes/npcs/api/ability/IAbilityHandler.java +++ b/java/noppes/npcs/api/ability/IAbilityHandler.java @@ -17,17 +17,25 @@ public interface IAbilityHandler { /** * Check if an ability type is registered. + * + * @param typeId the type ID to check + * @return true if registered */ boolean hasType(String typeId); /** * Get all registered ability type IDs. + * + * @return array of registered type IDs */ String[] getTypes(); /** * Create a new ability of the given type. * Returns null if the type is not registered. + * + * @param typeId the type ID + * @return the new ability, or null */ IAbility create(String typeId); diff --git a/java/noppes/npcs/api/ability/ICustomAbility.java b/java/noppes/npcs/api/ability/ICustomAbility.java index 631dcf4..616a96f 100644 --- a/java/noppes/npcs/api/ability/ICustomAbility.java +++ b/java/noppes/npcs/api/ability/ICustomAbility.java @@ -8,11 +8,13 @@ public interface ICustomAbility extends IAbility { /** * Get the duration in ticks for instant mode (non-toggle). + * @return duration in ticks */ int getDurationTicks(); /** * Set the duration in ticks for instant mode. + * @param ticks duration in ticks */ void setDurationTicks(int ticks); @@ -43,72 +45,86 @@ public interface ICustomAbility extends IAbility { /** * Get how many ticks the telegraph persists during the active phase. * When syncTelegraphWithDuration is true, this returns the duration ticks. + * @return telegraph active ticks */ int getTelegraphActiveTicks(); /** * Set how many ticks the telegraph persists during the active phase. * Only used when syncTelegraphWithDuration is false. + * @param ticks telegraph active ticks */ void setTelegraphActiveTicks(int ticks); /** * Whether telegraph active ticks are synced to the ability duration. + * @return true if synced */ boolean isSyncTelegraphWithDuration(); /** * Set whether telegraph active ticks should sync to the ability duration. + * @param sync whether to sync */ void setSyncTelegraphWithDuration(boolean sync); /** * Get the telegraph radius (used by CIRCLE, RING, SQUARE shapes). + * @return the telegraph radius */ float getTelegraphRadius(); /** * Set the telegraph radius. + * @param radius the telegraph radius */ void setTelegraphRadius(float radius); /** * Get the telegraph inner radius (used by RING, CONE shapes). + * @return the inner radius */ float getTelegraphInnerRadius(); /** * Set the telegraph inner radius. + * @param innerRadius the inner radius */ void setTelegraphInnerRadius(float innerRadius); /** * Get the telegraph length (used by LINE, CONE shapes). + * @return the telegraph length */ float getTelegraphLength(); /** * Set the telegraph length. + * @param length the telegraph length */ void setTelegraphLength(float length); /** * Get the telegraph width (used by LINE shape). + * @return the telegraph width */ float getTelegraphWidth(); /** * Set the telegraph width. + * @param width the telegraph width */ void setTelegraphWidth(float width); /** * Get the telegraph angle in degrees (used by CONE shape). + * @return the telegraph angle in degrees */ float getTelegraphAngle(); /** * Set the telegraph angle in degrees. + * @param angle the angle in degrees */ void setTelegraphAngle(float angle); } diff --git a/java/noppes/npcs/api/ability/IDataAbilities.java b/java/noppes/npcs/api/ability/IDataAbilities.java index 9a3feb0..4345cd5 100644 --- a/java/noppes/npcs/api/ability/IDataAbilities.java +++ b/java/noppes/npcs/api/ability/IDataAbilities.java @@ -8,54 +8,78 @@ public interface IDataAbilities { /** * Check if the ability system is enabled for this NPC. + * + * @return true if enabled */ boolean isEnabled(); /** * Enable or disable the ability system for this NPC. + * + * @param enabled whether to enable */ void setEnabled(boolean enabled); /** * Get all abilities assigned to this NPC (resolved from slots). * Returns safe deep copies. Use {@link #getSourceAbility(String)} for live references. + * + * @return array of abilities */ IAbility[] getAbilities(); /** * Add an inline ability to this NPC. + * + * @param ability the ability to add */ void addAbility(IAbility ability); /** * Add a reference ability by key (built-in name or custom UUID). + * + * @param key the ability reference key */ void addAbilityReference(String key); /** * Remove an ability by ID. + * + * @param abilityId the ability ID to remove */ void removeAbility(String abilityId); /** * Get an ability by ID. * Returns a safe deep copy. Use {@link #getSourceAbility(String)} for the live reference. + * + * @param abilityId the ability ID + * @return the ability, or null */ IAbility getAbility(String abilityId); /** * Check if the NPC has an ability with the given ID. + * + * @param abilityId the ability ID + * @return true if found */ boolean hasAbility(String abilityId); /** * Check if a slot is a reference (by ability ID). + * + * @param abilityId the ability ID + * @return true if reference */ boolean isAbilityReference(String abilityId); /** * Convert a reference slot to inline (by ability ID). * Returns false if the reference cannot be resolved. + * + * @param abilityId the ability ID + * @return true if converted successfully */ boolean convertToInline(String abilityId); @@ -67,11 +91,15 @@ public interface IDataAbilities { /** * Get the currently executing ability, or null if none. * Returns a safe deep copy. Use {@link #getSourceCurrentAbility()} for the live reference. + * + * @return the current ability, or null */ IAbility getCurrentAbility(); /** * Check if any ability is currently executing. + * + * @return true if executing */ boolean isExecutingAbility(); @@ -87,11 +115,15 @@ public interface IDataAbilities { /** * Get the global cooldown timer in ticks. + * + * @return cooldown in ticks */ int getGlobalCooldown(); /** * Set the global cooldown timer in ticks. + * + * @param ticks cooldown in ticks */ void setGlobalCooldown(int ticks); diff --git a/java/noppes/npcs/api/ability/IPlayerAbilityData.java b/java/noppes/npcs/api/ability/IPlayerAbilityData.java index ece63ee..1dad19e 100644 --- a/java/noppes/npcs/api/ability/IPlayerAbilityData.java +++ b/java/noppes/npcs/api/ability/IPlayerAbilityData.java @@ -10,6 +10,8 @@ public interface IPlayerAbilityData { /** * Get all unlocked ability keys. + * + * @return array of ability keys */ String[] getUnlockedAbilities(); @@ -22,26 +24,37 @@ public interface IPlayerAbilityData { /** * Lock (remove) an ability from this player. + * + * @param key the ability key */ void lockAbility(String key); /** * Check if the player has unlocked a specific ability. + * + * @param key the ability key + * @return true if unlocked */ boolean hasUnlockedAbility(String key); /** * Get the currently selected ability index. + * + * @return the selected index */ int getSelectedIndex(); /** * Set the selected ability index. + * + * @param index the ability index */ void setSelectedIndex(int index); /** * Get the key of the currently selected ability. + * + * @return the selected ability key */ String getSelectedAbilityKey(); @@ -57,11 +70,15 @@ public interface IPlayerAbilityData { /** * Check if the player is currently executing an ability. + * + * @return true if executing */ boolean isExecutingAbility(); /** * Get the currently executing ability. + * + * @return the current ability, or null */ IAbility getCurrentAbility(); @@ -77,6 +94,8 @@ public interface IPlayerAbilityData { /** * Check if the player is on universal cooldown. + * + * @return true if on cooldown */ boolean isOnCooldown(); @@ -107,11 +126,16 @@ public interface IPlayerAbilityData { /** * Activate the currently selected ability. + * + * @return true if activated */ boolean activateAbility(); /** * Activate a specific ability by key. + * + * @param key the ability key + * @return true if activated */ boolean activateAbility(String key); @@ -119,24 +143,33 @@ public interface IPlayerAbilityData { /** * Cycle a toggle ability to its next state. - * Off -> State 1 -> State 2 -> ... -> State N -> Off + * Off -> State 1 -> State 2 -> ... -> State N -> Off + * @param key the ability key * @return The new state (0 = off, 1+ = active state number) */ int toggleAbility(String key); /** * Get the current toggle state for an ability. + * + * @param key the ability key * @return 0 if not active, 1+ for active state */ int getToggleState(String key); /** * Set a toggle to a specific state. 0 = deactivate, 1+ = specific state. + * + * @param key the ability key + * @param state the toggle state */ void setToggleState(String key, int state); /** - * Check if a toggle ability is currently active (any state > 0). + * Check if a toggle ability is currently active (any state > 0). + * + * @param key the ability key + * @return true if toggled on */ boolean isAbilityToggled(String key); } diff --git a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java index fb8b1c2..5abdbfc 100644 --- a/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java +++ b/java/noppes/npcs/api/ability/data/IEnergyAnchorData.java @@ -5,10 +5,13 @@ package noppes.npcs.api.ability.data; * Controls where the projectile spawns relative to the caster. */ public interface IEnergyAnchorData { - /** @return Anchor point ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ + /** @return Anchor point ordinal (0=FRONT, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=ABOVE_HEAD, 5=CHEST, 6=EYE). */ int getAnchor(); - /** Set the anchor point. @param anchor Anchor ordinal (0=FEET, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=HEAD, 5=FRONT, 6=ABOVE_HEAD). */ + /** + * Set the anchor point. + * @param anchor Anchor ordinal (0=FRONT, 1=CENTER, 2=RIGHT_HAND, 3=LEFT_HAND, 4=ABOVE_HEAD, 5=CHEST, 6=EYE) + */ void setAnchor(int anchor); /** @return X offset from the anchor point (positive = right). */ diff --git a/java/noppes/npcs/api/block/IBlockScripted.java b/java/noppes/npcs/api/block/IBlockScripted.java index 213c04d..f97b107 100644 --- a/java/noppes/npcs/api/block/IBlockScripted.java +++ b/java/noppes/npcs/api/block/IBlockScripted.java @@ -79,11 +79,13 @@ public interface IBlockScripted extends IBlock { /** * TYPO VERSION + * @return true if entities can pass through this block */ boolean getIsPassible(); /** * TYPO VERSION + * @param bo whether entities can pass through this block */ void setIsPassible(boolean bo); diff --git a/java/noppes/npcs/api/block/ITextPlane.java b/java/noppes/npcs/api/block/ITextPlane.java index 337bf07..ebed3bf 100644 --- a/java/noppes/npcs/api/block/ITextPlane.java +++ b/java/noppes/npcs/api/block/ITextPlane.java @@ -1,42 +1,103 @@ package noppes.npcs.api.block; +/** + * Represents a text plane that can be positioned, rotated, and scaled on a block. + */ public interface ITextPlane { + /** + * Gets the text displayed on this plane. + * @return the display text + */ public String getText(); + /** + * Sets the text displayed on this plane. + * @param text the display text to set + */ public void setText(String text); + /** + * Gets the X-axis rotation in degrees. + * @return the X rotation + */ public int getRotationX(); + /** + * Gets the Y-axis rotation in degrees. + * @return the Y rotation + */ public int getRotationY(); + /** + * Gets the Z-axis rotation in degrees. + * @return the Z rotation + */ public int getRotationZ(); + /** + * Sets the X-axis rotation in degrees. + * @param x the X rotation to set + */ public void setRotationX(int x); + /** + * Sets the Y-axis rotation in degrees. + * @param y the Y rotation to set + */ public void setRotationY(int y); /** - * @param z Default: 0.5 + * Sets the Z-axis rotation in degrees. + * @param z the Z rotation to set. Default: 0.5 */ public void setRotationZ(int z); + /** + * Gets the X-axis positional offset. + * @return the X offset + */ public float getOffsetX(); + /** + * Gets the Y-axis positional offset. + * @return the Y offset + */ public float getOffsetY(); + /** + * Gets the Z-axis positional offset. + * @return the Z offset + */ public float getOffsetZ(); + /** + * Sets the X-axis positional offset. + * @param x the X offset to set + */ public void setOffsetX(float x); + /** + * Sets the Y-axis positional offset. + * @param y the Y offset to set + */ public void setOffsetY(float y); + /** + * Sets the Z-axis positional offset. + * @param z the Z offset to set + */ public void setOffsetZ(float z); + /** + * Gets the scale of the text plane. + * @return the scale factor + */ public float getScale(); /** - * @param scale Default: 1 + * Sets the scale of the text plane. + * @param scale the scale factor to set. Default: 1 */ public void setScale(float scale); } diff --git a/java/noppes/npcs/api/entity/IArrow.java b/java/noppes/npcs/api/entity/IArrow.java index dcd23d7..276e213 100644 --- a/java/noppes/npcs/api/entity/IArrow.java +++ b/java/noppes/npcs/api/entity/IArrow.java @@ -9,9 +9,20 @@ import net.minecraft.entity.projectile.EntityArrow; */ public interface IArrow extends IEntity { + /** + * Gets the entity that shot this arrow. + * @return the shooter entity, or null if none + */ IEntity getShooter(); + /** + * Gets the base damage of this arrow. + * @return the damage value + */ double getDamage(); + /** + * Removes this arrow from the world. + */ void kill(); } diff --git a/java/noppes/npcs/api/entity/IEnergyBarrier.java b/java/noppes/npcs/api/entity/IEnergyBarrier.java index 36999cf..724364d 100644 --- a/java/noppes/npcs/api/entity/IEnergyBarrier.java +++ b/java/noppes/npcs/api/entity/IEnergyBarrier.java @@ -63,6 +63,7 @@ public interface IEnergyBarrier extends IEnergyAbility { /** * Returns the barrier type: 0=Dome, 1=Panel + * @return the barrier type ordinal */ int getBarrierType(); diff --git a/java/noppes/npcs/api/entity/IEnergyBeam.java b/java/noppes/npcs/api/entity/IEnergyBeam.java index 7d9d739..c18c250 100644 --- a/java/noppes/npcs/api/entity/IEnergyBeam.java +++ b/java/noppes/npcs/api/entity/IEnergyBeam.java @@ -13,7 +13,10 @@ import net.minecraft.entity.Entity; */ public interface IEnergyBeam extends IEnergyProjectile { - /** Width of the beam trail. */ + /** + * Width of the beam trail. + * @return the beam width in blocks + */ float getBeamWidth(); void setBeamWidth(float width); diff --git a/java/noppes/npcs/api/entity/IEnergyDisc.java b/java/noppes/npcs/api/entity/IEnergyDisc.java index 17b27df..7e19791 100644 --- a/java/noppes/npcs/api/entity/IEnergyDisc.java +++ b/java/noppes/npcs/api/entity/IEnergyDisc.java @@ -10,7 +10,10 @@ import net.minecraft.entity.Entity; */ public interface IEnergyDisc extends IEnergyProjectile { - /** Radius of the disc. */ + /** + * Radius of the disc. + * @return the disc radius in blocks + */ float getDiscRadius(); void setDiscRadius(float radius); diff --git a/java/noppes/npcs/api/entity/IEnergyDome.java b/java/noppes/npcs/api/entity/IEnergyDome.java index 0a6fcbf..20c6492 100644 --- a/java/noppes/npcs/api/entity/IEnergyDome.java +++ b/java/noppes/npcs/api/entity/IEnergyDome.java @@ -7,7 +7,9 @@ import net.minecraft.entity.Entity; */ public interface IEnergyDome extends IEnergyBarrier { + /** @return The radius of the dome in blocks. */ float getDomeRadius(); + /** @param radius The radius of the dome in blocks. */ void setDomeRadius(float radius); } diff --git a/java/noppes/npcs/api/entity/IEnergyExplosion.java b/java/noppes/npcs/api/entity/IEnergyExplosion.java index 6121dc9..2a9fe91 100644 --- a/java/noppes/npcs/api/entity/IEnergyExplosion.java +++ b/java/noppes/npcs/api/entity/IEnergyExplosion.java @@ -8,7 +8,7 @@ import noppes.npcs.api.INbt; * Created via {@link noppes.npcs.api.IEnergyController#createExplosion}. * Configure visual/damage properties, then call {@link #spawn()} to place in the world. * - * When damage is set (> 0), the explosion will deal area damage on the first tick + * When damage is set (> 0), the explosion will deal area damage on the first tick * with distance-based falloff, routing through energy damage handlers for addon integration. */ public interface IEnergyExplosion extends IEnergyAbility { @@ -29,7 +29,7 @@ public interface IEnergyExplosion extends IEnergyAbility { /** @return Base damage dealt at the center. 0 means visual-only. */ float getDamage(); - /** @param damage Base damage at the center. Setting > 0 enables damage. */ + /** @param damage Base damage at the center. Setting > 0 enables damage. */ void setDamage(float damage); /** @return Base knockback strength. */ @@ -54,7 +54,7 @@ public interface IEnergyExplosion extends IEnergyAbility { /** * Spawn this explosion entity into the world. - * Sends the visual to nearby clients and, if damage > 0, applies area damage on the first tick. + * Sends the visual to nearby clients and, if damage > 0, applies area damage on the first tick. */ void spawn(); } diff --git a/java/noppes/npcs/api/entity/IEnergyLaser.java b/java/noppes/npcs/api/entity/IEnergyLaser.java index 844b1c0..432ab8b 100644 --- a/java/noppes/npcs/api/entity/IEnergyLaser.java +++ b/java/noppes/npcs/api/entity/IEnergyLaser.java @@ -14,7 +14,10 @@ import net.minecraft.entity.Entity; */ public interface IEnergyLaser extends IEnergyProjectile { - /** Width of the laser beam. */ + /** + * Width of the laser beam. + * @return the laser width in blocks + */ float getLaserWidth(); void setLaserWidth(float width); diff --git a/java/noppes/npcs/api/entity/IEnergyPanel.java b/java/noppes/npcs/api/entity/IEnergyPanel.java index 6371973..daa97cc 100644 --- a/java/noppes/npcs/api/entity/IEnergyPanel.java +++ b/java/noppes/npcs/api/entity/IEnergyPanel.java @@ -21,6 +21,7 @@ public interface IEnergyPanel extends IEnergyBarrier { /** * Panel mode: 0=PLACED, 1=HELD, 2=LAUNCHED + * @return the panel mode ordinal */ int getPanelMode(); diff --git a/java/noppes/npcs/api/entity/IEnergyProjectile.java b/java/noppes/npcs/api/entity/IEnergyProjectile.java index 0a339e3..fd93d65 100644 --- a/java/noppes/npcs/api/entity/IEnergyProjectile.java +++ b/java/noppes/npcs/api/entity/IEnergyProjectile.java @@ -23,7 +23,10 @@ public interface IEnergyProjectile extends IEnergyAbility { // ==================== OWNER & TARGET ==================== - /** Sets the owner entity (used for homing return, damage attribution, etc.). */ + /** + * Sets the owner entity (used for homing return, damage attribution, etc.). + * @param owner the entity that owns this projectile + */ void setOwner(IEntity owner); /** @return the entity ID of the current homing/tracking target, or -1 if none */ @@ -32,7 +35,10 @@ public interface IEnergyProjectile extends IEnergyAbility { /** @return the current homing/tracking target entity, or null if none */ IEntity getTarget(); - /** Sets the homing/tracking target entity. Pass null to clear. */ + /** + * Sets the homing/tracking target entity. Pass null to clear. + * @param target the entity to home towards + */ void setTarget(IEntity target); // ==================== SIZE ==================== @@ -40,7 +46,10 @@ public interface IEnergyProjectile extends IEnergyAbility { /** @return the projectile's visual and collision size */ float getSize(); - /** Sets the projectile's visual and collision size. */ + /** + * Sets the projectile's visual and collision size. + * @param size the projectile size + */ void setSize(float size); // ==================== DISPLAY (PROJECTILE-SPECIFIC) ==================== diff --git a/java/noppes/npcs/api/entity/IEnergySlicer.java b/java/noppes/npcs/api/entity/IEnergySlicer.java index 7a20182..5eb0478 100644 --- a/java/noppes/npcs/api/entity/IEnergySlicer.java +++ b/java/noppes/npcs/api/entity/IEnergySlicer.java @@ -9,7 +9,10 @@ import net.minecraft.entity.Entity; */ public interface IEnergySlicer extends IEnergyProjectile { - /** Width of the slicer blade. */ + /** + * Width of the slicer blade. + * @return the width of each slice in blocks + */ float getSliceWidth(); void setSliceWidth(float width); diff --git a/java/noppes/npcs/api/entity/IEnergySweeper.java b/java/noppes/npcs/api/entity/IEnergySweeper.java index 334679e..da0f545 100644 --- a/java/noppes/npcs/api/entity/IEnergySweeper.java +++ b/java/noppes/npcs/api/entity/IEnergySweeper.java @@ -11,35 +11,53 @@ public interface IEnergySweeper extends IEnergyAbility { // ==================== BEAM DIMENSIONS ==================== + /** @return Length of the sweeping beam in blocks. */ float getBeamLength(); + /** @param length Beam length in blocks. */ void setBeamLength(float length); + /** @return Width of the sweeping beam in blocks. */ float getBeamWidth(); + /** @param width Beam width in blocks. */ void setBeamWidth(float width); + /** @return Height of the sweeping beam in blocks. */ float getBeamHeight(); + /** @param height Beam height in blocks. */ void setBeamHeight(float height); // ==================== ROTATION ==================== + /** @return Rotation speed of the sweep in degrees per tick. */ float getSweepSpeed(); + /** @param degreesPerTick Sweep rotation speed in degrees per tick. */ void setSweepSpeed(float degreesPerTick); + /** @return Number of full rotations the beam completes before stopping. */ int getNumberOfRotations(); + /** @param rotations Number of full rotations. */ void setNumberOfRotations(int rotations); + /** @return Whether the beam pivot tracks the target instead of rotating freely. */ boolean isLockOnTarget(); + /** @param lock Whether the beam locks on to the target. */ void setLockOnTarget(boolean lock); // ==================== DAMAGE ==================== + /** @return Damage dealt per hit to entities caught in the beam. */ float getDamage(); + /** @param damage Damage per hit. */ void setDamage(float damage); + /** @return Interval in ticks between damage applications to the same target. */ int getDamageInterval(); + /** @param ticks Damage interval in ticks. */ void setDamageInterval(int ticks); + /** @return Whether the beam can hit through multiple targets. */ boolean isPiercing(); + /** @param piercing Whether the beam pierces through targets. */ void setPiercing(boolean piercing); // ==================== SPAWNING ==================== diff --git a/java/noppes/npcs/api/entity/IEnergyZone.java b/java/noppes/npcs/api/entity/IEnergyZone.java index 35235fc..2dad28a 100644 --- a/java/noppes/npcs/api/entity/IEnergyZone.java +++ b/java/noppes/npcs/api/entity/IEnergyZone.java @@ -90,10 +90,16 @@ public interface IEnergyZone extends IEntity { // ==================== CUSTOM DAMAGE DATA ==================== - /** Get custom damage data for addon handler routing (e.g. DBC damage stats). */ + /** + * Get custom damage data for addon handler routing (e.g. DBC damage stats). + * @return the zone's damage configuration as NBT + */ noppes.npcs.api.INbt getDamageData(); - /** Set custom damage data for addon handler routing. */ + /** + * Set custom damage data for addon handler routing. + * @param data the damage configuration NBT + */ void setDamageData(noppes.npcs.api.INbt data); // ==================== SPAWNING ==================== diff --git a/java/noppes/npcs/api/entity/IEntityLivingBase.java b/java/noppes/npcs/api/entity/IEntityLivingBase.java index fe5bb06..9f7c30c 100644 --- a/java/noppes/npcs/api/entity/IEntityLivingBase.java +++ b/java/noppes/npcs/api/entity/IEntityLivingBase.java @@ -437,6 +437,11 @@ public interface IEntityLivingBase extends IEntity extends IEntity { + /** + * Returns the player who cast this fish hook. + * + * @return the casting player, or null if none. + */ IPlayer getCaster(); + /** + * Removes this fish hook entity from the world. + */ void kill(); } diff --git a/java/noppes/npcs/api/entity/IPlayer.java b/java/noppes/npcs/api/entity/IPlayer.java index 328555a..961bf86 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -684,6 +684,11 @@ public interface IPlayer extends IEntityLivingBase, IActionManager getActionManager(); + /** + * Returns the members of the player's current party, excluding the player. + * + * @return an array of party members, or an empty array if the player is not in a party. + */ IPlayer[] getPartyMembers(); // ========================================= diff --git a/java/noppes/npcs/api/entity/IThrowable.java b/java/noppes/npcs/api/entity/IThrowable.java index 1321c26..a78e9d8 100644 --- a/java/noppes/npcs/api/entity/IThrowable.java +++ b/java/noppes/npcs/api/entity/IThrowable.java @@ -9,7 +9,15 @@ import net.minecraft.entity.projectile.EntityThrowable; */ public interface IThrowable extends IEntity { + /** + * Returns the entity that threw this throwable. + * + * @return the thrower, or null if unknown. + */ IEntityLivingBase getThrower(); + /** + * Removes this throwable entity from the world. + */ void kill(); } diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index ee47885..75adaa4 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -15,26 +15,31 @@ public interface IAbilityEvent extends INpcEvent { /** * Get the entity executing the ability (NPC or Player). + * @return the entity executing the ability */ IEntityLivingBase getEntity(); /** * Get the player executing the ability, or null if the caster is an NPC. + * @return the player executing the ability, or null if NPC */ IPlayer getPlayer(); /** * Whether the entity executing the ability is an NPC. + * @return true if the executor is an NPC */ boolean isNPC(); /** * Get the ability involved in this event. + * @return the ability being executed */ IAbility getAbility(); /** * Get the target of the ability, or null if no target. + * @return the current target entity */ IEntityLivingBase getTarget(); @@ -60,11 +65,13 @@ public interface IAbilityEvent extends INpcEvent { interface InterruptEvent extends IAbilityEvent { /** * Get the damage source that caused the interruption. + * @return the damage source */ IDamageSource getDamageSource(); /** * Get the amount of damage that caused the interruption. + * @return the final damage dealt */ float getDamage(); } @@ -105,36 +112,43 @@ public interface IAbilityEvent extends INpcEvent { interface HitEvent extends IAbilityEvent { /** * Get the entity that was hit by the ability. + * @return the entity that was hit */ IEntityLivingBase getHitEntity(); /** * Get the damage amount. + * @return the damage amount */ float getDamage(); /** * Set the damage amount. Allows scripts to modify damage. + * @param damage the new damage amount */ void setDamage(float damage); /** * Get the horizontal knockback amount. + * @return the knockback strength */ float getKnockback(); /** * Set the horizontal knockback amount. + * @param knockback the new knockback strength */ void setKnockback(float knockback); /** * Get the vertical knockback (upward force) amount. + * @return the upward knockback component */ float getKnockbackUp(); /** * Set the vertical knockback (upward force) amount. + * @param knockbackUp the new upward knockback component */ void setKnockbackUp(float knockbackUp); } @@ -147,11 +161,13 @@ public interface IAbilityEvent extends INpcEvent { /** * Get the current phase of the ability. * 0 = IDLE, 1 = WINDUP, 2 = ACTIVE, 3 = DAZED, 4 = BURST_DELAY + * @return the current ability phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=DAZED, 4=BURST_DELAY) */ int getAbilityPhase(); /** * Get the current tick count within the phase. + * @return the current tick within the phase */ int getTick(); } diff --git a/java/noppes/npcs/api/event/IAnimationEvent.java b/java/noppes/npcs/api/event/IAnimationEvent.java index e5ce165..31d607c 100644 --- a/java/noppes/npcs/api/event/IAnimationEvent.java +++ b/java/noppes/npcs/api/event/IAnimationEvent.java @@ -6,15 +6,22 @@ import noppes.npcs.api.handler.data.IAnimation; import noppes.npcs.api.handler.data.IAnimationData; import noppes.npcs.api.handler.data.IFrame; +/** + * Events fired during entity animation playback. + */ public interface IAnimationEvent extends ICustomNPCsEvent { + /** @return the animation being played. */ IAnimation getAnimation(); + /** @return the animation data managing the playback. */ IAnimationData getAnimationData(); + /** @return the animatable entity playing the animation. */ IAnimatable getEntity(); /** + * Fired when an animation starts playing. Cancelable. * @hookName animationStart */ @Cancelable @@ -23,16 +30,20 @@ public interface IAnimationEvent extends ICustomNPCsEvent { } /** + * Fired when an animation finishes playing. * @hookName animationEnd */ interface Ended extends IAnimationEvent { } + /** Events fired when animation frames are entered or exited. */ interface IFrameEvent extends IAnimationEvent { + /** @return the frame index. */ int getIndex(); + /** @return the frame data. */ IFrame getFrame(); /** diff --git a/java/noppes/npcs/api/event/IBlockEvent.java b/java/noppes/npcs/api/event/IBlockEvent.java index 67bece3..f3e2046 100644 --- a/java/noppes/npcs/api/event/IBlockEvent.java +++ b/java/noppes/npcs/api/event/IBlockEvent.java @@ -6,7 +6,11 @@ import noppes.npcs.api.IPos; import noppes.npcs.api.entity.IEntity; import noppes.npcs.api.entity.IPlayer; +/** + * Events fired for scripted blocks, including interactions, redstone, and entity collisions. + */ public interface IBlockEvent extends ICustomNPCsEvent { + /** @return the scripted block associated with this event. */ IBlock getBlock(); /** diff --git a/java/noppes/npcs/api/event/IChainEvent.java b/java/noppes/npcs/api/event/IChainEvent.java index 7ab8fae..3829caf 100644 --- a/java/noppes/npcs/api/event/IChainEvent.java +++ b/java/noppes/npcs/api/event/IChainEvent.java @@ -15,36 +15,43 @@ public interface IChainEvent extends ICustomNPCsEvent { /** * Get the entity executing the chain (NPC or Player). + * @return the entity executing the chain */ IEntityLivingBase getEntity(); /** * Get the player executing the chain, or null if the caster is an NPC. + * @return the player executing the chain, or null if NPC */ IPlayer getPlayer(); /** * Get the NPC executing the chain, or null if the caster is a player. + * @return the NPC executing the chain, or null if player */ ICustomNpc getNpc(); /** * Whether the entity executing the chain is an NPC. + * @return true if the executor is an NPC */ boolean isNPC(); /** * Get the chained ability being executed. + * @return the chained ability being executed */ IChainedAbility getChain(); /** * Get the target of the chain, or null if no target. + * @return the current target entity */ IEntityLivingBase getTarget(); /** * Get the current entry index within the chain (0-based). + * @return the current entry index in the chain */ int getEntryIndex(); @@ -69,11 +76,13 @@ public interface IChainEvent extends ICustomNPCsEvent { interface InterruptEvent extends IChainEvent { /** * Get the damage source that caused the interruption. + * @return the damage source used for this hit */ IDamageSource getDamageSource(); /** * Get the amount of damage that caused the interruption. + * @return the damage amount */ float getDamage(); } diff --git a/java/noppes/npcs/api/event/ICustomGuiEvent.java b/java/noppes/npcs/api/event/ICustomGuiEvent.java index d5b3578..0e6ec3e 100644 --- a/java/noppes/npcs/api/event/ICustomGuiEvent.java +++ b/java/noppes/npcs/api/event/ICustomGuiEvent.java @@ -4,10 +4,15 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.item.IItemStack; +/** + * Events fired when a player interacts with a custom GUI. + */ public interface ICustomGuiEvent extends IPlayerEvent { + /** @return the custom GUI associated with this event. */ ICustomGui getGui(); + /** @return the component ID that triggered this event. */ int getId(); /** diff --git a/java/noppes/npcs/api/event/ICustomNPCsEvent.java b/java/noppes/npcs/api/event/ICustomNPCsEvent.java index 961ecf0..bb585a0 100644 --- a/java/noppes/npcs/api/event/ICustomNPCsEvent.java +++ b/java/noppes/npcs/api/event/ICustomNPCsEvent.java @@ -5,8 +5,12 @@ import noppes.npcs.api.IPos; import noppes.npcs.api.IWorld; import noppes.npcs.api.handler.data.INaturalSpawn; +/** + * Base interface for all CustomNPC+ script events. + */ public interface ICustomNPCsEvent { + /** @return the script hook name that triggered this event. */ String getHookName(); /** diff --git a/java/noppes/npcs/api/event/IDialogEvent.java b/java/noppes/npcs/api/event/IDialogEvent.java index 5b3d99a..6d37d15 100644 --- a/java/noppes/npcs/api/event/IDialogEvent.java +++ b/java/noppes/npcs/api/event/IDialogEvent.java @@ -3,23 +3,38 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.handler.data.IDialog; +/** + * Events fired during dialog interactions between a player and an NPC. + */ public interface IDialogEvent extends IPlayerEvent { + /** @return the dialog associated with this event. */ IDialog getDialog(); + /** @return the dialog's unique ID. */ int getDialogId(); + /** @return the selected dialog option ID. */ int getOptionId(); + /** + * Fired when a dialog is opened. Cancelable. + * @hookName dialogOpen + */ @Cancelable interface DialogOpen extends IDialogEvent { } + /** + * Fired when a dialog option is selected. Cancelable. + * @hookName dialogOption + */ @Cancelable interface DialogOption extends IDialogEvent { } /** + * Fired when a dialog is closed. * @hookName dialogClose */ interface DialogClosed extends IDialogEvent { diff --git a/java/noppes/npcs/api/event/IEnergyBarrierEvent.java b/java/noppes/npcs/api/event/IEnergyBarrierEvent.java index 3b7f602..2f7e6c2 100644 --- a/java/noppes/npcs/api/event/IEnergyBarrierEvent.java +++ b/java/noppes/npcs/api/event/IEnergyBarrierEvent.java @@ -4,36 +4,48 @@ import noppes.npcs.api.entity.IEnergyBarrier; import noppes.npcs.api.entity.IEnergyProjectile; import noppes.npcs.api.entity.IEntity; +/** + * Events fired during energy barrier lifecycle and interactions. + */ public interface IEnergyBarrierEvent extends ICustomNPCsEvent { + /** @return the energy barrier entity. */ IEnergyBarrier getBarrier(); + /** @return the entity that owns this barrier. */ IEntity getOwner(); /** + * Fired when an energy barrier is spawned. * @hookName energyBarrierSpawned */ interface SpawnedEvent extends IEnergyBarrierEvent { } /** + * Fired each tick while the barrier exists. * @hookName energyBarrierTick */ interface UpdateEvent extends IEnergyBarrierEvent { } /** + * Fired when the barrier is hit by an energy projectile. * @hookName energyBarrierHit */ interface HitEvent extends IEnergyBarrierEvent { + /** @return the projectile that hit the barrier. */ IEnergyProjectile getProjectile(); + /** @return the damage dealt. */ float getDamage(); + /** @param damage the new damage value. */ void setDamage(float damage); } /** + * Fired when the barrier is destroyed. * @hookName energyBarrierDestroyed */ interface DestroyedEvent extends IEnergyBarrierEvent { diff --git a/java/noppes/npcs/api/event/IEnergyProjectileEvent.java b/java/noppes/npcs/api/event/IEnergyProjectileEvent.java index 80461f2..d1498fd 100644 --- a/java/noppes/npcs/api/event/IEnergyProjectileEvent.java +++ b/java/noppes/npcs/api/event/IEnergyProjectileEvent.java @@ -4,43 +4,57 @@ import noppes.npcs.api.IBlock; import noppes.npcs.api.entity.IEnergyProjectile; import noppes.npcs.api.entity.IEntity; +/** + * Events fired during energy projectile lifecycle and impacts. + */ public interface IEnergyProjectileEvent extends ICustomNPCsEvent { + /** @return the energy projectile entity. */ IEnergyProjectile getProjectile(); + /** @return the entity that fired this projectile. */ IEntity getOwner(); /** + * Fired when an energy projectile is launched. * @hookName energyProjectileFired */ interface FiredEvent extends IEnergyProjectileEvent { } /** + * Fired each tick while the projectile exists. * @hookName energyProjectileTick */ interface UpdateEvent extends IEnergyProjectileEvent { } /** + * Fired when the projectile hits an entity. * @hookName energyProjectileEntityImpact */ interface EntityImpactEvent extends IEnergyProjectileEvent { + /** @return the entity that was hit. */ IEntity getTarget(); + /** @return the damage dealt. */ float getDamage(); + /** @param damage the new damage value. */ void setDamage(float damage); } /** + * Fired when the projectile hits a block. * @hookName energyProjectileBlockImpact */ interface BlockImpactEvent extends IEnergyProjectileEvent { + /** @return the block that was hit. */ IBlock getBlock(); } /** + * Fired when the projectile expires without hitting anything. * @hookName energyProjectileExpired */ interface ExpiredEvent extends IEnergyProjectileEvent { diff --git a/java/noppes/npcs/api/event/IFactionEvent.java b/java/noppes/npcs/api/event/IFactionEvent.java index 6750588..8a0c8fe 100644 --- a/java/noppes/npcs/api/event/IFactionEvent.java +++ b/java/noppes/npcs/api/event/IFactionEvent.java @@ -3,14 +3,24 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.handler.data.IFaction; +/** + * Events fired when a player's faction standing changes. + */ public interface IFactionEvent extends IPlayerEvent { + /** @return the faction involved in this event. */ IFaction getFaction(); + /** + * Fired when a player's faction points change. Cancelable. + * @hookName factionPoints + */ @Cancelable interface FactionPoints extends IFactionEvent { + /** @return true if the points decreased, false if increased. */ boolean decreased(); + /** @return the amount of points changed. */ int getPoints(); } } diff --git a/java/noppes/npcs/api/event/IForgeEvent.java b/java/noppes/npcs/api/event/IForgeEvent.java index a88934c..028e041 100644 --- a/java/noppes/npcs/api/event/IForgeEvent.java +++ b/java/noppes/npcs/api/event/IForgeEvent.java @@ -4,25 +4,34 @@ import cpw.mods.fml.common.eventhandler.Event; import noppes.npcs.api.IWorld; import noppes.npcs.api.entity.IEntity; +/** + * Wrapper events for Forge events, allowing scripts to listen for native Forge events. + */ public interface IForgeEvent extends ICustomNPCsEvent { + /** @return the underlying Forge event. */ Event getEvent(); /** + * Fired for Forge world events. * @hookName forgeWorld */ interface WorldEvent extends IForgeEvent { + /** @return the world associated with this event. */ IWorld getWorld(); } /** + * Fired for Forge entity events. * @hookName forgeEntity */ interface EntityEvent extends IForgeEvent { + /** @return the entity associated with this event. */ IEntity getEntity(); } /** + * Fired during Forge initialization. * @hookName forgeInit */ interface InitEvent extends IForgeEvent { diff --git a/java/noppes/npcs/api/event/IItemEvent.java b/java/noppes/npcs/api/event/IItemEvent.java index c6c2bde..44a1c7e 100644 --- a/java/noppes/npcs/api/event/IItemEvent.java +++ b/java/noppes/npcs/api/event/IItemEvent.java @@ -6,113 +6,185 @@ import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.item.IItemCustomizable; import noppes.npcs.api.item.IItemStack; +/** + * Events fired for scripted/customizable items during their lifecycle and interactions. + */ public interface IItemEvent extends ICustomNPCsEvent { + /** @return the customizable item associated with this event. */ IItemCustomizable getItem(); + /** + * Fired when the item is initialized. + * @hookName init + */ interface InitEvent extends IItemEvent { } /** + * Fired each tick while the item exists in an entity's inventory. * @hookName tick */ interface UpdateEvent extends IItemEvent { + /** @return the entity holding the item. */ IEntity getEntity(); } + /** + * Fired when the item is tossed/dropped. Cancelable. + * @hookName tossed + */ @Cancelable interface TossedEvent extends IItemEvent { + /** @return the dropped item entity. */ IEntity getEntity(); + /** @return the player who dropped the item. */ IPlayer getPlayer(); } + /** + * Fired when the item is picked up. + * @hookName pickedUp + */ interface PickedUpEvent extends IItemEvent { + /** @return the player who picked up the item. */ IPlayer getPlayer(); } + /** + * Fired when the item entity spawns in the world. Cancelable. + * @hookName spawn + */ @Cancelable interface SpawnEvent extends IItemEvent { + /** @return the spawned item entity. */ IEntity getEntity(); } + /** + * Fired when the item is used to interact with an entity. Cancelable. + * @hookName interact + */ @Cancelable interface InteractEvent extends IItemEvent { + /** @return the interaction type. */ int getType(); + /** @return the target entity. */ IEntity getTarget(); + /** @return the player performing the interaction. */ IPlayer getPlayer(); } + /** + * Fired when the item is right-clicked. Cancelable. + * @hookName rightClick + */ @Cancelable interface RightClickEvent extends IItemEvent { + /** @return the click type. */ int getType(); + /** @return the target (entity or block). */ Object getTarget(); + /** @return the player who right-clicked. */ IPlayer getPlayer(); } + /** + * Fired when the item is used to attack an entity. Cancelable. + * @hookName attack + */ @Cancelable interface AttackEvent extends IItemEvent { + /** @return the attack type. */ int getType(); + /** @return the entity being attacked. */ IEntity getTarget(); + /** @return the entity swinging the item. */ IEntity getSwingingEntity(); } /** + * Fired when the player starts using the item (e.g., drawing a bow). * @hookName startItem */ interface StartUsingItem extends IItemEvent { + /** @return the player using the item. */ IPlayer getPlayer(); - int getDuration(); - } - - interface UsingItem extends IItemEvent { - IPlayer getPlayer(); - + /** @return the use duration in ticks. */ int getDuration(); } /** + * Fired each tick while the player is using the item. + * @hookName usingItem + */ + interface UsingItem extends IItemEvent { + /** @return the player using the item. */ + IPlayer getPlayer(); + + /** @return the remaining use duration in ticks. */ + int getDuration(); + } + + /** + * Fired when the player stops using the item before completion. * @hookName stopItem */ interface StopUsingItem extends IItemEvent { + /** @return the player who stopped using the item. */ IPlayer getPlayer(); + /** @return the remaining use duration in ticks. */ int getDuration(); } /** + * Fired when the player finishes using the item (full duration). * @hookName finishItem */ interface FinishUsingItem extends IItemEvent { + /** @return the player who finished using the item. */ IPlayer getPlayer(); + /** @return the total use duration in ticks. */ int getDuration(); } - // onBreakEvent if Durability Expires or Consumed + /** + * Fired when the item breaks due to durability loss or consumption. + * @hookName breakItem + */ interface BreakItem extends IItemEvent { - + /** @return the item stack that broke. */ IItemStack getBrokenStack(); + /** @return the player whose item broke. */ IPlayer getPlayer(); } - // onRepairEvent + /** + * Fired when the item is repaired on an anvil. + * @hookName repairItem + */ interface RepairItem extends IItemEvent { - + /** @return the left input item. */ IItemStack getLeft(); + /** @return the right input item (repair material). */ IItemStack getRight(); + /** @return the resulting output item. */ IItemStack getOutput(); + /** @return the chance the anvil breaks after this repair. */ float getAnvilBreakChance(); } } diff --git a/java/noppes/npcs/api/event/ILinkedItemEvent.java b/java/noppes/npcs/api/event/ILinkedItemEvent.java index 6e9194c..6e15606 100644 --- a/java/noppes/npcs/api/event/ILinkedItemEvent.java +++ b/java/noppes/npcs/api/event/ILinkedItemEvent.java @@ -1,18 +1,24 @@ package noppes.npcs.api.event; +/** + * Events fired for linked items when their version changes or when they are being built. + */ public interface ILinkedItemEvent extends IItemEvent { /** + * Fired when the linked item's version changes. * @hookName versionChanged */ interface VersionChangeEvent extends IItemEvent { - + /** @return the new version number. */ int getVersion(); + /** @return the previous version number. */ int getPreviousVersion(); } /** + * Fired when the linked item is being built/constructed. * @hookName buildingItem */ interface BuildEvent extends IItemEvent { diff --git a/java/noppes/npcs/api/event/INpcEvent.java b/java/noppes/npcs/api/event/INpcEvent.java index 4c4bac9..ee22b0e 100644 --- a/java/noppes/npcs/api/event/INpcEvent.java +++ b/java/noppes/npcs/api/event/INpcEvent.java @@ -9,55 +9,94 @@ import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.handler.data.IDialog; import noppes.npcs.api.item.IItemStack; +/** + * Events fired for CustomNPC entities during their lifecycle and interactions. + */ public interface INpcEvent extends ICustomNPCsEvent { + /** @return the NPC associated with this event. */ ICustomNpc getNpc(); + /** + * Fired when an NPC timer triggers. + * @hookName timer + */ interface TimerEvent extends INpcEvent { + /** @return the timer ID. */ int getId(); } + /** + * Fired when an entity collides with the NPC. + * @hookName collide + */ interface CollideEvent extends INpcEvent { + /** @return the colliding entity. */ IEntity getEntity(); } + /** + * Fired when the NPC takes damage. Cancelable. + * @hookName damaged + */ @Cancelable interface DamagedEvent extends INpcEvent { - + /** @return the entity that caused the damage, or null. */ IEntity getSource(); + /** @return the damage source details. */ IDamageSource getDamageSource(); + /** @return the damage amount. */ float getDamage(); + /** @param damage the new damage amount. */ void setDamage(float damage); + /** @param bo whether to clear the NPC's current target after damage. */ void setClearTarget(boolean bo); + /** @return whether the NPC's target will be cleared after damage. */ boolean getClearTarget(); + /** @return the damage type string. */ String getType(); } + /** + * Fired when the NPC launches a ranged attack. Cancelable. + * @hookName rangedLaunched + */ @Cancelable interface RangedLaunchedEvent extends INpcEvent { + /** @return the target entity. */ IEntityLivingBase getTarget(); + /** @param damage the new ranged damage. */ void setDamage(float damage); - float getDamage(); - } - - @Cancelable - interface MeleeAttackEvent extends INpcEvent { - IEntityLivingBase getTarget(); - - void setDamage(float damage); - + /** @return the ranged damage. */ float getDamage(); } /** + * Fired when the NPC performs a melee attack. Cancelable. + * @hookName meleeAttack + */ + @Cancelable + interface MeleeAttackEvent extends INpcEvent { + /** @return the target entity. */ + IEntityLivingBase getTarget(); + + /** @param damage the new melee damage. */ + void setDamage(float damage); + + /** @return the melee damage. */ + float getDamage(); + } + + /** + * Fired when the NPC swings its weapon. * @hookName meleeSwing */ interface SwingEvent extends INpcEvent { @@ -71,78 +110,126 @@ public interface INpcEvent extends ICustomNPCsEvent { } /** + * Fired when the NPC kills an entity. * @hookName kills */ interface KilledEntityEvent { + /** @return the entity that was killed. */ IEntityLivingBase getEntity(); } /** + * Fired when the NPC dies. Cancelable. * @hookName killed */ @Cancelable interface DiedEvent extends INpcEvent { + /** @return the entity that killed this NPC, or null. */ IEntity getSource(); + /** @return the damage source details. */ IDamageSource getDamageSource(); + /** @return the damage type string. */ String getType(); + /** @param droppedItems the items to drop on death. */ void setDroppedItems(IItemStack[] droppedItems); + /** @return the items dropped on death. */ IItemStack[] getDroppedItems(); + /** @param expDropped the experience to drop on death. */ void setExpDropped(int expDropped); + /** @return the experience dropped on death. */ int getExpDropped(); } + /** + * Fired when a player interacts with the NPC. Cancelable. + * @hookName interact + */ @Cancelable interface InteractEvent extends INpcEvent { + /** @return the interacting player. */ IPlayer getPlayer(); } + /** + * Fired when a dialog opens with the NPC. Cancelable. + * @hookName dialog + */ @Cancelable interface DialogEvent extends INpcEvent { + /** @return the interacting player. */ IPlayer getPlayer(); + /** @return the dialog. */ IDialog getDialog(); + /** @return the dialog ID. */ int getDialogId(); + /** @return the selected option ID. */ int getOptionId(); } + /** + * Fired when a dialog with the NPC is closed. + * @hookName dialogClosed + */ interface DialogClosedEvent extends INpcEvent { + /** @return the player who closed the dialog. */ IPlayer getPlayer(); + /** @return the dialog. */ IDialog getDialog(); + /** @return the dialog ID. */ int getDialogId(); + /** @return the selected option ID. */ int getOptionId(); } + /** + * Fired when the NPC loses its current target. Cancelable. + * @hookName targetLost + */ @Cancelable interface TargetLostEvent extends INpcEvent { + /** @return the target being lost. */ IEntityLivingBase getTarget(); + /** @return the new target, or null. */ IEntityLivingBase getNewTarget(); } + /** + * Fired when the NPC acquires a new target. Cancelable. + * @hookName target + */ @Cancelable interface TargetEvent extends INpcEvent { + /** @param entity the new target to set. */ void setTarget(IEntityLivingBase entity); + /** @return the current target. */ IEntityLivingBase getTarget(); } /** + * Fired each tick for the NPC. * @hookName tick */ interface UpdateEvent extends INpcEvent { } + /** + * Fired when the NPC is initialized. + * @hookName init + */ interface InitEvent extends INpcEvent { } } diff --git a/java/noppes/npcs/api/event/IPartyEvent.java b/java/noppes/npcs/api/event/IPartyEvent.java index d1994de..5005db5 100644 --- a/java/noppes/npcs/api/event/IPartyEvent.java +++ b/java/noppes/npcs/api/event/IPartyEvent.java @@ -5,45 +5,82 @@ import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.handler.data.IParty; import noppes.npcs.api.handler.data.IQuest; +/** + * Events fired during party operations such as quest progress, invitations, kicks, and disbanding. + */ public interface IPartyEvent { + /** @return the party involved in this event. */ IParty getParty(); + /** @return the quest associated with this party event. */ IQuest getQuest(); + /** + * Fired when a party quest is completed. + * @hookName partyQuestCompleted + */ interface PartyQuestCompletedEvent extends IPartyEvent { } + /** + * Fired when a quest is assigned to the party. Cancelable. + * @hookName partyQuestSet + */ @Cancelable interface PartyQuestSetEvent extends IPartyEvent { } + /** + * Fired when a party quest is turned in. Cancelable. + * @hookName partyQuestTurnedIn + */ @Cancelable interface PartyQuestTurnedInEvent extends IPartyEvent { } + /** + * Fired when a player is invited to the party. Cancelable. + * @hookName partyInvite + */ @Cancelable interface PartyInviteEvent extends IPartyEvent { - + /** @return the invited player. */ IPlayer getPlayer(); + /** @return the invited player's name. */ String getPlayerName(); - } + /** + * Fired when a player is kicked from the party. Cancelable. + * @hookName partyKick + */ @Cancelable interface PartyKickEvent extends IPartyEvent { + /** @return the kicked player. */ IPlayer getPlayer(); + /** @return the kicked player's name. */ String getPlayerName(); } + /** + * Fired when a player voluntarily leaves the party. + * @hookName partyLeave + */ interface PartyLeaveEvent extends IPartyEvent { + /** @return the leaving player. */ IPlayer getPlayer(); + /** @return the leaving player's name. */ String getPlayerName(); } + /** + * Fired when the party is disbanded. + * @hookName partyDisband + */ interface PartyDisbandEvent extends IPartyEvent { } } diff --git a/java/noppes/npcs/api/event/IPlayerEvent.java b/java/noppes/npcs/api/event/IPlayerEvent.java index 2d36189..88c8fd4 100644 --- a/java/noppes/npcs/api/event/IPlayerEvent.java +++ b/java/noppes/npcs/api/event/IPlayerEvent.java @@ -11,307 +11,537 @@ import noppes.npcs.api.handler.data.IPlayerEffect; import noppes.npcs.api.handler.data.IProfile; import noppes.npcs.api.item.IItemStack; +/** + * Events fired for player actions including combat, items, movement, and interactions. + */ public interface IPlayerEvent extends ICustomNPCsEvent { + /** @return the player associated with this event. */ IPlayer getPlayer(); + /** + * Fired when the player sends a chat message. Cancelable. + * @hookName chat + */ @Cancelable interface ChatEvent extends IPlayerEvent { + /** @param message the new chat message. */ void setMessage(String message); + /** @return the chat message. */ String getMessage(); } + /** + * Fired when the player presses or releases a key. + * @hookName keyPressed + */ interface KeyPressedEvent extends IPlayerEvent { + /** @return the key code. */ int getKey(); + /** @return true if Ctrl is held. */ boolean isCtrlPressed(); + /** @return true if Alt is held. */ boolean isAltPressed(); + /** @return true if Shift is held. */ boolean isShiftPressed(); + /** @return true if Meta is held. */ boolean isMetaPressed(); + /** @return true if the key is being pressed down, false if released. */ boolean keyDown(); + /** @return array of currently held key codes. */ int[] getKeysDown(); } + /** + * Fired when the player clicks a mouse button. + * @hookName mouseClicked + */ interface MouseClickedEvent extends IPlayerEvent { + /** @return the mouse button index. */ int getButton(); + /** @return the mouse wheel scroll delta. */ int getMouseWheel(); + /** @return true if the button is being pressed down. */ boolean buttonDown(); + /** @return true if Ctrl is held. */ boolean isCtrlPressed(); + /** @return true if Alt is held. */ boolean isAltPressed(); + /** @return true if Shift is held. */ boolean isShiftPressed(); + /** @return true if Meta is held. */ boolean isMetaPressed(); + /** @return array of currently held key codes. */ int[] getKeysDown(); } + /** + * Fired when the player picks up experience orbs. + * @hookName pickupXP + */ interface PickupXPEvent extends IPlayerEvent { + /** @return the amount of XP picked up. */ int getAmount(); } + /** + * Fired when the player levels up. + * @hookName levelUp + */ interface LevelUpEvent extends IPlayerEvent { + /** @return the number of levels gained. */ int getChange(); } + /** + * Fired when the player logs out. + * @hookName logout + */ interface LogoutEvent extends IPlayerEvent { } + /** + * Fired when the player logs in. + * @hookName login + */ interface LoginEvent extends IPlayerEvent { } + /** + * Fired when the player respawns after death. + * @hookName respawn + */ interface RespawnEvent extends IPlayerEvent { } /** + * Fired when the player changes dimensions. * @hookName changedDim */ interface ChangedDimension extends IPlayerEvent { + /** @return the dimension ID the player came from. */ int getFromDim(); + /** @return the dimension ID the player traveled to. */ int getToDim(); } + /** + * Fired when a player timer triggers. + * @hookName timer + */ interface TimerEvent extends IPlayerEvent { + /** @return the timer ID. */ int getId(); } + /** + * Fired when the player is attacked (before armor reduction). Cancelable. + * @hookName attacked + */ @Cancelable interface AttackedEvent extends IPlayerEvent { + /** @return the damage source details. */ IDamageSource getDamageSource(); + /** @return the attacking entity, or null. */ IEntity getSource(); + /** @return the raw damage amount. */ float getDamage(); } + /** + * Fired when the player takes damage (after armor reduction). Cancelable. + * @hookName damaged + */ @Cancelable interface DamagedEvent extends IPlayerEvent { + /** @return the damage source details. */ IDamageSource getDamageSource(); + /** @return the damaging entity, or null. */ IEntity getSource(); + /** @return the damage amount after reduction. */ float getDamage(); } + /** + * Fired when the player is about to be struck by lightning. Cancelable. + * @hookName lightning + */ @Cancelable interface LightningEvent extends IPlayerEvent { } /** + * Fired when a sound is played for the player. Cancelable. * @hookName playSound */ @Cancelable interface SoundEvent extends IPlayerEvent { + /** @return the sound resource name. */ String getName(); + /** @return the sound pitch. */ float getPitch(); + /** @return the sound volume. */ float getVolume(); } + /** + * Fired when the player falls. Cancelable. + * @hookName fall + */ @Cancelable interface FallEvent extends IPlayerEvent { + /** @return the fall distance in blocks. */ float getDistance(); } + /** + * Fired when the player jumps. + * @hookName jump + */ interface JumpEvent extends IPlayerEvent { } /** + * Fired when the player kills an entity. * @hookName kills */ interface KilledEntityEvent extends IPlayerEvent { + /** @return the killed entity. */ IEntityLivingBase getEntity(); } /** + * Fired when the player dies. * @hookName killed */ interface DiedEvent extends IPlayerEvent { + /** @return the damage source that killed the player. */ IDamageSource getDamageSource(); + /** @return the damage type string. */ String getType(); + /** @return the entity that killed the player, or null. */ IEntity getSource(); } + /** + * Fired when the player launches a ranged weapon (e.g., bow). Cancelable. + * @hookName rangedLaunched + */ @Cancelable interface RangedLaunchedEvent extends IPlayerEvent { + /** @return the bow item. */ IItemStack getBow(); + /** @return the charge level of the bow. */ int getCharge(); } + /** + * Fired when the player attacks an entity. Cancelable. + * @hookName attack + */ @Cancelable interface AttackEvent extends IPlayerEvent { + /** @return the damage source details. */ IDamageSource getDamageSource(); + /** @return the target entity. */ IEntity getTarget(); + /** @return the attack damage. */ float getDamage(); } + /** + * Fired when the player deals damage to an entity (after hit). Cancelable. + * @hookName damagedEntity + */ @Cancelable interface DamagedEntityEvent extends IPlayerEvent { + /** @return the damage source details. */ IDamageSource getDamageSource(); + /** @return the damaged entity. */ IEntity getTarget(); + /** @return the damage dealt. */ float getDamage(); } + /** + * Fired when the player closes a container. + * @hookName containerClosed + */ interface ContainerClosed extends IPlayerEvent { + /** @return the closed container. */ IContainer getContainer(); } + /** + * Fired when the player opens a container. + * @hookName containerOpen + */ interface ContainerOpen extends IPlayerEvent { + /** @return the opened container. */ IContainer getContainer(); } + /** + * Fired when the player picks up an item. Cancelable. + * @hookName pickUp + */ @Cancelable interface PickUpEvent extends IPlayerEvent { + /** @return the picked up item. */ IItemStack getItem(); } + /** + * Fired when items are dropped from the player's inventory (e.g., on death). Cancelable. + * @hookName drop + */ @Cancelable interface DropEvent extends IPlayerEvent { + /** @return the dropped items. */ IItemStack[] getItems(); } + /** + * Fired when the player tosses a single item. Cancelable. + * @hookName toss + */ @Cancelable interface TossEvent extends IPlayerEvent { + /** @return the tossed item. */ IItemStack getItem(); } + /** + * Fired when the player interacts with an entity. Cancelable. + * @hookName interact + */ @Cancelable interface InteractEvent extends IPlayerEvent { + /** @return the interaction type. */ int getType(); + /** @return the target entity. */ IEntity getTarget(); } + /** + * Fired when the player right-clicks. Cancelable. + * @hookName rightClick + */ @Cancelable interface RightClickEvent extends IPlayerEvent { + /** @return the click type. */ int getType(); + /** @return the target (entity, block, or null). */ Object getTarget(); + /** @return the player. */ IPlayer getPlayer(); } /** + * Fired each tick for the player. * @hookName tick */ interface UpdateEvent extends IPlayerEvent { } + /** + * Fired when the player script is initialized. + * @hookName init + */ interface InitEvent extends IPlayerEvent { } /** + * Fired when the player starts using an item (e.g., drawing a bow). * @hookName startItem */ interface StartUsingItem extends IPlayerEvent { + /** @return the item being used. */ IItemStack getItem(); - int getDuration(); - } - - interface UsingItem extends IPlayerEvent { - IItemStack getItem(); - + /** @return the use duration in ticks. */ int getDuration(); } /** + * Fired each tick while the player is using an item. + * @hookName usingItem + */ + interface UsingItem extends IPlayerEvent { + /** @return the item being used. */ + IItemStack getItem(); + + /** @return the remaining use duration in ticks. */ + int getDuration(); + } + + /** + * Fired when the player stops using an item before completion. * @hookName stopItem */ interface StopUsingItem extends IPlayerEvent { + /** @return the item that was being used. */ IItemStack getItem(); + /** @return the remaining use duration in ticks. */ int getDuration(); } /** + * Fired when the player finishes using an item (full duration). * @hookName finishItem */ interface FinishUsingItem extends IPlayerEvent { + /** @return the item that was used. */ IItemStack getItem(); + /** @return the total use duration in ticks. */ int getDuration(); } /** + * Fired when the player breaks a block. Cancelable. * @hookName breakBlock */ @Cancelable interface BreakEvent extends IPlayerEvent { + /** @return the block being broken. */ IBlock getBlock(); + /** @return the experience dropped from breaking the block. */ int getExp(); } + /** + * Fired when the player uses a hoe on a block. + * @hookName useHoe + */ interface UseHoeEvent extends IPlayerEvent { + /** @return the hoe item. */ IItemStack getHoe(); + /** @return the X coordinate of the hoed block. */ int getX(); + /** @return the Y coordinate of the hoed block. */ int getY(); + /** @return the Z coordinate of the hoed block. */ int getZ(); } + /** + * Fired when the player wakes up from a bed. + * @hookName wakeUp + */ interface WakeUpEvent extends IPlayerEvent { + /** @return true if the bed position was set as spawn. */ boolean setSpawn(); } + /** + * Fired when the player sleeps in a bed. + * @hookName sleep + */ interface SleepEvent extends IPlayerEvent { + /** @return the X coordinate of the bed. */ int getX(); + /** @return the Y coordinate of the bed. */ int getY(); + /** @return the Z coordinate of the bed. */ int getZ(); } + /** + * Fired when the player earns an achievement. + * @hookName achievement + */ interface AchievementEvent extends IPlayerEvent { + /** @return the achievement description. */ String getDescription(); } + /** + * Fired when the player fills a bucket. + * @hookName fillBucket + */ interface FillBucketEvent extends IPlayerEvent { + /** @return the empty bucket item. */ IItemStack getCurrent(); + /** @return the filled bucket item. */ IItemStack getFilled(); } + /** + * Fired when the player uses bonemeal on a block. + * @hookName bonemeal + */ interface BonemealEvent extends IPlayerEvent { + /** @return the block that was bonemealed. */ IBlock getBlock(); + /** @return the X coordinate. */ int getX(); + /** @return the Y coordinate. */ int getY(); + /** @return the Z coordinate. */ int getZ(); } + /** + * Fired when the player begins charging a ranged weapon. + * @hookName rangedCharge + */ interface RangedChargeEvent extends IPlayerEvent { } + /** + * Events fired for player custom effects (add, tick, remove). + * @hookName onEffect + */ interface EffectEvent extends IPlayerEvent { + /** @return the player effect. */ IPlayerEffect getEffect(); /** + * Fired when an effect is added to the player. * @hookName onEffectAdd */ interface Added extends EffectEvent { @@ -319,6 +549,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } /** + * Fired each tick while the effect is active. * @hookName onEffectTick */ interface Ticked extends EffectEvent { @@ -326,6 +557,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } /** + * Fired when an effect is removed from the player. * @hookName onEffectRemove */ interface Removed extends EffectEvent { @@ -343,6 +575,10 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } + /** + * Events fired for profile operations (create, change, remove). Cancelable. + * @hookName profile + */ @Cancelable interface ProfileEvent extends IPlayerEvent { @@ -362,6 +598,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { boolean isPost(); /** + * Fired when the player switches profile slots. Cancelable. * @hookName profileChange */ @Cancelable @@ -373,6 +610,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } /** + * Fired when a new profile is created. Cancelable. * @hookName profileCreate */ @Cancelable @@ -380,6 +618,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } /** + * Fired when a profile is removed. Cancelable. * @hookName profileRemove */ @Cancelable diff --git a/java/noppes/npcs/api/event/IProjectileEvent.java b/java/noppes/npcs/api/event/IProjectileEvent.java index 5137273..0a05178 100644 --- a/java/noppes/npcs/api/event/IProjectileEvent.java +++ b/java/noppes/npcs/api/event/IProjectileEvent.java @@ -4,26 +4,36 @@ import noppes.npcs.api.IBlock; import noppes.npcs.api.entity.IEntity; import noppes.npcs.api.entity.IProjectile; +/** + * Events fired during NPC projectile lifecycle and impacts. + */ public interface IProjectileEvent extends ICustomNPCsEvent { + /** @return the projectile entity. */ public IProjectile getProjectile(); + /** @return the entity that launched this projectile. */ public IEntity getSource(); /** + * Fired each tick while the projectile exists. * @hookName projectileTick */ interface UpdateEvent extends IProjectileEvent { } /** + * Fired when the projectile hits something. * @hookName projectileImpact */ interface ImpactEvent extends IProjectileEvent { + /** @return the impact type. */ public int getType(); + /** @return the entity hit, or null if a block was hit. */ public IEntity getEntity(); + /** @return the block hit, or null if an entity was hit. */ public IBlock getBlock(); } diff --git a/java/noppes/npcs/api/event/IQuestEvent.java b/java/noppes/npcs/api/event/IQuestEvent.java index a871bc6..e4ddd18 100644 --- a/java/noppes/npcs/api/event/IQuestEvent.java +++ b/java/noppes/npcs/api/event/IQuestEvent.java @@ -4,28 +4,45 @@ import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.handler.data.IQuest; import noppes.npcs.api.item.IItemStack; +/** + * Events fired during quest lifecycle: starting, completing, and turning in. + */ public interface IQuestEvent extends IPlayerEvent { + /** @return the quest associated with this event. */ IQuest getQuest(); + /** + * Fired when a quest's objectives are all completed. + * @hookName questCompleted + */ interface QuestCompletedEvent extends IQuestEvent { } + /** + * Fired when a quest is started/accepted. Cancelable. + * @hookName questStart + */ @Cancelable interface QuestStartEvent extends IQuestEvent { } /** + * Fired when a completed quest is turned in. Cancelable. * @hookName questTurnIn */ @Cancelable interface QuestTurnedInEvent extends IQuestEvent { + /** @param expReward the experience reward to give. */ void setExpReward(int expReward); + /** @param itemRewards the item rewards to give. */ void setItemRewards(IItemStack[] itemRewards); + /** @return the experience reward. */ int getExpReward(); + /** @return the item rewards. */ IItemStack[] getItemRewards(); } } diff --git a/java/noppes/npcs/api/event/IRecipeEvent.java b/java/noppes/npcs/api/event/IRecipeEvent.java index 78b81be..128703b 100644 --- a/java/noppes/npcs/api/event/IRecipeEvent.java +++ b/java/noppes/npcs/api/event/IRecipeEvent.java @@ -3,6 +3,9 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.item.IItemStack; +/** + * Events fired before and after recipe crafting, for both crafting table and anvil recipes. + */ public interface IRecipeEvent extends IPlayerEvent { /** @@ -13,14 +16,22 @@ public interface IRecipeEvent extends IPlayerEvent { */ Object getRecipe(); + /** @return the input item stacks used in the recipe. */ IItemStack[] getItems(); + /** @return true if this is an anvil recipe, false for crafting table. */ boolean isAnvil(); + /** + * Fired before a recipe is crafted. Cancelable. + * @hookName recipeCraftPre + */ @Cancelable interface Pre extends IRecipeEvent { + /** @param message the denial message shown when canceled. */ void setMessage(String message); + /** @return the denial message. */ String getMessage(); /** @@ -52,9 +63,15 @@ public interface IRecipeEvent extends IPlayerEvent { void setMaterialUsage(int materialUsage); } + /** + * Fired after a recipe is crafted. + * @hookName recipeCraftPost + */ interface Post extends IRecipeEvent { + /** @return the crafted item. */ IItemStack getCraft(); + /** @param stack the item to set as the crafting result. */ void setResult(IItemStack stack); } } diff --git a/java/noppes/npcs/api/gui/ICustomGui.java b/java/noppes/npcs/api/gui/ICustomGui.java index 3a92495..ee3bc80 100644 --- a/java/noppes/npcs/api/gui/ICustomGui.java +++ b/java/noppes/npcs/api/gui/ICustomGui.java @@ -231,12 +231,19 @@ public interface ICustomGui { IItemSlot addItemSlot(int id, int x, int y, IItemStack itemStack); /** + * @param x the X position in the GUI + * @param y the Y position in the GUI + * @return the created item slot * @deprecated Use addItemSlot(int, int, IItemStack) with an ID instead. */ @Deprecated IItemSlot addItemSlot(int x, int y); /** + * @param x the X position in the GUI + * @param y the Y position in the GUI + * @param itemStack the item to display in the slot + * @return the created item slot * @deprecated Use addItemSlot(int, int, IItemStack) with an ID instead. */ @Deprecated diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java index 2c51777..e3882b5 100644 --- a/java/noppes/npcs/api/handler/IAbilityHandler.java +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -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); diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index 683f410..cdb89a9 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -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... 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); diff --git a/java/noppes/npcs/api/handler/IAnimationHandler.java b/java/noppes/npcs/api/handler/IAnimationHandler.java index 31dec79..c5173ff 100644 --- a/java/noppes/npcs/api/handler/IAnimationHandler.java +++ b/java/noppes/npcs/api/handler/IAnimationHandler.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/IAuctionHandler.java b/java/noppes/npcs/api/handler/IAuctionHandler.java index 8b00df9..8ae9bf5 100644 --- a/java/noppes/npcs/api/handler/IAuctionHandler.java +++ b/java/noppes/npcs/api/handler/IAuctionHandler.java @@ -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(); diff --git a/java/noppes/npcs/api/handler/ICloneHandler.java b/java/noppes/npcs/api/handler/ICloneHandler.java index 805fd6c..7cc4a76 100644 --- a/java/noppes/npcs/api/handler/ICloneHandler.java +++ b/java/noppes/npcs/api/handler/ICloneHandler.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IDialogHandler.java b/java/noppes/npcs/api/handler/IDialogHandler.java index 36d5789..901efbc 100644 --- a/java/noppes/npcs/api/handler/IDialogHandler.java +++ b/java/noppes/npcs/api/handler/IDialogHandler.java @@ -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 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); } diff --git a/java/noppes/npcs/api/handler/IFactionHandler.java b/java/noppes/npcs/api/handler/IFactionHandler.java index 5bade90..58444d8 100644 --- a/java/noppes/npcs/api/handler/IFactionHandler.java +++ b/java/noppes/npcs/api/handler/IFactionHandler.java @@ -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 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); } diff --git a/java/noppes/npcs/api/handler/ILinkedItemHandler.java b/java/noppes/npcs/api/handler/ILinkedItemHandler.java index 056be78..d1dc310 100644 --- a/java/noppes/npcs/api/handler/ILinkedItemHandler.java +++ b/java/noppes/npcs/api/handler/ILinkedItemHandler.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/INaturalSpawnsHandler.java b/java/noppes/npcs/api/handler/INaturalSpawnsHandler.java index b851d11..ece4c58 100644 --- a/java/noppes/npcs/api/handler/INaturalSpawnsHandler.java +++ b/java/noppes/npcs/api/handler/INaturalSpawnsHandler.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/IOverlayHandler.java b/java/noppes/npcs/api/handler/IOverlayHandler.java index 81750fc..6036a3d 100644 --- a/java/noppes/npcs/api/handler/IOverlayHandler.java +++ b/java/noppes/npcs/api/handler/IOverlayHandler.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/IPlayerBankData.java b/java/noppes/npcs/api/handler/IPlayerBankData.java index 642e82d..bd88b59 100644 --- a/java/noppes/npcs/api/handler/IPlayerBankData.java +++ b/java/noppes/npcs/api/handler/IPlayerBankData.java @@ -1,4 +1,8 @@ package noppes.npcs.api.handler; +/** + * Holds bank-related data for a player. + * Currently a marker interface. + */ public interface IPlayerBankData { } diff --git a/java/noppes/npcs/api/handler/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index 8927fef..d69a23e 100644 --- a/java/noppes/npcs/api/handler/IPlayerData.java +++ b/java/noppes/npcs/api/handler/IPlayerData.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/IPlayerDialogData.java b/java/noppes/npcs/api/handler/IPlayerDialogData.java index ad79cc7..5ee3a83 100644 --- a/java/noppes/npcs/api/handler/IPlayerDialogData.java +++ b/java/noppes/npcs/api/handler/IPlayerDialogData.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IPlayerFactionData.java b/java/noppes/npcs/api/handler/IPlayerFactionData.java index f4e7128..9de6700 100644 --- a/java/noppes/npcs/api/handler/IPlayerFactionData.java +++ b/java/noppes/npcs/api/handler/IPlayerFactionData.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IPlayerItemGiverData.java b/java/noppes/npcs/api/handler/IPlayerItemGiverData.java index 67dc129..7c95083 100644 --- a/java/noppes/npcs/api/handler/IPlayerItemGiverData.java +++ b/java/noppes/npcs/api/handler/IPlayerItemGiverData.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IPlayerMailData.java b/java/noppes/npcs/api/handler/IPlayerMailData.java index 8f3dc4e..bb24828 100644 --- a/java/noppes/npcs/api/handler/IPlayerMailData.java +++ b/java/noppes/npcs/api/handler/IPlayerMailData.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IPlayerQuestData.java b/java/noppes/npcs/api/handler/IPlayerQuestData.java index 0e7afae..82efa23 100644 --- a/java/noppes/npcs/api/handler/IPlayerQuestData.java +++ b/java/noppes/npcs/api/handler/IPlayerQuestData.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IPlayerTradeData.java b/java/noppes/npcs/api/handler/IPlayerTradeData.java index ef8086e..1d05b2f 100644 --- a/java/noppes/npcs/api/handler/IPlayerTradeData.java +++ b/java/noppes/npcs/api/handler/IPlayerTradeData.java @@ -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(); diff --git a/java/noppes/npcs/api/handler/IPlayerTransportData.java b/java/noppes/npcs/api/handler/IPlayerTransportData.java index e55f91f..64ec7c8 100644 --- a/java/noppes/npcs/api/handler/IPlayerTransportData.java +++ b/java/noppes/npcs/api/handler/IPlayerTransportData.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IProfileHandler.java b/java/noppes/npcs/api/handler/IProfileHandler.java index 46d5774..65fbd6c 100644 --- a/java/noppes/npcs/api/handler/IProfileHandler.java +++ b/java/noppes/npcs/api/handler/IProfileHandler.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/IQuestHandler.java b/java/noppes/npcs/api/handler/IQuestHandler.java index 9bbf54b..4733c3b 100644 --- a/java/noppes/npcs/api/handler/IQuestHandler.java +++ b/java/noppes/npcs/api/handler/IQuestHandler.java @@ -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 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); } diff --git a/java/noppes/npcs/api/handler/IRecipeHandler.java b/java/noppes/npcs/api/handler/IRecipeHandler.java index 5791feb..eae1694 100644 --- a/java/noppes/npcs/api/handler/IRecipeHandler.java +++ b/java/noppes/npcs/api/handler/IRecipeHandler.java @@ -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 getGlobalList(); + /** @return all carpentry table recipes. */ List getCarpentryList(); + /** @return all custom anvil recipes. */ List 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); } diff --git a/java/noppes/npcs/api/handler/ITagHandler.java b/java/noppes/npcs/api/handler/ITagHandler.java index 9f3e210..9fd20ce 100644 --- a/java/noppes/npcs/api/handler/ITagHandler.java +++ b/java/noppes/npcs/api/handler/ITagHandler.java @@ -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 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); } diff --git a/java/noppes/npcs/api/handler/ITelegraphHandler.java b/java/noppes/npcs/api/handler/ITelegraphHandler.java index c73b2c6..7bb0a69 100644 --- a/java/noppes/npcs/api/handler/ITelegraphHandler.java +++ b/java/noppes/npcs/api/handler/ITelegraphHandler.java @@ -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. diff --git a/java/noppes/npcs/api/handler/ITransportHandler.java b/java/noppes/npcs/api/handler/ITransportHandler.java index 8ee2ea9..e93bb7d 100644 --- a/java/noppes/npcs/api/handler/ITransportHandler.java +++ b/java/noppes/npcs/api/handler/ITransportHandler.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/IAction.java b/java/noppes/npcs/api/handler/data/IAction.java index 29e3d9e..ae04d69 100644 --- a/java/noppes/npcs/api/handler/data/IAction.java +++ b/java/noppes/npcs/api/handler/data/IAction.java @@ -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 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 task); /** * * @param task Fires right before a marked done action gets removed from it's IActionQueue - * @return + * @return this action */ IAction onDone(Consumer 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 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 > 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... 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); diff --git a/java/noppes/npcs/api/handler/data/IActionChain.java b/java/noppes/npcs/api/handler/data/IActionChain.java index 7192c27..58c51ad 100644 --- a/java/noppes/npcs/api/handler/data/IActionChain.java +++ b/java/noppes/npcs/api/handler/data/IActionChain.java @@ -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 task); @@ -32,7 +32,7 @@ public interface IActionChain { /** * Start IActionManager * - * @return + * @return this IActionChain for method chaining */ IActionChain start(); } diff --git a/java/noppes/npcs/api/handler/data/IActionListener.java b/java/noppes/npcs/api/handler/data/IActionListener.java index 56cdf51..a471b0e 100644 --- a/java/noppes/npcs/api/handler/data/IActionListener.java +++ b/java/noppes/npcs/api/handler/data/IActionListener.java @@ -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); diff --git a/java/noppes/npcs/api/handler/data/IActionQueue.java b/java/noppes/npcs/api/handler/data/IActionQueue.java index 4b1b55a..8af2a18 100644 --- a/java/noppes/npcs/api/handler/data/IActionQueue.java +++ b/java/noppes/npcs/api/handler/data/IActionQueue.java @@ -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. */ diff --git a/java/noppes/npcs/api/handler/data/IAnimation.java b/java/noppes/npcs/api/handler/data/IAnimation.java index 2344454..5d049b5 100644 --- a/java/noppes/npcs/api/handler/data/IAnimation.java +++ b/java/noppes/npcs/api/handler/data/IAnimation.java @@ -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); diff --git a/java/noppes/npcs/api/handler/data/IAnvilRecipe.java b/java/noppes/npcs/api/handler/data/IAnvilRecipe.java index 9de714b..40eb026 100644 --- a/java/noppes/npcs/api/handler/data/IAnvilRecipe.java +++ b/java/noppes/npcs/api/handler/data/IAnvilRecipe.java @@ -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(); diff --git a/java/noppes/npcs/api/handler/data/IAuctionClaim.java b/java/noppes/npcs/api/handler/data/IAuctionClaim.java index 92b0331..cccc7ac 100644 --- a/java/noppes/npcs/api/handler/data/IAuctionClaim.java +++ b/java/noppes/npcs/api/handler/data/IAuctionClaim.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IAuctionListing.java b/java/noppes/npcs/api/handler/data/IAuctionListing.java index a49496e..d6285ee 100644 --- a/java/noppes/npcs/api/handler/data/IAuctionListing.java +++ b/java/noppes/npcs/api/handler/data/IAuctionListing.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/ICustomEffect.java b/java/noppes/npcs/api/handler/data/ICustomEffect.java index e180049..7a5a543 100644 --- a/java/noppes/npcs/api/handler/data/ICustomEffect.java +++ b/java/noppes/npcs/api/handler/data/ICustomEffect.java @@ -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 '&' (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); } diff --git a/java/noppes/npcs/api/handler/data/IDialog.java b/java/noppes/npcs/api/handler/data/IDialog.java index 620f286..3d6fa64 100644 --- a/java/noppes/npcs/api/handler/data/IDialog.java +++ b/java/noppes/npcs/api/handler/data/IDialog.java @@ -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 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(); } diff --git a/java/noppes/npcs/api/handler/data/IDialogCategory.java b/java/noppes/npcs/api/handler/data/IDialogCategory.java index f7a6c09..2b35736 100644 --- a/java/noppes/npcs/api/handler/data/IDialogCategory.java +++ b/java/noppes/npcs/api/handler/data/IDialogCategory.java @@ -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 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(); } diff --git a/java/noppes/npcs/api/handler/data/IDialogImage.java b/java/noppes/npcs/api/handler/data/IDialogImage.java index f48cefd..a446c2e 100644 --- a/java/noppes/npcs/api/handler/data/IDialogImage.java +++ b/java/noppes/npcs/api/handler/data/IDialogImage.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IDialogOption.java b/java/noppes/npcs/api/handler/data/IDialogOption.java index 6c7a3e3..c98b75f 100644 --- a/java/noppes/npcs/api/handler/data/IDialogOption.java +++ b/java/noppes/npcs/api/handler/data/IDialogOption.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IFaction.java b/java/noppes/npcs/api/handler/data/IFaction.java index 71ffff2..e4f5f57 100644 --- a/java/noppes/npcs/api/handler/data/IFaction.java +++ b/java/noppes/npcs/api/handler/data/IFaction.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IFrame.java b/java/noppes/npcs/api/handler/data/IFrame.java index f75657f..574a4ea 100644 --- a/java/noppes/npcs/api/handler/data/IFrame.java +++ b/java/noppes/npcs/api/handler/data/IFrame.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/IFramePart.java b/java/noppes/npcs/api/handler/data/IFramePart.java index 3bb63e2..1b2dd8a 100644 --- a/java/noppes/npcs/api/handler/data/IFramePart.java +++ b/java/noppes/npcs/api/handler/data/IFramePart.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/ILine.java b/java/noppes/npcs/api/handler/data/ILine.java index 42ae759..99c53a0 100644 --- a/java/noppes/npcs/api/handler/data/ILine.java +++ b/java/noppes/npcs/api/handler/data/ILine.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/ILines.java b/java/noppes/npcs/api/handler/data/ILines.java index 39ede57..0c69251 100644 --- a/java/noppes/npcs/api/handler/data/ILines.java +++ b/java/noppes/npcs/api/handler/data/ILines.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/ILinkedItem.java b/java/noppes/npcs/api/handler/data/ILinkedItem.java index 2417872..e561dfe 100644 --- a/java/noppes/npcs/api/handler/data/ILinkedItem.java +++ b/java/noppes/npcs/api/handler/data/ILinkedItem.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/INaturalSpawn.java b/java/noppes/npcs/api/handler/data/INaturalSpawn.java index 92601de..fee02bf 100644 --- a/java/noppes/npcs/api/handler/data/INaturalSpawn.java +++ b/java/noppes/npcs/api/handler/data/INaturalSpawn.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IParty.java b/java/noppes/npcs/api/handler/data/IParty.java index 9595d0e..fbd0987 100644 --- a/java/noppes/npcs/api/handler/data/IParty.java +++ b/java/noppes/npcs/api/handler/data/IParty.java @@ -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); diff --git a/java/noppes/npcs/api/handler/data/IPartyOptions.java b/java/noppes/npcs/api/handler/data/IPartyOptions.java index 4ce1b72..2205500 100644 --- a/java/noppes/npcs/api/handler/data/IPartyOptions.java +++ b/java/noppes/npcs/api/handler/data/IPartyOptions.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/IPlayerAttributes.java b/java/noppes/npcs/api/handler/data/IPlayerAttributes.java index c0855c0..a1f5854 100644 --- a/java/noppes/npcs/api/handler/data/IPlayerAttributes.java +++ b/java/noppes/npcs/api/handler/data/IPlayerAttributes.java @@ -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); diff --git a/java/noppes/npcs/api/handler/data/IPlayerEffect.java b/java/noppes/npcs/api/handler/data/IPlayerEffect.java index c59bd12..e8851e5 100644 --- a/java/noppes/npcs/api/handler/data/IPlayerEffect.java +++ b/java/noppes/npcs/api/handler/data/IPlayerEffect.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/IPlayerMail.java b/java/noppes/npcs/api/handler/data/IPlayerMail.java index 7c01902..f2e27db 100644 --- a/java/noppes/npcs/api/handler/data/IPlayerMail.java +++ b/java/noppes/npcs/api/handler/data/IPlayerMail.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/IQuest.java b/java/noppes/npcs/api/handler/data/IQuest.java index 6aa4294..cb75503 100644 --- a/java/noppes/npcs/api/handler/data/IQuest.java +++ b/java/noppes/npcs/api/handler/data/IQuest.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/IQuestCategory.java b/java/noppes/npcs/api/handler/data/IQuestCategory.java index 04ff487..991f62d 100644 --- a/java/noppes/npcs/api/handler/data/IQuestCategory.java +++ b/java/noppes/npcs/api/handler/data/IQuestCategory.java @@ -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 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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestDialog.java b/java/noppes/npcs/api/handler/data/IQuestDialog.java index cf5e275..2a300e7 100644 --- a/java/noppes/npcs/api/handler/data/IQuestDialog.java +++ b/java/noppes/npcs/api/handler/data/IQuestDialog.java @@ -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 { } diff --git a/java/noppes/npcs/api/handler/data/IQuestInterface.java b/java/noppes/npcs/api/handler/data/IQuestInterface.java index d6c6055..3b5703a 100644 --- a/java/noppes/npcs/api/handler/data/IQuestInterface.java +++ b/java/noppes/npcs/api/handler/data/IQuestInterface.java @@ -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 { } diff --git a/java/noppes/npcs/api/handler/data/IQuestItem.java b/java/noppes/npcs/api/handler/data/IQuestItem.java index 883634b..9b719f0 100644 --- a/java/noppes/npcs/api/handler/data/IQuestItem.java +++ b/java/noppes/npcs/api/handler/data/IQuestItem.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestKill.java b/java/noppes/npcs/api/handler/data/IQuestKill.java index 86074d1..7da896c 100644 --- a/java/noppes/npcs/api/handler/data/IQuestKill.java +++ b/java/noppes/npcs/api/handler/data/IQuestKill.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestLocation.java b/java/noppes/npcs/api/handler/data/IQuestLocation.java index 27e43b5..e5b49a1 100644 --- a/java/noppes/npcs/api/handler/data/IQuestLocation.java +++ b/java/noppes/npcs/api/handler/data/IQuestLocation.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestObjective.java b/java/noppes/npcs/api/handler/data/IQuestObjective.java index d909a08..4adc6e0 100644 --- a/java/noppes/npcs/api/handler/data/IQuestObjective.java +++ b/java/noppes/npcs/api/handler/data/IQuestObjective.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IRecipe.java b/java/noppes/npcs/api/handler/data/IRecipe.java index 347664e..2170dae 100644 --- a/java/noppes/npcs/api/handler/data/IRecipe.java +++ b/java/noppes/npcs/api/handler/data/IRecipe.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/ISlot.java b/java/noppes/npcs/api/handler/data/ISlot.java index c76f67c..e92466c 100644 --- a/java/noppes/npcs/api/handler/data/ISlot.java +++ b/java/noppes/npcs/api/handler/data/ISlot.java @@ -46,6 +46,12 @@ public interface ISlot { */ Map 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); /** diff --git a/java/noppes/npcs/api/handler/data/ISound.java b/java/noppes/npcs/api/handler/data/ISound.java index d5a65b8..3cade21 100644 --- a/java/noppes/npcs/api/handler/data/ISound.java +++ b/java/noppes/npcs/api/handler/data/ISound.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/ITag.java b/java/noppes/npcs/api/handler/data/ITag.java index 97cebee..1ef328b 100644 --- a/java/noppes/npcs/api/handler/data/ITag.java +++ b/java/noppes/npcs/api/handler/data/ITag.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/ITransportCategory.java b/java/noppes/npcs/api/handler/data/ITransportCategory.java index 154839b..73d1ec1 100644 --- a/java/noppes/npcs/api/handler/data/ITransportCategory.java +++ b/java/noppes/npcs/api/handler/data/ITransportCategory.java @@ -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); } diff --git a/java/noppes/npcs/api/handler/data/ITransportLocation.java b/java/noppes/npcs/api/handler/data/ITransportLocation.java index 08c9b3c..9ed0c15 100644 --- a/java/noppes/npcs/api/handler/data/ITransportLocation.java +++ b/java/noppes/npcs/api/handler/data/ITransportLocation.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java b/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java index 63b5f30..baae8ce 100644 --- a/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java +++ b/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java @@ -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 condition); diff --git a/java/noppes/npcs/api/roles/IRole.java b/java/noppes/npcs/api/roles/IRole.java index dacd119..84b74e5 100644 --- a/java/noppes/npcs/api/roles/IRole.java +++ b/java/noppes/npcs/api/roles/IRole.java @@ -2,9 +2,17 @@ package noppes.npcs.api.roles; import net.minecraft.entity.INpc; +/** + * Base interface for all NPC roles (Trader, Follower, Bank, Mailman, Transporter). + */ public interface IRole { + /** @return the NPC this role is assigned to. */ INpc getNpc(); + /** + * @return the role type ordinal. + * 0: None, 1: Trader, 2: Follower, 3: Bank, 4: Transporter, 5: Mailman. + */ int getType(); } diff --git a/java/noppes/npcs/api/roles/IRoleBank.java b/java/noppes/npcs/api/roles/IRoleBank.java index 0a21f41..e0a7a18 100644 --- a/java/noppes/npcs/api/roles/IRoleBank.java +++ b/java/noppes/npcs/api/roles/IRoleBank.java @@ -1,5 +1,8 @@ package noppes.npcs.api.roles; +/** + * Represents the banker role for an NPC, providing storage access to players. + */ public interface IRoleBank extends IRole { } diff --git a/java/noppes/npcs/api/roles/IRoleFollower.java b/java/noppes/npcs/api/roles/IRoleFollower.java index 78b2aed..88d90f5 100644 --- a/java/noppes/npcs/api/roles/IRoleFollower.java +++ b/java/noppes/npcs/api/roles/IRoleFollower.java @@ -22,8 +22,10 @@ public interface IRoleFollower extends IRole { */ boolean hasOwner(); + /** @return true if the follower is currently following the owner. */ boolean isFollowing(); + /** @param following true to make the follower follow the owner. */ void setIsFollowing(boolean following); /** diff --git a/java/noppes/npcs/api/roles/IRoleMailman.java b/java/noppes/npcs/api/roles/IRoleMailman.java index 912b0a9..4013200 100644 --- a/java/noppes/npcs/api/roles/IRoleMailman.java +++ b/java/noppes/npcs/api/roles/IRoleMailman.java @@ -1,5 +1,8 @@ package noppes.npcs.api.roles; +/** + * Represents the mailman role for an NPC, enabling mail delivery to players. + */ public interface IRoleMailman extends IRole { } diff --git a/java/noppes/npcs/api/roles/IRoleTrader.java b/java/noppes/npcs/api/roles/IRoleTrader.java index b76a39e..ad90a60 100644 --- a/java/noppes/npcs/api/roles/IRoleTrader.java +++ b/java/noppes/npcs/api/roles/IRoleTrader.java @@ -285,7 +285,7 @@ public interface IRoleTrader extends IRole { /** * @param slot Slot number 0-17 - * @return Whether this slot has a currency cost > 0 + * @return Whether this slot has a currency cost > 0 */ boolean hasCurrencyCost(int slot); } diff --git a/java/noppes/npcs/api/roles/IRoleTransporter.java b/java/noppes/npcs/api/roles/IRoleTransporter.java index 6d535d3..4406aa2 100644 --- a/java/noppes/npcs/api/roles/IRoleTransporter.java +++ b/java/noppes/npcs/api/roles/IRoleTransporter.java @@ -4,16 +4,36 @@ import net.minecraft.entity.player.EntityPlayerMP; import noppes.npcs.api.entity.IPlayer; import noppes.npcs.api.handler.data.ITransportLocation; +/** + * Represents the transporter role for an NPC, allowing players to teleport + * between unlocked transport locations. + */ public interface IRoleTransporter extends IRole { + + /** @return the display name of this transporter NPC. */ String getName(); + /** @return the transport location ID assigned to this NPC. */ int getTransportId(); + /** + * Unlocks the given transport location for the player. + * + * @param player the player. + * @param location the transport location to unlock. + */ void unlock(IPlayer player, ITransportLocation location); + /** @return the transport location assigned to this NPC, or null if none. */ ITransportLocation getTransport(); + /** @return true if this NPC has a transport location assigned. */ boolean hasTransport(); + /** + * Assigns a transport location to this NPC. + * + * @param location the transport location. + */ void setTransport(ITransportLocation location); } From 10f8cfdeaa961f52f3229e07c5fc9aa0fb15e734 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 9 Mar 2026 17:26:55 -0400 Subject: [PATCH 90/93] Add Absorbing Radius to Barriers --- .../npcs/api/entity/IEnergyBarrier.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/java/noppes/npcs/api/entity/IEnergyBarrier.java b/java/noppes/npcs/api/entity/IEnergyBarrier.java index 724364d..243ca1c 100644 --- a/java/noppes/npcs/api/entity/IEnergyBarrier.java +++ b/java/noppes/npcs/api/entity/IEnergyBarrier.java @@ -57,10 +57,72 @@ public interface IEnergyBarrier extends IEnergyAbility { void setKnockbackStrength(float strength); + /** + * Returns whether this barrier absorbs damage on behalf of its owner. + * When absorbing is enabled, incoming damage to the barrier's owner is redirected + * to the barrier instead, subject to the absorb radius check. + * + * @return {@code true} if the barrier absorbs the owner's incoming damage + * @see #getAbsorbRadius() + */ boolean isAbsorbing(); + /** + * Sets whether this barrier absorbs damage on behalf of its owner. + * When absorbing is enabled, incoming damage to the barrier's owner is redirected + * to the barrier instead, subject to the absorb radius check. + * + * @param absorbing {@code true} to enable damage absorption for the owner + * @see #setAbsorbRadius(float) + */ void setAbsorbing(boolean absorbing); + /** + * Gets the absorb radius for this barrier. + * The absorb radius determines the maximum distance from the barrier's current + * position at which the owner's incoming damage will still be redirected to the barrier. + * This check uses the barrier entity's live position, so it works correctly with + * moving barriers (following domes, moving walls, shields, etc.). + * + *
      + *
    • {@code -1} = No distance limit. Damage is always absorbed regardless of distance.
    • + *
    • {@code 0} = Uses the barrier's own geometric extent as the effective radius. + *
        + *
      • Domes: the dome radius (sphere radius in blocks).
      • + *
      • Panels: {@code (max(width, height) * 0.5 + 1.0) * 3} + * (i.e. {@code max(width, height) * 1.5 + 3.0} blocks).
      • + *
      + *
    • + *
    • Positive values = The owner must be within this many blocks of the barrier entity.
    • + *
    + * + * @return the absorb radius in blocks, or {@code -1} for unlimited, or {@code 0} for barrier extent + */ + float getAbsorbRadius(); + + /** + * Sets the absorb radius for this barrier. + * The absorb radius determines the maximum distance from the barrier's current + * position at which the owner's incoming damage will still be redirected to the barrier. + * This check uses the barrier entity's live position, so it works correctly with + * moving barriers (following domes, moving walls, shields, etc.). + * + *
      + *
    • {@code -1} = No distance limit. Damage is always absorbed regardless of distance.
    • + *
    • {@code 0} = Uses the barrier's own geometric extent as the effective radius. + *
        + *
      • Domes: the dome radius (sphere radius in blocks).
      • + *
      • Panels: {@code (max(width, height) * 0.5 + 1.0) * 3} + * (i.e. {@code max(width, height) * 1.5 + 3.0} blocks).
      • + *
      + *
    • + *
    • Positive values = The owner must be within this many blocks of the barrier entity.
    • + *
    + * + * @param radius the absorb radius in blocks, or {@code -1} for unlimited, or {@code 0} for barrier extent + */ + void setAbsorbRadius(float radius); + /** * Returns the barrier type: 0=Dome, 1=Panel * @return the barrier type ordinal From 4ee1c41d061eb4638b923cd3a430c7b63767ebdb Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 9 Mar 2026 17:36:55 -0400 Subject: [PATCH 91/93] Renaming Scheme for Energy Handler and Energy Extender --- java/noppes/npcs/api/AbstractNpcAPI.java | 2 +- .../npcs/api/{IEnergyController.java => IEnergyHandler.java} | 2 +- java/noppes/npcs/api/entity/IEnergyExplosion.java | 4 ++-- java/noppes/npcs/api/entity/IEnergySweeper.java | 2 +- java/noppes/npcs/api/entity/IEnergyZone.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename java/noppes/npcs/api/{IEnergyController.java => IEnergyHandler.java} (99%) diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index 75fcfba..23957b5 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -285,7 +285,7 @@ public abstract class AbstractNpcAPI { public abstract IDamageSource getIDamageSource(IEntity entity); - public abstract IEnergyController getEnergyController(); + public abstract IEnergyHandler getEnergyHandler(); public abstract EventBus events(); diff --git a/java/noppes/npcs/api/IEnergyController.java b/java/noppes/npcs/api/IEnergyHandler.java similarity index 99% rename from java/noppes/npcs/api/IEnergyController.java rename to java/noppes/npcs/api/IEnergyHandler.java index a3cd8f7..463f4ee 100644 --- a/java/noppes/npcs/api/IEnergyController.java +++ b/java/noppes/npcs/api/IEnergyHandler.java @@ -11,7 +11,7 @@ import noppes.npcs.api.entity.IEnergyExplosion; * Configure the entity, then call fire() (projectiles) or spawn() (zones/sweepers/panels) * to place it in the world. */ -public interface IEnergyController { +public interface IEnergyHandler { // ==================== PROJECTILE CREATION ==================== diff --git a/java/noppes/npcs/api/entity/IEnergyExplosion.java b/java/noppes/npcs/api/entity/IEnergyExplosion.java index 2a9fe91..40964bf 100644 --- a/java/noppes/npcs/api/entity/IEnergyExplosion.java +++ b/java/noppes/npcs/api/entity/IEnergyExplosion.java @@ -1,11 +1,11 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; -import noppes.npcs.api.INbt; +import noppes.npcs.api.IEnergyHandler; /** * Represents a standalone energy explosion entity. - * Created via {@link noppes.npcs.api.IEnergyController#createExplosion}. + * Created via {@link IEnergyHandler#createExplosion}. * Configure visual/damage properties, then call {@link #spawn()} to place in the world. * * When damage is set (> 0), the explosion will deal area damage on the first tick diff --git a/java/noppes/npcs/api/entity/IEnergySweeper.java b/java/noppes/npcs/api/entity/IEnergySweeper.java index da0f545..11e2dd5 100644 --- a/java/noppes/npcs/api/entity/IEnergySweeper.java +++ b/java/noppes/npcs/api/entity/IEnergySweeper.java @@ -4,7 +4,7 @@ import net.minecraft.entity.Entity; /** * Entity-level interface for sweeper beam entities. - * Created via IEnergyController.createSweeper(). + * Created via IEnergyHandler.createSweeper(). * Configure properties, then call spawn() to place in the world. */ public interface IEnergySweeper extends IEnergyAbility { diff --git a/java/noppes/npcs/api/entity/IEnergyZone.java b/java/noppes/npcs/api/entity/IEnergyZone.java index 2dad28a..878791d 100644 --- a/java/noppes/npcs/api/entity/IEnergyZone.java +++ b/java/noppes/npcs/api/entity/IEnergyZone.java @@ -4,7 +4,7 @@ import net.minecraft.entity.Entity; /** * Entity-level interface for zone entities (Hazard and Trap). - * Created via IEnergyController.createHazard() or createTrap(). + * Created via IEnergyHandler.createHazard() or createTrap(). * Configure properties, then call spawn() to place in the world. */ public interface IEnergyZone extends IEntity { From 88c90ef0e43e650fb2d8f44c6e2369ec72ffb7ac Mon Sep 17 00:00:00 2001 From: Vidal Date: Mon, 9 Mar 2026 18:44:15 -0300 Subject: [PATCH 92/93] Square telegraph --- java/noppes/npcs/api/ITelegraph.java | 5 +++-- java/noppes/npcs/api/handler/ITelegraphHandler.java | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/java/noppes/npcs/api/ITelegraph.java b/java/noppes/npcs/api/ITelegraph.java index 63fe339..5ca4f2b 100644 --- a/java/noppes/npcs/api/ITelegraph.java +++ b/java/noppes/npcs/api/ITelegraph.java @@ -20,6 +20,7 @@ import noppes.npcs.api.entity.IEntity; *
  • RING - A ring with inner and outer radius
  • *
  • LINE - A rectangular line in a direction
  • *
  • CONE - A cone/arc shape
  • + *
  • SQUARE - A square shape
  • *
  • POINT - A small point marker
  • * */ @@ -48,13 +49,13 @@ public interface ITelegraph { // ========================================================================== /** - * Get the radius (for CIRCLE and RING types). + * Get the radius (for CIRCLE, SQUARE and RING types). * @return the circle/ring radius in blocks */ float getRadius(); /** - * Set the radius (for CIRCLE and RING types). + * Set the radius (for CIRCLE, SQUARE and RING types). * @param radius circle/ring radius in blocks */ void setRadius(float radius); diff --git a/java/noppes/npcs/api/handler/ITelegraphHandler.java b/java/noppes/npcs/api/handler/ITelegraphHandler.java index 7bb0a69..64cfd85 100644 --- a/java/noppes/npcs/api/handler/ITelegraphHandler.java +++ b/java/noppes/npcs/api/handler/ITelegraphHandler.java @@ -68,6 +68,8 @@ public interface ITelegraphHandler { */ ITelegraph createCone(float length, float angle); + ITelegraph createSquare(float radius); + /** * Create a point telegraph. * From efce1a99b75dc6931e406b77bf188115befb54e2 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 9 Mar 2026 17:50:46 -0400 Subject: [PATCH 93/93] Documentation to Square Telegraph --- java/noppes/npcs/api/ITelegraph.java | 4 ++-- java/noppes/npcs/api/handler/ITelegraphHandler.java | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/java/noppes/npcs/api/ITelegraph.java b/java/noppes/npcs/api/ITelegraph.java index 5ca4f2b..7fb9129 100644 --- a/java/noppes/npcs/api/ITelegraph.java +++ b/java/noppes/npcs/api/ITelegraph.java @@ -33,14 +33,14 @@ public interface ITelegraph { /** * Get the telegraph type. * - * @return Type name: "CIRCLE", "RING", "LINE", "CONE", or "POINT" + * @return Type name: "CIRCLE", "RING", "LINE", "CONE", "SQUARE", or "POINT" */ String getType(); /** * Set the telegraph type. * - * @param type Type name: "circle", "ring", "line", "cone", or "point" (case insensitive) + * @param type Type name: "circle", "ring", "line", "cone", "square", or "point" (case insensitive) */ void setType(String type); diff --git a/java/noppes/npcs/api/handler/ITelegraphHandler.java b/java/noppes/npcs/api/handler/ITelegraphHandler.java index 64cfd85..8afb515 100644 --- a/java/noppes/npcs/api/handler/ITelegraphHandler.java +++ b/java/noppes/npcs/api/handler/ITelegraphHandler.java @@ -68,6 +68,13 @@ public interface ITelegraphHandler { */ ITelegraph createCone(float length, float angle); + /** + * Create a square telegraph. + * The square is axis-aligned by default and can be rotated with yaw when spawned. + * + * @param radius The half-size of the square (distance from center to edge) + * @return A new telegraph configuration + */ ITelegraph createSquare(float radius); /** @@ -80,7 +87,7 @@ public interface ITelegraphHandler { /** * Create a telegraph by type name. * - * @param type Type name: "circle", "ring", "line", "cone", "point" (case insensitive) + * @param type Type name: "circle", "ring", "line", "cone", "square", "point" (case insensitive) * @return A new telegraph configuration, or null if type is invalid */ ITelegraph create(String type);