mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-03 08:26:11 +00:00
sync
This commit is contained in:
parent
eda44a8ace
commit
7f530a4b32
@ -44,6 +44,7 @@ registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins')
|
||||
registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.19.4/plugins')
|
||||
registerCustomOutputTask('CrazyDev22', 'C://Users/Julian/Desktop/server/plugins')
|
||||
registerCustomOutputTask('Pixel', 'D://Iris Dimension Engine/1.20.4 - Development/plugins')
|
||||
registerCustomOutputTask('PixelFury', 'C://Users/RePixelatedMC/Iris/1.21 - Render/plugins')
|
||||
// ========================== UNIX ==============================
|
||||
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/development/server/plugins')
|
||||
registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Developer/RemoteGit/Server/plugins')
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.engine.actuator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.nms.IMemoryWorld;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
@ -32,13 +33,15 @@ import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.misc.E;
|
||||
import com.volmit.iris.util.scheduling.PrecisionStopwatch;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.packs.DataPack;
|
||||
import org.bukkit.packs.DataPackManager;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData> {
|
||||
private static final BlockData AIR = Material.AIR.createBlockData();
|
||||
@ -56,9 +59,15 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
public IrisTerrainNormalActuator(Engine engine) {
|
||||
super(engine, "Terrain");
|
||||
rng = new RNG(engine.getSeedManager().getTerrain());
|
||||
if (memoryWorld != null) {
|
||||
boolean debug = getDimension().getMerger().isDatapackMode();
|
||||
if (!getDimension().getMerger().getGenerator().isBlank()) {
|
||||
try {
|
||||
if (!getDimension().getMerger().isDatapackMode()) {
|
||||
this.memoryWorld = INMS.get().createMemoryWorld(new WorldCreator("terrain").generator(getEngine().getDimension().getMerger().getGenerator()));
|
||||
} else {
|
||||
String test = getDimension().getMerger().getGenerator().toLowerCase();
|
||||
this.memoryWorld = INMS.get().createMemoryWorld(NamespacedKey.minecraft(test), new WorldCreator("terrain"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -69,17 +78,19 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
@Override
|
||||
public void onActuate(int x, int z, Hunk<BlockData> h, boolean multicore, ChunkContext context) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
Hunk<BlockData> hm = null;
|
||||
if (memoryWorld != null) {
|
||||
Hunk<BlockData> hm = toHunk(memoryWorld.getChunkData(x,z));
|
||||
hm = toHunk(memoryWorld.getChunkData(x, z));
|
||||
}
|
||||
|
||||
for (int xf = 0; xf < h.getWidth(); xf++) {
|
||||
terrainSliver(x, z, xf, h, context);
|
||||
terrainSliver(x, z, xf, h, hm, context);
|
||||
}
|
||||
|
||||
getEngine().getMetrics().getTerrain().put(p.getMilliseconds());
|
||||
}
|
||||
|
||||
|
||||
private int fluidOrHeight(int height) {
|
||||
return Math.max(getDimension().getFluidHeight(), height);
|
||||
}
|
||||
@ -93,7 +104,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
* @param h the blockdata
|
||||
*/
|
||||
@BlockCoordinates
|
||||
public void terrainSliver(int x, int z, int xf, Hunk<BlockData> h, ChunkContext context) {
|
||||
public void terrainSliver(int x, int z, int xf, Hunk<BlockData> h, @Nullable Hunk<BlockData> hm, ChunkContext context) {
|
||||
int zf, realX, realZ, hf, he;
|
||||
IrisBiome biome;
|
||||
IrisRegion region;
|
||||
@ -158,13 +169,18 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
continue;
|
||||
}
|
||||
|
||||
// Merger DEV CODE
|
||||
if (hm != null) {
|
||||
h.set(xf, i, zf, hm.get(xf, i, zf));
|
||||
}
|
||||
|
||||
BlockData ore = biome.generateOres(realX, i, realZ, rng, getData());
|
||||
ore = ore == null ? region.generateOres(realX, i, realZ, rng, getData()) : ore;
|
||||
ore = ore == null ? getDimension().generateOres(realX, i, realZ, rng, getData()) : ore;
|
||||
|
||||
if (ore != null) {
|
||||
h.set(xf, i, zf, ore);
|
||||
} else {
|
||||
} else if (hm == null) {
|
||||
// todo remove this ( TEMP )
|
||||
if (getDimension().isDeepslateLayer() && i < 64) {
|
||||
h.set(xf, i, zf, DEEPSLATE);
|
||||
@ -176,24 +192,6 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Merges caves from a selected chunk into the corresponding chunk in the outcome world.
|
||||
* This is calling 1/16th of a chunk x/z slice. It is a plane from sky to bedrock 1 thick in the x direction.
|
||||
*
|
||||
* @param x the chunk x in blocks
|
||||
* @param z the chunk z in blocks
|
||||
* @param xf the current x slice
|
||||
* @param h the blockdata
|
||||
*/
|
||||
@BlockCoordinates
|
||||
private void terrainMergeSliver(int x, int z, int xf, Hunk<BlockData> h, ChunkContext context) {
|
||||
int zf, realX, realZ, hf, he;
|
||||
|
||||
for (zf = 0; zf < h.getDepth(); zf++) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private Hunk<BlockData> toHunk(ChunkGenerator.ChunkData data) {
|
||||
Hunk<BlockData> h = Hunk.newArrayHunk(16, memoryWorld.getBukkit().getMaxHeight(), 16);
|
||||
|
@ -1,15 +1,20 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.object.annotations.ArrayType;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.platform.BukkitChunkGenerator;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.context.ChunkContext;
|
||||
import com.volmit.iris.util.documentation.BlockCoordinates;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ -19,9 +24,37 @@ public class IrisMerger {
|
||||
@Desc("Selected Generator")
|
||||
private String generator;
|
||||
|
||||
@Desc("Uses the generator as a datapack key")
|
||||
private boolean datapackMode;
|
||||
|
||||
@Desc("Merging strategy")
|
||||
private IrisMergeStrategies mode;
|
||||
|
||||
/**
|
||||
* Merges caves from a selected chunk into the corresponding chunk in the outcome world.
|
||||
* This is calling 1/16th of a chunk x/z slice. It is a plane from sky to bedrock 1 thick in the x direction.
|
||||
*
|
||||
* @param x the chunk x in blocks
|
||||
* @param z the chunk z in blocks
|
||||
* @param xf the current x slice
|
||||
* @param h the blockdata
|
||||
*/
|
||||
@BlockCoordinates
|
||||
private void terrainMergeSliver(int x, int z, int xf, Hunk<BlockData> h, Engine engine) {
|
||||
int zf, realX, realZ, hf, he;
|
||||
|
||||
for (zf = 0; zf < h.getDepth(); zf++) {
|
||||
realX = xf + x;
|
||||
realZ = zf + z;
|
||||
|
||||
for (int i = h.getHeight(); i >= 0; i--) {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import net.minecraft.nbt.*;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.server.commands.data.BlockDataAccessor;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.level.DataPackConfig;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.EntityBlock;
|
||||
import org.bukkit.*;
|
||||
@ -39,6 +40,8 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.packs.DataPack;
|
||||
import org.bukkit.packs.DataPackManager;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user