mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 15:02:17 +00:00
Added several more functions to pre-existing classes:
-Spawner, Transport, Healer, Guard, Bard jobs received more functions. -Added more functions to the transporter role. -IRole: Added getNpc() function. -IAnimal, IEntityLiving, and IEntityLivingBase received more functions from their MC counterparts. -Nearly every function with that takes position/vector parameters now has an equivalent with IPos as a parameter instead.
This commit is contained in:
1 parent
112e82a09d
commit
e9a8f8cebc
51 files changed
+1025
-227
No files matched your search
@@ -19,6 +19,7 @@ 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;
|
||||
@@ -209,10 +210,18 @@ 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) {
|
||||
|
||||
@@ -2,6 +2,8 @@ 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 {
|
||||
@@ -78,6 +80,16 @@ 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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user