mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 16:26:14 +00:00
Cleanup
This commit is contained in:
@@ -92,7 +92,7 @@ public class IrisEntityInitialSpawn {
|
||||
private Entity spawn100(Engine g, Location at) {
|
||||
try {
|
||||
return getRealEntity(g).spawn(g, at.clone().add(0.5, 1, 0.5), rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4)));
|
||||
} catch (Throwable e){
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.debug("Failed to retrieve real entity @ " + at);
|
||||
return null;
|
||||
|
||||
@@ -87,9 +87,8 @@ public class IrisFeature {
|
||||
return actualRadius.aquire(() -> {
|
||||
double o = 0;
|
||||
|
||||
if(fractureRadius != null)
|
||||
{
|
||||
o+=fractureRadius.getMaxFractureDistance();
|
||||
if (fractureRadius != null) {
|
||||
o += fractureRadius.getMaxFractureDistance();
|
||||
}
|
||||
|
||||
return o + IrisInterpolation.getRealRadius(getInterpolator(), getInterpolationRadius());
|
||||
|
||||
@@ -22,8 +22,6 @@ import com.google.gson.Gson;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.function.NoiseProvider;
|
||||
import com.volmit.iris.util.math.M;
|
||||
@@ -123,12 +121,9 @@ public class IrisFeaturePositional {
|
||||
return M.lerp(1, getFeature().getObjectChance(), getStrength(x, z, rng));
|
||||
}
|
||||
|
||||
public IrisBiome filter(double x, double z, IrisBiome biome, RNG rng)
|
||||
{
|
||||
if(getFeature().getCustomBiome() != null)
|
||||
{
|
||||
if(getStrength(x, z, rng) >= getFeature().getBiomeStrengthThreshold())
|
||||
{
|
||||
public IrisBiome filter(double x, double z, IrisBiome biome, RNG rng) {
|
||||
if (getFeature().getCustomBiome() != null) {
|
||||
if (getStrength(x, z, rng) >= getFeature().getBiomeStrengthThreshold()) {
|
||||
IrisBiome b = biome.getLoader().getBiomeLoader().load(getFeature().getCustomBiome());
|
||||
b.setInferredType(biome.getInferredType());
|
||||
return b;
|
||||
@@ -158,16 +153,16 @@ public class IrisFeaturePositional {
|
||||
}
|
||||
|
||||
public double distance(double x, double z, RNG rng) {
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier()/2 : 1;
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier() / 2 : 1;
|
||||
double mod = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().create(rng).fitDouble(-mul, mul, x, z) : 0;
|
||||
return Math.sqrt(Math.pow(this.x - (x + mod), 2) + Math.pow(this.z - (z + mod), 2));
|
||||
}
|
||||
|
||||
public double distance2(double x, double z, RNG rng) {
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier()/2 : 1;
|
||||
double mul = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().getMultiplier() / 2 : 1;
|
||||
double mod = getFeature().getFractureRadius() != null ? getFeature().getFractureRadius().create(rng).fitDouble(-mul, mul, x, z) : 0;
|
||||
|
||||
return Math.pow(this.x - (x+mod), 2) + Math.pow(this.z - (z+mod), 2);
|
||||
return Math.pow(this.x - (x + mod), 2) + Math.pow(this.z - (z + mod), 2);
|
||||
}
|
||||
|
||||
private NoiseProvider getNoiseProvider(RNG rng) {
|
||||
|
||||
@@ -18,27 +18,13 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisDataManager;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.data.DataProvider;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.io.IO;
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@SuppressWarnings("DefaultAnnotationParam")
|
||||
@Accessors(chain = true)
|
||||
|
||||
@@ -18,12 +18,11 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListBiome;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListRegion;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListRegion;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -21,11 +21,7 @@ package com.volmit.iris.engine.object;
|
||||
import com.volmit.iris.engine.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.interpolation.IrisInterpolation;
|
||||
import com.volmit.iris.engine.noise.CNG;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MaxNumber;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@@ -44,7 +44,6 @@ import org.bukkit.block.TileState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.block.data.type.Leaves;
|
||||
import org.bukkit.entity.ThrownExpBottle;
|
||||
import org.bukkit.util.BlockVector;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@@ -582,8 +581,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
int lowest = Integer.MAX_VALUE;
|
||||
y += yrand;
|
||||
readLock.lock();
|
||||
try
|
||||
{
|
||||
try {
|
||||
for (BlockVector g : getBlocks().keySet()) {
|
||||
BlockData d;
|
||||
TileData<? extends TileState> tile = null;
|
||||
@@ -621,12 +619,9 @@ public class IrisObject extends IrisRegistrant {
|
||||
if (j.isExact() ? k.matches(data) : k.getMaterial().equals(data.getMaterial())) {
|
||||
BlockData newData = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||
|
||||
if (newData.getMaterial() == data.getMaterial())
|
||||
{
|
||||
if (newData.getMaterial() == data.getMaterial()) {
|
||||
data = data.merge(newData);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
data = newData;
|
||||
}
|
||||
}
|
||||
@@ -680,10 +675,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
readLock.unlock();
|
||||
|
||||
@@ -64,8 +64,7 @@ public class IrisObjectRotation {
|
||||
}
|
||||
|
||||
public IrisObject rotateCopy(IrisObject e) {
|
||||
if(e == null)
|
||||
{
|
||||
if (e == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -24,10 +24,11 @@ public class IrisTreeSize {
|
||||
|
||||
/**
|
||||
* Does the size match
|
||||
*
|
||||
* @param size the size to check match
|
||||
* @return true if it matches (fits within width and depth)
|
||||
*/
|
||||
public boolean doesMatch(IrisTreeSize size){
|
||||
public boolean doesMatch(IrisTreeSize size) {
|
||||
return (width == size.getWidth() && depth == size.getDepth()) || (depth == size.getWidth() && width == size.getDepth());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user