mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 19:42:19 +00:00
Merge branch 'dev' into syntax-highlighter-unified
This commit is contained in:
commit
45cda3cc90
13 files changed
+167
-25
No files matched your search
@@ -3,6 +3,7 @@ package noppes.npcs.controllers.data;
|
||||
import kamkeel.npcs.network.packets.request.script.ChainedAbilityScriptPacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.constants.ScriptContext;
|
||||
import noppes.npcs.janino.EventJaninoScript;
|
||||
|
||||
/**
|
||||
* Script handler for chained ability scripts.
|
||||
@@ -30,6 +31,11 @@ public class ChainedAbilityScript extends SingleScriptHandler implements IScript
|
||||
this.chainId = chainId != null ? chainId : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IScriptUnit createJaninoScriptUnit() {
|
||||
return new EventJaninoScript(ScriptContext.CHAINED_ABILITY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptContext getContext() {
|
||||
return ScriptContext.CHAINED_ABILITY;
|
||||
|
||||
@@ -157,6 +157,17 @@ public interface IScriptUnit {
|
||||
*/
|
||||
void setErrored(boolean errored);
|
||||
|
||||
// ==================== INSTANCE SCOPE ====================
|
||||
|
||||
/**
|
||||
* Create an instance-scoped copy of this script unit for isolated execution.
|
||||
* The instance shares compiled code with the template but has isolated state.
|
||||
*
|
||||
* @param instanceHandler the script handler for the new instance
|
||||
* @return a new IScriptUnit with isolated variable state
|
||||
*/
|
||||
IScriptUnit createInstanceScope(IScriptHandler instanceHandler);
|
||||
|
||||
// ==================== EXECUTION ====================
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user