This commit is contained in:
Daniel Mills
2020-01-17 10:40:45 -05:00
parent 451eca0aa9
commit 3a699d34eb
11 changed files with 135 additions and 99 deletions

View File

@@ -934,7 +934,6 @@ public class IrisBiome
{
final int prime = 31;
int result = 1;
result = prime * result + ((bng == null) ? 0 : bng.hashCode());
long temp;
temp = Double.doubleToLongBits(cliffChance);
result = prime * result + (int) (temp ^ (temp >>> 32));
@@ -956,9 +955,6 @@ public class IrisBiome
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((parent == null) ? 0 : parent.hashCode());
result = prime * result + ((poly == null) ? 0 : poly.hashCode());
result = prime * result + ((polyRock == null) ? 0 : polyRock.hashCode());
result = prime * result + ((polySub == null) ? 0 : polySub.hashCode());
result = prime * result + ((realBiome == null) ? 0 : realBiome.hashCode());
result = prime * result + ((region == null) ? 0 : region.hashCode());
result = prime * result + ((rock == null) ? 0 : rock.hashCode());
@@ -994,13 +990,6 @@ public class IrisBiome
if(getClass() != obj.getClass())
return false;
IrisBiome other = (IrisBiome) obj;
if(bng == null)
{
if(other.bng != null)
return false;
}
else if(!bng.equals(other.bng))
return false;
if(Double.doubleToLongBits(cliffChance) != Double.doubleToLongBits(other.cliffChance))
return false;
if(Double.doubleToLongBits(cliffScale) != Double.doubleToLongBits(other.cliffScale))
@@ -1042,27 +1031,6 @@ public class IrisBiome
}
else if(!parent.equals(other.parent))
return false;
if(poly == null)
{
if(other.poly != null)
return false;
}
else if(!poly.equals(other.poly))
return false;
if(polyRock == null)
{
if(other.polyRock != null)
return false;
}
else if(!polyRock.equals(other.polyRock))
return false;
if(polySub == null)
{
if(other.polySub != null)
return false;
}
else if(!polySub.equals(other.polySub))
return false;
if(realBiome != other.realBiome)
return false;
if(region == null)

View File

@@ -8,6 +8,8 @@ import ninja.bytecode.iris.Iris;
import ninja.bytecode.iris.controller.PackController;
import ninja.bytecode.shuriken.collections.GList;
import ninja.bytecode.shuriken.execution.J;
import ninja.bytecode.shuriken.execution.TaskExecutor;
import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup;
import ninja.bytecode.shuriken.json.JSONArray;
import ninja.bytecode.shuriken.json.JSONException;
import ninja.bytecode.shuriken.json.JSONObject;
@@ -65,14 +67,21 @@ public class IrisDimension
private GList<IrisBiome> biomesFromArray(JSONArray a) throws JSONException, IOException
{
GList<IrisBiome> b = new GList<>();
TaskExecutor t = new TaskExecutor(Runtime.getRuntime().availableProcessors() * 2, Thread.MIN_PRIORITY, "Biome Loader");
TaskGroup g = t.startWork();
for(int i = 0; i < a.length(); i++)
{
int ii = i;
IrisBiome bb = Iris.getController(PackController.class).loadBiome(a.getString(ii));
Iris.getController(PackController.class).registerBiome(a.getString(ii), bb);
b.add(bb);
g.queue(() ->
{
IrisBiome bb = Iris.getController(PackController.class).loadBiome(a.getString(ii));
Iris.getController(PackController.class).registerBiome(a.getString(ii), bb);
b.add(bb);
});
}
g.execute();
t.close();
return b;
}