mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 20:39:21 +00:00
implement MemoryWorlds
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.volmit.iris.core.nms;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
public interface IMemoryWorld extends Listener, AutoCloseable {
|
||||
|
||||
World getBukkit();
|
||||
|
||||
Chunk getChunk(int x, int z);
|
||||
|
||||
ChunkGenerator.ChunkData getChunkData(int x, int z);
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import com.volmit.iris.core.nms.datapack.DataVersion;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.mantle.Mantle;
|
||||
import com.volmit.iris.util.math.Vector3d;
|
||||
import com.volmit.iris.util.nbt.mca.palette.MCABiomeContainer;
|
||||
@@ -43,6 +42,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.io.IOException;
|
||||
|
||||
public interface INMSBinding {
|
||||
boolean hasTile(Material material);
|
||||
@@ -99,10 +99,6 @@ public interface INMSBinding {
|
||||
|
||||
int countCustomBiomes();
|
||||
|
||||
default void setBiomes(int cx, int cz, World world, Hunk<Object> biomes) {
|
||||
Iris.error("Unsupported version!");
|
||||
}
|
||||
|
||||
void forceBiomeInto(int x, int y, int z, Object somethingVeryDirty, ChunkGenerator.BiomeGrid chunk);
|
||||
|
||||
default boolean supportsDataPacks() {
|
||||
@@ -137,4 +133,15 @@ public interface INMSBinding {
|
||||
Iris.error("Unsupported version!");
|
||||
return null;
|
||||
};
|
||||
|
||||
default IMemoryWorld createMemoryWorld(WorldCreator creator) throws IOException {
|
||||
return createMemoryWorld(switch (creator.environment()) {
|
||||
case NORMAL -> NamespacedKey.minecraft("overworld");
|
||||
case NETHER -> NamespacedKey.minecraft("the_nether");
|
||||
case THE_END -> NamespacedKey.minecraft("the_end");
|
||||
default -> throw new IllegalArgumentException("Illegal dimension (" + creator.environment() + ")");
|
||||
}, creator);
|
||||
}
|
||||
|
||||
IMemoryWorld createMemoryWorld(NamespacedKey levelType, WorldCreator creator) throws IOException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user