mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Cleanup sources
This commit is contained in:
parent
51a056b3d7
commit
43d7dfde4c
@ -22,7 +22,6 @@ import com.volmit.iris.core.*;
|
|||||||
import com.volmit.iris.core.command.CommandIris;
|
import com.volmit.iris.core.command.CommandIris;
|
||||||
import com.volmit.iris.core.command.PermissionIris;
|
import com.volmit.iris.core.command.PermissionIris;
|
||||||
import com.volmit.iris.core.command.world.CommandLocate;
|
import com.volmit.iris.core.command.world.CommandLocate;
|
||||||
import com.volmit.iris.core.events.IrisEngineHotloadEvent;
|
|
||||||
import com.volmit.iris.core.link.IrisPapiExpansion;
|
import com.volmit.iris.core.link.IrisPapiExpansion;
|
||||||
import com.volmit.iris.core.link.MultiverseCoreLink;
|
import com.volmit.iris.core.link.MultiverseCoreLink;
|
||||||
import com.volmit.iris.core.link.OraxenLink;
|
import com.volmit.iris.core.link.OraxenLink;
|
||||||
|
@ -30,7 +30,6 @@ import com.volmit.iris.util.math.RNG;
|
|||||||
import com.volmit.iris.util.plugin.MortarCommand;
|
import com.volmit.iris.util.plugin.MortarCommand;
|
||||||
import com.volmit.iris.util.plugin.VolmitSender;
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
||||||
@ -73,7 +72,6 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Supplier<Function2<Double, Double, Double>> l = () -> {
|
Supplier<Function2<Double, Double, Double>> l = () -> {
|
||||||
long seed = 12345;
|
long seed = 12345;
|
||||||
IrisGenerator generator;
|
IrisGenerator generator;
|
||||||
@ -84,8 +82,7 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
|||||||
generator = IrisData.loadAnyGenerator(args[0]);
|
generator = IrisData.loadAnyGenerator(args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(generator == null)
|
if (generator == null) {
|
||||||
{
|
|
||||||
return (x, z) -> 0D;
|
return (x, z) -> 0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +91,6 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NoiseExplorerGUI.launch(l, "Custom Generator");
|
NoiseExplorerGUI.launch(l, "Custom Generator");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -42,7 +42,6 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class NoiseExplorerGUI extends JPanel implements MouseWheelListener, Listener {
|
public class NoiseExplorerGUI extends JPanel implements MouseWheelListener, Listener {
|
||||||
@ -108,8 +107,7 @@ public class NoiseExplorerGUI extends JPanel implements MouseWheelListener, List
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void on(IrisEngineHotloadEvent e)
|
public void on(IrisEngineHotloadEvent e) {
|
||||||
{
|
|
||||||
generator = loader.get();
|
generator = loader.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,8 +195,7 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stream<T> streamAll(Stream<String> s)
|
public Stream<T> streamAll(Stream<String> s) {
|
||||||
{
|
|
||||||
return s.map(this::load);
|
return s.map(this::load);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,13 +413,11 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
|||||||
|
|
||||||
IrisEngineData getEngineData();
|
IrisEngineData getEngineData();
|
||||||
|
|
||||||
default IrisBiome getSurfaceBiome(Chunk c)
|
default IrisBiome getSurfaceBiome(Chunk c) {
|
||||||
{
|
|
||||||
return getSurfaceBiome((c.getX() << 4) + 8, (c.getZ() << 4) + 8);
|
return getSurfaceBiome((c.getX() << 4) + 8, (c.getZ() << 4) + 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
default IrisRegion getRegion(Chunk c)
|
default IrisRegion getRegion(Chunk c) {
|
||||||
{
|
|
||||||
return getRegion((c.getX() << 4) + 8, (c.getZ() << 4) + 8);
|
return getRegion((c.getX() << 4) + 8, (c.getZ() << 4) + 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ import com.volmit.iris.engine.cache.Cache;
|
|||||||
import com.volmit.iris.engine.data.B;
|
import com.volmit.iris.engine.data.B;
|
||||||
import com.volmit.iris.engine.data.DataProvider;
|
import com.volmit.iris.engine.data.DataProvider;
|
||||||
import com.volmit.iris.engine.hunk.Hunk;
|
import com.volmit.iris.engine.hunk.Hunk;
|
||||||
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
|
||||||
import com.volmit.iris.engine.jigsaw.PlannedStructure;
|
import com.volmit.iris.engine.jigsaw.PlannedStructure;
|
||||||
import com.volmit.iris.engine.object.*;
|
import com.volmit.iris.engine.object.*;
|
||||||
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
import com.volmit.iris.engine.object.common.IObjectPlacer;
|
||||||
@ -198,8 +197,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
default KList<IrisFeaturePositional> getFeaturesInChunk(int x, int z)
|
default KList<IrisFeaturePositional> getFeaturesInChunk(int x, int z) {
|
||||||
{
|
|
||||||
KList<IrisFeaturePositional> pos = new KList<>();
|
KList<IrisFeaturePositional> pos = new KList<>();
|
||||||
|
|
||||||
for (IrisFeaturePositional i : getEngine().getDimension().getSpecificFeatures()) {
|
for (IrisFeaturePositional i : getEngine().getDimension().getSpecificFeatures()) {
|
||||||
@ -567,8 +565,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
|
|
||||||
}, null, getData());
|
}, null, getData());
|
||||||
|
|
||||||
if(p.usesFeatures())
|
if (p.usesFeatures()) {
|
||||||
{
|
|
||||||
if (p.isVacuum()) {
|
if (p.isVacuum()) {
|
||||||
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
||||||
double a = Math.max(v.getW(), v.getD());
|
double a = Math.max(v.getW(), v.getD());
|
||||||
@ -588,8 +585,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
rw.getFeatures().add(new IrisFeaturePositional(xx, zz, f));
|
rw.getFeatures().add(new IrisFeaturePositional(xx, zz, f));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisFeaturePotential j : p.getAddFeatures())
|
for (IrisFeaturePotential j : p.getAddFeatures()) {
|
||||||
{
|
|
||||||
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
||||||
double a = Math.max(v.getW(), v.getD());
|
double a = Math.max(v.getW(), v.getD());
|
||||||
|
|
||||||
@ -629,8 +625,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
|
|
||||||
}, null, getData());
|
}, null, getData());
|
||||||
|
|
||||||
if(objectPlacement.usesFeatures())
|
if (objectPlacement.usesFeatures()) {
|
||||||
{
|
|
||||||
if (objectPlacement.isVacuum()) {
|
if (objectPlacement.isVacuum()) {
|
||||||
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
||||||
double a = Math.max(v.getW(), v.getD());
|
double a = Math.max(v.getW(), v.getD());
|
||||||
@ -650,8 +645,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
rw.getFeatures().add(new IrisFeaturePositional(xx, zz, f));
|
rw.getFeatures().add(new IrisFeaturePositional(xx, zz, f));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisFeaturePotential j : objectPlacement.getAddFeatures())
|
for (IrisFeaturePotential j : objectPlacement.getAddFeatures()) {
|
||||||
{
|
|
||||||
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
||||||
double a = Math.max(v.getW(), v.getD());
|
double a = Math.max(v.getW(), v.getD());
|
||||||
|
|
||||||
@ -952,8 +946,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChunkCoordinates
|
@ChunkCoordinates
|
||||||
default KList<IrisFeaturePositional> getFeaturesInChunk(Chunk c)
|
default KList<IrisFeaturePositional> getFeaturesInChunk(Chunk c) {
|
||||||
{
|
|
||||||
return getFeaturesInChunk(c.getX(), c.getZ());
|
return getFeaturesInChunk(c.getX(), c.getZ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,9 @@ package com.volmit.iris.engine.object;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.engine.IrisComplex;
|
import com.volmit.iris.engine.IrisComplex;
|
||||||
import com.volmit.iris.engine.cache.AtomicCache;
|
import com.volmit.iris.engine.cache.AtomicCache;
|
||||||
import com.volmit.iris.engine.data.B;
|
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.framework.EngineFramework;
|
import com.volmit.iris.engine.framework.EngineFramework;
|
||||||
import com.volmit.iris.engine.modifier.IrisCaveModifier;
|
import com.volmit.iris.engine.modifier.IrisCaveModifier;
|
||||||
import com.volmit.iris.engine.modifier.IrisPostModifier;
|
|
||||||
import com.volmit.iris.engine.object.annotations.Desc;
|
import com.volmit.iris.engine.object.annotations.Desc;
|
||||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||||
@ -41,14 +39,7 @@ import lombok.NoArgsConstructor;
|
|||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.block.data.type.Slab;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.potion.PotionEffect;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
import org.bukkit.potion.PotionType;
|
|
||||||
|
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ -87,8 +78,7 @@ public class IrisEntitySpawn implements IRare {
|
|||||||
int z = (c.getZ() * 16) + rng.i(15);
|
int z = (c.getZ() * 16) + rng.i(15);
|
||||||
int h = gen.getHeight(x, z, true);
|
int h = gen.getHeight(x, z, true);
|
||||||
int hf = gen.getHeight(x, z, false);
|
int hf = gen.getHeight(x, z, false);
|
||||||
Location l = switch(getReferenceSpawner().getGroup())
|
Location l = switch (getReferenceSpawner().getGroup()) {
|
||||||
{
|
|
||||||
case NORMAL -> new Location(c.getWorld(), x, hf + 1, z);
|
case NORMAL -> new Location(c.getWorld(), x, hf + 1, z);
|
||||||
case CAVE -> {
|
case CAVE -> {
|
||||||
IrisComplex comp = gen.getFramework().getComplex();
|
IrisComplex comp = gen.getFramework().getComplex();
|
||||||
@ -111,8 +101,7 @@ public class IrisEntitySpawn implements IRare {
|
|||||||
case UNDERWATER, BEACH -> new Location(c.getWorld(), x, rng.i(h + 1, hf), z);
|
case UNDERWATER, BEACH -> new Location(c.getWorld(), x, rng.i(h + 1, hf), z);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(l != null)
|
if (l != null) {
|
||||||
{
|
|
||||||
spawn100(gen, l);
|
spawn100(gen, l);
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
@ -218,8 +218,7 @@ public class IrisObjectPlacement {
|
|||||||
return getMode().equals(ObjectPlaceMode.VACUUM);
|
return getMode().equals(ObjectPlaceMode.VACUUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean usesFeatures()
|
public boolean usesFeatures() {
|
||||||
{
|
|
||||||
return isVacuum() || getAddFeatures().isNotEmpty();
|
return isVacuum() || getAddFeatures().isNotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ -52,10 +51,8 @@ public class IrisSpawner extends IrisRegistrant {
|
|||||||
@Desc("Where should these spawns be placed")
|
@Desc("Where should these spawns be placed")
|
||||||
private IrisSpawnGroup group = IrisSpawnGroup.NORMAL;
|
private IrisSpawnGroup group = IrisSpawnGroup.NORMAL;
|
||||||
|
|
||||||
public boolean isValid(IrisBiome biome)
|
public boolean isValid(IrisBiome biome) {
|
||||||
{
|
return switch (group) {
|
||||||
return switch (group)
|
|
||||||
{
|
|
||||||
case NORMAL -> switch (biome.getInferredType()) {
|
case NORMAL -> switch (biome.getInferredType()) {
|
||||||
case SHORE, SEA, CAVE, RIVER, LAKE, DEFER -> false;
|
case SHORE, SEA, CAVE, RIVER, LAKE, DEFER -> false;
|
||||||
case LAND -> true;
|
case LAND -> true;
|
||||||
|
@ -114,8 +114,7 @@ public class RNG extends Random {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double d(double lowerBound, double upperBound) {
|
public double d(double lowerBound, double upperBound) {
|
||||||
if(lowerBound > upperBound)
|
if (lowerBound > upperBound) {
|
||||||
{
|
|
||||||
return M.lerp(upperBound, lowerBound, nextDouble());
|
return M.lerp(upperBound, lowerBound, nextDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user