Significantly increased load time when using many mods
This commit is contained in:
parent
604a8fe8e1
commit
33066df231
|
|
@ -18,7 +18,23 @@ public class ListHandler
|
||||||
|
|
||||||
public static boolean isForbidden(Block block)
|
public static boolean isForbidden(Block block)
|
||||||
{
|
{
|
||||||
return FORBIDDEN_TILES.contains(block.getRegistryName().toString());
|
String name = block.getRegistryName().toString();
|
||||||
|
if (FORBIDDEN_TILES.contains(name))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boolean contains = false;
|
||||||
|
for (String s : FORBIDDEN_TILES)
|
||||||
|
{
|
||||||
|
if (s.contains("*"))
|
||||||
|
{
|
||||||
|
if(name.contains(s.replace("*", "")))
|
||||||
|
contains = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return contains;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isForbidden(Entity entity)
|
public static boolean isForbidden(Entity entity)
|
||||||
|
|
@ -32,7 +48,8 @@ public class ListHandler
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAllowed(Entity entity){
|
public static boolean isAllowed(Entity entity)
|
||||||
|
{
|
||||||
if (EntityList.getKey(entity) != null)
|
if (EntityList.getKey(entity) != null)
|
||||||
{
|
{
|
||||||
String name = EntityList.getKey(entity).toString();
|
String name = EntityList.getKey(entity).toString();
|
||||||
|
|
@ -44,7 +61,23 @@ public class ListHandler
|
||||||
|
|
||||||
public static boolean isAllowed(Block block)
|
public static boolean isAllowed(Block block)
|
||||||
{
|
{
|
||||||
return ALLOWED_TILES.contains(block.getRegistryName().toString());
|
String name = block.getRegistryName().toString();
|
||||||
|
if (ALLOWED_TILES.contains(name))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boolean contains = false;
|
||||||
|
for (String s : ALLOWED_TILES)
|
||||||
|
{
|
||||||
|
if (s.contains("*"))
|
||||||
|
{
|
||||||
|
if(name.contains(s.replace("*", "")))
|
||||||
|
contains = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return contains;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initForbiddenTiles()
|
public static void initForbiddenTiles()
|
||||||
|
|
@ -54,17 +87,6 @@ public class ListHandler
|
||||||
|
|
||||||
for (int i = 0; i < forbidden.length; i++)
|
for (int i = 0; i < forbidden.length; i++)
|
||||||
{
|
{
|
||||||
if (forbidden[i].contains("*"))
|
|
||||||
{
|
|
||||||
String modid = forbidden[i].replace("*", "");
|
|
||||||
for (int k = 0; k < Block.REGISTRY.getKeys().size(); k++)
|
|
||||||
{
|
|
||||||
if (Block.REGISTRY.getKeys().toArray()[k].toString().contains(modid))
|
|
||||||
{
|
|
||||||
FORBIDDEN_TILES.add(Block.REGISTRY.getKeys().toArray()[k].toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FORBIDDEN_TILES.add(forbidden[i]);
|
FORBIDDEN_TILES.add(forbidden[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,15 +109,17 @@ public class ListHandler
|
||||||
FORBIDDEN_ENTITIES.add(forbiddenEntity[i]);
|
FORBIDDEN_ENTITIES.add(forbiddenEntity[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
String [] allowedEntities=CarryOnConfig.whitelist.allowedEntities;
|
String[] allowedEntities = CarryOnConfig.whitelist.allowedEntities;
|
||||||
ALLOWED_ENTITIES=new ArrayList<String>();
|
ALLOWED_ENTITIES = new ArrayList<String>();
|
||||||
for(int i=0;i<allowedEntities.length;i++){
|
for (int i = 0; i < allowedEntities.length; i++)
|
||||||
if(allowedEntities[i].contains("*"))
|
{
|
||||||
|
if (allowedEntities[i].contains("*"))
|
||||||
{
|
{
|
||||||
String modid=allowedEntities[i].replace("*", "");
|
String modid = allowedEntities[i].replace("*", "");
|
||||||
for(int k=0;k<ForgeRegistries.ENTITIES.getKeys().size();k++)
|
for (int k = 0; k < ForgeRegistries.ENTITIES.getKeys().size(); k++)
|
||||||
{
|
{
|
||||||
if(ForgeRegistries.ENTITIES.getKeys().toArray()[k].toString().contains(modid)){
|
if (ForgeRegistries.ENTITIES.getKeys().toArray()[k].toString().contains(modid))
|
||||||
|
{
|
||||||
ALLOWED_ENTITIES.add(ForgeRegistries.ENTITIES.getKeys().toArray()[k].toString());
|
ALLOWED_ENTITIES.add(ForgeRegistries.ENTITIES.getKeys().toArray()[k].toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -105,20 +129,8 @@ public class ListHandler
|
||||||
|
|
||||||
String[] allowedBlocks = CarryOnConfig.whitelist.allowedBlocks;
|
String[] allowedBlocks = CarryOnConfig.whitelist.allowedBlocks;
|
||||||
ALLOWED_TILES = new ArrayList<String>();
|
ALLOWED_TILES = new ArrayList<String>();
|
||||||
|
|
||||||
for (int i = 0; i < allowedBlocks.length; i++)
|
for (int i = 0; i < allowedBlocks.length; i++)
|
||||||
{
|
{
|
||||||
if (allowedBlocks[i].contains("*"))
|
|
||||||
{
|
|
||||||
String modid = allowedBlocks[i].replace("*", "");
|
|
||||||
for (int k = 0; k < Block.REGISTRY.getKeys().size(); k++)
|
|
||||||
{
|
|
||||||
if (Block.REGISTRY.getKeys().toArray()[k].toString().contains(modid))
|
|
||||||
{
|
|
||||||
ALLOWED_TILES.add(Block.REGISTRY.getKeys().toArray()[k].toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ALLOWED_TILES.add(allowedBlocks[i]);
|
ALLOWED_TILES.add(allowedBlocks[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user