mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 15:45:10 +00:00
Added drowning types:
In Air, In Water, or Never to CNPCs.
This commit is contained in:
1 parent
44225194ac
commit
55b21de050
9 files changed
+102
-44
No files matched your search
@@ -204,6 +204,28 @@ public class ServerCloneController implements ICloneHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public IEntity[] getTab(int tab, IWorld world) {
|
||||
File dir = new File(getDir(), tab + "");
|
||||
if (!dir.exists() || !dir.isDirectory() || dir.listFiles() == null) {
|
||||
return new IEntity[]{};
|
||||
}
|
||||
|
||||
ArrayList<IEntity> arrayList = new ArrayList<>();
|
||||
|
||||
try {
|
||||
for (File file : dir.listFiles()) {
|
||||
if (file.getName().endsWith(".json")) {
|
||||
NBTTagCompound compound = NBTJsonUtil.LoadFile(file);
|
||||
Instance.cleanTags(compound);
|
||||
Entity entity = EntityList.createEntityFromNBT(compound, world.getMCWorld());
|
||||
arrayList.add(entity == null ? null : NpcAPI.Instance().getIEntity(entity));
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
return arrayList.toArray(new IEntity[]{});
|
||||
}
|
||||
|
||||
public IEntity get(int tab, String name, IWorld world) {
|
||||
NBTTagCompound compound = this.getCloneData((ICommandSender)null, name, tab);
|
||||
if (compound == null) {
|
||||
|
||||
Reference in new issue
Block a user