mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 06:55:03 +00:00
NpcAPI:
-Added getPlayer() function -Added getChunkLoadingNPCs function -Added getCurrentPlayerCount, getMaxPlayers, and kickAllPlayers, isHardcore, getFile(path), and getServerOwner functions
This commit is contained in:
1 parent
e9a8f8cebc
commit
3fd962289c
6 files changed
+78
-18
No files matched your search
@@ -1,6 +1,5 @@
|
||||
package noppes.npcs.controllers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -16,16 +15,16 @@ import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobChunkLoader;
|
||||
|
||||
public class ChunkController implements LoadingCallback{
|
||||
public static ChunkController instance;
|
||||
|
||||
private HashMap<Entity,Ticket> tickets = new HashMap<Entity,Ticket>();
|
||||
public HashMap<Entity,Ticket> tickets = new HashMap<Entity,Ticket>();
|
||||
|
||||
public ChunkController(){
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
tickets = new HashMap<Entity,Ticket>();
|
||||
}
|
||||
@@ -34,7 +33,7 @@ public class ChunkController implements LoadingCallback{
|
||||
Ticket ticket = tickets.get(npc);
|
||||
if(ticket != null)
|
||||
return ticket;
|
||||
if(size() >= CustomNpcs.ChuckLoaders)
|
||||
if(size() >= CustomNpcs.ChunkLoaders)
|
||||
return null;
|
||||
ticket = ForgeChunkManager.requestTicket(CustomNpcs.instance, npc.worldObj, Type.ENTITY);
|
||||
if(ticket == null)
|
||||
|
||||
Reference in new issue
Block a user