mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 15:56:27 +00:00
Fixes
This commit is contained in:
@@ -21,25 +21,10 @@ import ninja.bytecode.shuriken.math.RNG;
|
||||
public class IrisBiome
|
||||
{
|
||||
public static final double MAX_HEIGHT = 0.77768;
|
||||
public static final double IDEAL_HEIGHT = 0.1127;
|
||||
public static final double IDEAL_HEIGHT = 0.0527;
|
||||
public static final double MIN_HEIGHT = -0.0218;
|
||||
|
||||
//@builder
|
||||
private static final IrisBiome RIVER = new IrisBiome("River", Biome.RIVER)
|
||||
.surface(MB.of(Material.SAND))
|
||||
.coreBiome();
|
||||
private static final IrisBiome BEACH = new IrisBiome("Beach", Biome.BEACHES)
|
||||
.height(-0.078)
|
||||
.coreBiome()
|
||||
.surface(MB.of(Material.SAND));
|
||||
public static final IrisBiome ROAD_GRAVEL = new IrisBiome("Gravel Road", Biome.PLAINS)
|
||||
.surface(MB.of(Material.GRAVEL), MB.of(Material.COBBLESTONE))
|
||||
.coreBiome()
|
||||
.scatter(MB.of(Material.TORCH), 0.05);
|
||||
public static final IrisBiome ROAD_GRASSY = new IrisBiome("Grass Path", Biome.PLAINS)
|
||||
.surface(MB.of(Material.GRASS_PATH))
|
||||
.coreBiome()
|
||||
.scatter(MB.of(Material.TORCH), 0.05);
|
||||
private static final IrisBiome OCEAN = new IrisBiome("Ocean", Biome.OCEAN)
|
||||
.height(-0.5)
|
||||
.coreBiome()
|
||||
@@ -83,26 +68,6 @@ public class IrisBiome
|
||||
return MIN_HEIGHT;
|
||||
}
|
||||
|
||||
public static IrisBiome getRiver()
|
||||
{
|
||||
return RIVER;
|
||||
}
|
||||
|
||||
public static IrisBiome getBeach()
|
||||
{
|
||||
return BEACH;
|
||||
}
|
||||
|
||||
public static IrisBiome getRoadGravel()
|
||||
{
|
||||
return ROAD_GRAVEL;
|
||||
}
|
||||
|
||||
public static IrisBiome getRoadGrassy()
|
||||
{
|
||||
return ROAD_GRASSY;
|
||||
}
|
||||
|
||||
public static IrisBiome getOcean()
|
||||
{
|
||||
return OCEAN;
|
||||
@@ -146,7 +111,7 @@ public class IrisBiome
|
||||
|
||||
public IrisBiome(String name, Biome realBiome)
|
||||
{
|
||||
this.region = "Default";
|
||||
this.region = "default";
|
||||
this.core = false;
|
||||
this.name = name;
|
||||
this.realBiome = realBiome;
|
||||
@@ -454,7 +419,7 @@ public class IrisBiome
|
||||
|
||||
public static GList<IrisBiome> getBiomes()
|
||||
{
|
||||
return map.v().remove(IrisBiome.BEACH, IrisBiome.OCEAN, IrisBiome.DEEP_OCEAN, IrisBiome.ROAD_GRASSY, IrisBiome.ROAD_GRAVEL, IrisBiome.BEACH, IrisBiome.RIVER);
|
||||
return map.v().remove(IrisBiome.OCEAN, IrisBiome.DEEP_OCEAN);
|
||||
}
|
||||
|
||||
public static GList<IrisBiome> getAllBiomes()
|
||||
|
||||
@@ -1,18 +1,37 @@
|
||||
package ninja.bytecode.iris.pack;
|
||||
|
||||
import ninja.bytecode.iris.Iris;
|
||||
import ninja.bytecode.iris.controller.PackController;
|
||||
import ninja.bytecode.iris.util.MaxingGenerator.EnumMaxingGenerator;
|
||||
import ninja.bytecode.shuriken.collections.GList;
|
||||
import ninja.bytecode.shuriken.execution.J;
|
||||
import ninja.bytecode.shuriken.json.JSONObject;
|
||||
|
||||
public class IrisRegion
|
||||
{
|
||||
private String name;
|
||||
private GList<IrisBiome> biomes;
|
||||
private EnumMaxingGenerator<IrisBiome> gen;
|
||||
private double rarity;
|
||||
private IrisBiome beach;
|
||||
|
||||
public IrisRegion(String name)
|
||||
{
|
||||
this.name = name;
|
||||
this.biomes = new GList<>();
|
||||
rarity = 1;
|
||||
beach = null;
|
||||
}
|
||||
|
||||
public void load()
|
||||
{
|
||||
J.attempt(() ->
|
||||
{
|
||||
JSONObject o = Iris.getController(PackController.class).loadJSON("pack/regions/" + name + ".json");
|
||||
J.attempt(() -> name = o.getString("name"));
|
||||
J.attempt(() -> rarity = o.getDouble("rarity"));
|
||||
J.attempt(() -> beach = Iris.getController(PackController.class).getBiomeById(o.getString("beach")));
|
||||
});
|
||||
}
|
||||
|
||||
public EnumMaxingGenerator<IrisBiome> getGen()
|
||||
@@ -45,13 +64,38 @@ public class IrisRegion
|
||||
this.biomes = biomes;
|
||||
}
|
||||
|
||||
public double getRarity()
|
||||
{
|
||||
return rarity;
|
||||
}
|
||||
|
||||
public void setRarity(double rarity)
|
||||
{
|
||||
this.rarity = rarity;
|
||||
}
|
||||
|
||||
public IrisBiome getBeach()
|
||||
{
|
||||
return beach;
|
||||
}
|
||||
|
||||
public void setBeach(IrisBiome beach)
|
||||
{
|
||||
this.beach = beach;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((beach == null) ? 0 : beach.hashCode());
|
||||
result = prime * result + ((biomes == null) ? 0 : biomes.hashCode());
|
||||
result = prime * result + ((gen == null) ? 0 : gen.hashCode());
|
||||
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
||||
long temp;
|
||||
temp = Double.doubleToLongBits(rarity);
|
||||
result = prime * result + (int) (temp ^ (temp >>> 32));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -65,6 +109,13 @@ public class IrisRegion
|
||||
if(getClass() != obj.getClass())
|
||||
return false;
|
||||
IrisRegion other = (IrisRegion) obj;
|
||||
if(beach == null)
|
||||
{
|
||||
if(other.beach != null)
|
||||
return false;
|
||||
}
|
||||
else if(!beach.equals(other.beach))
|
||||
return false;
|
||||
if(biomes == null)
|
||||
{
|
||||
if(other.biomes != null)
|
||||
@@ -72,6 +123,13 @@ public class IrisRegion
|
||||
}
|
||||
else if(!biomes.equals(other.biomes))
|
||||
return false;
|
||||
if(gen == null)
|
||||
{
|
||||
if(other.gen != null)
|
||||
return false;
|
||||
}
|
||||
else if(!gen.equals(other.gen))
|
||||
return false;
|
||||
if(name == null)
|
||||
{
|
||||
if(other.name != null)
|
||||
@@ -79,6 +137,8 @@ public class IrisRegion
|
||||
}
|
||||
else if(!name.equals(other.name))
|
||||
return false;
|
||||
if(Double.doubleToLongBits(rarity) != Double.doubleToLongBits(other.rarity))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user