rename tag methods
This commit is contained in:
parent
c527989ada
commit
753b4b8b5d
57 changed files with 276 additions and 276 deletions
|
@ -183,8 +183,8 @@ public final class Server implements IThreadListener {
|
|||
if(!value.noDef || !value.def.equals(value.getValue()))
|
||||
cfg.setString(cvar, value.getValue());
|
||||
}
|
||||
data.setTag("Config", cfg);
|
||||
data.setTag("Universe", UniverseRegistry.saveNbt());
|
||||
data.setObject("Config", cfg);
|
||||
data.setObject("Universe", UniverseRegistry.saveNbt());
|
||||
File nfile = new File("server.nbt.tmp");
|
||||
File lfile = new File("server.nbt");
|
||||
try {
|
||||
|
@ -207,11 +207,11 @@ public final class Server implements IThreadListener {
|
|||
if(file.exists()) {
|
||||
try {
|
||||
TagObject tag = TagLoader.readGZip(file);
|
||||
TagObject cfg = tag.getTag("Config");
|
||||
TagObject cfg = tag.getObject("Config");
|
||||
for(String key : cfg.getKeySet()) {
|
||||
Config.set(key, cfg.getString(key), false);
|
||||
}
|
||||
UniverseRegistry.loadNbt(tag.getTag("Universe"));
|
||||
UniverseRegistry.loadNbt(tag.getObject("Universe"));
|
||||
long lastPlayed = tag.getLong("LastAccess");
|
||||
String version = tag.hasString("Version") ? tag.getString("Version") : null;
|
||||
version = version != null && version.isEmpty() ? "<unbekannt>" : version;
|
||||
|
|
|
@ -15,7 +15,7 @@ public class ClipboardBlock {
|
|||
public ClipboardBlock(State data, TileEntity tile) {
|
||||
this(data);
|
||||
TagObject tag = new TagObject();
|
||||
tile.writeToNBT(tag);
|
||||
tile.writeTags(tag);
|
||||
this.nbt = tag;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class CommandBlock extends Command {
|
|||
TileEntity tile = world.getTileEntity(position);
|
||||
if(tile != null) {
|
||||
TagObject te = new TagObject();
|
||||
tile.writeToNBT(te);
|
||||
tile.writeTags(te);
|
||||
tag.setString("id", te.getString("id"));
|
||||
tag.setInt("x", position.getX());
|
||||
tag.setInt("y", position.getY());
|
||||
|
|
|
@ -622,7 +622,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
if(tag.hasString("password"))
|
||||
this.password = tag.getString("password");
|
||||
this.selected = tag.getInt("selected");
|
||||
TagObjectList list = tag.getTagList("characters");
|
||||
TagObjectList list = tag.getObjectList("characters");
|
||||
for(int z = 0; z < list.size(); z++) {
|
||||
this.characters.add(list.get(z));
|
||||
}
|
||||
|
@ -653,7 +653,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
for(TagObject etag : this.characters) {
|
||||
list.add(etag);
|
||||
}
|
||||
tag.setTagList("characters", list);
|
||||
tag.setObjectList("characters", list);
|
||||
}
|
||||
// NBTTagCompound stats = new NBTTagCompound();
|
||||
// for(Entry<StatBase, Integer> entry : this.stats.entrySet()) {
|
||||
|
@ -2988,14 +2988,14 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
// changed = true;
|
||||
// }
|
||||
|
||||
if (itemstack.hasTagCompound() && itemstack.getTagCompound().hasTag("BlockEntityTag"))
|
||||
if (itemstack.hasTagCompound() && itemstack.getTagCompound().hasObject("BlockEntityTag"))
|
||||
{
|
||||
// if(!itemstack.getTagCompound().hasTag("BlockEntityTag")) {
|
||||
// changed = true;
|
||||
// itemstack.setTagCompound(null);
|
||||
// }
|
||||
// else {
|
||||
TagObject nbttagcompound = itemstack.getTagCompound().getTag("BlockEntityTag");
|
||||
TagObject nbttagcompound = itemstack.getTagCompound().getObject("BlockEntityTag");
|
||||
|
||||
if (nbttagcompound.hasInt("x") && nbttagcompound.hasInt("y") && nbttagcompound.hasInt("z"))
|
||||
{
|
||||
|
@ -3005,7 +3005,7 @@ public class Player extends NetHandler implements ICrafting, Executor, IPlayer
|
|||
if (tileentity != null)
|
||||
{
|
||||
TagObject nbttagcompound1 = new TagObject();
|
||||
tileentity.writeToNBT(nbttagcompound1);
|
||||
tileentity.writeTags(nbttagcompound1);
|
||||
nbttagcompound1.remove("x");
|
||||
nbttagcompound1.remove("y");
|
||||
nbttagcompound1.remove("z");
|
||||
|
|
|
@ -26,7 +26,7 @@ public class VillageCollection
|
|||
public VillageCollection(TagObject nbt) {
|
||||
if(nbt != null) {
|
||||
this.tickCounter = nbt.getInt("Tick");
|
||||
TagObjectList nbttaglist = nbt.getTagList("Villages");
|
||||
TagObjectList nbttaglist = nbt.getObjectList("Villages");
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||
{
|
||||
|
@ -261,7 +261,7 @@ public class VillageCollection
|
|||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
||||
nbt.setTagList("Villages", nbttaglist);
|
||||
nbt.setObjectList("Villages", nbttaglist);
|
||||
this.dirty = false;
|
||||
return nbt;
|
||||
}
|
||||
|
|
|
@ -1068,7 +1068,7 @@ public abstract class Converter {
|
|||
sections.add(section);
|
||||
}
|
||||
}
|
||||
ntag.setTagList("Sections", sections);
|
||||
ntag.setObjectList("Sections", sections);
|
||||
byte[] biomes = new byte[256];
|
||||
Arrays.fill(biomes, (byte)(Biome.DEF_BIOME.id & 255));
|
||||
ntag.setByteArray("Biomes", biomes);
|
||||
|
@ -1101,7 +1101,7 @@ public abstract class Converter {
|
|||
entities.add(nent);
|
||||
}
|
||||
}
|
||||
ntag.setTagList("Entities", entities);
|
||||
ntag.setObjectList("Entities", entities);
|
||||
|
||||
ents = tag.getTagList("TileEntities");
|
||||
entities = new TagObjectList();
|
||||
|
@ -1117,7 +1117,7 @@ public abstract class Converter {
|
|||
entities.add(nent);
|
||||
}
|
||||
}
|
||||
ntag.setTagList("TileEntities", entities);
|
||||
ntag.setObjectList("TileEntities", entities);
|
||||
|
||||
OldNbtTag[] sects = tag.getTagList("Sections");
|
||||
entities = new TagObjectList();
|
||||
|
@ -1163,7 +1163,7 @@ public abstract class Converter {
|
|||
nsect.setByteArray("Add", adddata.getData());
|
||||
entities.add(nsect);
|
||||
}
|
||||
ntag.setTagList("Sections", entities);
|
||||
ntag.setObjectList("Sections", entities);
|
||||
return ntag;
|
||||
}
|
||||
|
||||
|
|
|
@ -366,7 +366,7 @@ public class Region {
|
|||
// return null;
|
||||
// }
|
||||
// tag = tag.getCompoundTag("Level");
|
||||
if(!tag.hasTagList("Sections")) {
|
||||
if(!tag.hasObjectList("Sections")) {
|
||||
Log.IO.warn("Chunk-Datei bei " + x + "," + z + " hat keine Block-Daten, überspringe");
|
||||
return null;
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ public class Region {
|
|||
chunk.setTerrainPopulated(tag.getBool("TerrainPopulated"));
|
||||
chunk.setLightPopulated(tag.getBool("LightPopulated"));
|
||||
chunk.setInhabited(tag.getLong("InhabitedTime"));
|
||||
TagObjectList sects = tag.getTagList("Sections");
|
||||
TagObjectList sects = tag.getObjectList("Sections");
|
||||
BlockArray[] sections = new BlockArray[sects.size()];
|
||||
boolean light = !world.dimension.hasNoLight();
|
||||
|
||||
|
@ -413,7 +413,7 @@ public class Region {
|
|||
chunk.setBiomes(tag.getByteArray("Biomes"));
|
||||
}
|
||||
|
||||
TagObjectList entities = tag.getTagList("Entities");
|
||||
TagObjectList entities = tag.getObjectList("Entities");
|
||||
|
||||
if(entities != null) {
|
||||
for(int n = 0; n < entities.size(); ++n) {
|
||||
|
@ -425,8 +425,8 @@ public class Region {
|
|||
chunk.addEntity(entity);
|
||||
Entity rider = entity;
|
||||
|
||||
for(TagObject ride = ent; ride.hasTag("Riding"); ride = ride.getTag("Riding")) {
|
||||
Entity pass = EntityRegistry.createEntityFromNBT(ride.getTag("Riding"), world);
|
||||
for(TagObject ride = ent; ride.hasObject("Riding"); ride = ride.getObject("Riding")) {
|
||||
Entity pass = EntityRegistry.createEntityFromNBT(ride.getObject("Riding"), world);
|
||||
|
||||
if(pass != null) {
|
||||
chunk.addEntity(pass);
|
||||
|
@ -439,7 +439,7 @@ public class Region {
|
|||
}
|
||||
}
|
||||
|
||||
TagObjectList tiles = tag.getTagList("TileEntities");
|
||||
TagObjectList tiles = tag.getObjectList("TileEntities");
|
||||
|
||||
if(tiles != null) {
|
||||
for(int n = 0; n < tiles.size(); ++n) {
|
||||
|
@ -452,8 +452,8 @@ public class Region {
|
|||
}
|
||||
}
|
||||
|
||||
if(tag.hasTagList("TileTicks")) {
|
||||
TagObjectList ticks = tag.getTagList("TileTicks");
|
||||
if(tag.hasObjectList("TileTicks")) {
|
||||
TagObjectList ticks = tag.getObjectList("TileTicks");
|
||||
|
||||
if(ticks != null) {
|
||||
int invalid = 0;
|
||||
|
@ -544,7 +544,7 @@ public class Region {
|
|||
}
|
||||
}
|
||||
|
||||
tag.setTagList("Sections", sects);
|
||||
tag.setObjectList("Sections", sects);
|
||||
tag.setByteArray("Biomes", chunk.getBiomes());
|
||||
chunk.setHasEntities(false);
|
||||
TagObjectList entities = new TagObjectList();
|
||||
|
@ -560,16 +560,16 @@ public class Region {
|
|||
}
|
||||
}
|
||||
|
||||
tag.setTagList("Entities", entities);
|
||||
tag.setObjectList("Entities", entities);
|
||||
TagObjectList tiles = new TagObjectList();
|
||||
|
||||
for(TileEntity tileentity : chunk.getTiles().values()) {
|
||||
TagObject tile = new TagObject();
|
||||
tileentity.writeToNBT(tile);
|
||||
tileentity.writeTags(tile);
|
||||
tiles.add(tile);
|
||||
}
|
||||
|
||||
tag.setTagList("TileEntities", tiles);
|
||||
tag.setObjectList("TileEntities", tiles);
|
||||
List<NextTickListEntry> tics = world.getPendingBlockUpdates(chunk);
|
||||
|
||||
if(tics != null) {
|
||||
|
@ -588,7 +588,7 @@ public class Region {
|
|||
ticks.add(tick);
|
||||
}
|
||||
|
||||
tag.setTagList("TileTicks", ticks);
|
||||
tag.setObjectList("TileTicks", ticks);
|
||||
}
|
||||
|
||||
return tag;
|
||||
|
|
|
@ -309,8 +309,8 @@ public final class WorldServer extends AWorldServer {
|
|||
if(tag != null) {
|
||||
this.exterminated = tag.getBool("Exterminated");
|
||||
this.time = tag.getLong("Time");
|
||||
if(tag.hasTag("Generator")) {
|
||||
this.dimension.fromNbt(tag.getTag("Generator"));
|
||||
if(tag.hasObject("Generator")) {
|
||||
this.dimension.fromNbt(tag.getObject("Generator"));
|
||||
if(this.dimension.getType().weather && !this.exterminated)
|
||||
this.weather = this.dimension.getWeather();
|
||||
this.seed = this.dimension.getSeed();
|
||||
|
@ -448,8 +448,8 @@ public final class WorldServer extends AWorldServer {
|
|||
catch(Exception e) {
|
||||
Log.IO.error(e, "Konnte Ladeliste nicht laden");
|
||||
}
|
||||
if(tag != null && tag.hasTagList("Loaders")) {
|
||||
TagObjectList list = tag.getTagList("Loaders");
|
||||
if(tag != null && tag.hasObjectList("Loaders")) {
|
||||
TagObjectList list = tag.getObjectList("Loaders");
|
||||
for(int z = 0; z < list.size(); z++) {
|
||||
TagObject pos = list.get(z);
|
||||
this.addLoader(new BlockPos(pos.getInt("X"), pos.getInt("Y"), pos.getInt("Z")));
|
||||
|
@ -937,7 +937,7 @@ public final class WorldServer extends AWorldServer {
|
|||
catch(Exception e) {
|
||||
return false;
|
||||
}
|
||||
return tag != null && tag.hasTagList("Loaders") && !tag.getTagList("Loaders").isEmpty();
|
||||
return tag != null && tag.hasObjectList("Loaders") && !tag.getObjectList("Loaders").isEmpty();
|
||||
}
|
||||
|
||||
public static void loadWarps(Dimension dim, Map<String, Position> warps) {
|
||||
|
@ -951,8 +951,8 @@ public final class WorldServer extends AWorldServer {
|
|||
Log.IO.error(e, "Konnte Warpliste nicht laden");
|
||||
return;
|
||||
}
|
||||
if(tag != null && tag.hasTagList("Warps")) {
|
||||
TagObjectList list = tag.getTagList("Warps");
|
||||
if(tag != null && tag.hasObjectList("Warps")) {
|
||||
TagObjectList list = tag.getObjectList("Warps");
|
||||
for(int z = 0; z < list.size(); z++) {
|
||||
TagObject pos = list.get(z);
|
||||
warps.put(pos.getString("Name"), new Position(pos.getDouble("X"), pos.getDouble("Y"), pos.getDouble("Z"),
|
||||
|
@ -987,7 +987,7 @@ public final class WorldServer extends AWorldServer {
|
|||
}
|
||||
else {
|
||||
TagObject tag = new TagObject();
|
||||
tag.setTagList("Warps", list);
|
||||
tag.setObjectList("Warps", list);
|
||||
try {
|
||||
TagLoader.writeGZip(tag, file);
|
||||
}
|
||||
|
@ -1039,7 +1039,7 @@ public final class WorldServer extends AWorldServer {
|
|||
loader.setInt("Z", pos.getZ());
|
||||
list.add(loader);
|
||||
}
|
||||
loaders.setTagList("Loaders", list);
|
||||
loaders.setObjectList("Loaders", list);
|
||||
File file = new File(this.chunkDir, "loaders.nbt");
|
||||
if(list.isEmpty()) {
|
||||
file.delete();
|
||||
|
@ -1060,7 +1060,7 @@ public final class WorldServer extends AWorldServer {
|
|||
// this.dataModified = false;
|
||||
TagObject data = new TagObject();
|
||||
// data.setLong("Seed", this.seed);
|
||||
data.setTag("Generator", this.dimension.toNbt(true));
|
||||
data.setObject("Generator", this.dimension.toNbt(true));
|
||||
data.setLong("Time", this.time);
|
||||
data.setBool("Exterminated", this.exterminated);
|
||||
data.setString("Weather", this.weather.getName());
|
||||
|
|
|
@ -232,7 +232,7 @@ public abstract class MapGenStructure extends MapGenBase
|
|||
|
||||
private void setStructureStart(int chunkX, int chunkZ, StructureStart start)
|
||||
{
|
||||
this.structureData.tag.setTag("[" + chunkX + "," + chunkZ + "]", start.writeStructureComponentsToNBT(chunkX, chunkZ));
|
||||
this.structureData.tag.setObject("[" + chunkX + "," + chunkZ + "]", start.writeStructureComponentsToNBT(chunkX, chunkZ));
|
||||
this.structureData.dirty = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public abstract class StructureStart
|
|||
nbttaglist.add(structurecomponent.createStructureBaseNBT());
|
||||
}
|
||||
|
||||
nbttagcompound.setTagList("Children", nbttaglist);
|
||||
nbttagcompound.setObjectList("Children", nbttaglist);
|
||||
this.writeToNBT(nbttagcompound);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public abstract class StructureStart
|
|||
this.boundingBox = new StructureBoundingBox(tagCompound.getIntArray("BB"));
|
||||
}
|
||||
|
||||
TagObjectList nbttaglist = tagCompound.getTagList("Children");
|
||||
TagObjectList nbttaglist = tagCompound.getObjectList("Children");
|
||||
|
||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue