mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 00:17:27 +00:00
Consolidated EventScriptContainer and ScriptContainer into a single ScriptContainer class. NPCs are now able to fly when ai.movementType == 1.
This commit is contained in:
1 parent
f3ebf86b1e
commit
72869e6a78
14 files changed
+422
-457
No files matched your search
@@ -13,10 +13,9 @@ import java.util.TreeMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.EventScriptContainer;
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.controllers.IScriptHandler;
|
||||
@@ -26,7 +25,7 @@ import noppes.npcs.scripted.wrapper.WrapperNpcAPI;
|
||||
import javax.script.ScriptEngine;
|
||||
|
||||
public class ForgeDataScript implements IScriptHandler {
|
||||
private List<EventScriptContainer> scripts = new ArrayList();
|
||||
private List<ScriptContainer> scripts = new ArrayList();
|
||||
private String scriptLanguage = "ECMAScript";
|
||||
public long lastInited = -1L;
|
||||
private boolean enabled = false;
|
||||
@@ -69,7 +68,7 @@ public class ForgeDataScript implements IScriptHandler {
|
||||
Iterator var3 = this.scripts.iterator();
|
||||
|
||||
while (var3.hasNext()) {
|
||||
EventScriptContainer script = (EventScriptContainer) var3.next();
|
||||
ScriptContainer script = (ScriptContainer) var3.next();
|
||||
|
||||
script.setEngine(scriptLanguage);
|
||||
if(script.engine == null)
|
||||
@@ -80,8 +79,6 @@ public class ForgeDataScript implements IScriptHandler {
|
||||
script.engine.put("event", event);
|
||||
script.engine.put("API", new WrapperNpcAPI());
|
||||
|
||||
ScriptEngine engine = script.engine;
|
||||
|
||||
script.run(type, event);
|
||||
}
|
||||
//});
|
||||
@@ -112,7 +109,7 @@ public class ForgeDataScript implements IScriptHandler {
|
||||
this.scriptLanguage = lang;
|
||||
}
|
||||
|
||||
public List<EventScriptContainer> getScripts() {
|
||||
public List<ScriptContainer> getScripts() {
|
||||
return this.scripts;
|
||||
}
|
||||
|
||||
@@ -126,7 +123,7 @@ public class ForgeDataScript implements IScriptHandler {
|
||||
Iterator var3 = this.getScripts().iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
EventScriptContainer script = (EventScriptContainer)var3.next();
|
||||
ScriptContainer script = (ScriptContainer)var3.next();
|
||||
++tab;
|
||||
Iterator var5 = script.console.entrySet().iterator();
|
||||
|
||||
@@ -143,7 +140,7 @@ public class ForgeDataScript implements IScriptHandler {
|
||||
Iterator var1 = this.getScripts().iterator();
|
||||
|
||||
while(var1.hasNext()) {
|
||||
EventScriptContainer script = (EventScriptContainer)var1.next();
|
||||
ScriptContainer script = (ScriptContainer)var1.next();
|
||||
script.console.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user