mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-08 08:46:21 +00:00
Cleanup Code
This commit is contained in:
@@ -515,37 +515,28 @@ public class IrisDimension extends IrisRegistrant {
|
||||
|
||||
public boolean hasFeatures(DataProvider data) {
|
||||
return featuresUsed.aquire(() -> {
|
||||
if(getFeatures().isNotEmpty() || getSpecificFeatures().isNotEmpty())
|
||||
{
|
||||
if (getFeatures().isNotEmpty() || getSpecificFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for(IrisRegion i : getAllRegions(data))
|
||||
{
|
||||
if(i.getFeatures().isNotEmpty())
|
||||
{
|
||||
for (IrisRegion i : getAllRegions(data)) {
|
||||
if (i.getFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for(IrisObjectPlacement j : i.getObjects())
|
||||
{
|
||||
if(j.isVacuum())
|
||||
{
|
||||
for (IrisObjectPlacement j : i.getObjects()) {
|
||||
if (j.isVacuum()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for(IrisBiome j : i.getAllBiomes(data))
|
||||
{
|
||||
if(j.getFeatures().isNotEmpty())
|
||||
{
|
||||
for (IrisBiome j : i.getAllBiomes(data)) {
|
||||
if (j.getFeatures().isNotEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for(IrisObjectPlacement k : i.getObjects())
|
||||
{
|
||||
if(k.isVacuum())
|
||||
{
|
||||
for (IrisObjectPlacement k : i.getObjects()) {
|
||||
if (k.isVacuum()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,13 +142,9 @@ public class IrisLoot {
|
||||
i.apply(rng, m);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
m.setCustomModelData(getCustomModel());
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
m.setLocalizedName(C.translateAlternateColorCodes('&', displayName));
|
||||
@@ -231,13 +227,9 @@ public class IrisLoot {
|
||||
i.apply(rng, m);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
m.setCustomModelData(getCustomModel());
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,31 +47,27 @@ public class IrisWorld {
|
||||
private int minHeight;
|
||||
private int maxHeight;
|
||||
|
||||
public static IrisWorld fromWorld(World world)
|
||||
{
|
||||
public static IrisWorld fromWorld(World world) {
|
||||
return bindWorld(IrisWorld.builder().build(), world);
|
||||
}
|
||||
|
||||
private static IrisWorld bindWorld(IrisWorld iw, World world)
|
||||
{
|
||||
private static IrisWorld bindWorld(IrisWorld iw, World world) {
|
||||
return iw.name(world.getName())
|
||||
.worldFolder(world.getWorldFolder())
|
||||
.seed(world.getSeed())
|
||||
.minHeight(world.getMinHeight())
|
||||
.maxHeight(world.getMaxHeight())
|
||||
.realWorld(world)
|
||||
.environment(world.getEnvironment());
|
||||
.worldFolder(world.getWorldFolder())
|
||||
.seed(world.getSeed())
|
||||
.minHeight(world.getMinHeight())
|
||||
.maxHeight(world.getMaxHeight())
|
||||
.realWorld(world)
|
||||
.environment(world.getEnvironment());
|
||||
}
|
||||
|
||||
public boolean hasRealWorld()
|
||||
{
|
||||
public boolean hasRealWorld() {
|
||||
return realWorld != null;
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
|
||||
if(hasRealWorld())
|
||||
{
|
||||
if (hasRealWorld()) {
|
||||
return realWorld().getPlayers();
|
||||
}
|
||||
|
||||
@@ -79,8 +75,7 @@ public class IrisWorld {
|
||||
}
|
||||
|
||||
public void evacuate() {
|
||||
if(hasRealWorld())
|
||||
{
|
||||
if (hasRealWorld()) {
|
||||
IrisWorlds.evacuate(realWorld());
|
||||
}
|
||||
}
|
||||
@@ -90,8 +85,7 @@ public class IrisWorld {
|
||||
}
|
||||
|
||||
public Location spawnLocation() {
|
||||
if(hasRealWorld())
|
||||
{
|
||||
if (hasRealWorld()) {
|
||||
return realWorld().getSpawnLocation();
|
||||
}
|
||||
|
||||
@@ -100,8 +94,7 @@ public class IrisWorld {
|
||||
}
|
||||
|
||||
public <T extends Entity> Collection<? extends T> getEntitiesByClass(Class<T> t) {
|
||||
if(hasRealWorld())
|
||||
{
|
||||
if (hasRealWorld()) {
|
||||
return realWorld().getEntitiesByClass(t);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user