change nbt format: change class names
This commit is contained in:
parent
4433d3b3df
commit
47a69ce8bc
143 changed files with 1207 additions and 1207 deletions
|
@ -43,10 +43,10 @@ import common.init.Registry;
|
|||
import common.init.UniverseRegistry;
|
||||
import common.init.Config.ValueType;
|
||||
import common.log.Log;
|
||||
import common.nbt.NBTLoader;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagDoubleList;
|
||||
import common.nbt.NBTTagFloatList;
|
||||
import common.nbt.TagLoader;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagDoubleList;
|
||||
import common.nbt.TagFloatList;
|
||||
import common.net.bootstrap.ServerBootstrap;
|
||||
import common.net.channel.Channel;
|
||||
import common.net.channel.ChannelException;
|
||||
|
@ -173,11 +173,11 @@ public final class Server implements IThreadListener {
|
|||
}
|
||||
|
||||
public static void saveServerConfig(long time) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
TagObject data = new TagObject();
|
||||
data.setLong("Time", time);
|
||||
data.setLong("LastAccess", System.currentTimeMillis());
|
||||
data.setString("Version", Util.VERSION);
|
||||
NBTTagCompound cfg = new NBTTagCompound();
|
||||
TagObject cfg = new TagObject();
|
||||
for(String cvar : Config.VARS.keySet()) {
|
||||
Config.Value value = Config.VARS.get(cvar);
|
||||
if(!value.noDef || !value.def.equals(value.getValue()))
|
||||
|
@ -188,7 +188,7 @@ public final class Server implements IThreadListener {
|
|||
File nfile = new File("server.nbt.tmp");
|
||||
File lfile = new File("server.nbt");
|
||||
try {
|
||||
NBTLoader.writeGZip(data, nfile);
|
||||
TagLoader.writeGZip(data, nfile);
|
||||
if(lfile.exists())
|
||||
lfile.delete();
|
||||
nfile.renameTo(lfile);
|
||||
|
@ -206,8 +206,8 @@ public final class Server implements IThreadListener {
|
|||
file = new File("server.nbt.tmp");
|
||||
if(file.exists()) {
|
||||
try {
|
||||
NBTTagCompound tag = NBTLoader.readGZip(file);
|
||||
NBTTagCompound cfg = tag.getTag("Config");
|
||||
TagObject tag = TagLoader.readGZip(file);
|
||||
TagObject cfg = tag.getTag("Config");
|
||||
for(String key : cfg.getKeySet()) {
|
||||
Config.set(key, cfg.getString(key), false);
|
||||
}
|
||||
|
@ -291,15 +291,15 @@ public final class Server implements IThreadListener {
|
|||
}
|
||||
}
|
||||
|
||||
public NBTTagCompound loadPlayerData(String user) {
|
||||
public TagObject loadPlayerData(String user) {
|
||||
if(this.debug || !IPlayer.isValidUser(user))
|
||||
return null;
|
||||
NBTTagCompound tag = null;
|
||||
TagObject tag = null;
|
||||
try {
|
||||
File dat = new File(new File("players"), user + ".nbt");
|
||||
|
||||
if(dat.exists() && dat.isFile()) {
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
@ -308,13 +308,13 @@ public final class Server implements IThreadListener {
|
|||
return tag;
|
||||
}
|
||||
|
||||
public void writePlayerData(String user, NBTTagCompound tag) {
|
||||
public void writePlayerData(String user, TagObject tag) {
|
||||
if(this.debug || !IPlayer.isValidUser(user))
|
||||
return;
|
||||
try {
|
||||
File tmp = new File(new File("players"), user + ".nbt.tmp");
|
||||
File dat = new File(new File("players"), user + ".nbt");
|
||||
NBTLoader.writeGZip(tag, tmp);
|
||||
TagLoader.writeGZip(tag, tmp);
|
||||
if(dat.exists()) {
|
||||
dat.delete();
|
||||
}
|
||||
|
@ -326,11 +326,11 @@ public final class Server implements IThreadListener {
|
|||
}
|
||||
|
||||
public Position getOfflinePosition(String user) {
|
||||
NBTTagCompound tag = this.loadPlayerData(user);
|
||||
TagObject tag = this.loadPlayerData(user);
|
||||
if(tag == null)
|
||||
return null;
|
||||
NBTTagDoubleList pos = tag.getDoubleList("Pos");
|
||||
NBTTagFloatList rot = tag.getFloatList("Rotation");
|
||||
TagDoubleList pos = tag.getDoubleList("Pos");
|
||||
TagFloatList rot = tag.getFloatList("Rotation");
|
||||
double posX = pos.get(0);
|
||||
double posY = pos.get(1);
|
||||
double posZ = pos.get(2);
|
||||
|
@ -837,7 +837,7 @@ public final class Server implements IThreadListener {
|
|||
}
|
||||
|
||||
public String addPlayer(NetConnection connection, String loginUser, String loginPass) {
|
||||
NBTTagCompound tag = this.readPlayer(loginUser);
|
||||
TagObject tag = this.readPlayer(loginUser);
|
||||
Player conn = new Player(this, connection, loginUser);
|
||||
if(tag != null)
|
||||
conn.readFromNBT(tag);
|
||||
|
@ -934,15 +934,15 @@ public final class Server implements IThreadListener {
|
|||
newWorld.loadChunk((int)player.posX >> 4, (int)player.posZ >> 4);
|
||||
}
|
||||
|
||||
private NBTTagCompound readPlayer(String user) {
|
||||
private TagObject readPlayer(String user) {
|
||||
if(this.debug)
|
||||
return null;
|
||||
NBTTagCompound tag = null;
|
||||
TagObject tag = null;
|
||||
try {
|
||||
File dat = new File(new File("players"), user + ".nbt");
|
||||
|
||||
if(dat.exists() && dat.isFile()) {
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
@ -955,10 +955,10 @@ public final class Server implements IThreadListener {
|
|||
if(this.debug)
|
||||
return;
|
||||
try {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
TagObject tag = new TagObject();
|
||||
EntityNPC entity = conn.getPresentEntity();
|
||||
if(entity != null) {
|
||||
NBTTagCompound etag = new NBTTagCompound();
|
||||
TagObject etag = new TagObject();
|
||||
entity.writeToNBT(etag);
|
||||
etag.setInt("Dimension", entity.worldObj.dimension.getDimensionId());
|
||||
etag.setString("id", EntityRegistry.getEntityString(entity));
|
||||
|
@ -969,7 +969,7 @@ public final class Server implements IThreadListener {
|
|||
conn.writeToNBT(tag);
|
||||
File tmp = new File(new File("players"), conn.getUser() + ".nbt.tmp");
|
||||
File dat = new File(new File("players"), conn.getUser() + ".nbt");
|
||||
NBTLoader.writeGZip(tag, tmp);
|
||||
TagLoader.writeGZip(tag, tmp);
|
||||
if(dat.exists()) {
|
||||
dat.delete();
|
||||
}
|
||||
|
@ -1045,10 +1045,10 @@ public final class Server implements IThreadListener {
|
|||
old.worldObj.dimension.getFormattedName(false));
|
||||
}
|
||||
|
||||
public NBTTagCompound swapPlayer(Player conn, NBTTagCompound tag, Class<? extends EntityNPC> clazz) {
|
||||
public TagObject swapPlayer(Player conn, TagObject tag, Class<? extends EntityNPC> clazz) {
|
||||
EntityNPC old = conn.getEntity();
|
||||
old.unmount();
|
||||
NBTTagCompound oldTag = new NBTTagCompound();
|
||||
TagObject oldTag = new TagObject();
|
||||
old.writeToNBT(oldTag);
|
||||
oldTag.setInt("Dimension", old.worldObj.dimension.getDimensionId());
|
||||
oldTag.setString("id", EntityRegistry.getEntityString(old));
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package server.clipboard;
|
||||
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.world.State;
|
||||
|
||||
public class ClipboardBlock {
|
||||
private State state;
|
||||
private NBTTagCompound nbt;
|
||||
private TagObject nbt;
|
||||
|
||||
public ClipboardBlock(State state) {
|
||||
this.state = state;
|
||||
|
@ -14,7 +14,7 @@ public class ClipboardBlock {
|
|||
|
||||
public ClipboardBlock(State data, TileEntity tile) {
|
||||
this(data);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
TagObject tag = new TagObject();
|
||||
tile.writeToNBT(tag);
|
||||
this.nbt = tag;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class ClipboardBlock {
|
|||
this.state = state;
|
||||
}
|
||||
|
||||
public NBTTagCompound getNbtData() {
|
||||
public TagObject getNbtData() {
|
||||
return this.nbt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
package server.command;
|
||||
|
||||
import common.nbt.NBTException;
|
||||
import common.nbt.NBTParser;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagException;
|
||||
import common.nbt.TagInterpreter;
|
||||
import common.nbt.TagObject;
|
||||
|
||||
public class TagParser extends DefaultingParser {
|
||||
public TagParser(String name, NBTTagCompound def, Object ... completions) {
|
||||
public TagParser(String name, TagObject def, Object ... completions) {
|
||||
super(name, def, completions);
|
||||
}
|
||||
|
||||
public NBTTagCompound parse(CommandEnvironment env, String input) {
|
||||
NBTTagCompound value;
|
||||
public TagObject parse(CommandEnvironment env, String input) {
|
||||
TagObject value;
|
||||
try {
|
||||
value = NBTParser.parseTag(input);
|
||||
value = TagInterpreter.parseTag(input);
|
||||
}
|
||||
catch(NBTException e) {
|
||||
catch(TagException e) {
|
||||
throw new RunException(e, "Ungültiger NBT-Tag '%s'", input);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public Class<?> getTypeClass(boolean required) {
|
||||
return NBTTagCompound.class;
|
||||
return TagObject.class;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package server.command.commands;
|
|||
|
||||
import java.util.Collection;
|
||||
import common.init.BlockRegistry;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.world.State;
|
||||
|
@ -28,7 +28,7 @@ public class CommandBlock extends Command {
|
|||
this.addTag("tag", 't');
|
||||
}
|
||||
|
||||
public Object exec(CommandEnvironment env, Executor exec, String block, BlockPos position, WorldServer world, NBTTagCompound tag) {
|
||||
public Object exec(CommandEnvironment env, Executor exec, String block, BlockPos position, WorldServer world, TagObject tag) {
|
||||
State state = BlockRegistry.getFromIdName(block, null);
|
||||
if(state == null)
|
||||
throw new RunException("Block '%s' existiert nicht", block);
|
||||
|
@ -36,7 +36,7 @@ public class CommandBlock extends Command {
|
|||
if(tag != null) {
|
||||
TileEntity tile = world.getTileEntity(position);
|
||||
if(tile != null) {
|
||||
NBTTagCompound te = new NBTTagCompound();
|
||||
TagObject te = new TagObject();
|
||||
tile.writeToNBT(te);
|
||||
tag.setString("id", te.getString("id"));
|
||||
tag.setInt("x", position.getX());
|
||||
|
|
|
@ -2,7 +2,7 @@ package server.command.commands;
|
|||
|
||||
import common.color.TextColor;
|
||||
import common.init.Config;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.network.IPlayer;
|
||||
import server.command.Command;
|
||||
import server.command.CommandEnvironment;
|
||||
|
@ -25,7 +25,7 @@ public class CommandRegister extends Command {
|
|||
Player player = env.getServer().getPlayer(username);
|
||||
if(player != null)
|
||||
throw new RunException("Ein Spieler mit diesem Nutzernamen ist bereits online");
|
||||
NBTTagCompound tag = env.getServer().loadPlayerData(username);
|
||||
TagObject tag = env.getServer().loadPlayerData(username);
|
||||
if(tag != null)
|
||||
throw new RunException("Ein Spieler mit diesem Nutzernamen ist bereits registriert");
|
||||
if(exec.isPlayer()) {
|
||||
|
@ -53,7 +53,7 @@ public class CommandRegister extends Command {
|
|||
exec.logConsole(TextColor.RED + "Passwörter stimmen nicht überein");
|
||||
return;
|
||||
}
|
||||
NBTTagCompound user = new NBTTagCompound();
|
||||
TagObject user = new TagObject();
|
||||
user.setString("password", this.passwordField.get());
|
||||
env.getServer().writePlayerData(username, user);
|
||||
exec.logConsole(TextColor.GREEN + "Spieler %s registriert", username);
|
||||
|
@ -63,7 +63,7 @@ public class CommandRegister extends Command {
|
|||
else if(exec.isConsole()) {
|
||||
if(password == null)
|
||||
throw new RunException("Bei Verwendung in der Konsole muss ein Passwort angegeben werden");
|
||||
NBTTagCompound user = new NBTTagCompound();
|
||||
TagObject user = new TagObject();
|
||||
user.setString("password", password);
|
||||
env.getServer().writePlayerData(username, user);
|
||||
exec.logConsole(TextColor.GREEN + "Spieler %s registriert", username);
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.collect.Sets;
|
|||
import common.entity.Entity;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.init.EntityRegistry;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.util.Util;
|
||||
import common.util.Vec3;
|
||||
import server.command.Command;
|
||||
|
@ -38,7 +38,7 @@ public class CommandSpawn extends Command {
|
|||
this.addTag("postTag", 'p');
|
||||
}
|
||||
|
||||
public Object exec(CommandEnvironment env, Executor exec, String type, Vec3 pos, WorldServer world, NBTTagCompound tag, boolean noinit, int count, NBTTagCompound postTag) {
|
||||
public Object exec(CommandEnvironment env, Executor exec, String type, Vec3 pos, WorldServer world, TagObject tag, boolean noinit, int count, TagObject postTag) {
|
||||
if(type.equalsIgnoreCase("Lightning")) {
|
||||
for(int z = 0; z < count; z++) {
|
||||
int color = 0xffffff;
|
||||
|
@ -66,7 +66,7 @@ public class CommandSpawn extends Command {
|
|||
throw new RunException("Objekt konnte nicht erzeugt werden");
|
||||
entity.setLocationAndAngles(pos.xCoord, pos.yCoord, pos.zCoord, world.rand.floatv() * 360.0f, 0.0f);
|
||||
if(tag != null) {
|
||||
NBTTagCompound ent = new NBTTagCompound();
|
||||
TagObject ent = new TagObject();
|
||||
entity.writeToNBT(ent);
|
||||
ent.merge(tag);
|
||||
entity.readFromNBT(ent);
|
||||
|
@ -75,7 +75,7 @@ public class CommandSpawn extends Command {
|
|||
((EntityLiving)entity).onInitialSpawn(null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
if(postTag != null) {
|
||||
NBTTagCompound ent = new NBTTagCompound();
|
||||
TagObject ent = new TagObject();
|
||||
entity.writeToNBT(ent);
|
||||
ent.merge(postTag);
|
||||
entity.readFromNBT(ent);
|
||||
|
|
|
@ -46,9 +46,9 @@ import common.item.ItemArmor;
|
|||
import common.item.ItemControl;
|
||||
import common.item.ItemStack;
|
||||
import common.log.Log;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagDoubleList;
|
||||
import common.nbt.NBTTagTagList;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagDoubleList;
|
||||
import common.nbt.TagObjectList;
|
||||
import common.net.util.concurrent.Future;
|
||||
import common.net.util.concurrent.GenericFutureListener;
|
||||
import common.network.IPlayer;
|
||||
|
@ -153,7 +153,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
private final Server server;
|
||||
private final String user;
|
||||
private final IntHashMap<Short> transactions = new IntHashMap();
|
||||
private final List<NBTTagCompound> characters = Lists.newArrayList();
|
||||
private final List<TagObject> characters = Lists.newArrayList();
|
||||
|
||||
private EntityNPC entity;
|
||||
private int tickTime;
|
||||
|
@ -617,12 +617,12 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
}
|
||||
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
public void readFromNBT(TagObject tag) {
|
||||
this.admin = tag.getBool("admin");
|
||||
if(tag.hasString("password"))
|
||||
this.password = tag.getString("password");
|
||||
this.selected = tag.getInt("selected");
|
||||
NBTTagTagList list = tag.getTagList("characters");
|
||||
TagObjectList list = tag.getTagList("characters");
|
||||
for(int z = 0; z < list.size(); z++) {
|
||||
this.characters.add(list.get(z));
|
||||
}
|
||||
|
@ -642,15 +642,15 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
// }
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
public void writeToNBT(TagObject tag) {
|
||||
if(this.admin)
|
||||
tag.setBool("admin", this.admin);
|
||||
if(this.password != null)
|
||||
tag.setString("password", this.password);
|
||||
if(!this.characters.isEmpty()) {
|
||||
tag.setInt("selected", this.selected);
|
||||
NBTTagTagList list = new NBTTagTagList();
|
||||
for(NBTTagCompound etag : this.characters) {
|
||||
TagObjectList list = new TagObjectList();
|
||||
for(TagObject etag : this.characters) {
|
||||
list.add(etag);
|
||||
}
|
||||
tag.setTagList("characters", list);
|
||||
|
@ -1611,11 +1611,11 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
this.addHotbar(TextColor.YELLOW + (info.isEmpty() ? "Keine Drehung" : info));
|
||||
}
|
||||
|
||||
public NBTTagCompound readCharacter() {
|
||||
public TagObject readCharacter() {
|
||||
return this.characters.isEmpty() || this.selected < 0 ? null : this.characters.get(this.selected);
|
||||
}
|
||||
|
||||
public void writeCharacter(NBTTagCompound tag) {
|
||||
public void writeCharacter(TagObject tag) {
|
||||
if(!this.characters.isEmpty() && this.selected >= 0)
|
||||
this.characters.set(this.selected, tag);
|
||||
}
|
||||
|
@ -1647,13 +1647,13 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
this.server.removePlayer(this);
|
||||
}
|
||||
|
||||
public PlayerCharacter getCharacterInfo(NBTTagCompound tag) {
|
||||
public PlayerCharacter getCharacterInfo(TagObject tag) {
|
||||
String name = tag.getString("CustomName");
|
||||
String info = tag.getString("Description");
|
||||
if(info != null && info.isEmpty())
|
||||
info = null;
|
||||
Alignment align = Alignment.getByName(tag.getString("Align"));
|
||||
NBTTagDoubleList position = tag.getDoubleList("Pos");
|
||||
TagDoubleList position = tag.getDoubleList("Pos");
|
||||
Dimension dimension = UniverseRegistry.getDimension(tag.getInt("Dimension"));
|
||||
String dim = dimension == null ? "???" : dimension.getFormattedName(false);
|
||||
BlockPos pos = new BlockPos(position.get(0), position.get(1), position.get(2));
|
||||
|
@ -1664,7 +1664,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
|
||||
public void onConnect() {
|
||||
List<PlayerCharacter> chars = Lists.newArrayList();
|
||||
for(NBTTagCompound tag : this.characters) {
|
||||
for(TagObject tag : this.characters) {
|
||||
chars.add(this.getCharacterInfo(tag));
|
||||
}
|
||||
this.sendPacket(new SPacketCharacterList(this.selected, chars));
|
||||
|
@ -2535,7 +2535,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
this.charEditor = true;
|
||||
// if(this.local)
|
||||
// this.server.resetProgress();
|
||||
NBTTagCompound tag = this.server.swapPlayer(this, null, EntityHuman.class);
|
||||
TagObject tag = this.server.swapPlayer(this, null, EntityHuman.class);
|
||||
if(!this.characters.isEmpty() && this.selected >= 0)
|
||||
this.characters.set(this.selected, tag);
|
||||
int last = this.selected;
|
||||
|
@ -2547,7 +2547,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
case CLOSE_EDITOR: {
|
||||
this.charEditor = false;
|
||||
this.selected = this.characters.size();
|
||||
this.characters.add(new NBTTagCompound());
|
||||
this.characters.add(new TagObject());
|
||||
WorldServer world = this.server.getWorld(packetIn.getAuxData());
|
||||
world = world == null ? this.server.getSpace() : world;
|
||||
WorldPos origin = new WorldPos(world.rand.range(-Config.originRadius, Config.originRadius), 64, world.rand.range(-Config.originRadius, Config.originRadius),
|
||||
|
@ -2565,7 +2565,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
int index = packetIn.getAuxData();
|
||||
if(index == this.selected || index >= this.characters.size() || index < 0)
|
||||
return;
|
||||
NBTTagCompound etag = this.server.swapPlayer(this, this.characters.get(index), null);
|
||||
TagObject etag = this.server.swapPlayer(this, this.characters.get(index), null);
|
||||
if(!this.characters.isEmpty() && this.selected >= 0)
|
||||
this.characters.set(this.selected, etag);
|
||||
int last = this.selected;
|
||||
|
@ -2995,7 +2995,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
// itemstack.setTagCompound(null);
|
||||
// }
|
||||
// else {
|
||||
NBTTagCompound nbttagcompound = itemstack.getTagCompound().getTag("BlockEntityTag");
|
||||
TagObject nbttagcompound = itemstack.getTagCompound().getTag("BlockEntityTag");
|
||||
|
||||
if (nbttagcompound.hasInt("x") && nbttagcompound.hasInt("y") && nbttagcompound.hasInt("z"))
|
||||
{
|
||||
|
@ -3004,7 +3004,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
|
||||
if (tileentity != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
TagObject nbttagcompound1 = new TagObject();
|
||||
tileentity.writeToNBT(nbttagcompound1);
|
||||
nbttagcompound1.remove("x");
|
||||
nbttagcompound1.remove("y");
|
||||
|
|
|
@ -7,8 +7,8 @@ import common.block.Block;
|
|||
import common.block.Material;
|
||||
import common.block.artificial.BlockDoor;
|
||||
import common.collect.Lists;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagTagList;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagObjectList;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.village.Village;
|
||||
|
@ -23,14 +23,14 @@ public class VillageCollection
|
|||
private int tickCounter;
|
||||
private boolean dirty;
|
||||
|
||||
public VillageCollection(NBTTagCompound nbt) {
|
||||
public VillageCollection(TagObject nbt) {
|
||||
if(nbt != null) {
|
||||
this.tickCounter = nbt.getInt("Tick");
|
||||
NBTTagTagList nbttaglist = nbt.getTagList("Villages");
|
||||
TagObjectList nbttaglist = nbt.getTagList("Villages");
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = nbttaglist.get(i);
|
||||
TagObject nbttagcompound = nbttaglist.get(i);
|
||||
Village village = new Village();
|
||||
village.readVillageDataFromNBT(nbttagcompound);
|
||||
this.villageList.add(village);
|
||||
|
@ -248,15 +248,15 @@ public class VillageCollection
|
|||
return block instanceof BlockDoor ? block.getMaterial() == Material.WOOD : false;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT()
|
||||
public TagObject writeToNBT()
|
||||
{
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
TagObject nbt = new TagObject();
|
||||
nbt.setInt("Tick", this.tickCounter);
|
||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
||||
TagObjectList nbttaglist = new TagObjectList();
|
||||
|
||||
for (Village village : this.villageList)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
TagObject nbttagcompound = new TagObject();
|
||||
village.writeVillageDataToNBT(nbttagcompound);
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
|
|
@ -67,11 +67,11 @@ import common.init.EntityRegistry;
|
|||
import common.init.TileRegistry;
|
||||
import common.init.UniverseRegistry;
|
||||
import common.log.Log;
|
||||
import common.nbt.NBTLoader;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagDoubleList;
|
||||
import common.nbt.NBTTagFloatList;
|
||||
import common.nbt.NBTTagTagList;
|
||||
import common.nbt.TagLoader;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagDoubleList;
|
||||
import common.nbt.TagFloatList;
|
||||
import common.nbt.TagObjectList;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntityBanner;
|
||||
|
@ -938,8 +938,8 @@ public abstract class Converter {
|
|||
return (OldNbtTag)read(in, (byte)10);
|
||||
}
|
||||
|
||||
private static NBTTagCompound convertTile(OldNbtTag ent, String id) {
|
||||
NBTTagCompound nent = new NBTTagCompound();
|
||||
private static TagObject convertTile(OldNbtTag ent, String id) {
|
||||
TagObject nent = new TagObject();
|
||||
if("Sign".equals(id)) {
|
||||
String[] signText = new String[4];
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
|
@ -997,24 +997,24 @@ public abstract class Converter {
|
|||
return idx >= 0 ? name.substring(idx + 1) : name; // save compat
|
||||
}
|
||||
|
||||
private static NBTTagFloatList getList(float[] values) {
|
||||
NBTTagFloatList nlist = new NBTTagFloatList();
|
||||
private static TagFloatList getList(float[] values) {
|
||||
TagFloatList nlist = new TagFloatList();
|
||||
for(int z = 0; z < values.length; z++) {
|
||||
nlist.add(values[z]);
|
||||
}
|
||||
return nlist;
|
||||
}
|
||||
|
||||
private static NBTTagDoubleList getList(double[] values) {
|
||||
NBTTagDoubleList nlist = new NBTTagDoubleList();
|
||||
private static TagDoubleList getList(double[] values) {
|
||||
TagDoubleList nlist = new TagDoubleList();
|
||||
for(int z = 0; z < values.length; z++) {
|
||||
nlist.add(values[z]);
|
||||
}
|
||||
return nlist;
|
||||
}
|
||||
|
||||
private static NBTTagCompound convertChunkData(OldNbtTag tag, boolean legacy) {
|
||||
NBTTagCompound ntag = new NBTTagCompound();
|
||||
private static TagObject convertChunkData(OldNbtTag tag, boolean legacy) {
|
||||
TagObject ntag = new TagObject();
|
||||
tag = tag.getTag("Level");
|
||||
if(legacy) {
|
||||
byte[] oldheight = tag.getByteArray("HeightMap");
|
||||
|
@ -1027,7 +1027,7 @@ public abstract class Converter {
|
|||
byte[] olddata = tag.getByteArray("Data");
|
||||
byte[] oldsky = tag.getByteArray("SkyLight");
|
||||
byte[] oldlight = tag.getByteArray("BlockLight");
|
||||
NBTTagTagList sections = new NBTTagTagList();
|
||||
TagObjectList sections = new TagObjectList();
|
||||
for(int n = 0; n < 8; ++n) {
|
||||
boolean empty = true;
|
||||
for(int x = 0; x < 16 && empty; ++x) {
|
||||
|
@ -1059,7 +1059,7 @@ public abstract class Converter {
|
|||
}
|
||||
}
|
||||
}
|
||||
NBTTagCompound section = new NBTTagCompound();
|
||||
TagObject section = new TagObject();
|
||||
section.setByte("Y", (byte)(n & 255));
|
||||
section.setByteArray("Blocks", blocks);
|
||||
section.setByteArray("Data", data.getData());
|
||||
|
@ -1081,9 +1081,9 @@ public abstract class Converter {
|
|||
ntag.setBool("LightPopulated", tag.getByte("LightPopulated") != 0);
|
||||
|
||||
OldNbtTag[] ents = tag.getTagList("Entities");
|
||||
NBTTagTagList entities = new NBTTagTagList();
|
||||
TagObjectList entities = new TagObjectList();
|
||||
for(OldNbtTag ent : ents) {
|
||||
NBTTagCompound nent = new NBTTagCompound();
|
||||
TagObject nent = new TagObject();
|
||||
String mapped = ENTITY_MAP.get(trimColon(ent.getString("id")));
|
||||
if(mapped != null) {
|
||||
double[] pos = ent.getDoubleList("Pos");
|
||||
|
@ -1104,9 +1104,9 @@ public abstract class Converter {
|
|||
ntag.setTagList("Entities", entities);
|
||||
|
||||
ents = tag.getTagList("TileEntities");
|
||||
entities = new NBTTagTagList();
|
||||
entities = new TagObjectList();
|
||||
for(OldNbtTag ent : ents) {
|
||||
NBTTagCompound nent = new NBTTagCompound();
|
||||
TagObject nent = new TagObject();
|
||||
String mapped = TILE_MAP.get(trimColon(ent.getString("id")));
|
||||
if(mapped != null) {
|
||||
nent = convertTile(ent, mapped);
|
||||
|
@ -1120,9 +1120,9 @@ public abstract class Converter {
|
|||
ntag.setTagList("TileEntities", entities);
|
||||
|
||||
OldNbtTag[] sects = tag.getTagList("Sections");
|
||||
entities = new NBTTagTagList();
|
||||
entities = new TagObjectList();
|
||||
for(OldNbtTag sect : sects) {
|
||||
NBTTagCompound nsect = new NBTTagCompound();
|
||||
TagObject nsect = new TagObject();
|
||||
byte[] blocks = sect.getByteArray("Blocks");
|
||||
NibbleArray data = new NibbleArray(sect.getByteArray("Data"));
|
||||
byte[] add = sect.getByteArray("Add");
|
||||
|
@ -1212,7 +1212,7 @@ public abstract class Converter {
|
|||
}
|
||||
OldNbtTag tag = readTag(in);
|
||||
in.close();
|
||||
NBTTagCompound ntag = convertChunkData(tag, legacy);
|
||||
TagObject ntag = convertChunkData(tag, legacy);
|
||||
// DataOutputStream out = newreg.getOutputStream(nx, nz);
|
||||
// CompressedStreamTools.write(tag, out);
|
||||
// out.close();
|
||||
|
@ -1326,12 +1326,12 @@ public abstract class Converter {
|
|||
Server.saveServerConfig(World.START_TIME);
|
||||
Weather weather = nbt.getByte("thundering") != 0 ? Weather.THUNDER : (nbt.getByte("raining") != 0 ? Weather.RAIN : Weather.CLEAR);
|
||||
if(weather != Weather.CLEAR) {
|
||||
NBTTagCompound dataTag = new NBTTagCompound();
|
||||
TagObject dataTag = new TagObject();
|
||||
dataTag.setString("Weather", weather.getName());
|
||||
Log.IO.info("Speichere neue data.nbt ...");
|
||||
File dataFile = new File(new File(new File("chunk"), "terra"), "data.nbt");
|
||||
try {
|
||||
NBTLoader.writeGZip(dataTag, dataFile);
|
||||
TagLoader.writeGZip(dataTag, dataFile);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Weltdaten nicht speichern");
|
||||
|
|
|
@ -25,10 +25,10 @@ import common.entity.Entity;
|
|||
import common.init.BlockRegistry;
|
||||
import common.init.EntityRegistry;
|
||||
import common.log.Log;
|
||||
import common.nbt.NBTLoader;
|
||||
import common.nbt.TagLoader;
|
||||
import common.nbt.SizeTracker;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagTagList;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagObjectList;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.NextTickListEntry;
|
||||
|
@ -273,10 +273,10 @@ public class Region {
|
|||
return (long)this.timestamps[x + z * 8] * 10000L;
|
||||
}
|
||||
|
||||
public void writeTag(int x, int z, NBTTagCompound tag) throws IOException {
|
||||
public void writeTag(int x, int z, TagObject tag) throws IOException {
|
||||
ChunkBuffer buf = new ChunkBuffer();
|
||||
DataOutputStream out = new DataOutputStream(new DeflaterOutputStream(buf));
|
||||
NBTLoader.write(tag, out);
|
||||
TagLoader.write(tag, out);
|
||||
out.close();
|
||||
this.write(x, z, buf.getData(), buf.size());
|
||||
}
|
||||
|
@ -343,24 +343,24 @@ public class Region {
|
|||
clearCache(true);
|
||||
}
|
||||
|
||||
public static /* synchronized */ NBTTagCompound readChunk(File dir, int x, int z) throws IOException {
|
||||
public static /* synchronized */ TagObject readChunk(File dir, int x, int z) throws IOException {
|
||||
// return getRegionFile(dir, x >> 3, z >> 3).readTag(x & 7, z & 7);
|
||||
byte[] data = getRegionFile(dir, x >> 3, z >> 3).read(x & 7, z & 7);
|
||||
if(data == null)
|
||||
return null;
|
||||
return NBTLoader.read(new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(data)))), SizeTracker.INFINITE);
|
||||
return TagLoader.read(new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(data)))), SizeTracker.INFINITE);
|
||||
}
|
||||
|
||||
public static /* synchronized */ void writeChunk(File dir, int x, int z, NBTTagCompound tag) throws IOException {
|
||||
public static /* synchronized */ void writeChunk(File dir, int x, int z, TagObject tag) throws IOException {
|
||||
ChunkBuffer buf = new ChunkBuffer();
|
||||
DataOutputStream out = new DataOutputStream(new DeflaterOutputStream(buf));
|
||||
NBTLoader.write(tag, out);
|
||||
TagLoader.write(tag, out);
|
||||
out.close();
|
||||
getRegionFile(dir, x >> 3, z >> 3).write(x & 7, z & 7, buf.getData(), buf.size());
|
||||
// getRegionFile(dir, x >> 3, z >> 3).writeTag(x & 7, z & 7, tag);
|
||||
}
|
||||
|
||||
public static ChunkServer readNbt(WorldServer world, int x, int z, NBTTagCompound tag) {
|
||||
public static ChunkServer readNbt(WorldServer world, int x, int z, TagObject tag) {
|
||||
// if(!tag.hasTag("Level")) {
|
||||
// Log.error("Chunk-Datei bei " + x + "," + z + " hat keine Level-Daten, überspringe");
|
||||
// return null;
|
||||
|
@ -375,12 +375,12 @@ public class Region {
|
|||
chunk.setTerrainPopulated(tag.getBool("TerrainPopulated"));
|
||||
chunk.setLightPopulated(tag.getBool("LightPopulated"));
|
||||
chunk.setInhabited(tag.getLong("InhabitedTime"));
|
||||
NBTTagTagList sects = tag.getTagList("Sections");
|
||||
TagObjectList sects = tag.getTagList("Sections");
|
||||
BlockArray[] sections = new BlockArray[sects.size()];
|
||||
boolean light = !world.dimension.hasNoLight();
|
||||
|
||||
for(int n = 0; n < sects.size(); ++n) {
|
||||
NBTTagCompound sect = sects.get(n);
|
||||
TagObject sect = sects.get(n);
|
||||
int y = sect.getInt("Y");
|
||||
BlockArray storage = new BlockArray(y << 4, light, null);
|
||||
byte[] blocks = sect.getByteArray("Blocks");
|
||||
|
@ -413,11 +413,11 @@ public class Region {
|
|||
chunk.setBiomes(tag.getByteArray("Biomes"));
|
||||
}
|
||||
|
||||
NBTTagTagList entities = tag.getTagList("Entities");
|
||||
TagObjectList entities = tag.getTagList("Entities");
|
||||
|
||||
if(entities != null) {
|
||||
for(int n = 0; n < entities.size(); ++n) {
|
||||
NBTTagCompound ent = entities.get(n);
|
||||
TagObject ent = entities.get(n);
|
||||
Entity entity = EntityRegistry.createEntityFromNBT(ent, world);
|
||||
chunk.setHasEntities(true);
|
||||
|
||||
|
@ -425,7 +425,7 @@ public class Region {
|
|||
chunk.addEntity(entity);
|
||||
Entity rider = entity;
|
||||
|
||||
for(NBTTagCompound ride = ent; ride.hasTag("Riding"); ride = ride.getTag("Riding")) {
|
||||
for(TagObject ride = ent; ride.hasTag("Riding"); ride = ride.getTag("Riding")) {
|
||||
Entity pass = EntityRegistry.createEntityFromNBT(ride.getTag("Riding"), world);
|
||||
|
||||
if(pass != null) {
|
||||
|
@ -439,11 +439,11 @@ public class Region {
|
|||
}
|
||||
}
|
||||
|
||||
NBTTagTagList tiles = tag.getTagList("TileEntities");
|
||||
TagObjectList tiles = tag.getTagList("TileEntities");
|
||||
|
||||
if(tiles != null) {
|
||||
for(int n = 0; n < tiles.size(); ++n) {
|
||||
NBTTagCompound tile = tiles.get(n);
|
||||
TagObject tile = tiles.get(n);
|
||||
TileEntity tileentity = TileEntity.createAndLoadEntity(tile);
|
||||
|
||||
if(tileentity != null) {
|
||||
|
@ -453,12 +453,12 @@ public class Region {
|
|||
}
|
||||
|
||||
if(tag.hasTagList("TileTicks")) {
|
||||
NBTTagTagList ticks = tag.getTagList("TileTicks");
|
||||
TagObjectList ticks = tag.getTagList("TileTicks");
|
||||
|
||||
if(ticks != null) {
|
||||
int invalid = 0;
|
||||
for(int n = 0; n < ticks.size(); ++n) {
|
||||
NBTTagCompound tick = ticks.get(n);
|
||||
TagObject tick = ticks.get(n);
|
||||
Block block;
|
||||
|
||||
if(tick.hasString("i")) {
|
||||
|
@ -486,8 +486,8 @@ public class Region {
|
|||
return chunk;
|
||||
}
|
||||
|
||||
public static NBTTagCompound writeNbt(WorldServer world, ChunkServer chunk) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
public static TagObject writeNbt(WorldServer world, ChunkServer chunk) {
|
||||
TagObject tag = new TagObject();
|
||||
// tag.setShort("V", (short)Config.PROTOCOL);
|
||||
tag.setLong("LastUpdate", world.getTime());
|
||||
tag.setIntArray("HeightMap", chunk.getHeights());
|
||||
|
@ -495,12 +495,12 @@ public class Region {
|
|||
tag.setBool("LightPopulated", chunk.isLightPopulated());
|
||||
tag.setLong("InhabitedTime", chunk.getInhabited());
|
||||
Set<BlockArray> sections = chunk.getStorage();
|
||||
NBTTagTagList sects = new NBTTagTagList();
|
||||
TagObjectList sects = new TagObjectList();
|
||||
boolean light = !world.dimension.hasNoLight();
|
||||
|
||||
for(BlockArray storage : sections) {
|
||||
if(storage != null) {
|
||||
NBTTagCompound sect = new NBTTagCompound();
|
||||
TagObject sect = new TagObject();
|
||||
sect.setInt("Y", storage.getY() >> 4);
|
||||
byte[] blocks = new byte[storage.getData().length];
|
||||
NibbleArray data = new NibbleArray();
|
||||
|
@ -547,11 +547,11 @@ public class Region {
|
|||
tag.setTagList("Sections", sects);
|
||||
tag.setByteArray("Biomes", chunk.getBiomes());
|
||||
chunk.setHasEntities(false);
|
||||
NBTTagTagList entities = new NBTTagTagList();
|
||||
TagObjectList entities = new TagObjectList();
|
||||
|
||||
for(int n = 0; n < chunk.getEntities().length; ++n) {
|
||||
for(Entity entity : chunk.getEntities()[n]) {
|
||||
NBTTagCompound ent = new NBTTagCompound();
|
||||
TagObject ent = new TagObject();
|
||||
|
||||
if(entity.writeToNBTOptional(ent)) {
|
||||
chunk.setHasEntities(true);
|
||||
|
@ -561,10 +561,10 @@ public class Region {
|
|||
}
|
||||
|
||||
tag.setTagList("Entities", entities);
|
||||
NBTTagTagList tiles = new NBTTagTagList();
|
||||
TagObjectList tiles = new TagObjectList();
|
||||
|
||||
for(TileEntity tileentity : chunk.getTiles().values()) {
|
||||
NBTTagCompound tile = new NBTTagCompound();
|
||||
TagObject tile = new TagObject();
|
||||
tileentity.writeToNBT(tile);
|
||||
tiles.add(tile);
|
||||
}
|
||||
|
@ -574,10 +574,10 @@ public class Region {
|
|||
|
||||
if(tics != null) {
|
||||
long time = world.getTime();
|
||||
NBTTagTagList ticks = new NBTTagTagList();
|
||||
TagObjectList ticks = new TagObjectList();
|
||||
|
||||
for(NextTickListEntry tic : tics) {
|
||||
NBTTagCompound tick = new NBTTagCompound();
|
||||
TagObject tick = new TagObject();
|
||||
String res = BlockRegistry.REGISTRY.getNameForObject(tic.getBlock());
|
||||
tick.setString("i", res == null ? "" : res.toString());
|
||||
tick.setInt("x", tic.position.getX());
|
||||
|
|
|
@ -40,9 +40,9 @@ import common.init.UniverseRegistry;
|
|||
import common.item.ItemDoor;
|
||||
import common.log.Log;
|
||||
import common.model.ParticleType;
|
||||
import common.nbt.NBTLoader;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagTagList;
|
||||
import common.nbt.TagLoader;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagObjectList;
|
||||
import common.network.IPlayer;
|
||||
import common.network.Packet;
|
||||
import common.packet.SPacketEntityStatus;
|
||||
|
@ -129,7 +129,7 @@ public final class WorldServer extends AWorldServer {
|
|||
private final Set<Long> dropped = Collections.<Long>newSetFromMap(new ConcurrentHashMap());
|
||||
private final LongHashMap<ChunkServer> chunks = new LongHashMap();
|
||||
private final List<ChunkServer> loaded = Lists.<ChunkServer>newArrayList();
|
||||
private final Map<ChunkPos, NBTTagCompound> toRemove = new ConcurrentHashMap();
|
||||
private final Map<ChunkPos, TagObject> toRemove = new ConcurrentHashMap();
|
||||
private final Set<ChunkPos> pending = Collections.<ChunkPos>newSetFromMap(new ConcurrentHashMap());
|
||||
private final LongHashMap<BlockPos> loaders = new LongHashMap();
|
||||
private final Set<BlockPos> loaderList = Sets.<BlockPos>newHashSet();
|
||||
|
@ -297,11 +297,11 @@ public final class WorldServer extends AWorldServer {
|
|||
this.chunkDir.mkdirs();
|
||||
this.seed = this.rand.longv();
|
||||
this.dimension.setSeed(this.seed);
|
||||
NBTTagCompound tag = null;
|
||||
TagObject tag = null;
|
||||
try {
|
||||
File dat = new File(this.chunkDir, "data.nbt");
|
||||
if(dat.exists() && dat.isFile())
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Weltdaten nicht laden");
|
||||
|
@ -439,19 +439,19 @@ public final class WorldServer extends AWorldServer {
|
|||
this.calculateInitialWeather();
|
||||
this.updatePhysics();
|
||||
if(!debug) {
|
||||
NBTTagCompound tag = null;
|
||||
TagObject tag = null;
|
||||
try {
|
||||
File dat = new File(this.chunkDir, "loaders.nbt");
|
||||
if(dat.exists() && dat.isFile())
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Ladeliste nicht laden");
|
||||
}
|
||||
if(tag != null && tag.hasTagList("Loaders")) {
|
||||
NBTTagTagList list = tag.getTagList("Loaders");
|
||||
TagObjectList list = tag.getTagList("Loaders");
|
||||
for(int z = 0; z < list.size(); z++) {
|
||||
NBTTagCompound pos = list.get(z);
|
||||
TagObject pos = list.get(z);
|
||||
this.addLoader(new BlockPos(pos.getInt("X"), pos.getInt("Y"), pos.getInt("Z")));
|
||||
}
|
||||
this.loadersModified = false;
|
||||
|
@ -479,7 +479,7 @@ public final class WorldServer extends AWorldServer {
|
|||
try {
|
||||
File dat = new File(this.chunkDir, "villages.nbt");
|
||||
if(dat.exists() && dat.isFile())
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Dorfliste nicht laden");
|
||||
|
@ -928,11 +928,11 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
|
||||
public static boolean needsLoading(Dimension dim) {
|
||||
NBTTagCompound tag = null;
|
||||
TagObject tag = null;
|
||||
try {
|
||||
File dat = new File(new File(new File("chunk"), dim.getDimensionName()), "loaders.nbt");
|
||||
if(dat.exists() && dat.isFile())
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
catch(Exception e) {
|
||||
return false;
|
||||
|
@ -941,20 +941,20 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
|
||||
public static void loadWarps(Dimension dim, Map<String, Position> warps) {
|
||||
NBTTagCompound tag = null;
|
||||
TagObject tag = null;
|
||||
try {
|
||||
File dat = new File(new File(new File("chunk"), dim.getDimensionName()), "warps.nbt");
|
||||
if(dat.exists() && dat.isFile())
|
||||
tag = NBTLoader.readGZip(dat);
|
||||
tag = TagLoader.readGZip(dat);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Warpliste nicht laden");
|
||||
return;
|
||||
}
|
||||
if(tag != null && tag.hasTagList("Warps")) {
|
||||
NBTTagTagList list = tag.getTagList("Warps");
|
||||
TagObjectList list = tag.getTagList("Warps");
|
||||
for(int z = 0; z < list.size(); z++) {
|
||||
NBTTagCompound pos = list.get(z);
|
||||
TagObject pos = list.get(z);
|
||||
warps.put(pos.getString("Name"), new Position(pos.getDouble("X"), pos.getDouble("Y"), pos.getDouble("Z"),
|
||||
pos.getFloat("Yaw"), pos.getFloat("Pitch"), dim.getDimensionId()));
|
||||
}
|
||||
|
@ -962,14 +962,14 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
|
||||
public static void saveWarps(Map<String, Position> warps) {
|
||||
Map<Integer, NBTTagTagList> map = Maps.newHashMap();
|
||||
Map<Integer, TagObjectList> map = Maps.newHashMap();
|
||||
for(Entry<String, Position> pos : warps.entrySet()) {
|
||||
Dimension dim = UniverseRegistry.getDimension(pos.getValue().dim);
|
||||
if(dim != null) {
|
||||
NBTTagTagList list = map.get(pos.getValue().dim);
|
||||
TagObjectList list = map.get(pos.getValue().dim);
|
||||
if(list == null)
|
||||
map.put(pos.getValue().dim, list = new NBTTagTagList());
|
||||
NBTTagCompound warp = new NBTTagCompound();
|
||||
map.put(pos.getValue().dim, list = new TagObjectList());
|
||||
TagObject warp = new TagObject();
|
||||
warp.setString("Name", pos.getKey());
|
||||
warp.setDouble("X", pos.getValue().x);
|
||||
warp.setDouble("Y", pos.getValue().y);
|
||||
|
@ -980,16 +980,16 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
}
|
||||
for(Dimension dim : UniverseRegistry.getDimensions()) {
|
||||
NBTTagTagList list = map.get(dim.getDimensionId());
|
||||
TagObjectList list = map.get(dim.getDimensionId());
|
||||
File file = new File(new File(new File("chunk"), dim.getDimensionName()), "warps.nbt");
|
||||
if(list == null) {
|
||||
file.delete();
|
||||
}
|
||||
else {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
TagObject tag = new TagObject();
|
||||
tag.setTagList("Warps", list);
|
||||
try {
|
||||
NBTLoader.writeGZip(tag, file);
|
||||
TagLoader.writeGZip(tag, file);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Warpliste nicht speichern");
|
||||
|
@ -1030,10 +1030,10 @@ public final class WorldServer extends AWorldServer {
|
|||
// }
|
||||
if(this.loadersModified) {
|
||||
this.loadersModified = false;
|
||||
NBTTagCompound loaders = new NBTTagCompound();
|
||||
NBTTagTagList list = new NBTTagTagList();
|
||||
TagObject loaders = new TagObject();
|
||||
TagObjectList list = new TagObjectList();
|
||||
for(BlockPos pos : this.loaderList) {
|
||||
NBTTagCompound loader = new NBTTagCompound();
|
||||
TagObject loader = new TagObject();
|
||||
loader.setInt("X", pos.getX());
|
||||
loader.setInt("Y", pos.getY());
|
||||
loader.setInt("Z", pos.getZ());
|
||||
|
@ -1046,7 +1046,7 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
else {
|
||||
try {
|
||||
NBTLoader.writeGZip(loaders, file);
|
||||
TagLoader.writeGZip(loaders, file);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Ladeliste nicht speichern");
|
||||
|
@ -1058,7 +1058,7 @@ public final class WorldServer extends AWorldServer {
|
|||
// }
|
||||
// if(this.dataModified) {
|
||||
// this.dataModified = false;
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
TagObject data = new TagObject();
|
||||
// data.setLong("Seed", this.seed);
|
||||
data.setTag("Generator", this.dimension.toNbt(true));
|
||||
data.setLong("Time", this.time);
|
||||
|
@ -1067,7 +1067,7 @@ public final class WorldServer extends AWorldServer {
|
|||
// ...
|
||||
File file = new File(this.chunkDir, "data.nbt");
|
||||
try {
|
||||
NBTLoader.writeGZip(data, file);
|
||||
TagLoader.writeGZip(data, file);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Weltdaten nicht speichern");
|
||||
|
@ -1081,10 +1081,10 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
}
|
||||
if(this.villageStorage != null && this.villageStorage.isDirty()) {
|
||||
NBTTagCompound tag = this.villageStorage.writeToNBT();
|
||||
TagObject tag = this.villageStorage.writeToNBT();
|
||||
File dat = new File(this.chunkDir, "villages.nbt");
|
||||
try {
|
||||
NBTLoader.writeGZip(tag, dat);
|
||||
TagLoader.writeGZip(tag, dat);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Dorfliste nicht speichern");
|
||||
|
@ -1403,7 +1403,7 @@ public final class WorldServer extends AWorldServer {
|
|||
private ChunkServer loadChunkFromFile(int x, int z) {
|
||||
try {
|
||||
ChunkPos coord = new ChunkPos(x, z);
|
||||
NBTTagCompound tag = this.toRemove.get(coord);
|
||||
TagObject tag = this.toRemove.get(coord);
|
||||
if(tag == null) {
|
||||
tag = Region.readChunk(this.chunkDir, x, z);
|
||||
// DataInputStream in = ;
|
||||
|
@ -1446,7 +1446,7 @@ public final class WorldServer extends AWorldServer {
|
|||
try {
|
||||
// NBTTagCompound ltag = new NBTTagCompound();
|
||||
// tag.setTag("Level", ltag);
|
||||
NBTTagCompound tag = Region.writeNbt(this, chunk);
|
||||
TagObject tag = Region.writeNbt(this, chunk);
|
||||
ChunkPos coord = new ChunkPos(chunk.xPos, chunk.zPos);
|
||||
if(!this.pending.contains(coord)) {
|
||||
this.toRemove.put(coord, tag);
|
||||
|
@ -1474,7 +1474,7 @@ public final class WorldServer extends AWorldServer {
|
|||
boolean flag;
|
||||
try {
|
||||
this.pending.add(coord);
|
||||
NBTTagCompound tag = this.toRemove.remove(coord);
|
||||
TagObject tag = this.toRemove.remove(coord);
|
||||
|
||||
if(tag != null) {
|
||||
try {
|
||||
|
@ -2230,7 +2230,7 @@ public final class WorldServer extends AWorldServer {
|
|||
if(successful) {
|
||||
if(block.getNbtData() != null) {
|
||||
this.removeTileEntity(pos);
|
||||
NBTTagCompound tag = block.getNbtData();
|
||||
TagObject tag = block.getNbtData();
|
||||
tag.setString("id", tag.getString("id"));
|
||||
tag.setInt("x", pos.getX());
|
||||
tag.setInt("y", pos.getY());
|
||||
|
@ -2486,7 +2486,7 @@ public final class WorldServer extends AWorldServer {
|
|||
File file = this.getSaveFile(id);
|
||||
if(file.exists()) {
|
||||
// try {
|
||||
data = new WorldSavedData(id, NBTLoader.readGZip(file));
|
||||
data = new WorldSavedData(id, TagLoader.readGZip(file));
|
||||
// }
|
||||
// catch(Exception re) {
|
||||
// throw new RuntimeException("Konnte " + clazz.toString() + " nicht instanzieren", re);
|
||||
|
@ -2523,7 +2523,7 @@ public final class WorldServer extends AWorldServer {
|
|||
// NBTTagCompound dtag = new NBTTagCompound();
|
||||
// dtag.setTag("data", tag);
|
||||
// FileOutputStream out = new FileOutputStream(file);
|
||||
NBTLoader.writeGZip(data.tag, file);
|
||||
TagLoader.writeGZip(data.tag, file);
|
||||
// out.close();
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
@ -2787,11 +2787,11 @@ public final class WorldServer extends AWorldServer {
|
|||
|
||||
public static class WorldSavedData {
|
||||
public final String id;
|
||||
public final NBTTagCompound tag;
|
||||
public final TagObject tag;
|
||||
|
||||
public boolean dirty;
|
||||
|
||||
public WorldSavedData(String id, NBTTagCompound tag) {
|
||||
public WorldSavedData(String id, TagObject tag) {
|
||||
this.id = id;
|
||||
this.tag = tag;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.util.Iterator;
|
|||
import java.util.Map;
|
||||
|
||||
import common.collect.Maps;
|
||||
import common.nbt.NBTBase;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.Tag;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ChunkPos;
|
||||
|
@ -198,20 +198,20 @@ public abstract class MapGenStructure extends MapGenBase
|
|||
|
||||
if (this.structureData == null)
|
||||
{
|
||||
this.structureData = new WorldSavedData(this.getStructureName(), new NBTTagCompound());
|
||||
this.structureData = new WorldSavedData(this.getStructureName(), new TagObject());
|
||||
worldIn.setItemData(this.getStructureName(), this.structureData);
|
||||
}
|
||||
else
|
||||
{
|
||||
NBTTagCompound tag = this.structureData.tag;
|
||||
TagObject tag = this.structureData.tag;
|
||||
|
||||
for (String s : tag.getKeySet())
|
||||
{
|
||||
NBTBase nbtbase = tag.get(s);
|
||||
Tag nbtbase = tag.get(s);
|
||||
|
||||
if (nbtbase instanceof NBTTagCompound)
|
||||
if (nbtbase instanceof TagObject)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbtbase;
|
||||
TagObject nbttagcompound1 = (TagObject)nbtbase;
|
||||
|
||||
if (nbttagcompound1.hasInt("ChunkX") && nbttagcompound1.hasInt("ChunkZ"))
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.Map;
|
|||
|
||||
import common.collect.Maps;
|
||||
import common.log.Log;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import server.world.WorldServer;
|
||||
|
||||
public class MapGenStructureIO
|
||||
|
@ -36,7 +36,7 @@ public class MapGenStructureIO
|
|||
return (String)componentClassToNameMap.get(component.getClass());
|
||||
}
|
||||
|
||||
public static StructureStart getStructureStart(NBTTagCompound tagCompound, WorldServer worldIn)
|
||||
public static StructureStart getStructureStart(TagObject tagCompound, WorldServer worldIn)
|
||||
{
|
||||
StructureStart structurestart = null;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class MapGenStructureIO
|
|||
return structurestart;
|
||||
}
|
||||
|
||||
public static StructureComponent getStructureComponent(NBTTagCompound tagCompound, WorldServer worldIn)
|
||||
public static StructureComponent getStructureComponent(TagObject tagCompound, WorldServer worldIn)
|
||||
{
|
||||
StructureComponent structurecomponent = null;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Set;
|
|||
|
||||
import common.biome.Biome;
|
||||
import common.collect.Sets;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import server.world.WorldServer;
|
||||
|
||||
|
@ -140,13 +140,13 @@ public class MapGenVillage extends MapGenStructure
|
|||
return this.hasMoreThanTwoComponents;
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
public void writeToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setBool("Valid", this.hasMoreThanTwoComponents);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
public void readFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
this.hasMoreThanTwoComponents = tagCompound.getBool("Valid");
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.List;
|
|||
|
||||
import common.collect.Lists;
|
||||
import common.init.Blocks;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntityMobSpawner;
|
||||
|
@ -115,13 +115,13 @@ public class StructureBridge
|
|||
this.field_111021_b = p_i45615_2_.zrange(3) == 0;
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.field_111021_b = tagCompound.getBool("Chest");
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Chest", this.field_111021_b);
|
||||
|
@ -186,13 +186,13 @@ public class StructureBridge
|
|||
this.field_111020_b = p_i45613_2_.zrange(3) == 0;
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.field_111020_b = tagCompound.getBool("Chest");
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Chest", this.field_111020_b);
|
||||
|
@ -636,13 +636,13 @@ public class StructureBridge
|
|||
return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_175884_0_, structureboundingbox) == null ? new StructureBridge.End(p_175884_6_, p_175884_1_, structureboundingbox, p_175884_5_) : null;
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.fillSeed = tagCompound.getInt("Seed");
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("Seed", this.fillSeed);
|
||||
|
@ -951,11 +951,11 @@ public class StructureBridge
|
|||
super(p_i2054_1_);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1243,12 +1243,12 @@ public class StructureBridge
|
|||
}
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
}
|
||||
|
@ -1325,13 +1325,13 @@ public class StructureBridge
|
|||
this.boundingBox = p_i45611_3_;
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.hasSpawner = tagCompound.getBool("Mob");
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Mob", this.hasSpawner);
|
||||
|
|
|
@ -8,7 +8,7 @@ import common.block.artificial.BlockDoor;
|
|||
import common.init.Blocks;
|
||||
import common.item.ItemDoor;
|
||||
import common.item.RngLoot;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import common.rng.WeightedList;
|
||||
import common.tileentity.TileEntity;
|
||||
|
@ -44,9 +44,9 @@ public abstract class StructureComponent
|
|||
* game.worldgen.structure.StructureComponent#componentType componentType}) to new NBTTagCompound and
|
||||
* returns it.
|
||||
*/
|
||||
public NBTTagCompound createStructureBaseNBT()
|
||||
public TagObject createStructureBaseNBT()
|
||||
{
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
TagObject nbttagcompound = new TagObject();
|
||||
nbttagcompound.setString("id", MapGenStructureIO.getStructureComponentName(this));
|
||||
nbttagcompound.setIntArray("BB", this.boundingBox.toIntArray());
|
||||
nbttagcompound.setInt("O", this.coordBaseMode == null ? -1 : this.coordBaseMode.getHorizontalIndex());
|
||||
|
@ -58,14 +58,14 @@ public abstract class StructureComponent
|
|||
/**
|
||||
* (abstract) Helper method to write subclass data to NBT
|
||||
*/
|
||||
protected abstract void writeStructureToNBT(NBTTagCompound tagCompound);
|
||||
protected abstract void writeStructureToNBT(TagObject tagCompound);
|
||||
|
||||
/**
|
||||
* Reads and sets structure base data (boundingbox, {@link
|
||||
* game.worldgen.structure.StructureComponent#coordBaseMode coordBase} and {@link
|
||||
* game.worldgen.structure.StructureComponent#componentType componentType})
|
||||
*/
|
||||
public void readStructureBaseNBT(WorldServer worldIn, NBTTagCompound tagCompound)
|
||||
public void readStructureBaseNBT(WorldServer worldIn, TagObject tagCompound)
|
||||
{
|
||||
if (tagCompound.hasIntArray("BB"))
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public abstract class StructureComponent
|
|||
/**
|
||||
* (abstract) Helper method to read subclass data from NBT
|
||||
*/
|
||||
protected abstract void readStructureFromNBT(NBTTagCompound tagCompound);
|
||||
protected abstract void readStructureFromNBT(TagObject tagCompound);
|
||||
|
||||
/**
|
||||
* Initiates construction of the Structure Component picked, at the current Location of StructGen
|
||||
|
|
|
@ -7,8 +7,8 @@ import common.entity.item.EntityChestCart;
|
|||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.RngLoot;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagIntArrayList;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagIntArrayList;
|
||||
import common.rng.Random;
|
||||
import common.rng.WeightedList;
|
||||
import common.tileentity.TileEntity;
|
||||
|
@ -100,7 +100,7 @@ public class StructureMineshaft
|
|||
{
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
tagCompound.setBool("hr", this.hasRails);
|
||||
tagCompound.setBool("sc", this.hasSpiders);
|
||||
|
@ -108,7 +108,7 @@ public class StructureMineshaft
|
|||
tagCompound.setInt("Num", this.sectionCount);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
this.hasRails = tagCompound.getBool("hr");
|
||||
this.hasSpiders = tagCompound.getBool("sc");
|
||||
|
@ -425,13 +425,13 @@ public class StructureMineshaft
|
|||
{
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
tagCompound.setBool("tf", this.isMultipleFloors);
|
||||
tagCompound.setInt("D", this.corridorDirection.getHorizontalIndex());
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
this.isMultipleFloors = tagCompound.getBool("tf");
|
||||
this.corridorDirection = Facing.getHorizontal(tagCompound.getInt("D"));
|
||||
|
@ -710,9 +710,9 @@ public class StructureMineshaft
|
|||
}
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
NBTTagIntArrayList nbttaglist = new NBTTagIntArrayList();
|
||||
TagIntArrayList nbttaglist = new TagIntArrayList();
|
||||
|
||||
for (StructureBoundingBox structureboundingbox : this.roomsLinkedToTheRoom)
|
||||
{
|
||||
|
@ -722,9 +722,9 @@ public class StructureMineshaft
|
|||
tagCompound.setIntArrayList("Entrances", nbttaglist);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
NBTTagIntArrayList nbttaglist = tagCompound.getIntArrayList("Entrances");
|
||||
TagIntArrayList nbttaglist = tagCompound.getIntArrayList("Entrances");
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||
{
|
||||
|
@ -746,11 +746,11 @@ public class StructureMineshaft
|
|||
this.boundingBox = structurebb;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import common.init.Blocks;
|
|||
import common.init.Config;
|
||||
import common.init.Items;
|
||||
import common.item.RngLoot;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
|
@ -41,7 +41,7 @@ public class StructureScattered
|
|||
super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("hasPlacedChest0", this.hasPlacedChest[0]);
|
||||
|
@ -50,7 +50,7 @@ public class StructureScattered
|
|||
tagCompound.setBool("hasPlacedChest3", this.hasPlacedChest[3]);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.hasPlacedChest[0] = tagCompound.getBool("hasPlacedChest0");
|
||||
|
@ -293,7 +293,7 @@ public class StructureScattered
|
|||
}
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
tagCompound.setInt("Width", this.scatteredFeatureSizeX);
|
||||
tagCompound.setInt("Height", this.scatteredFeatureSizeY);
|
||||
|
@ -301,7 +301,7 @@ public class StructureScattered
|
|||
tagCompound.setInt("HPos", this.field_74936_d);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
this.scatteredFeatureSizeX = tagCompound.getInt("Width");
|
||||
this.scatteredFeatureSizeY = tagCompound.getInt("Height");
|
||||
|
@ -366,7 +366,7 @@ public class StructureScattered
|
|||
super(p_i2064_1_, p_i2064_2_, 64, p_i2064_3_, 12, 10, 15);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("placedMainChest", this.placedMainChest);
|
||||
|
@ -375,7 +375,7 @@ public class StructureScattered
|
|||
tagCompound.setBool("placedTrap2", this.placedTrap2);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.placedMainChest = tagCompound.getBool("placedMainChest");
|
||||
|
@ -613,13 +613,13 @@ public class StructureScattered
|
|||
super(p_i2066_1_, p_i2066_2_, 64, p_i2066_3_, 7, 7, 9);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Mage", this.hasMage);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.hasMage = tagCompound.getBool("Mage");
|
||||
|
|
|
@ -3,8 +3,8 @@ package server.worldgen.structure;
|
|||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.NBTTagTagList;
|
||||
import common.nbt.TagObject;
|
||||
import common.nbt.TagObjectList;
|
||||
import common.rng.Random;
|
||||
import common.util.ChunkPos;
|
||||
import server.world.WorldServer;
|
||||
|
@ -67,14 +67,14 @@ public abstract class StructureStart
|
|||
}
|
||||
}
|
||||
|
||||
public NBTTagCompound writeStructureComponentsToNBT(int chunkX, int chunkZ)
|
||||
public TagObject writeStructureComponentsToNBT(int chunkX, int chunkZ)
|
||||
{
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
TagObject nbttagcompound = new TagObject();
|
||||
nbttagcompound.setString("id", MapGenStructureIO.getStructureStartName(this));
|
||||
nbttagcompound.setInt("ChunkX", chunkX);
|
||||
nbttagcompound.setInt("ChunkZ", chunkZ);
|
||||
nbttagcompound.setIntArray("BB", this.boundingBox.toIntArray());
|
||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
||||
TagObjectList nbttaglist = new TagObjectList();
|
||||
|
||||
for (StructureComponent structurecomponent : this.components)
|
||||
{
|
||||
|
@ -86,11 +86,11 @@ public abstract class StructureStart
|
|||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
public void writeToNBT(TagObject tagCompound)
|
||||
{
|
||||
}
|
||||
|
||||
public void readStructureComponentsFromNBT(WorldServer worldIn, NBTTagCompound tagCompound)
|
||||
public void readStructureComponentsFromNBT(WorldServer worldIn, TagObject tagCompound)
|
||||
{
|
||||
this.chunkPosX = tagCompound.getInt("ChunkX");
|
||||
this.chunkPosZ = tagCompound.getInt("ChunkZ");
|
||||
|
@ -100,7 +100,7 @@ public abstract class StructureStart
|
|||
this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
|
||||
}
|
||||
|
||||
NBTTagTagList nbttaglist = tagCompound.getTagList("Children");
|
||||
TagObjectList nbttaglist = tagCompound.getTagList("Children");
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ public abstract class StructureStart
|
|||
this.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
public void readFromNBT(TagObject tagCompound)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import common.collect.Maps;
|
|||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.RngLoot;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.tileentity.TileEntityMobSpawner;
|
||||
|
@ -252,13 +252,13 @@ public class StructureStronghold
|
|||
this.boundingBox = p_i45582_3_;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Chest", this.hasMadeChest);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.hasMadeChest = tagCompound.getBool("Chest");
|
||||
|
@ -324,13 +324,13 @@ public class StructureStronghold
|
|||
this.field_74993_a = p_i45581_4_ != Facing.NORTH && p_i45581_4_ != Facing.SOUTH ? p_i45581_3_.getXSize() : p_i45581_3_.getZSize();
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("Steps", this.field_74993_a);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.field_74993_a = tagCompound.getInt("Steps");
|
||||
|
@ -425,7 +425,7 @@ public class StructureStronghold
|
|||
this.field_74999_h = p_i45580_2_.zrange(3) > 0;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("leftLow", this.field_74996_b);
|
||||
|
@ -434,7 +434,7 @@ public class StructureStronghold
|
|||
tagCompound.setBool("rightHigh", this.field_74999_h);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.field_74996_b = tagCompound.getBool("leftLow");
|
||||
|
@ -608,13 +608,13 @@ public class StructureStronghold
|
|||
this.isLargeRoom = p_i45578_3_.getYSize() > 6;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Tall", this.isLargeRoom);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.isLargeRoom = tagCompound.getBool("Tall");
|
||||
|
@ -792,13 +792,13 @@ public class StructureStronghold
|
|||
this.boundingBox = p_i45577_3_;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Mob", this.hasSpawner);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.hasSpawner = tagCompound.getBool("Mob");
|
||||
|
@ -1030,13 +1030,13 @@ public class StructureStronghold
|
|||
this.roomType = p_i45575_2_.zrange(5);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("Type", this.roomType);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.roomType = tagCompound.getInt("Type");
|
||||
|
@ -1199,13 +1199,13 @@ public class StructureStronghold
|
|||
this.boundingBox = p_i45574_3_;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Source", this.field_75024_a);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.field_75024_a = tagCompound.getBool("Source");
|
||||
|
@ -1393,14 +1393,14 @@ public class StructureStronghold
|
|||
this.expandsZ = p_i45573_2_.zrange(2) == 0;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Left", this.expandsX);
|
||||
tagCompound.setBool("Right", this.expandsZ);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.expandsX = tagCompound.getBool("Left");
|
||||
|
@ -1472,12 +1472,12 @@ public class StructureStronghold
|
|||
super(p_i2087_1_);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
tagCompound.setString("EntryDoor", this.field_143013_d.getName());
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
this.field_143013_d = StructureStronghold.Stronghold.Door.getByName(tagCompound.getString("EntryDoor"));
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import common.entity.npc.EntityHuman;
|
|||
import common.init.BlockRegistry;
|
||||
import common.init.Blocks;
|
||||
import common.init.Config;
|
||||
import common.nbt.NBTTagCompound;
|
||||
import common.nbt.TagObject;
|
||||
import common.rng.Random;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
|
@ -403,7 +403,7 @@ public class StructureVillage
|
|||
this.cropTypeD = this.func_151559_a(rand);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("CA", BlockRegistry.REGISTRY.getIDForObject(this.cropTypeA));
|
||||
|
@ -412,7 +412,7 @@ public class StructureVillage
|
|||
tagCompound.setInt("CD", BlockRegistry.REGISTRY.getIDForObject(this.cropTypeD));
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.cropTypeA = BlockRegistry.getBlockById(tagCompound.getInt("CA"));
|
||||
|
@ -512,14 +512,14 @@ public class StructureVillage
|
|||
this.cropTypeB = this.func_151560_a(rand);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("CA", BlockRegistry.REGISTRY.getIDForObject(this.cropTypeA));
|
||||
tagCompound.setInt("CB", BlockRegistry.REGISTRY.getIDForObject(this.cropTypeB));
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.cropTypeA = BlockRegistry.getBlockById(tagCompound.getInt("CA"));
|
||||
|
@ -855,13 +855,13 @@ public class StructureVillage
|
|||
return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_175855_1_, structureboundingbox) == null ? new StructureVillage.House2(start, p_175855_7_, rand, structureboundingbox, facing) : null;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Chest", this.hasMadeChest);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.hasMadeChest = tagCompound.getBool("Chest");
|
||||
|
@ -1123,13 +1123,13 @@ public class StructureVillage
|
|||
this.isRoofAccessible = rand.chance();
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("Terrace", this.isRoofAccessible);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.isRoofAccessible = tagCompound.getBool("Terrace");
|
||||
|
@ -1252,13 +1252,13 @@ public class StructureVillage
|
|||
this.length = Math.max(p_i45562_4_.getXSize(), p_i45562_4_.getZSize());
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("Length", this.length);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.length = tagCompound.getInt("Length");
|
||||
|
@ -1507,14 +1507,14 @@ public class StructureVillage
|
|||
}
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
tagCompound.setInt("HPos", this.field_143015_k);
|
||||
tagCompound.setInt("VCount", this.villagersSpawned);
|
||||
tagCompound.setBool("Desert", this.isDesertVillage);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
this.field_143015_k = tagCompound.getInt("HPos");
|
||||
this.villagersSpawned = tagCompound.getInt("VCount");
|
||||
|
@ -1789,14 +1789,14 @@ public class StructureVillage
|
|||
this.tablePosition = rand.zrange(3);
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setInt("T", this.tablePosition);
|
||||
tagCompound.setBool("C", this.isTallHouse);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.tablePosition = tagCompound.getInt("T");
|
||||
|
@ -1901,13 +1901,13 @@ public class StructureVillage
|
|||
this.boundingBox = p_i45565_4_;
|
||||
}
|
||||
|
||||
protected void writeStructureToNBT(NBTTagCompound tagCompound)
|
||||
protected void writeStructureToNBT(TagObject tagCompound)
|
||||
{
|
||||
super.writeStructureToNBT(tagCompound);
|
||||
tagCompound.setBool("VSpawn", this.villagerSpawned);
|
||||
}
|
||||
|
||||
protected void readStructureFromNBT(NBTTagCompound tagCompound)
|
||||
protected void readStructureFromNBT(TagObject tagCompound)
|
||||
{
|
||||
super.readStructureFromNBT(tagCompound);
|
||||
this.villagerSpawned = tagCompound.getBool("VSpawn");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue