mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 19:19:07 +00:00
@@ -24,7 +24,7 @@ plugins {
|
||||
id "de.undercouch.download" version "5.0.1"
|
||||
}
|
||||
|
||||
version '2.1.2-1.18.2' // Needs to be version specific
|
||||
version '2.1.3-1.18.2' // Needs to be version specific
|
||||
def nmsVersion = "1.18.2"
|
||||
def apiVersion = '1.18'
|
||||
def spigotJarVersion = '1.18.2-R0.1-SNAPSHOT'
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.volmit.iris.core.link.*;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.core.service.StudioSVC;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.EnginePanic;
|
||||
import com.volmit.iris.engine.object.IrisCompat;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
@@ -60,6 +61,7 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@@ -407,6 +409,8 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
splash();
|
||||
autoStartStudio();
|
||||
checkForBukkitWorlds();
|
||||
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
|
||||
IrisToolbelt.retainMantleDataForSlice(BlockData.class.getCanonicalName());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ public class NMSBinding18_2 implements INMSBinding {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserializeTile(CompoundTag c, Location newPosition) {
|
||||
((CraftWorld) newPosition.getWorld()).getHandle().getChunkAt(new BlockPos(newPosition.getBlockX(), 0, newPosition.getBlockZ())).setBlockEntityNbt(convert(c));
|
||||
public void deserializeTile(CompoundTag c, Location pos) {
|
||||
((CraftWorld) pos.getWorld()).getHandle().getChunkAt(new BlockPos(pos.getBlockX(), 0, pos.getBlockZ())).setBlockEntityNbt(convert(c));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,25 +24,12 @@ import com.volmit.iris.core.gui.components.RenderType;
|
||||
import com.volmit.iris.core.gui.components.Renderer;
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.core.loader.IrisRegistrant;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.data.chunk.TerrainChunk;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.object.InventorySlotType;
|
||||
import com.volmit.iris.engine.object.IrisBiome;
|
||||
import com.volmit.iris.engine.object.IrisColor;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
import com.volmit.iris.engine.object.IrisEngineData;
|
||||
import com.volmit.iris.engine.object.IrisJigsawStructure;
|
||||
import com.volmit.iris.engine.object.IrisJigsawStructurePlacement;
|
||||
import com.volmit.iris.engine.object.IrisLootMode;
|
||||
import com.volmit.iris.engine.object.IrisLootReference;
|
||||
import com.volmit.iris.engine.object.IrisLootTable;
|
||||
import com.volmit.iris.engine.object.IrisObject;
|
||||
import com.volmit.iris.engine.object.IrisObjectPlacement;
|
||||
import com.volmit.iris.engine.object.IrisPosition;
|
||||
import com.volmit.iris.engine.object.IrisRegion;
|
||||
import com.volmit.iris.engine.object.IrisWorld;
|
||||
import com.volmit.iris.engine.object.*;
|
||||
import com.volmit.iris.engine.scripting.EngineExecutionEnvironment;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
@@ -61,6 +48,7 @@ import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.MatterCavern;
|
||||
import com.volmit.iris.util.matter.MatterUpdate;
|
||||
import com.volmit.iris.util.matter.TileWrapper;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import com.volmit.iris.util.scheduling.ChronoLatch;
|
||||
@@ -262,11 +250,6 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
}
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
default void placeTiles(Chunk c) {
|
||||
|
||||
}
|
||||
|
||||
void blockUpdatedMetric();
|
||||
|
||||
@ChunkCoordinates
|
||||
@@ -280,6 +263,15 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
&& c.getWorld().isChunkLoaded(c.getX() - 1, c.getZ())
|
||||
&& c.getWorld().isChunkLoaded(c.getX() + 1, c.getZ() - 1)
|
||||
&& c.getWorld().isChunkLoaded(c.getX() - 1, c.getZ() + 1) && getMantle().getMantle().isLoaded(c)) {
|
||||
|
||||
getMantle().getMantle().raiseFlag(c.getX(), c.getZ(), MantleFlag.TILE, () -> J.s(() -> {
|
||||
getMantle().getMantle().iterateChunk(c.getX(), c.getZ(), TileWrapper.class, (x, y, z, tile) -> {
|
||||
int betterY = y + getWorld().minHeight();
|
||||
if(!TileData.setTileState(c.getBlock(x, betterY, z), tile.getData()))
|
||||
Iris.warn("Failed to set tile entity data at [%d %d %d | %s] for tile %s!", x, betterY ,z, c.getBlock(x, betterY, z).getBlockData().getMaterial().getKey(), tile.getData().getTileId());
|
||||
});
|
||||
}));
|
||||
|
||||
getMantle().getMantle().raiseFlag(c.getX(), c.getZ(), MantleFlag.UPDATE, () -> J.s(() -> {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
KMap<Long, Integer> updates = new KMap<>();
|
||||
|
||||
@@ -38,10 +38,7 @@ import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.mantle.Mantle;
|
||||
import com.volmit.iris.util.mantle.MantleChunk;
|
||||
import com.volmit.iris.util.mantle.MantleFlag;
|
||||
import com.volmit.iris.util.matter.Matter;
|
||||
import com.volmit.iris.util.matter.MatterCavern;
|
||||
import com.volmit.iris.util.matter.MatterFluidBody;
|
||||
import com.volmit.iris.util.matter.MatterMarker;
|
||||
import com.volmit.iris.util.matter.*;
|
||||
import com.volmit.iris.util.matter.slices.UpdateMatter;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
@@ -109,17 +106,14 @@ public interface EngineMantle extends IObjectPlacer {
|
||||
|
||||
@Override
|
||||
default void setTile(int x, int y, int z, TileData<? extends TileState> d) {
|
||||
// TODO SET TILE
|
||||
getMantle().set(x, y, z, new TileWrapper(d));
|
||||
}
|
||||
|
||||
@Override
|
||||
default BlockData get(int x, int y, int z) {
|
||||
BlockData block = getMantle().get(x, y, z, BlockData.class);
|
||||
|
||||
if(block == null) {
|
||||
if(block == null)
|
||||
return AIR;
|
||||
}
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -199,6 +200,19 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
});
|
||||
}
|
||||
|
||||
public TileData<?> tryGetTile() {
|
||||
//TODO Do like a registry thing with the tile data registry. Also update the parsing of data to include **block** entities.
|
||||
if(data.containsKey("entitySpawn")) {
|
||||
TileSpawner spawner = new TileSpawner();
|
||||
String name = (String)data.get("entitySpawn");
|
||||
if(name.contains(":"))
|
||||
name = name.split(":")[1];
|
||||
spawner.setEntityType(EntityType.fromName(name));
|
||||
return spawner;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String keyify(String dat) {
|
||||
if(dat.contains(":")) {
|
||||
return dat;
|
||||
|
||||
@@ -34,6 +34,8 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Snippet("palette")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@@ -66,6 +68,14 @@ public class IrisMaterialPalette {
|
||||
return getLayerGenerator(rng, rdata).fit(getBlockData(rdata), x / zoom, y / zoom, z / zoom);
|
||||
}
|
||||
|
||||
public Optional<TileData<?>> getTile(RNG rng, double x, double y, double z, IrisData rdata) {
|
||||
if(getBlockData(rdata).isEmpty())
|
||||
return Optional.empty();
|
||||
|
||||
TileData<?> tile = getBlockData(rdata).size() == 1 ? palette.get(0).tryGetTile() : palette.getRandom(rng).tryGetTile();
|
||||
return tile != null ? Optional.of(tile) : Optional.empty();
|
||||
}
|
||||
|
||||
public CNG getLayerGenerator(RNG rng, IrisData rdata) {
|
||||
return layerGenerator.aquire(() ->
|
||||
{
|
||||
|
||||
@@ -34,8 +34,6 @@ import com.volmit.iris.util.math.AxisAlignedBB;
|
||||
import com.volmit.iris.util.math.BlockPosition;
|
||||
import com.volmit.iris.util.math.Position2;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.IrisMatter;
|
||||
import com.volmit.iris.util.matter.Matter;
|
||||
import com.volmit.iris.util.matter.MatterMarker;
|
||||
import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
@@ -65,11 +63,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@@ -739,10 +733,16 @@ public class IrisObject extends IrisRegistrant {
|
||||
if(j.isExact() ? k.matches(data) : k.getMaterial().equals(data.getMaterial())) {
|
||||
BlockData newData = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||
|
||||
if(newData.getMaterial() == data.getMaterial()) {
|
||||
if(newData.getMaterial() == data.getMaterial())
|
||||
data = data.merge(newData);
|
||||
} else {
|
||||
else
|
||||
data = newData;
|
||||
|
||||
if(newData.getMaterial() == Material.SPAWNER) {
|
||||
Optional<TileData<?>> t = j.getReplace().getTile(rng, x, y, z, rdata);
|
||||
if(t.isPresent()) {
|
||||
tile = t.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class TileBanner implements TileData<Banner> {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void toNBT(CompoundTag tag) {
|
||||
public CompoundTag toNBT(CompoundTag tag) {
|
||||
@SuppressWarnings("unchecked") ListTag<CompoundTag> listTag = (ListTag<CompoundTag>) ListTag.createUnchecked(CompoundTag.class);
|
||||
for(Pattern p : patterns) {
|
||||
CompoundTag pattern = new CompoundTag();
|
||||
@@ -107,6 +107,7 @@ public class TileBanner implements TileData<Banner> {
|
||||
listTag.add(pattern);
|
||||
}
|
||||
tag.put("Patterns", listTag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
public boolean isBanner(Material material) {
|
||||
|
||||
@@ -29,11 +29,12 @@ import org.bukkit.block.data.BlockData;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public interface TileData<T extends TileState> extends Cloneable {
|
||||
|
||||
KList<TileData<? extends TileState>> registry = setup();
|
||||
static final KList<TileData<? extends TileState>> registry = setup();
|
||||
|
||||
static KList<TileData<? extends TileState>> setup() {
|
||||
KList<TileData<? extends TileState>> registry = new KList<>();
|
||||
@@ -45,17 +46,21 @@ public interface TileData<T extends TileState> extends Cloneable {
|
||||
return registry;
|
||||
}
|
||||
|
||||
static TileData<? extends TileState> read(DataInputStream s) throws Throwable {
|
||||
int id = s.readShort();
|
||||
@SuppressWarnings("unchecked") TileData<? extends TileState> d = registry.get(id).getClass().getConstructor().newInstance();
|
||||
d.fromBinary(s);
|
||||
return d;
|
||||
static TileData<? extends TileState> read(DataInputStream s) throws IOException {
|
||||
try {
|
||||
int id = s.readShort();
|
||||
@SuppressWarnings("unchecked") TileData<? extends TileState> d = registry.get(id).getClass().getConstructor().newInstance();
|
||||
d.fromBinary(s);
|
||||
return d;
|
||||
} catch(InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) {
|
||||
throw new IOException("Failed to create TileData instance due to missing type registrar!");
|
||||
}
|
||||
}
|
||||
|
||||
static void setTileState(Block block, TileData<? extends TileState> data) {
|
||||
if(data.isApplicable(block.getBlockData())) {
|
||||
data.toBukkitTry(block.getState());
|
||||
}
|
||||
static boolean setTileState(Block block, TileData<? extends TileState> data) {
|
||||
if(block.getState() instanceof TileState && data.isApplicable(block.getBlockData()))
|
||||
return data.toBukkitTry(block.getState());
|
||||
return false;
|
||||
}
|
||||
|
||||
static TileData<? extends TileState> getTileState(Block block) {
|
||||
@@ -89,6 +94,7 @@ public interface TileData<T extends TileState> extends Cloneable {
|
||||
try {
|
||||
//noinspection unchecked
|
||||
toBukkit((T) t);
|
||||
t.update();
|
||||
return true;
|
||||
} catch(Throwable e) {
|
||||
Iris.reportError(e);
|
||||
@@ -111,11 +117,11 @@ public interface TileData<T extends TileState> extends Cloneable {
|
||||
return false;
|
||||
}
|
||||
|
||||
TileData<T> clone();
|
||||
CompoundTag toNBT(CompoundTag parent);
|
||||
|
||||
void toBinary(DataOutputStream out) throws IOException;
|
||||
|
||||
void toNBT(CompoundTag tag);
|
||||
|
||||
void fromBinary(DataInputStream in) throws IOException;
|
||||
|
||||
TileData<T> clone();
|
||||
}
|
||||
|
||||
@@ -98,11 +98,12 @@ public class TileSign implements TileData<Sign> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toNBT(CompoundTag tag) {
|
||||
public CompoundTag toNBT(CompoundTag tag) {
|
||||
tag.putString("Text1", line1);
|
||||
tag.putString("Text2", line2);
|
||||
tag.putString("Text3", line3);
|
||||
tag.putString("Text4", line4);
|
||||
tag.putString("Color", dyeColor.name().toLowerCase());
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,12 +32,13 @@ import java.io.IOException;
|
||||
|
||||
@Data
|
||||
public class TileSpawner implements TileData<CreatureSpawner> {
|
||||
public static final int id = 1;
|
||||
private EntityType entityType;
|
||||
|
||||
public static final int id = 1;
|
||||
|
||||
private EntityType entityType;
|
||||
@Override
|
||||
public String getTileId() {
|
||||
return "minecraft:spawner";
|
||||
return "minecraft:mob_spawner";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +76,7 @@ public class TileSpawner implements TileData<CreatureSpawner> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toNBT(CompoundTag tag) {
|
||||
public CompoundTag toNBT(CompoundTag parent) {
|
||||
@SuppressWarnings("unchecked") ListTag<CompoundTag> potentials = (ListTag<CompoundTag>) ListTag.createUnchecked(CompoundTag.class);
|
||||
CompoundTag t = new CompoundTag();
|
||||
CompoundTag ent = new CompoundTag();
|
||||
@@ -83,6 +84,7 @@ public class TileSpawner implements TileData<CreatureSpawner> {
|
||||
t.put("Entity", ent);
|
||||
t.putInt("Weight", 1);
|
||||
potentials.add(t);
|
||||
tag.put("SpawnPotentials", potentials);
|
||||
parent.put("SpawnPotentials", potentials);
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ public enum MantleFlag {
|
||||
INITIAL_SPAWNED_MARKER,
|
||||
CLEANED,
|
||||
PLANNED,
|
||||
ETCHED;
|
||||
ETCHED,
|
||||
TILE;
|
||||
|
||||
static StateList getStateList() {
|
||||
return new StateList(MantleFlag.values());
|
||||
|
||||
@@ -18,12 +18,10 @@
|
||||
|
||||
package com.volmit.iris.util.matter;
|
||||
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import com.volmit.iris.engine.object.TileData;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MatterTile {
|
||||
private final CompoundTag tileData;
|
||||
public class TileWrapper {
|
||||
private final TileData<?> data;
|
||||
}
|
||||
@@ -33,8 +33,8 @@ public class WorldMatter {
|
||||
matter.slice(MatterEntityGroup.class).writeInto(at);
|
||||
}
|
||||
|
||||
if(matter.hasSlice(MatterTile.class)) {
|
||||
matter.slice(MatterTile.class).writeInto(at);
|
||||
if(matter.hasSlice(TileWrapper.class)) {
|
||||
matter.slice(TileWrapper.class).writeInto(at);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WorldMatter {
|
||||
s.getHeader().setAuthor(author);
|
||||
s.slice(BlockData.class).readFrom(c.getLowerNE());
|
||||
s.slice(MatterEntityGroup.class).readFrom(c.getLowerNE());
|
||||
s.slice(MatterTile.class).readFrom(c.getLowerNE());
|
||||
s.slice(TileWrapper.class).readFrom(c.getLowerNE());
|
||||
s.trimSlices();
|
||||
|
||||
return s;
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
package com.volmit.iris.util.matter.slices;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.nms.INMS;
|
||||
import com.volmit.iris.engine.object.TileData;
|
||||
import com.volmit.iris.util.data.palette.Palette;
|
||||
import com.volmit.iris.util.matter.MatterTile;
|
||||
import com.volmit.iris.util.matter.Sliced;
|
||||
import com.volmit.iris.util.nbt.io.NBTUtil;
|
||||
import com.volmit.iris.util.matter.TileWrapper;
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@@ -31,43 +32,49 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Sliced
|
||||
public class TileMatter extends RawMatter<MatterTile> {
|
||||
public static final MatterTile EMPTY = new MatterTile(new CompoundTag());
|
||||
public class TileMatter extends RawMatter<TileWrapper> {
|
||||
|
||||
public TileMatter() {
|
||||
this(1, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Palette<MatterTile> getGlobalPalette() {
|
||||
public Palette<TileWrapper> getGlobalPalette() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public TileMatter(int width, int height, int depth) {
|
||||
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))));
|
||||
super(width, height, depth, TileWrapper.class);
|
||||
registerWriter(World.class, (w, d, x, y, z) -> {
|
||||
CompoundTag tag = commonNbt(x, y, z, d.getData().getTileId());
|
||||
INMS.get().deserializeTile(d.getData().toNBT(d.getData().toNBT(tag)), new Location(w, x, y, z));
|
||||
Iris.warn("S: " + tag);
|
||||
});
|
||||
registerReader(World.class, (w, x, y, z) -> {
|
||||
Location l = new Location(w, x, y, z);
|
||||
if(INMS.get().hasTile(l)) {
|
||||
CompoundTag tag = INMS.get().serializeTile(l);
|
||||
|
||||
if(tag != null) {
|
||||
return new MatterTile(tag);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
TileData d = TileData.getTileState(w.getBlockAt(new Location(w, x, y, z)));
|
||||
if(d == null)
|
||||
return null;
|
||||
return new TileWrapper(d);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNode(MatterTile b, DataOutputStream dos) throws IOException {
|
||||
NBTUtil.write(b.getTileData(), dos, false);
|
||||
public void writeNode(TileWrapper b, DataOutputStream dos) throws IOException {
|
||||
b.getData().toBinary(dos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MatterTile readNode(DataInputStream din) throws IOException {
|
||||
return new MatterTile((CompoundTag) NBTUtil.read(din, false).getTag());
|
||||
public TileWrapper readNode(DataInputStream din) throws IOException {
|
||||
return new TileWrapper(TileData.read(din));
|
||||
}
|
||||
|
||||
private CompoundTag commonNbt(int x, int y, int z, String mobId) {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
tag.putInt("x", x);
|
||||
tag.putInt("y", y);
|
||||
tag.putInt("z", z);
|
||||
tag.putBoolean("keepPacked", false);
|
||||
tag.putString("id", mobId);
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user