mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-01-06 15:51:30 +00:00
Compare commits
17 Commits
2.2.6-1.19
...
2.2.9-1.19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2871038584 | ||
|
|
340885f939 | ||
|
|
1e32e47f54 | ||
|
|
3c759f3b01 | ||
|
|
6615f34d20 | ||
|
|
3a4aac1ee4 | ||
|
|
4d6c092615 | ||
|
|
93421a1dc9 | ||
|
|
209458a856 | ||
|
|
82bd94620e | ||
|
|
af9f017871 | ||
|
|
2f8922ea87 | ||
|
|
0ea936f3fe | ||
|
|
d1870ee0a8 | ||
|
|
d2151690ad | ||
|
|
dff373e7d5 | ||
|
|
0aec2a664f |
@@ -24,8 +24,8 @@ plugins {
|
|||||||
id "de.undercouch.download" version "5.0.1"
|
id "de.undercouch.download" version "5.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
version '2.2.6-1.19.1' // Needs to be version specific
|
version '2.2.9-1.19.2' // Needs to be version specific
|
||||||
def nmsVersion = "1.19.1"
|
def nmsVersion = "1.19.2"
|
||||||
def apiVersion = '1.19'
|
def apiVersion = '1.19'
|
||||||
def spigotJarVersion = '1.19.1-R0.1-SNAPSHOT'
|
def spigotJarVersion = '1.19.1-R0.1-SNAPSHOT'
|
||||||
def name = getRootProject().getName() // Defined in settings.gradle
|
def name = getRootProject().getName() // Defined in settings.gradle
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class NoiseExplorerGUI extends JPanel implements MouseWheelListener, List
|
|||||||
JFrame frame = new JFrame("Noise Explorer");
|
JFrame frame = new JFrame("Noise Explorer");
|
||||||
NoiseExplorerGUI nv = new NoiseExplorerGUI();
|
NoiseExplorerGUI nv = new NoiseExplorerGUI();
|
||||||
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
||||||
KList<String> li = new KList<>(NoiseStyle.values()).toStringList();
|
KList<String> li = new KList<>(NoiseStyle.values()).toStringList().sort();
|
||||||
combo = new JComboBox<>(li.toArray(new String[0]));
|
combo = new JComboBox<>(li.toArray(new String[0]));
|
||||||
combo.setSelectedItem("STATIC");
|
combo.setSelectedItem("STATIC");
|
||||||
combo.setFocusable(false);
|
combo.setFocusable(false);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ package com.volmit.iris.core.nms;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.IrisSettings;
|
import com.volmit.iris.core.IrisSettings;
|
||||||
import com.volmit.iris.core.nms.v19_1.NMSBinding19_1;
|
import com.volmit.iris.core.nms.v19_2.NMSBinding19_2;
|
||||||
import com.volmit.iris.core.nms.v1X.NMSBinding1X;
|
import com.volmit.iris.core.nms.v1X.NMSBinding1X;
|
||||||
import com.volmit.iris.util.collection.KMap;
|
import com.volmit.iris.util.collection.KMap;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -28,7 +28,7 @@ import org.bukkit.Bukkit;
|
|||||||
public class INMS {
|
public class INMS {
|
||||||
//@builder
|
//@builder
|
||||||
private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>()
|
private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>()
|
||||||
.qput("v1_19_R1", NMSBinding19_1.class);
|
.qput("v1_19_R1", NMSBinding19_2.class);
|
||||||
//@done
|
//@done
|
||||||
private static final INMSBinding binding = bind();
|
private static final INMSBinding binding = bind();
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.volmit.iris.core.nms.v19_1;
|
package com.volmit.iris.core.nms.v19_2;
|
||||||
|
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
@@ -39,15 +39,10 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
|||||||
import net.minecraft.core.*;
|
import net.minecraft.core.*;
|
||||||
import net.minecraft.nbt.NbtIo;
|
import net.minecraft.nbt.NbtIo;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.BitStorage;
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
|
||||||
import net.minecraft.world.level.chunk.Palette;
|
|
||||||
import net.minecraft.world.level.chunk.PalettedContainer;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@@ -74,7 +69,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class NMSBinding19_1 implements INMSBinding {
|
public class NMSBinding19_2 implements INMSBinding {
|
||||||
|
|
||||||
private final KMap<Biome, Object> baseBiomeCache = new KMap<>();
|
private final KMap<Biome, Object> baseBiomeCache = new KMap<>();
|
||||||
private final BlockData AIR = Material.AIR.createBlockData();
|
private final BlockData AIR = Material.AIR.createBlockData();
|
||||||
@@ -29,6 +29,7 @@ import com.volmit.iris.util.scheduling.ChronoLatch;
|
|||||||
import com.volmit.iris.util.scheduling.J;
|
import com.volmit.iris.util.scheduling.J;
|
||||||
import com.volmit.iris.util.scheduling.Looper;
|
import com.volmit.iris.util.scheduling.Looper;
|
||||||
|
|
||||||
|
import java.util.concurrent.Semaphore;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
@@ -55,10 +56,12 @@ public class IrisPregenerator {
|
|||||||
private final KSet<Position2> retry;
|
private final KSet<Position2> retry;
|
||||||
private final KSet<Position2> net;
|
private final KSet<Position2> net;
|
||||||
private final ChronoLatch cl;
|
private final ChronoLatch cl;
|
||||||
|
private final Semaphore limiter;
|
||||||
|
|
||||||
public IrisPregenerator(PregenTask task, PregeneratorMethod generator, PregenListener listener) {
|
public IrisPregenerator(PregenTask task, PregeneratorMethod generator, PregenListener listener) {
|
||||||
this.listener = listenify(listener);
|
this.listener = listenify(listener);
|
||||||
cl = new ChronoLatch(5000);
|
cl = new ChronoLatch(5000);
|
||||||
|
limiter = new Semaphore(Runtime.getRuntime().availableProcessors());
|
||||||
generatedRegions = new KSet<>();
|
generatedRegions = new KSet<>();
|
||||||
this.shutdown = new AtomicBoolean(false);
|
this.shutdown = new AtomicBoolean(false);
|
||||||
this.paused = new AtomicBoolean(false);
|
this.paused = new AtomicBoolean(false);
|
||||||
@@ -140,6 +143,7 @@ public class IrisPregenerator {
|
|||||||
generator.close();
|
generator.close();
|
||||||
ticker.interrupt();
|
ticker.interrupt();
|
||||||
listener.onClose();
|
listener.onClose();
|
||||||
|
getMantle().trim(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void visitRegion(int x, int z, boolean regions) {
|
private void visitRegion(int x, int z, boolean regions) {
|
||||||
@@ -162,12 +166,26 @@ public class IrisPregenerator {
|
|||||||
boolean hit = false;
|
boolean hit = false;
|
||||||
if(generator.supportsRegions(x, z, listener) && regions) {
|
if(generator.supportsRegions(x, z, listener) && regions) {
|
||||||
hit = true;
|
hit = true;
|
||||||
listener.onRegionGenerating(x, z);
|
try {
|
||||||
generator.generateRegion(x, z, listener);
|
limiter.acquire();
|
||||||
|
listener.onRegionGenerating(x, z);
|
||||||
|
generator.generateRegion(x, z, listener);
|
||||||
|
limiter.release();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
} else if(!regions) {
|
} else if(!regions) {
|
||||||
hit = true;
|
hit = true;
|
||||||
listener.onRegionGenerating(x, z);
|
listener.onRegionGenerating(x, z);
|
||||||
PregenTask.iterateRegion(x, z, (xx, zz) -> generator.generateChunk(xx, zz, listener));
|
PregenTask.iterateRegion(x, z, (xx, zz) -> {
|
||||||
|
try {
|
||||||
|
limiter.acquire();
|
||||||
|
generator.generateChunk(xx, zz, listener);
|
||||||
|
limiter.release();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hit) {
|
if(hit) {
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ public class ModeOverworld extends IrisEngineMode implements EngineMode {
|
|||||||
var deposit = new IrisDepositModifier(getEngine());
|
var deposit = new IrisDepositModifier(getEngine());
|
||||||
var perfection = new IrisPerfectionModifier(getEngine());
|
var perfection = new IrisPerfectionModifier(getEngine());
|
||||||
|
|
||||||
|
registerStage((x, z, k, p, m) -> biome.actuate(x, z, p, m));
|
||||||
registerStage(burst(
|
registerStage(burst(
|
||||||
(x, z, k, p, m) -> generateMatter(x >> 4, z >> 4, m),
|
(x, z, k, p, m) -> generateMatter(x >> 4, z >> 4, m),
|
||||||
(x, z, k, p, m) -> terrain.actuate(x, z, k, m),
|
(x, z, k, p, m) -> terrain.actuate(x, z, k, m)
|
||||||
(x, z, k, p, m) -> biome.actuate(x, z, p, m)
|
|
||||||
));
|
));
|
||||||
registerStage((x, z, k, p, m) -> cave.modify(x >> 4, z >> 4, k, m));
|
registerStage((x, z, k, p, m) -> cave.modify(x >> 4, z >> 4, k, m));
|
||||||
registerStage((x, z, k, p, m) -> deposit.modify(x, z, k, m));
|
registerStage((x, z, k, p, m) -> deposit.modify(x, z, k, m));
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ public class IrisObject extends IrisRegistrant {
|
|||||||
zz += config.warp(rng, i.getZ() + z, i.getY() + y, i.getX() + x, getLoader());
|
zz += config.warp(rng, i.getZ() + z, i.getY() + y, i.getX() + x, getLoader());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(yv < 0 && (config.getMode().equals(ObjectPlaceMode.PAINT))) {
|
if(yv < 0 && (config.getMode().equals(ObjectPlaceMode.PAINT)) && !B.isVineBlock(data)) {
|
||||||
yy = (int) Math.round(i.getY()) + Math.floorDiv(h, 2) + placer.getHighest(xx, zz, getLoader(), config.isUnderwater());
|
yy = (int) Math.round(i.getY()) + Math.floorDiv(h, 2) + placer.getHighest(xx, zz, getLoader(), config.isUnderwater());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,7 +823,9 @@ public class IrisObject extends IrisRegistrant {
|
|||||||
placer.getEngine().getMantle().getMantle().set(xx, yy, zz, new MatterMarker(markers.get(g)));
|
placer.getEngine().getMantle().getMantle().set(xx, yy, zz, new MatterMarker(markers.get(g)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!data.getMaterial().equals(Material.AIR) && !data.getMaterial().equals(Material.CAVE_AIR)) {
|
boolean wouldReplace = B.isSolid(placer.get(xx, yy, zz)) && B.isVineBlock(data);
|
||||||
|
|
||||||
|
if(!data.getMaterial().equals(Material.AIR) && !data.getMaterial().equals(Material.CAVE_AIR) && !wouldReplace) {
|
||||||
placer.set(xx, yy, zz, data);
|
placer.set(xx, yy, zz, data);
|
||||||
if(tile != null) {
|
if(tile != null) {
|
||||||
placer.setTile(xx, yy, zz, tile);
|
placer.setTile(xx, yy, zz, tile);
|
||||||
|
|||||||
@@ -81,12 +81,14 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
private Engine engine;
|
private Engine engine;
|
||||||
private Looper hotloader;
|
private Looper hotloader;
|
||||||
private StudioMode lastMode;
|
private StudioMode lastMode;
|
||||||
|
private DummyBiomeProvider dummyBiomeProvider;
|
||||||
@Setter
|
@Setter
|
||||||
private StudioGenerator studioGenerator;
|
private StudioGenerator studioGenerator;
|
||||||
|
|
||||||
public BukkitChunkGenerator(IrisWorld world, boolean studio, File dataLocation, String dimensionKey) {
|
public BukkitChunkGenerator(IrisWorld world, boolean studio, File dataLocation, String dimensionKey) {
|
||||||
setup = new AtomicBoolean(false);
|
setup = new AtomicBoolean(false);
|
||||||
studioGenerator = null;
|
studioGenerator = null;
|
||||||
|
dummyBiomeProvider = new DummyBiomeProvider();
|
||||||
populators = new KList<>();
|
populators = new KList<>();
|
||||||
loadLock = new Semaphore(LOAD_LOCKS);
|
loadLock = new Semaphore(LOAD_LOCKS);
|
||||||
this.world = world;
|
this.world = world;
|
||||||
@@ -368,6 +370,6 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BiomeProvider getDefaultBiomeProvider(@NotNull WorldInfo worldInfo) {
|
public BiomeProvider getDefaultBiomeProvider(@NotNull WorldInfo worldInfo) {
|
||||||
return null;
|
return dummyBiomeProvider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.volmit.iris.engine.platform;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.collection.KList;
|
||||||
|
import org.bukkit.block.Biome;
|
||||||
|
import org.bukkit.generator.BiomeProvider;
|
||||||
|
import org.bukkit.generator.WorldInfo;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DummyBiomeProvider extends BiomeProvider {
|
||||||
|
private final List<Biome> ALL = new KList<>(Biome.values()).qdel(Biome.CUSTOM);
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z) {
|
||||||
|
return Biome.PLAINS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public List<Biome> getBiomes(@NotNull WorldInfo worldInfo) {
|
||||||
|
return ALL;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -405,6 +405,8 @@ public class B {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSolid(BlockData mat) {
|
public static boolean isSolid(BlockData mat) {
|
||||||
|
if(mat == null)
|
||||||
|
return false;
|
||||||
return mat.getMaterial().isSolid();
|
return mat.getMaterial().isSolid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package com.volmit.iris.util.stream;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.loader.IrisData;
|
import com.volmit.iris.core.loader.IrisData;
|
||||||
|
import com.volmit.iris.engine.data.cache.Cache;
|
||||||
import com.volmit.iris.engine.framework.Engine;
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.object.IRare;
|
import com.volmit.iris.engine.object.IRare;
|
||||||
import com.volmit.iris.engine.object.IrisStyledRange;
|
import com.volmit.iris.engine.object.IrisStyledRange;
|
||||||
@@ -531,6 +532,21 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
|||||||
|
|
||||||
ProceduralStream<?> getSource();
|
ProceduralStream<?> getSource();
|
||||||
|
|
||||||
|
default void fillChunk(int x, int z, T[] c) {
|
||||||
|
if(c.length != 256) {
|
||||||
|
throw new RuntimeException("Not 256 Length for chunk get");
|
||||||
|
}
|
||||||
|
|
||||||
|
int xs = x << 4;
|
||||||
|
int zs = z << 4;
|
||||||
|
|
||||||
|
for(int i = 0; i < 16; i++) {
|
||||||
|
for(int j = 0; j < 16; j++) {
|
||||||
|
c[Cache.to1D(i+xs, j+zs, 0, 16, 16)] = get(i+xs, j+zs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
T get(double x, double z);
|
T get(double x, double z);
|
||||||
|
|
||||||
T get(double x, double y, double z);
|
T get(double x, double y, double z);
|
||||||
|
|||||||
Reference in New Issue
Block a user