Cleanup Code

This commit is contained in:
Daniel Mills
2021-07-20 11:36:44 -04:00
parent 4e81151e11
commit 4d90bd9e31
45 changed files with 350 additions and 601 deletions

View File

@@ -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;
}
}

View File

@@ -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);
}

View File

@@ -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);
}