Data fixes for tec plates

This commit is contained in:
cyberpwn
2021-09-25 18:25:00 -04:00
parent b6d9eb3dcc
commit a80031c3c5
26 changed files with 184 additions and 71 deletions

View File

@@ -19,7 +19,6 @@
package com.volmit.iris.util.matter;
import com.volmit.iris.engine.data.cache.Cache;
import com.volmit.iris.util.data.Varint;
import com.volmit.iris.util.data.palette.Palette;
import com.volmit.iris.util.data.palette.PaletteType;
import com.volmit.iris.util.hunk.Hunk;

View File

@@ -1,25 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2021 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.volmit.iris.util.matter;
public class MatterTest {
public static void test() {
}
}

View File

@@ -43,7 +43,7 @@ public class BlockMatter extends RawMatter<BlockData> {
}
public BlockMatter(int width, int height, int depth) {
super(width, height, depth, BlockData.class, AIR);
super(width, height, depth, BlockData.class);
registerWriter(World.class, ((w, d, x, y, z) -> w.getBlockAt(x, y, z).setBlockData(d)));
registerReader(World.class, (w, x, y, z) -> {
BlockData d = w.getBlockAt(x, y, z).getBlockData();

View File

@@ -37,7 +37,7 @@ public class BooleanMatter extends RawMatter<Boolean> {
}
public BooleanMatter(int width, int height, int depth) {
super(width, height, depth, Boolean.class, false);
super(width, height, depth, Boolean.class);
}
@Override

View File

@@ -40,7 +40,7 @@ public class CavernMatter extends RawMatter<MatterCavern> {
}
public CavernMatter(int width, int height, int depth) {
super(width, height, depth, MatterCavern.class, EMPTY);
super(width, height, depth, MatterCavern.class);
}
public static MatterCavern get(String customBiome, int liquid) {

View File

@@ -54,7 +54,7 @@ public class EntityMatter extends RawMatter<MatterEntityGroup> {
}
public EntityMatter(int width, int height, int depth) {
super(width, height, depth, MatterEntityGroup.class, EMPTY);
super(width, height, depth, MatterEntityGroup.class);
registerWriter(World.class, ((w, d, x, y, z) -> {
for (MatterEntity i : d.getEntities()) {
Location realPosition = new Location(w, x + i.getXOff(), y + i.getYOff(), z + i.getZOff());

View File

@@ -38,7 +38,7 @@ public class IntMatter extends RawMatter<Integer> {
}
public IntMatter(int width, int height, int depth) {
super(width, height, depth, Integer.class, 0);
super(width, height, depth, Integer.class);
}
@Override

View File

@@ -38,7 +38,7 @@ public class LongMatter extends RawMatter<Long> {
}
public LongMatter(int width, int height, int depth) {
super(width, height, depth, Long.class, 0L);
super(width, height, depth, Long.class);
}
@Override

View File

@@ -44,7 +44,7 @@ public class MarkerMatter extends RawMatter<MatterMarker> {
}
public MarkerMatter(int width, int height, int depth) {
super(width, height, depth, MatterMarker.class, NONE);
super(width, height, depth, MatterMarker.class);
}
@Override

View File

@@ -28,7 +28,7 @@ import java.io.IOException;
public class NBTMatter<T extends Tag<?>> extends RawMatter<T> {
public NBTMatter(int width, int height, int depth, Class<T> c, T e) {
super(width, height, depth, c, e);
super(width, height, depth, c);
}
@Override

View File

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

View File

@@ -28,7 +28,7 @@ import java.io.IOException;
public class RegistryMatter<T extends IrisRegistrant> extends RawMatter<T> {
public RegistryMatter(int width, int height, int depth, Class<T> c, T e) {
super(width, height, depth, c, e);
super(width, height, depth, c);
}
@Override

View File

@@ -32,7 +32,7 @@ public class StringMatter extends RawMatter<String> {
}
public StringMatter(int width, int height, int depth) {
super(width, height, depth, String.class, "");
super(width, height, depth, String.class);
}
@Override

View File

@@ -45,7 +45,7 @@ public class TileMatter extends RawMatter<MatterTile> {
}
public TileMatter(int width, int height, int depth) {
super(width, height, depth, MatterTile.class, EMPTY);
super(width, height, depth, MatterTile.class);
registerWriter(World.class, ((w, d, x, y, z) -> INMS.get().deserializeTile(d.getTileData(), new Location(w, x, y, z))));
registerReader(World.class, (w, x, y, z) -> {
Location l = new Location(w, x, y, z);

View File

@@ -43,7 +43,7 @@ public class UpdateMatter extends RawMatter<MatterUpdate> {
}
public UpdateMatter(int width, int height, int depth) {
super(width, height, depth, MatterUpdate.class, OFF);
super(width, height, depth, MatterUpdate.class);
}
@Override