mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 14:00:26 +00:00
5 files changed
+50
-3
No files matched your search
@@ -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