mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 18:49:39 +00:00
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
This commit is contained in:
1 parent
936dc7f0cc
commit
675c4ef4f9
50 files changed
+1488
-938
No files matched your search
@@ -0,0 +1,54 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.AbilityScriptPacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.constants.ScriptContext;
|
||||
|
||||
/**
|
||||
* Script handler for ability scripts.
|
||||
* Manages a single script container for ability hooks (abilityStart, abilityTick, abilityComplete, etc.).
|
||||
*/
|
||||
public class AbilityScript extends SingleScriptHandler implements IScriptHandlerPacket {
|
||||
|
||||
/**
|
||||
* The ability ID (UUID) for packet communication. Empty if not bound.
|
||||
*/
|
||||
private String abilityId = "";
|
||||
|
||||
/**
|
||||
* Create an unbound AbilityScript (for server-side use).
|
||||
*/
|
||||
public AbilityScript() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an AbilityScript bound to a specific ability (for GUI use).
|
||||
*
|
||||
* @param abilityId The UUID of the ability
|
||||
*/
|
||||
public AbilityScript(String abilityId) {
|
||||
this.abilityId = abilityId != null ? abilityId : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptContext getContext() {
|
||||
return ScriptContext.ABILITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String noticeString() {
|
||||
return !abilityId.isEmpty() ? "Ability[" + abilityId + "]" : "Ability";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestData() {
|
||||
if (!abilityId.isEmpty())
|
||||
AbilityScriptPacket.Get(abilityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSavePacket(int index, int totalCount, NBTTagCompound nbt) {
|
||||
if (!abilityId.isEmpty())
|
||||
AbilityScriptPacket.Save(abilityId, index, totalCount, nbt);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user