API Changes:

-Implemented interfaces for all jobs & roles.

ScriptPlayer:
-Added getData() function, which returns player data objects.

IPlayerData: New class that holds all player data for modification.
-Holds dialog, bank, quest, transport, faction, item giver, and mail data.
-Also holds companion data, with functions has/set/getCompanion, and a getCompanionID function to differentiate companions.
This commit is contained in:
Luis C.M committed 2022-06-12 01:26:23 -05:00
1 parent 587f63396f
commit 63a1525ee2
66 files changed
+1418 -207

No files matched your search

@@ -6,6 +6,7 @@
package noppes.npcs.scripted;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -93,6 +94,10 @@ public class NpcAPI extends AbstractNpcAPI {
return ServerCloneController.Instance;
}
public ITransportHandler getLocations() {
return TransportController.getInstance();
}
public IEntity getIEntity(Entity entity) {
if(entity == null)
return null;
@@ -121,6 +126,18 @@ public class NpcAPI extends AbstractNpcAPI {
}
}
public IEntity[] getLoadedEntities() {
ArrayList<IEntity> list = new ArrayList<>();
for (IWorld world : worldCache.values()) {
for (Object obj : world.getMCWorld().loadedEntityList) {
list.add(NpcAPI.Instance().getIEntity((Entity) obj));
}
}
return list.toArray(new IEntity[0]);
}
public IBlock getIBlock(World world, BlockPos pos) {
return new ScriptBlock(world, world.getBlock(pos.getX(),pos.getY(),pos.getZ()), pos);
}