Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/noppes/npcs/scripted/NpcAPI.java
#	src/main/java/noppes/npcs/scripted/ScriptWorld.java
#	src/main/java/noppes/npcs/scripted/interfaces/AbstractNpcAPI.java
This commit is contained in:
Luis C.M committed 2022-11-06 01:00:47 -06:00
commit 66edbcea80
58 files changed
+283 -779

No files matched your search

@@ -19,7 +19,6 @@ import noppes.npcs.LogWriter;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.scripted.CustomNPCsException;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.interfaces.IPos;
import noppes.npcs.scripted.interfaces.handler.ICloneHandler;
import noppes.npcs.scripted.interfaces.entity.IEntity;
import noppes.npcs.scripted.interfaces.IWorld;
@@ -210,18 +209,10 @@ public class ServerCloneController implements ICloneHandler {
}
}
public IEntity spawn(IPos pos, int tab, String name, IWorld world, boolean ignoreProtection) {
return this.spawn(pos.getX(),pos.getY(),pos.getZ(),tab,name,world,ignoreProtection);
}
public IEntity spawn(double x, double y, double z, int tab, String name, IWorld world) {
return spawn(x, y, z, tab, name, world, true);
}
public IEntity spawn(IPos pos, int tab, String name, IWorld world) {
return this.spawn(pos.getX(),pos.getY(),pos.getZ(),tab,name,world);
}
public IEntity[] getTab(int tab, IWorld world) {
File dir = new File(getDir(), tab + "");
if (!dir.exists() || !dir.isDirectory() || dir.listFiles() == null) {
@@ -137,7 +137,11 @@ public class DataScript implements IScriptHandler {
script.engine.put(obs[i].toString(), ob);
}
if(CustomNpcs.ScriptLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
LogWriter.postScriptLog(npc.field_110179_h, type, String.format("[%s] NPC %s (%s, %s, %s) | Objects: %s", ((String)type.function).toUpperCase(), npc.display.name, (int)npc.posX, (int)npc.posY, (int)npc.posZ, Arrays.toString(obs)));
if(obs.length > 1 && obs[1] == null){
LogWriter.postScriptLog(npc.field_110179_h, type, String.format("[%s] NPC %s (%s, %s, %s)", ((String)type.function).toUpperCase(), npc.display.name, (int)npc.posX, (int)npc.posY, (int)npc.posZ));
} else {
LogWriter.postScriptLog(npc.field_110179_h, type, String.format("[%s] NPC %s (%s, %s, %s) | Objects: %s", ((String)type.function).toUpperCase(), npc.display.name, (int)npc.posX, (int)npc.posY, (int)npc.posZ, Arrays.toString(obs)));
}
}
return callScript(script, event);
}
@@ -2,8 +2,6 @@ package noppes.npcs.controllers.data;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.controllers.TransportController;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.interfaces.IPos;
import noppes.npcs.scripted.interfaces.handler.data.ITransportLocation;
public class TransportLocation implements ITransportLocation {
@@ -80,16 +78,6 @@ public class TransportLocation implements ITransportLocation {
this.posZ = z;
}
public void setPosition(IPos pos) {
this.posX = pos.getX();
this.posY = pos.getY();
this.posZ = pos.getZ();
}
public IPos getPos() {
return NpcAPI.Instance().getIPos(this.posX, this.posY, this.posZ);
}
public double getX() {
return posX;
}