mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Remove PlayerScript Cache
This commit is contained in:
1 parent
8732c3331c
commit
59e1950c70
1 file changed
+2
-7
@@ -73,7 +73,6 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
private static final Map<Integer, ScriptWorld> worldCache = new LRUHashMap<>(10);
|
||||
private static final CacheHashMap<ItemStack, CacheHashMap.CachedObject<ScriptItemStack>> scriptItemCache = new CacheHashMap<>(60*1000);
|
||||
public static final HashMap<String,Object> engineObjects = new HashMap<>();
|
||||
public static final HashMap<String,ScriptEntityData> playerCache = new HashMap<>();
|
||||
public static final EventBus EVENT_BUS = new EventBus();
|
||||
private static AbstractNpcAPI instance = null;
|
||||
|
||||
@@ -196,12 +195,8 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
ScriptEntityData data = (ScriptEntityData) entity.getExtendedProperties("ScriptedObject");
|
||||
if(data != null)
|
||||
return data.base;
|
||||
if(entity instanceof EntityPlayerMP) {
|
||||
if (!playerCache.containsKey(((EntityPlayerMP) entity).getDisplayName())) {
|
||||
playerCache.put(((EntityPlayerMP) entity).getDisplayName(),new ScriptEntityData(new ScriptPlayer<>((EntityPlayerMP) entity)));
|
||||
}
|
||||
data = playerCache.get(((EntityPlayerMP) entity).getDisplayName());
|
||||
}
|
||||
if(entity instanceof EntityPlayerMP)
|
||||
data = new ScriptEntityData(new ScriptPlayer<>((EntityPlayerMP) entity));
|
||||
else if(PixelmonHelper.isPixelmon(entity))
|
||||
return new ScriptPixelmon<EntityTameable>((EntityTameable) entity);
|
||||
else if(entity instanceof EntityAnimal)
|
||||
|
||||
Reference in new issue
Block a user