mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 15:56:27 +00:00
Cleanup
This commit is contained in:
@@ -19,14 +19,6 @@
|
||||
package com.volmit.iris.util.matter;
|
||||
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MatterEntity {
|
||||
private final double xOff;
|
||||
private final double yOff;
|
||||
private final double zOff;
|
||||
private final CompoundTag entityData;
|
||||
public record MatterEntity(double xOff, double yOff, double zOff, CompoundTag entityData) {
|
||||
}
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
package com.volmit.iris.util.matter;
|
||||
|
||||
import com.volmit.iris.util.nbt.tag.CompoundTag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class MatterTile {
|
||||
private final CompoundTag tileData;
|
||||
public record MatterTile(CompoundTag tileData) {
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ public class EntityMatter extends RawMatter<MatterEntityGroup> {
|
||||
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());
|
||||
INMS.get().deserializeEntity(i.getEntityData(), realPosition);
|
||||
Location realPosition = new Location(w, x + i.xOff(), y + i.yOff(), z + i.zOff());
|
||||
INMS.get().deserializeEntity(i.entityData(), realPosition);
|
||||
}
|
||||
}));
|
||||
registerReader(World.class, (w, x, y, z) -> {
|
||||
@@ -124,10 +124,10 @@ public class EntityMatter extends RawMatter<MatterEntityGroup> {
|
||||
public void writeNode(MatterEntityGroup b, DataOutputStream dos) throws IOException {
|
||||
Varint.writeUnsignedVarInt(b.getEntities().size(), dos);
|
||||
for (MatterEntity i : b.getEntities()) {
|
||||
dos.writeByte((int) (i.getXOff() * 255) + Byte.MIN_VALUE);
|
||||
dos.writeByte((int) (i.getYOff() * 255) + Byte.MIN_VALUE);
|
||||
dos.writeByte((int) (i.getZOff() * 255) + Byte.MIN_VALUE);
|
||||
NBTUtil.write(i.getEntityData(), dos, false);
|
||||
dos.writeByte((int) (i.xOff() * 255) + Byte.MIN_VALUE);
|
||||
dos.writeByte((int) (i.yOff() * 255) + Byte.MIN_VALUE);
|
||||
dos.writeByte((int) (i.zOff() * 255) + Byte.MIN_VALUE);
|
||||
NBTUtil.write(i.entityData(), dos, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TileMatter extends RawMatter<MatterTile> {
|
||||
|
||||
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))));
|
||||
registerWriter(World.class, ((w, d, x, y, z) -> INMS.get().deserializeTile(d.tileData(), new Location(w, x, y, z))));
|
||||
registerReader(World.class, (w, x, y, z) -> {
|
||||
Location l = new Location(w, x, y, z);
|
||||
if (INMS.get().hasTile(l)) {
|
||||
@@ -55,7 +55,7 @@ public class TileMatter extends RawMatter<MatterTile> {
|
||||
|
||||
@Override
|
||||
public void writeNode(MatterTile b, DataOutputStream dos) throws IOException {
|
||||
NBTUtil.write(b.getTileData(), dos, false);
|
||||
NBTUtil.write(b.tileData(), dos, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user