9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 19:19:07 +00:00

Allow disabling paletted hunks

This commit is contained in:
cyberpwn
2021-09-23 05:50:38 -04:00
parent 846b4faefa
commit ecc09a710a
6 changed files with 14 additions and 42 deletions

View File

@@ -399,6 +399,17 @@ public class B {
public static BlockData getOrNull(String bdxf) {
try {
String bd = bdxf.trim();
if(bd.startsWith("minecraft:cauldron[level="))
{
bd = bd.replaceAll("\\Q:cauldron[\\E", ":water_cauldron[");
}
if(bd.equals("minecraft:grass_path"))
{
return DIRT_PATH.createBlockData();
}
BlockData bdx = parseBlockData(bd);
if (bdx == null) {

View File

@@ -29,9 +29,9 @@ import java.util.function.Supplier;
public class PaletteOrHunk<T> extends StorageHunk<T> implements Hunk<T> {
private final Hunk<T> hunk;
public PaletteOrHunk(int width, int height, int depth, Supplier<Hunk<T>> factory) {
public PaletteOrHunk(int width, int height, int depth, boolean allow, Supplier<Hunk<T>> factory) {
super(width, height, depth);
hunk = width == 16 && height == 16 && depth == 16 ? new PaletteHunk<>() : factory.get();
hunk = (width == 16 && height == 16 && depth == 16 && allow) ? new PaletteHunk<>() : factory.get();
}
public PalettedContainer<T> palette()

View File

@@ -37,7 +37,7 @@ public abstract class RawMatter<T> extends PaletteOrHunk<T> implements MatterSli
private final Class<T> type;
public RawMatter(int width, int height, int depth, Class<T> type) {
super(width, height, depth, () -> new MappedHunk<>(width, height, depth));
super(width, height, depth, true, () -> new MappedHunk<>(width, height, depth));
writers = new KMap<>();
readers = new KMap<>();
this.type = type;