Compare commits

..

No commits in common. "688d5710c748cb6115bc716db3d95ca38e98654d" and "4433d3b3df3d0b9a1ce7a2468c3d27975add9ab8" have entirely different histories.

144 changed files with 1224 additions and 1224 deletions

View file

@ -5,7 +5,7 @@ import client.renderer.RenderBuffer;
import client.renderer.texture.TextureAtlasSprite;
import common.entity.Entity;
import common.entity.EntityType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.ExtMath;
import common.world.World;
@ -210,14 +210,14 @@ public class EntityFX extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
}

View file

@ -6,8 +6,8 @@ import client.world.WorldClient;
import common.entity.Entity;
import common.init.SoundEvent;
import common.item.ItemDye;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.util.BoundingBox;
import common.util.ExtMath;
import common.world.World;
@ -192,10 +192,10 @@ public class EntityFirework
{
private int fireworkAge;
private final EffectRenderer theEffectRenderer;
private TagObjectList fireworkExplosions;
private NBTTagTagList fireworkExplosions;
boolean twinkle;
public StarterFX(World p_i46464_1_, double p_i46464_2_, double p_i46464_4_, double p_i46464_6_, double p_i46464_8_, double p_i46464_10_, double p_i46464_12_, EffectRenderer p_i46464_14_, TagObject p_i46464_15_)
public StarterFX(World p_i46464_1_, double p_i46464_2_, double p_i46464_4_, double p_i46464_6_, double p_i46464_8_, double p_i46464_10_, double p_i46464_12_, EffectRenderer p_i46464_14_, NBTTagCompound p_i46464_15_)
{
super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D);
this.motionX = p_i46464_8_;
@ -218,7 +218,7 @@ public class EntityFirework
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
{
TagObject nbttagcompound = this.fireworkExplosions.get(i);
NBTTagCompound nbttagcompound = this.fireworkExplosions.get(i);
if (nbttagcompound.getBool("Flicker"))
{
@ -250,7 +250,7 @@ public class EntityFirework
{
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
{
TagObject nbttagcompound = this.fireworkExplosions.get(i);
NBTTagCompound nbttagcompound = this.fireworkExplosions.get(i);
if (nbttagcompound.getByte("Type") == 1)
{
@ -268,7 +268,7 @@ public class EntityFirework
if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.size())
{
int k = this.fireworkAge / 2;
TagObject nbttagcompound1 = this.fireworkExplosions.get(k);
NBTTagCompound nbttagcompound1 = this.fireworkExplosions.get(k);
int l = nbttagcompound1.getByte("Type");
boolean flag4 = nbttagcompound1.getBool("Trail");
boolean flag2 = nbttagcompound1.getBool("Flicker");

View file

@ -22,10 +22,10 @@ import common.init.SoundEvent;
import common.item.ItemDye;
import common.log.Log;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.rng.Random;
import common.sound.MovingSoundMinecart;
import common.sound.PositionedSound;
import common.tags.TagObject;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.ChunkPos;
@ -381,7 +381,7 @@ public class WorldClient extends AWorldClient
// }
}
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, TagObject compund)
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
{
this.gm.effectRenderer.addEffect(new EntityFirework.StarterFX(this.gm.world, x, y, z, motionX, motionY, motionZ, this.gm.effectRenderer, compund));
}

View file

@ -3,8 +3,8 @@ package common.attributes;
import java.util.Collection;
import common.log.Log;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
public class Attributes
{
@ -40,9 +40,9 @@ public class Attributes
/**
* Creates an NBTTagList from a BaseAttributeMap, including all its AttributeInstances
*/
public static TagObjectList writeBaseAttributeMapToNBT(AttributeMap map)
public static NBTTagTagList writeBaseAttributeMapToNBT(AttributeMap map)
{
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (AttributeInstance iattributeinstance : map.getAllAttributes())
{
@ -55,9 +55,9 @@ public class Attributes
/**
* Creates an NBTTagCompound from an AttributeInstance, including its AttributeModifiers
*/
private static TagObject writeAttributeInstanceToNBT(AttributeInstance instance)
private static NBTTagCompound writeAttributeInstanceToNBT(AttributeInstance instance)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
Attribute iattribute = instance.getAttribute();
nbttagcompound.setString("Name", iattribute.getUnlocalizedName());
nbttagcompound.setDouble("Base", instance.getBaseValue());
@ -65,7 +65,7 @@ public class Attributes
if (collection != null && !collection.isEmpty())
{
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (AttributeModifier attributemodifier : collection)
{
@ -84,9 +84,9 @@ public class Attributes
/**
* Creates an NBTTagCompound from an AttributeModifier
*/
private static TagObject writeAttributeModifierToNBT(AttributeModifier modifier)
private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier modifier)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Name", modifier.getName());
nbttagcompound.setDouble("Amount", modifier.getAmount());
nbttagcompound.setBool("Multiply", modifier.isMultiplied());
@ -94,11 +94,11 @@ public class Attributes
return nbttagcompound;
}
public static void setAttributeModifiers(AttributeMap map, TagObjectList list)
public static void setAttributeModifiers(AttributeMap map, NBTTagTagList list)
{
for (int i = 0; i < list.size(); ++i)
{
TagObject nbttagcompound = list.get(i);
NBTTagCompound nbttagcompound = list.get(i);
AttributeInstance iattributeinstance = map.getAttributeInstanceByName(nbttagcompound.getString("Name"));
if (iattributeinstance != null)
@ -112,13 +112,13 @@ public class Attributes
}
}
private static void applyModifiersToAttributeInstance(AttributeInstance instance, TagObject compound)
private static void applyModifiersToAttributeInstance(AttributeInstance instance, NBTTagCompound compound)
{
instance.setBaseValue(compound.getDouble("Base"));
if (compound.hasTagList("Modifiers"))
{
TagObjectList nbttaglist = compound.getTagList("Modifiers");
NBTTagTagList nbttaglist = compound.getTagList("Modifiers");
for (int i = 0; i < nbttaglist.size(); ++i)
{
@ -142,7 +142,7 @@ public class Attributes
/**
* Creates an AttributeModifier from an NBTTagCompound
*/
public static AttributeModifier readAttributeModifierFromNBT(TagObject compound)
public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound compound)
{
long id = compound.getLong("AttrId");
if(id == 0L)

View file

@ -8,11 +8,11 @@ import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.model.Transforms;
import common.nbt.NBTTagCompound;
import common.properties.IProperty;
import common.properties.PropertyDirection;
import common.properties.PropertyInteger;
import common.rng.Random;
import common.tags.TagObject;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityBanner;
import common.util.BlockPos;
@ -125,7 +125,7 @@ public class BlockBanner extends BlockContainer
if (tileentity instanceof TileEntityBanner)
{
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor());
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
tileentity.writeToNBT(nbttagcompound);
nbttagcompound.remove("x");
nbttagcompound.remove("y");
@ -151,7 +151,7 @@ public class BlockBanner extends BlockContainer
{
TileEntityBanner tileentitybanner = (TileEntityBanner)te;
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)te).getBaseColor());
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns());
itemstack.setTagInfo("BlockEntityTag", nbttagcompound);
spawnAsEntity(worldIn, pos, itemstack);

View file

@ -11,9 +11,9 @@ import common.init.BlockRegistry;
import common.init.Blocks;
import common.init.MetalType;
import common.init.UniverseRegistry;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.tags.TagStringList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagStringList;
import common.nbt.NBTTagTagList;
import common.util.ExtMath;
import common.util.Vec3;
import common.world.State;
@ -802,15 +802,15 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return other == null ? -1 : this.name.compareTo(other.name);
}
public static Dimension getByNbt(TagObject tag) {
public static Dimension getByNbt(NBTTagCompound tag) {
return getByNbt(tag, true, false, false, false);
}
public static Dimension getByNbt(TagObject tag, boolean generator) {
public static Dimension getByNbt(NBTTagCompound tag, boolean generator) {
return getByNbt(tag, false, generator, !generator, false);
}
private static Dimension getByNbt(TagObject tag, boolean mapOnly, boolean generator, boolean partialGen, boolean all) {
private static Dimension getByNbt(NBTTagCompound tag, boolean mapOnly, boolean generator, boolean partialGen, boolean all) {
Dimension dim;
DimType type = DimType.getByName(tag.getString("Type"));
int id = tag.getInt("ID");
@ -847,17 +847,17 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
public final Dimension copy(int id, String name) {
TagObject tag = this.toNbt(true, false, true);
NBTTagCompound tag = this.toNbt(true, false, true);
tag.setInt("ID", id);
tag.setString("Name", name);
return getByNbt(tag, false, true, false, true);
}
public final void fromNbt(TagObject tag) {
public final void fromNbt(NBTTagCompound tag) {
this.fromNbt(tag, true, false, false);
}
private final void fromNbt(TagObject tag, boolean generator, boolean partialGen, boolean all) {
private final void fromNbt(NBTTagCompound tag, boolean generator, boolean partialGen, boolean all) {
if(this == Space.INSTANCE) {
if(generator || partialGen)
this.seed = tag.getLong("Seed");
@ -921,7 +921,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.alt2 = BlockRegistry.getFromIdName(tag.getString("AltBlock2"), Blocks.sand.getState());
this.caveFiller = BlockRegistry.getFromIdName(tag.getString("CaveFillBlock"), Blocks.lava.getState());
if(tag.hasStringList("Layers")) {
TagStringList list = tag.getStringList("Layers");
NBTTagStringList list = tag.getStringList("Layers");
this.layers = new State[list.size()];
for(int z = 0; z < this.layers.length; z++) {
this.layers[z] = BlockRegistry.getFromIdName(list.get(z), Blocks.stone.getState());
@ -931,7 +931,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.layers = null;
}
if(tag.hasStringList("AddBiomes")) {
TagStringList list = tag.getStringList("AddBiomes");
NBTTagStringList list = tag.getStringList("AddBiomes");
if(list.isEmpty()) {
this.addBiomes = null;
}
@ -946,7 +946,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.addBiomes = null;
}
if(tag.hasStringList("FrostBiomes")) {
TagStringList list = tag.getStringList("FrostBiomes");
NBTTagStringList list = tag.getStringList("FrostBiomes");
if(list.isEmpty()) {
this.frostBiomes = null;
}
@ -961,7 +961,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.frostBiomes = null;
}
if(tag.hasStringList("ColdBiomes")) {
TagStringList list = tag.getStringList("ColdBiomes");
NBTTagStringList list = tag.getStringList("ColdBiomes");
if(list.isEmpty()) {
this.coldBiomes = null;
}
@ -976,7 +976,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.coldBiomes = null;
}
if(tag.hasStringList("MediumBiomes")) {
TagStringList list = tag.getStringList("MediumBiomes");
NBTTagStringList list = tag.getStringList("MediumBiomes");
if(list.isEmpty()) {
this.mediumBiomes = null;
}
@ -991,7 +991,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.mediumBiomes = null;
}
if(tag.hasStringList("HotBiomes")) {
TagStringList list = tag.getStringList("HotBiomes");
NBTTagStringList list = tag.getStringList("HotBiomes");
if(list.isEmpty()) {
this.hotBiomes = null;
}
@ -1007,9 +1007,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
this.ores.clear();
if(tag.hasTagList("Ores")) {
TagObjectList list = tag.getTagList("Ores");
NBTTagTagList list = tag.getTagList("Ores");
for(int z = 0; z < list.size(); z++) {
TagObject gen = list.get(z);
NBTTagCompound gen = list.get(z);
this.ores.add(new Ore(BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
gen.getInt("Count"), gen.getInt("Add"), gen.getInt("Size"),
gen.getInt("MinC"), gen.getInt("MaxS"), gen.getBool("Distrib")));
@ -1017,9 +1017,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
this.lakes.clear();
if(tag.hasTagList("Lakes")) {
TagObjectList list = tag.getTagList("Lakes");
NBTTagTagList list = tag.getTagList("Lakes");
for(int z = 0; z < list.size(); z++) {
TagObject gen = list.get(z);
NBTTagCompound gen = list.get(z);
this.lakes.add(new Lake(
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
gen.hasString("Filler") ? BlockRegistry.getFromIdName(gen.getString("Filler"), null) : null,
@ -1029,9 +1029,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
this.liquids.clear();
if(tag.hasTagList("Liquids")) {
TagObjectList list = tag.getTagList("Liquids");
NBTTagTagList list = tag.getTagList("Liquids");
for(int z = 0; z < list.size(); z++) {
TagObject gen = list.get(z);
NBTTagCompound gen = list.get(z);
this.liquids.add(new Liquid(
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
gen.getInt("Chance"), gen.getInt("Min"), gen.getInt("Max"), gen.getBool("Lower")));
@ -1068,7 +1068,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.setStarColor(tag.getInt("StarColor"));
}
else if(tag.hasTag("StarColorFnc")) {
TagObject fnc = tag.getTag("StarColorFnc");
NBTTagCompound fnc = tag.getTag("StarColorFnc");
this.setStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
}
@ -1079,7 +1079,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.setDeepStarColor(tag.getInt("DStarColor"));
}
else if(tag.hasTag("DStarColorFnc")) {
TagObject fnc = tag.getTag("DStarColorFnc");
NBTTagCompound fnc = tag.getTag("DStarColorFnc");
this.setDeepStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
}
@ -1089,12 +1089,12 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
}
public final TagObject toNbt(boolean generator) {
public final NBTTagCompound toNbt(boolean generator) {
return this.toNbt(generator, !generator, false);
}
private final TagObject toNbt(boolean generator, boolean partialGen, boolean all) {
TagObject tag = (all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) ? this.toNbt() : new TagObject();
private final NBTTagCompound toNbt(boolean generator, boolean partialGen, boolean all) {
NBTTagCompound tag = (all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) ? this.toNbt() : new NBTTagCompound();
if(this == Space.INSTANCE) {
if(generator || partialGen)
tag.setLong("Seed", this.seed);
@ -1158,51 +1158,51 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
tag.setString("AltBlock2", BlockRegistry.toIdName(this.alt2));
tag.setString("CaveFillBlock", BlockRegistry.toIdName(this.caveFiller));
if(this.layers != null) {
TagStringList list = new TagStringList();
NBTTagStringList list = new NBTTagStringList();
for(State gen : this.layers) {
list.add(BlockRegistry.toIdName(gen));
}
tag.setStringList("Layers", list);
}
if(this.addBiomes != null) {
TagStringList list = new TagStringList();
NBTTagStringList list = new NBTTagStringList();
for(Biome biome : this.addBiomes) {
list.add(biome.name.toLowerCase());
}
tag.setStringList("AddBiomes", list);
}
if(this.frostBiomes != null) {
TagStringList list = new TagStringList();
NBTTagStringList list = new NBTTagStringList();
for(Biome biome : this.frostBiomes) {
list.add(biome.name.toLowerCase());
}
tag.setStringList("FrostBiomes", list);
}
if(this.coldBiomes != null) {
TagStringList list = new TagStringList();
NBTTagStringList list = new NBTTagStringList();
for(Biome biome : this.coldBiomes) {
list.add(biome.name.toLowerCase());
}
tag.setStringList("ColdBiomes", list);
}
if(this.mediumBiomes != null) {
TagStringList list = new TagStringList();
NBTTagStringList list = new NBTTagStringList();
for(Biome biome : this.mediumBiomes) {
list.add(biome.name.toLowerCase());
}
tag.setStringList("MediumBiomes", list);
}
if(this.hotBiomes != null) {
TagStringList list = new TagStringList();
NBTTagStringList list = new NBTTagStringList();
for(Biome biome : this.hotBiomes) {
list.add(biome.name.toLowerCase());
}
tag.setStringList("HotBiomes", list);
}
if(!this.ores.isEmpty()) {
TagObjectList list = new TagObjectList();
NBTTagTagList list = new NBTTagTagList();
for(Ore gen : this.ores) {
TagObject ore = new TagObject();
NBTTagCompound ore = new NBTTagCompound();
ore.setString("Block", BlockRegistry.toIdName(gen.state));
ore.setBool("Distrib", gen.dist);
ore.setInt("Size", gen.size);
@ -1215,9 +1215,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
tag.setTagList("Ores", list);
}
if(!this.lakes.isEmpty()) {
TagObjectList list = new TagObjectList();
NBTTagTagList list = new NBTTagTagList();
for(Lake gen : this.lakes) {
TagObject lake = new TagObject();
NBTTagCompound lake = new NBTTagCompound();
lake.setString("Block", BlockRegistry.toIdName(gen.state));
if(gen.filler != null)
lake.setString("Filler", BlockRegistry.toIdName(gen.filler));
@ -1232,9 +1232,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
tag.setTagList("Lakes", list);
}
if(!this.liquids.isEmpty()) {
TagObjectList list = new TagObjectList();
NBTTagTagList list = new NBTTagTagList();
for(Liquid gen : this.liquids) {
TagObject liquid = new TagObject();
NBTTagCompound liquid = new NBTTagCompound();
liquid.setString("Block", BlockRegistry.toIdName(gen.state));
liquid.setBool("Lower", gen.lower);
liquid.setInt("Chance", gen.chance);
@ -1277,7 +1277,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
tag.setInt("StarColor", ((SingleColorGen)this.starColorFunc).color);
}
else if(this.starColorFunc instanceof SinusColorGen) {
TagObject fnc = new TagObject();
NBTTagCompound fnc = new NBTTagCompound();
fnc.setFloat("Period", ((SinusColorGen)this.starColorFunc).period);
fnc.setFloat("Det", ((SinusColorGen)this.starColorFunc).det);
fnc.setFloat("Dist", ((SinusColorGen)this.starColorFunc).dist);
@ -1290,7 +1290,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
tag.setInt("DStarColor", ((SingleColorGen)this.deepstarColorFunc).color);
}
else if(this.deepstarColorFunc instanceof SinusColorGen) {
TagObject fnc = new TagObject();
NBTTagCompound fnc = new NBTTagCompound();
fnc.setFloat("Period", ((SinusColorGen)this.deepstarColorFunc).period);
fnc.setFloat("Det", ((SinusColorGen)this.deepstarColorFunc).det);
fnc.setFloat("Dist", ((SinusColorGen)this.deepstarColorFunc).dist);
@ -1303,8 +1303,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return tag;
}
public final TagObject toNbt() {
TagObject tag = new TagObject();
public final NBTTagCompound toNbt() {
NBTTagCompound tag = new NBTTagCompound();
tag.setInt("ID", this.id);
tag.setString("Name", this.name);
tag.setString("Type", this.getType().getName());

View file

@ -1,6 +1,6 @@
package common.dimension;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
public abstract class Nameable {
protected String customName = null;
@ -13,11 +13,11 @@ public abstract class Nameable {
this.customName = name;
}
public void readNbt(TagObject tag) {
public void readNbt(NBTTagCompound tag) {
this.customName = tag.hasString("CustomName") ? tag.getString("CustomName") : null;
}
public void writeNbt(TagObject tag) {
public void writeNbt(NBTTagCompound tag) {
if(this.customName != null)
tag.setString("CustomName", this.customName);
}

View file

@ -12,10 +12,10 @@ import common.entity.types.EntityLiving;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.rng.Random;
import common.rng.WeightedList;
import common.tags.TagObject;
import common.tags.TagObjectList;
public class EnchantmentHelper
{
@ -45,7 +45,7 @@ public class EnchantmentHelper
}
else
{
TagObjectList nbttaglist = stack.getEnchantmentTagList();
NBTTagTagList nbttaglist = stack.getEnchantmentTagList();
if (nbttaglist == null)
{
@ -72,7 +72,7 @@ public class EnchantmentHelper
public static Map<Integer, Integer> getEnchantments(ItemStack stack)
{
Map<Integer, Integer> map = Maps.<Integer, Integer>newLinkedHashMap();
TagObjectList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList();
NBTTagTagList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList();
if (nbttaglist != null)
{
@ -92,7 +92,7 @@ public class EnchantmentHelper
*/
public static void setEnchantments(Map<Integer, Integer> enchMap, ItemStack stack)
{
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
Iterator iterator = enchMap.keySet().iterator();
while (iterator.hasNext())
@ -102,7 +102,7 @@ public class EnchantmentHelper
if (enchantment != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setShort("id", (short)i);
nbttagcompound.setShort("lvl", (short)enchMap.get(i).intValue());
nbttaglist.add(nbttagcompound);
@ -161,7 +161,7 @@ public class EnchantmentHelper
{
if (stack != null)
{
TagObjectList nbttaglist = stack.getEnchantmentTagList();
NBTTagTagList nbttaglist = stack.getEnchantmentTagList();
if (nbttaglist != null)
{

View file

@ -27,10 +27,10 @@ import common.init.UniverseRegistry;
import common.item.Item;
import common.item.ItemStack;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagDoubleList;
import common.nbt.NBTTagFloatList;
import common.rng.Random;
import common.tags.TagDoubleList;
import common.tags.TagFloatList;
import common.tags.TagObject;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -1424,7 +1424,7 @@ public abstract class Entity
* Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their
* riders.
*/
public boolean writeMountToNBT(TagObject tagCompund)
public boolean writeMountToNBT(NBTTagCompound tagCompund)
{
String s = EntityRegistry.getEntityString(this);
@ -1445,7 +1445,7 @@ public abstract class Entity
* returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their
* rider.
*/
public boolean writeToNBTOptional(TagObject tagCompund)
public boolean writeToNBTOptional(NBTTagCompound tagCompund)
{
String s = EntityRegistry.getEntityString(this);
@ -1488,7 +1488,7 @@ public abstract class Entity
/**
* Save the entity to NBT (calls an abstract helper method to write extra data)
*/
public void writeToNBT(TagObject tagCompund)
public void writeToNBT(NBTTagCompound tagCompund)
{
// if(this.persistentId != 0L) {
// tagCompund.setLong("PersistID", this.persistentId);
@ -1525,7 +1525,7 @@ public abstract class Entity
if (this.vehicle != null && !(this.isPlayer()))
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
if (this.vehicle.writeMountToNBT(nbttagcompound))
{
@ -1537,15 +1537,15 @@ public abstract class Entity
/**
* Reads the entity from NBT (calls an abstract helper method to read specialized data)
*/
public void readFromNBT(TagObject tagCompund)
public void readFromNBT(NBTTagCompound tagCompund)
{
// if(tagCompund.hasLong("PersistID"))
// this.setPersistentId(tagCompund.getLong("PersistID"));
// this.setTag(tagCompund.getString("ObjectTag"));
TagDoubleList nbttaglist = tagCompund.getDoubleList("Pos");
TagDoubleList nbttaglist1 = tagCompund.getDoubleList("Motion");
TagFloatList nbttaglist2 = tagCompund.getFloatList("Rotation");
NBTTagDoubleList nbttaglist = tagCompund.getDoubleList("Pos");
NBTTagDoubleList nbttaglist1 = tagCompund.getDoubleList("Motion");
NBTTagFloatList nbttaglist2 = tagCompund.getFloatList("Rotation");
this.motionX = nbttaglist1.get(0);
this.motionY = nbttaglist1.get(1);
this.motionZ = nbttaglist1.get(2);
@ -1614,12 +1614,12 @@ public abstract class Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected abstract void readEntityFromNBT(TagObject tagCompund);
protected abstract void readEntityFromNBT(NBTTagCompound tagCompund);
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected abstract void writeEntityToNBT(TagObject tagCompound);
protected abstract void writeEntityToNBT(NBTTagCompound tagCompound);
public void onChunkLoad()
{
@ -1628,9 +1628,9 @@ public abstract class Entity
/**
* creates a NBT list from the array of doubles passed to this function
*/
protected TagDoubleList newDoubleNBTList(double... numbers)
protected NBTTagDoubleList newDoubleNBTList(double... numbers)
{
TagDoubleList nbttaglist = new TagDoubleList();
NBTTagDoubleList nbttaglist = new NBTTagDoubleList();
for (double d0 : numbers)
{
@ -1643,9 +1643,9 @@ public abstract class Entity
/**
* Returns a new NBTTagList filled with the specified floats
*/
protected TagFloatList newFloatNBTList(float... numbers)
protected NBTTagFloatList newFloatNBTList(float... numbers)
{
TagFloatList nbttaglist = new TagFloatList();
NBTTagFloatList nbttaglist = new NBTTagFloatList();
for (float f : numbers)
{
@ -2350,7 +2350,7 @@ public abstract class Entity
*/
public void copyDataFromOld(Entity entityIn)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
entityIn.writeToNBT(nbttagcompound);
this.readFromNBT(nbttagcompound);
// this.portalTimer = entityIn.portalTimer;
@ -2612,7 +2612,7 @@ public abstract class Entity
return new BlockPos(this.posX, this.posY + 0.5D, this.posZ);
}
public TagObject getNBTTagCompound()
public NBTTagCompound getNBTTagCompound()
{
return null;
}
@ -2620,7 +2620,7 @@ public abstract class Entity
/**
* Called when client receives entity's NBTTagCompound from server.
*/
public void clientUpdateEntityNBT(TagObject compound)
public void clientUpdateEntityNBT(NBTTagCompound compound)
{
}

View file

@ -12,6 +12,7 @@ import common.entity.projectile.EntityArrow;
import common.entity.types.EntityLiving;
import common.item.ItemStack;
import common.log.Log;
import common.nbt.NBTTagCompound;
import common.network.Packet;
import common.packet.SPacketEntityRelMove;
import common.packet.SPacketEntityLook;
@ -29,7 +30,6 @@ import common.packet.SPacketSpawnMob;
import common.packet.SPacketSpawnObject;
import common.packet.SPacketSpawnPlayer;
import common.potion.PotionEffect;
import common.tags.TagObject;
import common.util.ExtMath;
public class EntityTrackerEntry {
@ -296,7 +296,7 @@ public class EntityTrackerEntry {
.sendPacket(new SPacketEntityMetadata(this.trackedEntity.getId(), this.trackedEntity.getDataWatcher(), true));
}
TagObject nbttagcompound = this.trackedEntity.getNBTTagCompound();
NBTTagCompound nbttagcompound = this.trackedEntity.getNBTTagCompound();
if(nbttagcompound != null) {
playerMP.connection.sendPacket(new SPacketUpdateEntityNBT(this.trackedEntity.getId(), nbttagcompound));

View file

@ -8,7 +8,7 @@ import common.entity.npc.Alignment;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.SoundEvent;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.World;
@ -248,7 +248,7 @@ public class EntityBat extends EntityLiving
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.dataWatcher.updateObject(16, Byte.valueOf(tagCompund.getByte("BatFlags")));
@ -257,7 +257,7 @@ public class EntityBat extends EntityLiving
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16));

View file

@ -17,7 +17,7 @@ import common.init.Items;
import common.init.SoundEvent;
import common.item.Item;
import common.item.ItemStack;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.ExtMath;
import common.world.World;
@ -175,7 +175,7 @@ public class EntityChicken extends EntityAnimal
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.chickenJockey = tagCompund.getBool("IsChickenJockey");
@ -193,7 +193,7 @@ public class EntityChicken extends EntityAnimal
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setBool("IsChickenJockey", this.chickenJockey);

View file

@ -4,7 +4,7 @@ import common.entity.DamageSource;
import common.entity.Entity;
import common.entity.EntityType;
import common.entity.types.IEntityMultiPart;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
public class EntityDragonPart extends Entity
{
@ -27,14 +27,14 @@ public class EntityDragonPart extends Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
}

View file

@ -31,10 +31,10 @@ import common.item.Item;
import common.item.ItemMonsterPlacer;
import common.item.ItemStack;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.pathfinding.PathNavigateGround;
import common.potion.Potion;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.World;
@ -1387,7 +1387,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setBool("EatingHaystack", this.isEatingHaystack());
@ -1402,7 +1402,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (this.isChested())
{
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (int i = 2; i < this.horseChest.getSizeInventory(); ++i)
{
@ -1410,7 +1410,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (itemstack != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte)i);
itemstack.writeToNBT(nbttagcompound);
nbttaglist.add(nbttagcompound);
@ -1422,19 +1422,19 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (this.horseChest.getStackInSlot(1) != null)
{
tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new TagObject()));
tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound()));
}
if (this.horseChest.getStackInSlot(0) != null)
{
tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new TagObject()));
tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setEatingHaystack(tagCompund.getBool("EatingHaystack"));
@ -1466,12 +1466,12 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (this.isChested())
{
TagObjectList nbttaglist = tagCompund.getTagList("Items");
NBTTagTagList nbttaglist = tagCompund.getTagList("Items");
this.initHorseChest();
for (int i = 0; i < nbttaglist.size(); ++i)
{
TagObject nbttagcompound = nbttaglist.get(i);
NBTTagCompound nbttagcompound = nbttaglist.get(i);
int j = nbttagcompound.getByte("Slot") & 255;
if (j >= 2 && j < this.horseChest.getSizeInventory())

View file

@ -26,8 +26,8 @@ import common.init.Items;
import common.init.SoundEvent;
import common.item.Item;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.pathfinding.PathNavigateGround;
import common.tags.TagObject;
import common.world.World;
public class EntityOcelot extends EntityTameable
@ -123,7 +123,7 @@ public class EntityOcelot extends EntityTameable
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("CatType", this.getTameSkin());
@ -132,7 +132,7 @@ public class EntityOcelot extends EntityTameable
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setTameSkin(tagCompund.getInt("CatType"));

View file

@ -17,8 +17,8 @@ import common.init.Items;
import common.init.SoundEvent;
import common.item.Item;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.pathfinding.PathNavigateGround;
import common.tags.TagObject;
import common.world.World;
public class EntityPig extends EntityAnimal
@ -69,7 +69,7 @@ public class EntityPig extends EntityAnimal
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setBool("Saddle", this.getSaddled());
@ -78,7 +78,7 @@ public class EntityPig extends EntityAnimal
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setSaddled(tagCompund.getBool("Saddle"));

View file

@ -33,11 +33,11 @@ import common.init.SoundEvent;
import common.item.Item;
import common.item.ItemStack;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.pathfinding.PathEntity;
import common.pathfinding.PathNavigateGround;
import common.potion.Potion;
import common.potion.PotionEffect;
import common.tags.TagObject;
import common.util.BlockPos;
import common.util.ExtMath;
import common.util.Vec3;
@ -198,13 +198,13 @@ public class EntityRabbit extends EntityAnimal {
this.getEntityAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);
}
public void writeEntityToNBT(TagObject tagCompound) {
public void writeEntityToNBT(NBTTagCompound tagCompound) {
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("RabbitType", this.getRabbitType());
tagCompound.setInt("MoreCarrotTicks", this.foodCooldown);
}
public void readEntityFromNBT(TagObject tagCompund) {
public void readEntityFromNBT(NBTTagCompound tagCompund) {
super.readEntityFromNBT(tagCompund);
this.setRabbitType(tagCompund.getInt("RabbitType"));
this.foodCooldown = tagCompund.getInt("MoreCarrotTicks");

View file

@ -29,9 +29,9 @@ import common.inventory.InventoryCrafting;
import common.item.Item;
import common.item.ItemShears;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.pathfinding.PathNavigateGround;
import common.rng.Random;
import common.tags.TagObject;
import common.util.ExtMath;
import common.world.World;
@ -210,7 +210,7 @@ public class EntitySheep extends EntityAnimal
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setBool("Sheared", this.getSheared());
@ -220,7 +220,7 @@ public class EntitySheep extends EntityAnimal
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setSheared(tagCompund.getBool("Sheared"));

View file

@ -31,8 +31,8 @@ import common.item.Item;
import common.item.ItemFood;
import common.item.ItemStack;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.pathfinding.PathNavigateGround;
import common.tags.TagObject;
import common.util.ExtMath;
import common.world.World;
@ -139,7 +139,7 @@ public class EntityWolf extends EntityTameable
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setBool("Angry", this.isAngry());
@ -149,7 +149,7 @@ public class EntityWolf extends EntityTameable
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setAngry(tagCompund.getBool("Angry"));

View file

@ -15,7 +15,7 @@ import common.init.ItemRegistry;
import common.init.Items;
import common.item.Item;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -501,14 +501,14 @@ public class EntityBoat extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
}

View file

@ -13,7 +13,7 @@ import common.init.Config;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.tileentity.IWorldNameable;
import common.util.BlockPos;
import common.util.BoundingBox;
@ -753,7 +753,7 @@ public abstract class EntityCart extends Entity implements IWorldNameable
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
if (tagCompund.getBool("CustomDisplayTile"))
{
@ -798,7 +798,7 @@ public abstract class EntityCart extends Entity implements IWorldNameable
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
if (this.hasDisplayTile())
{

View file

@ -7,8 +7,8 @@ import common.init.Config;
import common.inventory.Container;
import common.inventory.InventoryHelper;
import common.item.ItemStack;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.tileentity.ILockableContainer;
import common.tileentity.LockCode;
import common.util.BlockPos;
@ -187,16 +187,16 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (int i = 0; i < this.minecartContainerItems.length; ++i)
{
if (this.minecartContainerItems[i] != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte)i);
this.minecartContainerItems[i].writeToNBT(nbttagcompound);
nbttaglist.add(nbttagcompound);
@ -209,15 +209,15 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
TagObjectList nbttaglist = tagCompund.getTagList("Items");
NBTTagTagList nbttaglist = tagCompund.getTagList("Items");
this.minecartContainerItems = new ItemStack[this.getSizeInventory()];
for (int i = 0; i < nbttaglist.size(); ++i)
{
TagObject nbttagcompound = nbttaglist.get(i);
NBTTagCompound nbttagcompound = nbttaglist.get(i);
int j = nbttagcompound.getByte("Slot") & 255;
if (j >= 0 && j < this.minecartContainerItems.length)

View file

@ -3,7 +3,7 @@ package common.entity.item;
import common.entity.DamageSource;
import common.entity.Entity;
import common.entity.EntityType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public class EntityCrystal extends Entity
@ -63,14 +63,14 @@ public class EntityCrystal extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
}

View file

@ -2,7 +2,7 @@ package common.entity.item;
import common.entity.Entity;
import common.entity.EntityType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.Explosion;
import common.world.World;
@ -62,13 +62,13 @@ public class EntityExplosion extends Entity
Explosion.doExplosionAlgo3(this.worldObj, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, this.rand, min + 6.0d, min);
}
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setInt("Progress", this.progress);
tagCompound.setInt("Radius", this.radius);
}
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.progress = tagCompund.getInt("Progress");
this.radius = tagCompund.getInt("Radius");

View file

@ -15,8 +15,8 @@ import common.init.BlockRegistry;
import common.init.Blocks;
import common.init.Config;
import common.item.ItemStack;
import common.tags.Tag;
import common.tags.TagObject;
import common.nbt.NBTBase;
import common.nbt.NBTTagCompound;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.ExtMath;
@ -33,7 +33,7 @@ public class EntityFalling extends Entity implements IObjectData
private boolean hurtEntities;
private int fallHurtMax = 40;
private float fallHurtAmount = 2.0F;
public TagObject tileEntityData;
public NBTTagCompound tileEntityData;
public EntityFalling(World worldIn)
{
@ -148,12 +148,12 @@ public class EntityFalling extends Entity implements IObjectData
if (tileentity != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
tileentity.writeToNBT(nbttagcompound);
for (String s : this.tileEntityData.getKeySet())
{
Tag nbtbase = this.tileEntityData.get(s);
NBTBase nbtbase = this.tileEntityData.get(s);
if (!s.equals("x") && !s.equals("y") && !s.equals("z"))
{
@ -228,7 +228,7 @@ public class EntityFalling extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air;
String resourcelocation = BlockRegistry.REGISTRY.getNameForObject(block);
@ -249,7 +249,7 @@ public class EntityFalling extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
int i = tagCompund.getByte("Data") & 255;

View file

@ -5,7 +5,7 @@ import common.entity.EntityType;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.ExtMath;
import common.world.AWorldClient;
import common.world.World;
@ -51,8 +51,8 @@ public class EntityFireworks extends Entity
if (givenItem != null && givenItem.hasTagCompound())
{
this.dataWatcher.updateObject(8, givenItem);
TagObject nbttagcompound = givenItem.getTagCompound();
TagObject nbttagcompound1 = nbttagcompound.getTag("Fireworks");
NBTTagCompound nbttagcompound = givenItem.getTagCompound();
NBTTagCompound nbttagcompound1 = nbttagcompound.getTag("Fireworks");
if (nbttagcompound1 != null)
{
@ -151,7 +151,7 @@ public class EntityFireworks extends Entity
if (id == 17 && this.worldObj.client)
{
ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8);
TagObject nbttagcompound = null;
NBTTagCompound nbttagcompound = null;
if (itemstack != null && itemstack.hasTagCompound())
{
@ -167,7 +167,7 @@ public class EntityFireworks extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setInt("Life", this.fireworkAge);
tagCompound.setInt("LifeTime", this.lifetime);
@ -175,7 +175,7 @@ public class EntityFireworks extends Entity
if (itemstack != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
itemstack.writeToNBT(nbttagcompound);
tagCompound.setTag("FireworksItem", nbttagcompound);
}
@ -184,11 +184,11 @@ public class EntityFireworks extends Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.fireworkAge = tagCompund.getInt("Life");
this.lifetime = tagCompund.getInt("LifeTime");
TagObject nbttagcompound = tagCompund.getTag("FireworksItem");
NBTTagCompound nbttagcompound = tagCompund.getTag("FireworksItem");
if (nbttagcompound != null)
{

View file

@ -11,7 +11,7 @@ import common.init.ItemRegistry;
import common.inventory.Container;
import common.inventory.ContainerHopper;
import common.inventory.InventoryPlayer;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.tileentity.IHopper;
import common.tileentity.TileEntityHopper;
import common.util.BlockPos;
@ -201,7 +201,7 @@ public class EntityHopperCart extends EntityCartContainer implements IHopper
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("TransferCooldown", this.transferTicker);
@ -210,7 +210,7 @@ public class EntityHopperCart extends EntityCartContainer implements IHopper
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.transferTicker = tagCompund.getInt("TransferCooldown");

View file

@ -14,7 +14,7 @@ import common.init.SoundEvent;
import common.item.ItemStack;
import common.log.Log;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.ExtMath;
import common.util.PortalType;
@ -342,7 +342,7 @@ public class EntityItem extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setShort("Health", (short)((byte)this.health));
tagCompound.setShort("Age", (short)this.age);
@ -360,14 +360,14 @@ public class EntityItem extends Entity
if (this.getEntityItem() != null)
{
tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new TagObject()));
tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound()));
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.health = tagCompund.getShort("Health") & 255;
this.age = tagCompund.getShort("Age");
@ -384,7 +384,7 @@ public class EntityItem extends Entity
// this.thrower = tagCompund.getString("Thrower");
// }
TagObject nbttagcompound = tagCompund.getTag("Item");
NBTTagCompound nbttagcompound = tagCompund.getTag("Item");
this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound));
if (this.getEntityItem() == null)

View file

@ -9,7 +9,7 @@ import common.entity.types.EntityLiving;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -375,7 +375,7 @@ public class EntityLeashKnot extends Entity
* returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their
* rider.
*/
public boolean writeToNBTOptional(TagObject tagCompund)
public boolean writeToNBTOptional(NBTTagCompound tagCompund)
{
return false;
}
@ -383,14 +383,14 @@ public class EntityLeashKnot extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
}

View file

@ -3,7 +3,7 @@ package common.entity.item;
import common.entity.Entity;
import common.entity.EntityType;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public class EntityNuke extends Entity
@ -93,12 +93,12 @@ public class EntityNuke extends Entity
// Explosion.doExplosionAlgo3(this.worldObj, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, this.rand, min + 6.0d, min);
// }
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setInt("Fuse", this.fuse);
}
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.fuse = tagCompund.getInt("Fuse");
}

View file

@ -5,7 +5,7 @@ import common.entity.EntityType;
import common.entity.types.EntityLiving;
import common.entity.types.IObjectData;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public class EntityTnt extends Entity implements IObjectData
@ -109,7 +109,7 @@ public class EntityTnt extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setByte("Fuse", (byte)this.fuse);
tagCompound.setByte("Power", (byte)this.explosionSize);
@ -118,7 +118,7 @@ public class EntityTnt extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.fuse = tagCompund.getByte("Fuse");
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;

View file

@ -9,7 +9,7 @@ import common.init.Config;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.world.Explosion;
import common.world.State;
@ -206,7 +206,7 @@ public class EntityTntCart extends EntityCart
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.minecartTNTFuse = tagCompund.getInt("TNTFuse");
@ -215,7 +215,7 @@ public class EntityTntCart extends EntityCart
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("TNTFuse", this.minecartTNTFuse);

View file

@ -10,7 +10,7 @@ import common.entity.types.IObjectData;
import common.init.Config;
import common.init.SoundEvent;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.ExtMath;
import common.util.PortalType;
@ -293,7 +293,7 @@ public class EntityXp extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setShort("Health", (short)((byte)this.xpOrbHealth));
tagCompound.setShort("Age", (short)this.xpOrbAge);
@ -303,7 +303,7 @@ public class EntityXp extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.xpOrbHealth = tagCompund.getShort("Health") & 255;
this.xpOrbAge = tagCompund.getShort("Age");

View file

@ -6,8 +6,8 @@ import common.entity.DamageSource;
import common.init.Config;
import common.item.ItemStack;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.rng.Random;
import common.tags.TagObject;
import common.world.World;
public class EntityGargoyle extends EntityFlyingNPC
@ -35,13 +35,13 @@ public class EntityGargoyle extends EntityFlyingNPC
this.dataWatcher.addObject(23, 0);
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("Invul", this.getInvulTime());
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setInvulTime(tagCompund.getInt("Invul"));

View file

@ -9,8 +9,8 @@ import common.init.Config;
import common.init.Items;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.rng.Random;
import common.tags.TagObject;
import common.world.World;
import common.world.AWorldServer;
@ -58,7 +58,7 @@ public class EntityHaunter extends EntityNPC {
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
@ -74,7 +74,7 @@ public class EntityHaunter extends EntityNPC {
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setCharged(tagCompund.getBool("Charge"));

View file

@ -6,7 +6,7 @@ import common.attributes.Attributes;
import common.entity.DamageSource;
import common.entity.Entity;
import common.entity.types.EntityLiving;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public abstract class EntityMobNPC extends EntityNPC
@ -107,7 +107,7 @@ public abstract class EntityMobNPC extends EntityNPC
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setShort("Anger", (short)this.angerLevel);
@ -125,7 +125,7 @@ public abstract class EntityMobNPC extends EntityNPC
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.angerLevel = tagCompund.getShort("Anger");

View file

@ -67,6 +67,8 @@ import common.item.ItemStack;
import common.item.ItemSword;
import common.item.ItemTool;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.network.IClientPlayer;
import common.network.IPlayer;
import common.packet.CPacketPlayerPosition;
@ -83,8 +85,6 @@ import common.potion.Potion;
import common.potion.PotionEffect;
import common.rng.Random;
import common.sound.MovingSoundMinecartRiding;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.tileentity.IInteractionObject;
import common.tileentity.LockCode;
import common.tileentity.TileEntitySign;
@ -3380,7 +3380,7 @@ public abstract class EntityNPC extends EntityLiving
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
// super.readEntityFromNBT(tagCompund);
super.readEntityFromNBT(tagCompund);
@ -3390,7 +3390,7 @@ public abstract class EntityNPC extends EntityLiving
// }
if(tagCompund.hasTagList("Equipment")) {
TagObjectList nbttaglist = tagCompund.getTagList("Equipment");
NBTTagTagList nbttaglist = tagCompund.getTagList("Equipment");
for(int i = 0; i < this.equipment.length; ++i) {
this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.get(i));
@ -3423,7 +3423,7 @@ public abstract class EntityNPC extends EntityLiving
this.setNpcClass(type);
this.setHeight(tagCompund.hasFloat("Height") ? tagCompund.getFloat("Height") : this.getBaseSize());
TagObjectList nbttaglist = tagCompund.getTagList("Items");
NBTTagTagList nbttaglist = tagCompund.getTagList("Items");
for (int i = 0; i < nbttaglist.size(); ++i)
{
@ -3448,7 +3448,7 @@ public abstract class EntityNPC extends EntityLiving
if(this.isPlayer()) {
// this.entityUniqueID = getOfflineUUID(this.user);
TagObjectList nbttaglist0 = tagCompund.getTagList("Inventory");
NBTTagTagList nbttaglist0 = tagCompund.getTagList("Inventory");
this.inventory.readFromNBT(nbttaglist0);
this.inventory.currentItem = tagCompund.getInt("SelectedItemSlot");
// this.sleeping = tagCompund.getBoolean("Sleeping");
@ -3497,7 +3497,7 @@ public abstract class EntityNPC extends EntityLiving
if (tagCompund.hasTagList("WarpItems"))
{
TagObjectList nbttaglist1 = tagCompund.getTagList("WarpItems");
NBTTagTagList nbttaglist1 = tagCompund.getTagList("WarpItems");
this.warpChest.loadInventoryFromNBT(nbttaglist1);
}
@ -3518,7 +3518,7 @@ public abstract class EntityNPC extends EntityLiving
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
if(this.isPlayer()) {
for (int z = 0; z < this.inventory.mainInventory.length; z++)
@ -3534,10 +3534,10 @@ public abstract class EntityNPC extends EntityLiving
super.writeEntityToNBT(tagCompound);
// tagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot());
TagObjectList nbttaglist0 = new TagObjectList();
NBTTagTagList nbttaglist0 = new NBTTagTagList();
for(int i = 0; i < this.equipment.length; ++i) {
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
if(this.equipment[i] != null) {
this.equipment[i].writeToNBT(nbttagcompound);
@ -3559,7 +3559,7 @@ public abstract class EntityNPC extends EntityLiving
if(type != null)
tagCompound.setString("ClassType", this.species.classnames.inverse().get(type));
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (int i = 0; i < this.extraInventory.getSizeInventory(); ++i)
{
@ -3567,7 +3567,7 @@ public abstract class EntityNPC extends EntityLiving
if (itemstack != null)
{
nbttaglist.add(itemstack.writeToNBT(new TagObject()));
nbttaglist.add(itemstack.writeToNBT(new NBTTagCompound()));
}
}
@ -3587,7 +3587,7 @@ public abstract class EntityNPC extends EntityLiving
this.getAttributeMap().applyAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.stackSize);
}
}
tagCompound.setTagList("Inventory", this.inventory.writeToNBT(new TagObjectList()));
tagCompound.setTagList("Inventory", this.inventory.writeToNBT(new NBTTagTagList()));
tagCompound.setInt("SelectedItemSlot", this.inventory.currentItem);
// tagCompound.setBoolean("Sleeping", this.sleeping);
// tagCompound.setShort("SleepTimer", (short)this.sleepTimer);
@ -3629,7 +3629,7 @@ public abstract class EntityNPC extends EntityLiving
if (itemstack != null && itemstack.getItem() != null)
{
tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new TagObject()));
tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new NBTTagCompound()));
}
// tagCompound.setString("Model", this.getModel().name);

View file

@ -10,9 +10,9 @@ import common.entity.types.EntityLiving;
import common.init.Config;
import common.init.SoundEvent;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.pathfinding.PathNavigateGround;
import common.rng.Random;
import common.tags.TagObject;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.World;
@ -134,7 +134,7 @@ public class EntitySlime extends EntityNPC
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
// tagCompound.setInteger("Size", this.getSlimeSize() - 1);
@ -144,7 +144,7 @@ public class EntitySlime extends EntityNPC
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
// int i = tagCompund.getInteger("Size");

View file

@ -18,7 +18,7 @@ import common.init.Items;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -471,7 +471,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -491,7 +491,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -11,7 +11,7 @@ import common.entity.types.IObjectData;
import common.entity.types.IProjectile;
import common.init.Config;
import common.init.SoundEvent;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BoundingBox;
import common.util.ExtMath;
import common.util.HitPosition;
@ -347,13 +347,13 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData
// this.doBlockCollisions();
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setInt("damage", this.damage);
tagCompound.setInt("age", this.age);
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.damage = tagCompund.getInt("damage");
this.age = tagCompund.getInt("age");

View file

@ -9,7 +9,7 @@ import common.init.Items;
import common.init.SoundEvent;
import common.item.ItemDie;
import common.item.ItemStack;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.HitPosition;
import common.world.World;
@ -64,7 +64,7 @@ public class EntityDie extends EntityThrowable implements IObjectData
return this.dataWatcher.getWatchableObjectInt(16);
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("Sides", this.sides);
@ -72,7 +72,7 @@ public class EntityDie extends EntityThrowable implements IObjectData
tagCompound.setBool("NoPickup", this.noPickup);
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.sides = tagCompund.getInt("Sides");

View file

@ -9,7 +9,7 @@ import common.init.Config;
import common.init.ItemRegistry;
import common.init.Items;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.HitPosition;
import common.world.World;
@ -59,13 +59,13 @@ public class EntityDynamite extends EntityThrowable implements IObjectData
}
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setByte("Power", (byte)this.explosionSize);
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;

View file

@ -3,7 +3,7 @@ package common.entity.projectile;
import common.entity.DamageSource;
import common.entity.types.EntityLiving;
import common.init.Config;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.HitPosition;
import common.world.World;
@ -56,7 +56,7 @@ public class EntityFireball extends EntityProjectile
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("ExplosionPower", this.explosionPower);
@ -65,7 +65,7 @@ public class EntityFireball extends EntityProjectile
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.explosionPower = tagCompund.getInt("ExplosionPower");

View file

@ -18,7 +18,7 @@ import common.init.Items;
import common.init.SoundEvent;
import common.item.ItemStack;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -121,7 +121,7 @@ public class EntityHook extends Entity implements IObjectData
{
}
public boolean writeToNBTOptional(TagObject tagCompund)
public boolean writeToNBTOptional(NBTTagCompound tagCompund)
{
return false;
}
@ -517,7 +517,7 @@ public class EntityHook extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -533,7 +533,7 @@ public class EntityHook extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -7,9 +7,9 @@ import common.entity.types.EntityThrowable;
import common.entity.types.IObjectData;
import common.init.Items;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.potion.Potion;
import common.potion.PotionEffect;
import common.tags.TagObject;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.HitPosition;
@ -158,7 +158,7 @@ public class EntityPotion extends EntityThrowable implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
@ -180,13 +180,13 @@ public class EntityPotion extends EntityThrowable implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
if (this.potionDamage != null)
{
tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new TagObject()));
tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound()));
}
}

View file

@ -9,8 +9,8 @@ import common.entity.EntityType;
import common.entity.types.EntityLiving;
import common.init.BlockRegistry;
import common.model.ParticleType;
import common.tags.TagDoubleList;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagDoubleList;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -254,7 +254,7 @@ public abstract class EntityProjectile extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -269,7 +269,7 @@ public abstract class EntityProjectile extends Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");
@ -288,7 +288,7 @@ public abstract class EntityProjectile extends Entity
if (tagCompund.hasDoubleList("direction"))
{
TagDoubleList nbttaglist = tagCompund.getDoubleList("direction");
NBTTagDoubleList nbttaglist = tagCompund.getDoubleList("direction");
this.motionX = nbttaglist.get(0);
this.motionY = nbttaglist.get(1);
this.motionZ = nbttaglist.get(2);

View file

@ -12,7 +12,7 @@ import common.init.Blocks;
import common.init.Items;
import common.item.ItemStack;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.ExtMath;
import common.world.World;
@ -100,7 +100,7 @@ public abstract class EntityAnimal extends EntityLiving
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
tagCompound.setInt("InLove", this.inLove);
@ -109,7 +109,7 @@ public abstract class EntityAnimal extends EntityLiving
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
this.setInLove(tagCompund.getInt("InLove"), true);

View file

@ -47,6 +47,8 @@ import common.item.ItemArmor;
import common.item.ItemMonsterPlacer;
import common.item.ItemStack;
import common.model.ParticleType;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.network.IPlayer;
import common.packet.SPacketEntityAttach;
import common.packet.SPacketAnimation;
@ -57,8 +59,6 @@ import common.potion.Potion;
import common.potion.PotionEffect;
import common.potion.PotionHelper;
import common.rng.Random;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -87,7 +87,7 @@ public abstract class EntityLiving extends Entity
private EntitySenses senses;
private boolean leashed;
private Entity leashedTo;
private TagObject leashTag;
private NBTTagCompound leashTag;
public float prevCamPitch;
public float camPitch;
@ -539,7 +539,7 @@ public abstract class EntityLiving extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setInt("Health", this.getHealth());
// tagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth())));
@ -569,7 +569,7 @@ public abstract class EntityLiving extends Entity
if (!this.effects.isEmpty())
{
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (PotionEffect potioneffect : this.effects.values())
{
@ -582,7 +582,7 @@ public abstract class EntityLiving extends Entity
tagCompound.setBool("Leashed", this.leashed);
if(this.leashedTo != null) {
TagObject nbttagcompound1 = new TagObject();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
// if(this.leashedTo.isPlayer()) {
// nbttagcompound1.setString("PlayerName", ((EntityNPC)this.leashedTo).getUser());
@ -609,7 +609,7 @@ public abstract class EntityLiving extends Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.setAbsorptionAmount(tagCompund.getInt("Absorption"));
@ -620,11 +620,11 @@ public abstract class EntityLiving extends Entity
if (tagCompund.hasTagList("ActiveEffects"))
{
TagObjectList nbttaglist = tagCompund.getTagList("ActiveEffects");
NBTTagTagList nbttaglist = tagCompund.getTagList("ActiveEffects");
for (int i = 0; i < nbttaglist.size(); ++i)
{
TagObject nbttagcompound = nbttaglist.get(i);
NBTTagCompound nbttagcompound = nbttaglist.get(i);
PotionEffect potioneffect = PotionEffect.fromNbt(nbttagcompound);
if (potioneffect != null && !potioneffect.getPotion().isInstant())

View file

@ -2,7 +2,7 @@ package common.entity.types;
import common.ai.EntityAISit;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public abstract class EntityTameable extends EntityAnimal implements IEntityOwnable
@ -25,7 +25,7 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
super.writeEntityToNBT(tagCompound);
@ -45,7 +45,7 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
super.readEntityFromNBT(tagCompund);
// String s = "";

View file

@ -9,7 +9,7 @@ import common.entity.EntityType;
import common.init.BlockRegistry;
import common.init.Blocks;
import common.model.ParticleType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.ExtMath;
@ -303,7 +303,7 @@ public abstract class EntityThrowable extends Entity implements IProjectile
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntityToNBT(NBTTagCompound tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -326,7 +326,7 @@ public abstract class EntityThrowable extends Entity implements IProjectile
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -2,7 +2,7 @@ package common.entity.types;
import common.entity.Entity;
import common.entity.EntityType;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public abstract class EntityWeatherEffect extends Entity {
@ -25,10 +25,10 @@ public abstract class EntityWeatherEffect extends Entity {
protected final void entityInit() {
}
protected final void readEntityFromNBT(TagObject tagCompund) {
protected final void readEntityFromNBT(NBTTagCompound tagCompund) {
}
protected final void writeEntityToNBT(TagObject tagCompound) {
protected final void writeEntityToNBT(NBTTagCompound tagCompound) {
}
public final EntityType getType() {

View file

@ -25,8 +25,8 @@ import common.item.Item;
import common.item.ItemArmor;
import common.item.ItemDye;
import common.item.ItemStack;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.tileentity.TileEntityBanner;
import common.world.World;
@ -616,8 +616,8 @@ public abstract class CraftingRegistry
}
}
TagObject nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true);
TagObjectList nbttaglist = null;
NBTTagCompound nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true);
NBTTagTagList nbttaglist = null;
if (nbttagcompound1.hasTagList("Patterns"))
{
@ -625,11 +625,11 @@ public abstract class CraftingRegistry
}
else
{
nbttaglist = new TagObjectList();
nbttaglist = new NBTTagTagList();
nbttagcompound1.setTagList("Patterns", nbttaglist);
}
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID());
nbttagcompound.setInt("Color", k);
nbttaglist.add(nbttagcompound);
@ -969,9 +969,9 @@ public abstract class CraftingRegistry
if (l > 0)
{
TagObject nbttagcompound1 = new TagObject();
TagObject nbttagcompound3 = new TagObject();
TagObjectList nbttaglist = new TagObjectList();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (int k2 = 0; k2 < inv.getSizeInventory(); ++k2)
{
@ -994,8 +994,8 @@ public abstract class CraftingRegistry
else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1)
{
this.field_92102_a = new ItemStack(Items.firework_charge);
TagObject nbttagcompound = new TagObject();
TagObject nbttagcompound2 = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
byte b0 = 0;
List<Integer> list = Lists.<Integer>newArrayList();
@ -1080,7 +1080,7 @@ public abstract class CraftingRegistry
if (this.field_92102_a != null && this.field_92102_a.hasTagCompound())
{
TagObject nbttagcompound4 = this.field_92102_a.getTagCompound().getTag("Explosion");
NBTTagCompound nbttagcompound4 = this.field_92102_a.getTagCompound().getTag("Explosion");
if (nbttagcompound4 == null)
{
@ -1552,7 +1552,7 @@ public abstract class CraftingRegistry
if (itemstack1 != null && itemstack1.hasTagCompound())
{
itemstack.setTagCompound((TagObject)itemstack1.getTagCompound().copy());
itemstack.setTagCompound((NBTTagCompound)itemstack1.getTagCompound().copy());
}
}
}

View file

@ -49,7 +49,7 @@ import common.entity.projectile.EntitySnowball;
import common.entity.types.EntityLiving;
import common.entity.types.IObjectData;
import common.log.Log;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.world.World;
public abstract class EntityRegistry {
@ -117,7 +117,7 @@ public abstract class EntityRegistry {
return entity;
}
public static Entity createEntityFromNBT(TagObject nbt, World worldIn) {
public static Entity createEntityFromNBT(NBTTagCompound nbt, World worldIn) {
Entity entity = null;
// if("Minecart".equals(nbt.getString("id"))) {

View file

@ -27,11 +27,11 @@ import common.dimension.Star;
import common.dimension.Dimension.GeneratorType;
import common.dimension.Dimension.ReplacerType;
import common.log.Log;
import common.nbt.NBTException;
import common.nbt.NBTParser;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.rng.Random;
import common.tags.TagException;
import common.tags.TagInterpreter;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.util.PortalType;
import common.world.State;
import common.world.Weather;
@ -92,8 +92,8 @@ public abstract class UniverseRegistry {
}
}
public static void loadNbt(TagObject tag) {
TagObjectList list = tag.getTagList("Dimensions");
public static void loadNbt(NBTTagCompound tag) {
NBTTagTagList list = tag.getTagList("Dimensions");
for(int z = 0; z < list.size(); z++) {
Dimension dim = Dimension.getByNbt(list.get(z));
if(!REGISTRY.containsKey(dim.getDimensionId()) && !ALIASES.containsKey(dim.getDimensionName()))
@ -102,7 +102,7 @@ public abstract class UniverseRegistry {
list = tag.getTagList("Names");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
NBTTagCompound data = list.get(z);
String id = data.getString("ID");
// if(BASE_ALIASES.containsKey(id)) {
Dimension dim = ALIASES.get(id);
@ -113,7 +113,7 @@ public abstract class UniverseRegistry {
list = tag.getTagList("Sectors");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
NBTTagCompound data = list.get(z);
String id = data.getString("ID");
Sector sector = SECTORS.get(id);
if(sector == null)
@ -123,7 +123,7 @@ public abstract class UniverseRegistry {
list = tag.getTagList("Galaxies");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
NBTTagCompound data = list.get(z);
String id = data.getString("ID");
Galaxy galaxy = GALAXIES.get(id);
if(galaxy == null)
@ -133,7 +133,7 @@ public abstract class UniverseRegistry {
list = tag.getTagList("Domains");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
NBTTagCompound data = list.get(z);
String id = data.getString("ID");
Domain domain = DOMAINS.get(id);
if(domain == null)
@ -143,16 +143,16 @@ public abstract class UniverseRegistry {
list = tag.getTagList("Barycenters");
for(int z = 0; z < list.size(); z++) {
TagObject link = list.get(z);
NBTTagCompound link = list.get(z);
if(!assign(link.getString("Celestial"), link.getString("Center")))
Log.TICK.warn("Konnte '" + link.getString("Celestial") + "' nicht zu '" + link.getString("Center") + "' zuweisen");
}
}
public static TagObject saveNbt() {
TagObject tag = new TagObject();
public static NBTTagCompound saveNbt() {
NBTTagCompound tag = new NBTTagCompound();
TagObjectList list = new TagObjectList();
NBTTagTagList list = new NBTTagTagList();
for(Dimension dim : DIMENSIONS) {
if(!BASE_REGISTRY.containsKey(dim.getDimensionId()) && dim != Space.INSTANCE)
list.add(dim.toNbt());
@ -160,10 +160,10 @@ public abstract class UniverseRegistry {
if(!list.isEmpty())
tag.setTagList("Dimensions", list);
list = new TagObjectList();
list = new NBTTagTagList();
for(Dimension dim : DIMENSIONS) {
if(/* BASE_REGISTRY.containsKey(dim.getDimensionId()) */ dim != Space.INSTANCE) {
TagObject data = new TagObject();
NBTTagCompound data = new NBTTagCompound();
dim.writeNbt(data);
if(!data.isEmpty()) {
data.setString("ID", dim.getDimensionName());
@ -174,9 +174,9 @@ public abstract class UniverseRegistry {
if(!list.isEmpty())
tag.setTagList("Names", list);
list = new TagObjectList();
list = new NBTTagTagList();
for(Sector sector : SECTORS.values()) {
TagObject data = new TagObject();
NBTTagCompound data = new NBTTagCompound();
sector.writeNbt(data);
if(!data.isEmpty()) {
data.setString("ID", sector.id);
@ -186,9 +186,9 @@ public abstract class UniverseRegistry {
if(!list.isEmpty())
tag.setTagList("Sectors", list);
list = new TagObjectList();
list = new NBTTagTagList();
for(Galaxy galaxy : GALAXIES.values()) {
TagObject data = new TagObject();
NBTTagCompound data = new NBTTagCompound();
galaxy.writeNbt(data);
if(!data.isEmpty()) {
data.setString("ID", galaxy.id);
@ -198,9 +198,9 @@ public abstract class UniverseRegistry {
if(!list.isEmpty())
tag.setTagList("Galaxies", list);
list = new TagObjectList();
list = new NBTTagTagList();
for(Domain domain : DOMAINS.values()) {
TagObject data = new TagObject();
NBTTagCompound data = new NBTTagCompound();
domain.writeNbt(data);
if(!data.isEmpty()) {
data.setString("ID", domain.id);
@ -210,11 +210,11 @@ public abstract class UniverseRegistry {
if(!list.isEmpty())
tag.setTagList("Domains", list);
list = new TagObjectList();
list = new NBTTagTagList();
for(Entry<Moon, Planet> entry : MOON_MAP.entrySet()) {
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
continue;
TagObject link = new TagObject();
NBTTagCompound link = new NBTTagCompound();
link.setString("Celestial", entry.getKey().getDimensionName());
link.setString("Center", entry.getValue().getDimensionName());
list.add(link);
@ -222,7 +222,7 @@ public abstract class UniverseRegistry {
for(Entry<Planet, Star> entry : PLANET_MAP.entrySet()) {
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
continue;
TagObject link = new TagObject();
NBTTagCompound link = new NBTTagCompound();
link.setString("Celestial", entry.getKey().getDimensionName());
link.setString("Center", entry.getValue().getDimensionName());
list.add(link);
@ -230,7 +230,7 @@ public abstract class UniverseRegistry {
for(Entry<Star, Sector> entry : STAR_MAP.entrySet()) {
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
continue;
TagObject link = new TagObject();
NBTTagCompound link = new NBTTagCompound();
link.setString("Celestial", entry.getKey().getDimensionName());
link.setString("Center", entry.getValue().id);
list.add(link);
@ -238,7 +238,7 @@ public abstract class UniverseRegistry {
for(Entry<Sector, Galaxy> entry : SECTOR_MAP.entrySet()) {
if(BASE_MAP.containsKey(entry.getKey().id))
continue;
TagObject link = new TagObject();
NBTTagCompound link = new NBTTagCompound();
link.setString("Celestial", entry.getKey().id);
link.setString("Center", entry.getValue().id);
list.add(link);
@ -246,7 +246,7 @@ public abstract class UniverseRegistry {
for(Entry<Area, Domain> entry : AREA_MAP.entrySet()) {
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
continue;
TagObject link = new TagObject();
NBTTagCompound link = new NBTTagCompound();
link.setString("Celestial", entry.getKey().getDimensionName());
link.setString("Center", entry.getValue().id);
list.add(link);
@ -701,14 +701,14 @@ public abstract class UniverseRegistry {
private static Dimension addPreset(String name, String base, String data) {
Dimension dim = BASE_ALIASES.get(base).copy(UniverseRegistry.MORE_DIM_ID, "preset");
TagObject ptag;
NBTTagCompound ptag;
try {
ptag = TagInterpreter.parseTag("{" + data + "}");
ptag = NBTParser.parseTag("{" + data + "}");
}
catch(TagException e) {
catch(NBTException e) {
throw new RuntimeException(e);
}
TagObject dtag = dim.toNbt(true);
NBTTagCompound dtag = dim.toNbt(true);
if(ptag.getBool("ClearGenerator")) {
ptag.remove("ClearGenerator");
dtag.remove("FloorBlock");

View file

@ -3,8 +3,8 @@ package common.inventory;
import common.entity.Entity;
import common.entity.item.EntityItem;
import common.item.ItemStack;
import common.nbt.NBTTagCompound;
import common.rng.Random;
import common.tags.TagObject;
import common.util.BlockPos;
import common.world.World;
@ -55,7 +55,7 @@ public class InventoryHelper
if (stack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((TagObject)stack.getTagCompound().copy());
entityitem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy());
}
float f3 = 0.05F;

View file

@ -5,8 +5,8 @@ import common.entity.npc.EntityNPC;
import common.item.Item;
import common.item.ItemArmor;
import common.item.ItemStack;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
public class InventoryPlayer implements IInventory
{
@ -216,7 +216,7 @@ public class InventoryPlayer implements IInventory
if (itemStackIn.hasTagCompound())
{
this.mainInventory[j].setTagCompound((TagObject)itemStackIn.getTagCompound().copy());
this.mainInventory[j].setTagCompound((NBTTagCompound)itemStackIn.getTagCompound().copy());
}
}
@ -450,13 +450,13 @@ public class InventoryPlayer implements IInventory
*
* @param nbtTagListIn List to append tags to
*/
public TagObjectList writeToNBT(TagObjectList nbtTagListIn)
public NBTTagTagList writeToNBT(NBTTagTagList nbtTagListIn)
{
for (int i = 0; i < this.mainInventory.length; ++i)
{
if (this.mainInventory[i] != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte)i);
this.mainInventory[i].writeToNBT(nbttagcompound);
nbtTagListIn.add(nbttagcompound);
@ -467,7 +467,7 @@ public class InventoryPlayer implements IInventory
{
if (this.armorInventory[j] != null)
{
TagObject nbttagcompound1 = new TagObject();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte)(j + 100));
this.armorInventory[j].writeToNBT(nbttagcompound1);
nbtTagListIn.add(nbttagcompound1);
@ -482,14 +482,14 @@ public class InventoryPlayer implements IInventory
*
* @param nbtTagListIn tagList to read from
*/
public void readFromNBT(TagObjectList nbtTagListIn)
public void readFromNBT(NBTTagTagList nbtTagListIn)
{
this.mainInventory = new ItemStack[36];
this.armorInventory = new ItemStack[4];
for (int i = 0; i < nbtTagListIn.size(); ++i)
{
TagObject nbttagcompound = nbtTagListIn.get(i);
NBTTagCompound nbttagcompound = nbtTagListIn.get(i);
int j = nbttagcompound.getByte("Slot") & 255;
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);

View file

@ -3,8 +3,8 @@ package common.inventory;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.item.ItemStack;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.util.BlockPos;
public class InventoryWarpChest extends InventoryBasic
@ -21,7 +21,7 @@ public class InventoryWarpChest extends InventoryBasic
this.associatedChest = chestTileEntity;
}
public void loadInventoryFromNBT(TagObjectList p_70486_1_)
public void loadInventoryFromNBT(NBTTagTagList p_70486_1_)
{
for (int i = 0; i < this.getSizeInventory(); ++i)
{
@ -30,7 +30,7 @@ public class InventoryWarpChest extends InventoryBasic
for (int k = 0; k < p_70486_1_.size(); ++k)
{
TagObject nbttagcompound = p_70486_1_.get(k);
NBTTagCompound nbttagcompound = p_70486_1_.get(k);
int j = nbttagcompound.getByte("Slot") & 255;
if (j >= 0 && j < this.getSizeInventory())
@ -40,9 +40,9 @@ public class InventoryWarpChest extends InventoryBasic
}
}
public TagObjectList saveInventoryToNBT()
public NBTTagTagList saveInventoryToNBT()
{
TagObjectList nbttaglist = new TagObjectList();
NBTTagTagList nbttaglist = new NBTTagTagList();
for (int i = 0; i < this.getSizeInventory(); ++i)
{
@ -50,7 +50,7 @@ public class InventoryWarpChest extends InventoryBasic
if (itemstack != null)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setByte("Slot", (byte)i);
itemstack.writeToNBT(nbttagcompound);
nbttaglist.add(nbttagcompound);

View file

@ -16,8 +16,8 @@ import common.model.ItemMeshDefinition;
import common.model.Model;
import common.model.ModelProvider;
import common.model.Transforms;
import common.nbt.NBTTagCompound;
import common.rng.Random;
import common.tags.TagObject;
import common.util.BlockPos;
import common.util.ExtMath;
import common.util.Facing;
@ -105,7 +105,7 @@ public class Item
/**
* Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data
*/
public boolean updateItemStackNBT(TagObject nbt)
public boolean updateItemStackNBT(NBTTagCompound nbt)
{
return false;
}
@ -420,7 +420,7 @@ public class Item
// private static final Set<String> VALID_TAGS = Sets.newHashSet("Name", "ench", "RepairCost");
protected final boolean validateNbt(TagObject tag) {
protected final boolean validateNbt(NBTTagCompound tag) {
return true;
}

View file

@ -20,7 +20,7 @@ import common.init.ToolMaterial;
import common.model.Model;
import common.model.ModelProvider;
import common.model.Transforms;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.world.World;
@ -158,7 +158,7 @@ public class ItemArmor extends Item
}
else
{
TagObject nbttagcompound = stack.getTagCompound();
NBTTagCompound nbttagcompound = stack.getTagCompound();
if (nbttagcompound != null && nbttagcompound.hasInt("color"))
{
@ -181,7 +181,7 @@ public class ItemArmor extends Item
{
if (this.material.canBeDyed())
{
TagObject nbttagcompound = stack.getTagCompound();
NBTTagCompound nbttagcompound = stack.getTagCompound();
if (nbttagcompound != null)
{
@ -208,11 +208,11 @@ public class ItemArmor extends Item
}
else
{
TagObject nbttagcompound = stack.getTagCompound();
NBTTagCompound nbttagcompound = stack.getTagCompound();
if (nbttagcompound == null)
{
nbttagcompound = new TagObject();
nbttagcompound = new NBTTagCompound();
stack.setTagCompound(nbttagcompound);
}

View file

@ -10,8 +10,8 @@ import common.init.Blocks;
import common.model.ItemMeshDefinition;
import common.model.Model;
import common.model.ModelProvider;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityBanner;
import common.util.BlockPos;
@ -96,15 +96,15 @@ public class ItemBanner extends ItemBlock
*/
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
{
TagObject nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
if (nbttagcompound != null && nbttagcompound.hasTagList("Patterns"))
{
TagObjectList nbttaglist = nbttagcompound.getTagList("Patterns");
NBTTagTagList nbttaglist = nbttagcompound.getTagList("Patterns");
for (int i = 0; i < nbttaglist.size() && i < 6; ++i)
{
TagObject nbttagcompound1 = nbttaglist.get(i);
NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
DyeColor enumdyecolor = DyeColor.byDyeDamage(nbttagcompound1.getInt("Color"));
TileEntityBanner.EnumBannerPattern pattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));
@ -137,9 +137,9 @@ public class ItemBanner extends ItemBlock
{
for (DyeColor enumdyecolor : DyeColor.values())
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, enumdyecolor.getDyeDamage(), null);
TagObject nbttagcompound1 = new TagObject();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setTag("BlockEntityTag", nbttagcompound);
ItemStack itemstack = new ItemStack(itemIn, 1, enumdyecolor.getDyeDamage());
itemstack.setTagCompound(nbttagcompound1);
@ -157,7 +157,7 @@ public class ItemBanner extends ItemBlock
private DyeColor getBaseColor(ItemStack stack)
{
TagObject nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
DyeColor enumdyecolor = null;
if (nbttagcompound != null && nbttagcompound.hasInt("Base"))

View file

@ -11,7 +11,7 @@ import common.init.Blocks;
import common.model.Model;
import common.model.ModelProvider;
import common.model.Transforms;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
import common.tileentity.TileEntity;
import common.util.BlockPos;
import common.util.Facing;
@ -118,10 +118,10 @@ public class ItemBlock extends Item
return false;
}
TagObject nbttagcompound = new TagObject();
TagObject nbttagcompound1 = (TagObject)nbttagcompound.copy();
NBTTagCompound nbttagcompound = new NBTTagCompound();
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttagcompound.copy();
tileentity.writeToNBT(nbttagcompound);
TagObject nbttagcompound2 = (TagObject)p_179224_3_.getTagCompound().get("BlockEntityTag");
NBTTagCompound nbttagcompound2 = (NBTTagCompound)p_179224_3_.getTagCompound().get("BlockEntityTag");
nbttagcompound.merge(nbttagcompound2);
nbttagcompound.setInt("x", stack.getX());
nbttagcompound.setInt("y", stack.getY());

View file

@ -9,9 +9,9 @@ import common.enchantment.RngEnchantment;
import common.entity.npc.EntityNPC;
import common.init.Items;
import common.model.ItemMeshDefinition;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.rng.Random;
import common.tags.TagObject;
import common.tags.TagObjectList;
public class ItemEnchantedBook extends Item
{
@ -48,10 +48,10 @@ public class ItemEnchantedBook extends Item
// return this.getEnchantments(stack).tagCount() > 0 ? ChatFormat.YELLOW : super.getColor(stack);
// }
public TagObjectList getEnchantments(ItemStack stack)
public NBTTagTagList getEnchantments(ItemStack stack)
{
TagObject nbttagcompound = stack.getTagCompound();
return nbttagcompound != null && nbttagcompound.hasTagList("StoredEnchantments") ? nbttagcompound.getTagList("StoredEnchantments") : new TagObjectList();
NBTTagCompound nbttagcompound = stack.getTagCompound();
return nbttagcompound != null && nbttagcompound.hasTagList("StoredEnchantments") ? nbttagcompound.getTagList("StoredEnchantments") : new NBTTagTagList();
}
/**
@ -60,7 +60,7 @@ public class ItemEnchantedBook extends Item
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
{
super.addInformation(stack, playerIn, tooltip);
TagObjectList nbttaglist = this.getEnchantments(stack);
NBTTagTagList nbttaglist = this.getEnchantments(stack);
if (nbttaglist != null)
{
@ -82,12 +82,12 @@ public class ItemEnchantedBook extends Item
*/
public void addEnchantment(ItemStack stack, RngEnchantment enchantment)
{
TagObjectList nbttaglist = this.getEnchantments(stack);
NBTTagTagList nbttaglist = this.getEnchantments(stack);
boolean flag = true;
for (int i = 0; i < nbttaglist.size(); ++i)
{
TagObject nbttagcompound = nbttaglist.get(i);
NBTTagCompound nbttagcompound = nbttaglist.get(i);
if (nbttagcompound.getShort("id") == enchantment.enchantmentobj.effectId)
{
@ -103,7 +103,7 @@ public class ItemEnchantedBook extends Item
if (flag)
{
TagObject nbttagcompound1 = new TagObject();
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setShort("id", (short)enchantment.enchantmentobj.effectId);
nbttagcompound1.setShort("lvl", (short)enchantment.enchantmentLevel);
nbttaglist.add(nbttagcompound1);
@ -111,7 +111,7 @@ public class ItemEnchantedBook extends Item
if (!stack.hasTagCompound())
{
stack.setTagCompound(new TagObject());
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().setTagList("StoredEnchantments", nbttaglist);

View file

@ -5,8 +5,8 @@ import java.util.List;
import common.collect.Lists;
import common.entity.item.EntityFireworks;
import common.entity.npc.EntityNPC;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.util.BlockPos;
import common.util.Facing;
import common.world.World;
@ -43,7 +43,7 @@ public class ItemFirework extends Item
{
if (stack.hasTagCompound())
{
TagObject nbttagcompound = stack.getTagCompound().getTag("Fireworks");
NBTTagCompound nbttagcompound = stack.getTagCompound().getTag("Fireworks");
if (nbttagcompound != null)
{
@ -52,13 +52,13 @@ public class ItemFirework extends Item
tooltip.add("Flugdauer: " + nbttagcompound.getByte("Flight"));
}
TagObjectList nbttaglist = nbttagcompound.getTagList("Explosions");
NBTTagTagList nbttaglist = nbttagcompound.getTagList("Explosions");
if (nbttaglist != null && nbttaglist.size() > 0)
{
for (int i = 0; i < nbttaglist.size(); ++i)
{
TagObject nbttagcompound1 = nbttaglist.get(i);
NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
List<String> list = Lists.<String>newArrayList();
ItemFireworkCharge.addExplosionInfo(nbttagcompound1, list);

View file

@ -6,7 +6,7 @@ import common.color.DyeColor;
import common.entity.npc.EntityNPC;
import common.model.Model;
import common.model.ModelProvider;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
public class ItemFireworkCharge extends Item
{
@ -22,7 +22,7 @@ public class ItemFireworkCharge extends Item
{
if (stack.hasTagCompound())
{
TagObject nbttagcompound = stack.getTagCompound().getTag("Explosion");
NBTTagCompound nbttagcompound = stack.getTagCompound().getTag("Explosion");
if (nbttagcompound != null)
{
@ -65,7 +65,7 @@ public class ItemFireworkCharge extends Item
{
if (stack.hasTagCompound())
{
TagObject nbttagcompound = stack.getTagCompound().getTag("Explosion");
NBTTagCompound nbttagcompound = stack.getTagCompound().getTag("Explosion");
if (nbttagcompound != null)
{
@ -74,7 +74,7 @@ public class ItemFireworkCharge extends Item
}
}
public static void addExplosionInfo(TagObject nbt, List<String> tooltip)
public static void addExplosionInfo(NBTTagCompound nbt, List<String> tooltip)
{
byte b0 = nbt.getByte("Type");

View file

@ -19,10 +19,10 @@ import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.BlockRegistry;
import common.init.ItemRegistry;
import common.nbt.NBTBase;
import common.nbt.NBTTagCompound;
import common.nbt.NBTTagTagList;
import common.rng.Random;
import common.tags.Tag;
import common.tags.TagObject;
import common.tags.TagObjectList;
import common.util.BlockPos;
import common.util.Facing;
import common.world.World;
@ -46,7 +46,7 @@ public final class ItemStack
/**
* A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items
*/
private TagObject stackTagCompound;
private NBTTagCompound stackTagCompound;
private int itemDamage;
/** Item frame this stack is on, or null if not on an item frame. */
@ -114,7 +114,7 @@ public final class ItemStack
return (amount / 1000000000) + "B+";
}
public static ItemStack loadItemStackFromNBT(TagObject nbt)
public static ItemStack loadItemStackFromNBT(NBTTagCompound nbt)
{
ItemStack itemstack = new ItemStack();
itemstack.readFromNBT(nbt);
@ -138,7 +138,7 @@ public final class ItemStack
if (this.stackTagCompound != null)
{
itemstack.stackTagCompound = (TagObject)this.stackTagCompound.copy();
itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy();
}
this.stackSize -= amount;
@ -194,7 +194,7 @@ public final class ItemStack
/**
* Write the stack fields to a NBT object. Return the new NBT object.
*/
public TagObject writeToNBT(TagObject nbt)
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
String resourcelocation = ItemRegistry.REGISTRY.getNameForObject(this.item);
nbt.setString("id", resourcelocation == null ? "air" : resourcelocation.toString());
@ -212,7 +212,7 @@ public final class ItemStack
/**
* Read the stack fields from a NBT object.
*/
public void readFromNBT(TagObject nbt)
public void readFromNBT(NBTTagCompound nbt)
{
if (nbt.hasString("id"))
{
@ -450,7 +450,7 @@ public final class ItemStack
if (this.stackTagCompound != null)
{
itemstack.stackTagCompound = (TagObject)this.stackTagCompound.copy();
itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy();
}
return itemstack;
@ -571,7 +571,7 @@ public final class ItemStack
/**
* Returns the NBTTagCompound of the ItemStack.
*/
public TagObject getTagCompound()
public NBTTagCompound getTagCompound()
{
return this.stackTagCompound;
}
@ -579,7 +579,7 @@ public final class ItemStack
/**
* Get an NBTTagCompound from this stack's NBT data.
*/
public TagObject getSubCompound(String key, boolean create)
public NBTTagCompound getSubCompound(String key, boolean create)
{
if (this.stackTagCompound != null && this.stackTagCompound.hasTag(key))
{
@ -587,7 +587,7 @@ public final class ItemStack
}
else if (create)
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
this.setTagInfo(key, nbttagcompound);
return nbttagcompound;
}
@ -597,7 +597,7 @@ public final class ItemStack
}
}
public TagObjectList getEnchantmentTagList()
public NBTTagTagList getEnchantmentTagList()
{
return this.stackTagCompound == null ? null : this.stackTagCompound.getTagList("ench");
}
@ -605,7 +605,7 @@ public final class ItemStack
/**
* Assigns a NBTTagCompound to the ItemStack, does not validate that only non-stackable items can have it.
*/
public void setTagCompound(TagObject nbt)
public void setTagCompound(NBTTagCompound nbt)
{
this.stackTagCompound = nbt;
}
@ -642,7 +642,7 @@ public final class ItemStack
{
if (this.stackTagCompound == null)
{
this.stackTagCompound = new TagObject();
this.stackTagCompound = new NBTTagCompound();
}
// if (!this.stackTagCompound.hasTag("display"))
@ -842,7 +842,7 @@ public final class ItemStack
{
// if ((i1 & 1) == 0)
// {
TagObjectList nbttaglist = this.getEnchantmentTagList();
NBTTagTagList nbttaglist = this.getEnchantmentTagList();
if (nbttaglist != null)
{
@ -1033,16 +1033,16 @@ public final class ItemStack
{
if (this.stackTagCompound == null)
{
this.setTagCompound(new TagObject());
this.setTagCompound(new NBTTagCompound());
}
if (!this.stackTagCompound.hasTagList("ench"))
{
this.stackTagCompound.setTagList("ench", new TagObjectList());
this.stackTagCompound.setTagList("ench", new NBTTagTagList());
}
TagObjectList nbttaglist = this.stackTagCompound.getTagList("ench");
TagObject nbttagcompound = new TagObject();
NBTTagTagList nbttaglist = this.stackTagCompound.getTagList("ench");
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setShort("id", (short)ench.effectId);
nbttagcompound.setShort("lvl", (short)(/* (byte) */ level));
nbttaglist.add(nbttagcompound);
@ -1058,10 +1058,10 @@ public final class ItemStack
if(!this.stackTagCompound.hasTagList("ench")) {
return false;
}
TagObjectList oldEnch = this.stackTagCompound.getTagList("ench");
TagObjectList newEnch = new TagObjectList();
NBTTagTagList oldEnch = this.stackTagCompound.getTagList("ench");
NBTTagTagList newEnch = new NBTTagTagList();
boolean changed = false;
TagObject tag;
NBTTagCompound tag;
for(int z = 0; z < oldEnch.size(); z++) {
tag = oldEnch.get(z);
if(tag.getShort("id") != ench.effectId) {
@ -1111,11 +1111,11 @@ public final class ItemStack
return this.stackTagCompound != null && this.stackTagCompound.hasTagList("ench");
}
public void setTagInfo(String key, Tag value)
public void setTagInfo(String key, NBTBase value)
{
if (this.stackTagCompound == null)
{
this.setTagCompound(new TagObject());
this.setTagCompound(new NBTTagCompound());
}
this.stackTagCompound.set(key, value);
@ -1179,7 +1179,7 @@ public final class ItemStack
if (!this.hasTagCompound())
{
this.stackTagCompound = new TagObject();
this.stackTagCompound = new NBTTagCompound();
}
this.stackTagCompound.setInt("RepairCost", cost);

View file

@ -0,0 +1,60 @@
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public abstract class NBTBase {
protected static NBTBase createNewByType(byte id) {
switch(id) {
case 0:
return new NBTTagEnd();
case 1:
return new NBTTagByte();
case 2:
return new NBTTagShort();
case 3:
return new NBTTagInt();
case 4:
return new NBTTagLong();
case 5:
return new NBTTagFloat();
case 6:
return new NBTTagDouble();
case 7:
return new NBTTagByteArray();
case 8:
return new NBTTagString();
case 9:
return new NBTTagStringList();
case 10:
return new NBTTagCompound();
case 11:
return new NBTTagIntArray();
case 12:
return new NBTTagTagList();
case 13:
return new NBTTagFloatList();
case 14:
return new NBTTagDoubleList();
case 15:
return new NBTTagIntArrayList();
default:
return null;
}
}
abstract void write(DataOutput output) throws IOException;
abstract void read(DataInput input, int depth, SizeTracker tracker) throws IOException;
public abstract String toString();
protected abstract byte getId();
public abstract NBTBase copy();
public boolean equals(Object other) {
return other instanceof NBTBase && this.getId() == ((NBTBase)other).getId();
}
public int hashCode() {
return this.getId();
}
}

View file

@ -0,0 +1,7 @@
package common.nbt;
public class NBTException extends Exception {
public NBTException(String message) {
super(message);
}
}

View file

@ -1,4 +1,4 @@
package common.tags;
package common.nbt;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@ -13,10 +13,10 @@ import java.io.IOException;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class TagLoader {
public static TagObject readGZip(File file) throws IOException {
public class NBTLoader {
public static NBTTagCompound readGZip(File file) throws IOException {
DataInputStream in = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))));
TagObject tag;
NBTTagCompound tag;
try {
tag = read(in, SizeTracker.INFINITE);
}
@ -26,7 +26,7 @@ public class TagLoader {
return tag;
}
public static void writeGZip(TagObject tag, File file) throws IOException {
public static void writeGZip(NBTTagCompound tag, File file) throws IOException {
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file))));
try {
write(tag, out);
@ -36,13 +36,13 @@ public class TagLoader {
}
}
public static TagObject read(DataInput in, SizeTracker tracker) throws IOException {
TagObject tag = new TagObject();
public static NBTTagCompound read(DataInput in, SizeTracker tracker) throws IOException {
NBTTagCompound tag = new NBTTagCompound();
tag.read(in, 0, tracker);
return tag;
}
public static void write(TagObject tag, DataOutput out) throws IOException {
public static void write(NBTTagCompound tag, DataOutput out) throws IOException {
tag.write(out);
}
}

View file

@ -1,33 +1,33 @@
package common.tags;
package common.nbt;
import java.util.Stack;
import java.util.regex.Pattern;
import common.collect.Lists;
public class TagInterpreter
public class NBTParser
{
private static final Pattern PATTERN = Pattern.compile("\\[[-+\\d|,\\s]+\\]");
public static TagObject parseTag(String jsonString) throws TagException
public static NBTTagCompound parseTag(String jsonString) throws NBTException
{
jsonString = jsonString.trim();
if (!jsonString.startsWith("{"))
{
throw new TagException("Invalid tag encountered, expected \'{\' as first char.");
throw new NBTException("Invalid tag encountered, expected \'{\' as first char.");
}
else if (func_150310_b(jsonString) != 1)
{
throw new TagException("Encountered multiple top tags, only one expected");
throw new NBTException("Encountered multiple top tags, only one expected");
}
else
{
return (TagObject)func_150316_a("tag", jsonString).parse();
return (NBTTagCompound)func_150316_a("tag", jsonString).parse();
}
}
static int func_150310_b(String p_150310_0_) throws TagException
static int func_150310_b(String p_150310_0_) throws NBTException
{
int i = 0;
boolean flag = false;
@ -43,7 +43,7 @@ public class TagInterpreter
{
if (!flag)
{
throw new TagException("Illegal use of \\\": " + p_150310_0_);
throw new NBTException("Illegal use of \\\": " + p_150310_0_);
}
}
else
@ -57,12 +57,12 @@ public class TagInterpreter
{
if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123))
{
throw new TagException("Unbalanced curly brackets {}: " + p_150310_0_);
throw new NBTException("Unbalanced curly brackets {}: " + p_150310_0_);
}
if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91))
{
throw new TagException("Unbalanced square brackets []: " + p_150310_0_);
throw new NBTException("Unbalanced square brackets []: " + p_150310_0_);
}
}
else
@ -79,11 +79,11 @@ public class TagInterpreter
if (flag)
{
throw new TagException("Unbalanced quotation: " + p_150310_0_);
throw new NBTException("Unbalanced quotation: " + p_150310_0_);
}
else if (!stack.isEmpty())
{
throw new TagException("Unbalanced brackets: " + p_150310_0_);
throw new NBTException("Unbalanced brackets: " + p_150310_0_);
}
else
{
@ -101,17 +101,17 @@ public class TagInterpreter
// return func_150316_a(s1, s2);
// }
static TagInterpreter.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws TagException
static NBTParser.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws NBTException
{
p_150316_1_ = p_150316_1_.trim();
if (p_150316_1_.startsWith("{"))
{
p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1);
TagInterpreter.Compound jsontonbt$compound;
NBTParser.Compound jsontonbt$compound;
String s1;
for (jsontonbt$compound = new TagInterpreter.Compound(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s1.length() + 1))
for (jsontonbt$compound = new NBTParser.Compound(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s1.length() + 1))
{
s1 = func_150314_a(p_150316_1_, true);
@ -130,7 +130,7 @@ public class TagInterpreter
if (c1 != 44 && c1 != 123 && c1 != 125 && c1 != 91 && c1 != 93)
{
throw new TagException("Unexpected token \'" + c1 + "\' at: " + p_150316_1_.substring(s1.length()));
throw new NBTException("Unexpected token \'" + c1 + "\' at: " + p_150316_1_.substring(s1.length()));
}
}
@ -139,10 +139,10 @@ public class TagInterpreter
else if (p_150316_1_.startsWith("[") && !PATTERN.matcher(p_150316_1_).matches())
{
p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1);
TagInterpreter.List jsontonbt$list;
NBTParser.List jsontonbt$list;
String s;
for (jsontonbt$list = new TagInterpreter.List(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s.length() + 1))
for (jsontonbt$list = new NBTParser.List(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s.length() + 1))
{
s = func_150314_a(p_150316_1_, false);
@ -161,7 +161,7 @@ public class TagInterpreter
if (c0 != 44 && c0 != 123 && c0 != 125 && c0 != 91 && c0 != 93)
{
throw new TagException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s.length()));
throw new NBTException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s.length()));
}
}
@ -169,18 +169,18 @@ public class TagInterpreter
}
else
{
return new TagInterpreter.Primitive(p_150316_0_, p_150316_1_);
return new NBTParser.Primitive(p_150316_0_, p_150316_1_);
}
}
private static TagInterpreter.Any func_179270_a(String p_179270_0_, boolean p_179270_1_) throws TagException
private static NBTParser.Any func_179270_a(String p_179270_0_, boolean p_179270_1_) throws NBTException
{
String s = func_150313_b(p_179270_0_, p_179270_1_);
String s1 = func_150311_c(p_179270_0_, p_179270_1_);
return func_150316_a(s, s1);
}
private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws TagException
private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws NBTException
{
int i = func_150312_a(p_150314_0_, ':');
int j = func_150312_a(p_150314_0_, ',');
@ -189,12 +189,12 @@ public class TagInterpreter
{
if (i == -1)
{
throw new TagException("Unable to locate name/value separator for string: " + p_150314_0_);
throw new NBTException("Unable to locate name/value separator for string: " + p_150314_0_);
}
if (j != -1 && j < i)
{
throw new TagException("Name error at: " + p_150314_0_);
throw new NBTException("Name error at: " + p_150314_0_);
}
}
else if (i == -1 || i > j)
@ -205,7 +205,7 @@ public class TagInterpreter
return func_179269_a(p_150314_0_, i);
}
private static String func_179269_a(String p_179269_0_, int p_179269_1_) throws TagException
private static String func_179269_a(String p_179269_0_, int p_179269_1_) throws NBTException
{
Stack<Character> stack = new Stack();
int i = p_179269_1_ + 1;
@ -223,7 +223,7 @@ public class TagInterpreter
{
if (!flag)
{
throw new TagException("Illegal use of \\\": " + p_179269_0_);
throw new NBTException("Illegal use of \\\": " + p_179269_0_);
}
}
else
@ -247,12 +247,12 @@ public class TagInterpreter
{
if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123))
{
throw new TagException("Unbalanced curly brackets {}: " + p_179269_0_);
throw new NBTException("Unbalanced curly brackets {}: " + p_179269_0_);
}
if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91))
{
throw new TagException("Unbalanced square brackets []: " + p_179269_0_);
throw new NBTException("Unbalanced square brackets []: " + p_179269_0_);
}
if (c0 == 44 && stack.isEmpty())
@ -280,7 +280,7 @@ public class TagInterpreter
return p_179269_0_.substring(0, i);
}
private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws TagException
private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws NBTException
{
if (p_150313_1_)
{
@ -302,7 +302,7 @@ public class TagInterpreter
}
else
{
throw new TagException("Unable to locate name/value separator for string: " + p_150313_0_);
throw new NBTException("Unable to locate name/value separator for string: " + p_150313_0_);
}
}
else
@ -311,7 +311,7 @@ public class TagInterpreter
}
}
private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws TagException
private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws NBTException
{
if (p_150311_1_)
{
@ -333,7 +333,7 @@ public class TagInterpreter
}
else
{
throw new TagException("Unable to locate name/value separator for string: " + p_150311_0_);
throw new NBTException("Unable to locate name/value separator for string: " + p_150311_0_);
}
}
else
@ -383,23 +383,23 @@ public class TagInterpreter
{
protected String json;
public abstract Tag parse() throws TagException;
public abstract NBTBase parse() throws NBTException;
}
static class Compound extends TagInterpreter.Any
static class Compound extends NBTParser.Any
{
protected java.util.List<TagInterpreter.Any> field_150491_b = Lists.<TagInterpreter.Any>newArrayList();
protected java.util.List<NBTParser.Any> field_150491_b = Lists.<NBTParser.Any>newArrayList();
public Compound(String p_i45137_1_)
{
this.json = p_i45137_1_;
}
public Tag parse() throws TagException
public NBTBase parse() throws NBTException
{
TagObject nbttagcompound = new TagObject();
NBTTagCompound nbttagcompound = new NBTTagCompound();
for (TagInterpreter.Any jsontonbt$any : this.field_150491_b)
for (NBTParser.Any jsontonbt$any : this.field_150491_b)
{
nbttagcompound.set(jsontonbt$any.json, jsontonbt$any.parse());
}
@ -408,36 +408,36 @@ public class TagInterpreter
}
}
static class List extends TagInterpreter.Any
static class List extends NBTParser.Any
{
protected java.util.List<TagInterpreter.Any> field_150492_b = Lists.<TagInterpreter.Any>newArrayList();
protected java.util.List<NBTParser.Any> field_150492_b = Lists.<NBTParser.Any>newArrayList();
public List(String json)
{
this.json = json;
}
public Tag parse() throws TagException
public NBTBase parse() throws NBTException
{
TagList nbttaglist = null;
NBTTagList nbttaglist = null;
for (TagInterpreter.Any jsontonbt$any : this.field_150492_b)
for (NBTParser.Any jsontonbt$any : this.field_150492_b)
{
Tag tag = jsontonbt$any.parse();
NBTBase tag = jsontonbt$any.parse();
if(nbttaglist == null) {
switch(tag.getId()) {
case 8:
nbttaglist = new TagStringList();
nbttaglist = new NBTTagStringList();
case 10:
nbttaglist = new TagObjectList();
nbttaglist = new NBTTagTagList();
case 5:
nbttaglist = new TagFloatList();
nbttaglist = new NBTTagFloatList();
case 6:
nbttaglist = new TagDoubleList();
nbttaglist = new NBTTagDoubleList();
case 11:
nbttaglist = new TagIntArrayList();
nbttaglist = new NBTTagIntArrayList();
default:
throw new TagException("Type cannot be put in a list: " + jsontonbt$any.json);
throw new NBTException("Type cannot be put in a list: " + jsontonbt$any.json);
}
}
nbttaglist.addElem(tag);
@ -447,7 +447,7 @@ public class TagInterpreter
}
}
static class Primitive extends TagInterpreter.Any
static class Primitive extends NBTParser.Any
{
private static final Pattern DOUBLE = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+[d|D]");
private static final Pattern FLOAT = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+[f|F]");
@ -465,54 +465,54 @@ public class TagInterpreter
this.jsonValue = p_i45139_2_;
}
public Tag parse() throws TagException
public NBTBase parse() throws NBTException
{
try
{
if (DOUBLE.matcher(this.jsonValue).matches())
{
return new TagDouble(Double.parseDouble(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
return new NBTTagDouble(Double.parseDouble(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
}
if (FLOAT.matcher(this.jsonValue).matches())
{
return new TagFloat(Float.parseFloat(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
return new NBTTagFloat(Float.parseFloat(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
}
if (BYTE.matcher(this.jsonValue).matches())
{
return new TagByte(Byte.parseByte(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
return new NBTTagByte(Byte.parseByte(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
}
if (LONG.matcher(this.jsonValue).matches())
{
return new TagLong(Long.parseLong(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
return new NBTTagLong(Long.parseLong(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
}
if (SHORT.matcher(this.jsonValue).matches())
{
return new TagShort(Short.parseShort(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
return new NBTTagShort(Short.parseShort(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
}
if (INTEGER.matcher(this.jsonValue).matches())
{
return new TagInt(Integer.parseInt(this.jsonValue));
return new NBTTagInt(Integer.parseInt(this.jsonValue));
}
if (DOUBLE_UNTYPED.matcher(this.jsonValue).matches())
{
return new TagDouble(Double.parseDouble(this.jsonValue));
return new NBTTagDouble(Double.parseDouble(this.jsonValue));
}
if (this.jsonValue.equalsIgnoreCase("true") || this.jsonValue.equalsIgnoreCase("false"))
{
return new TagByte((byte)(Boolean.parseBoolean(this.jsonValue) ? 1 : 0));
return new NBTTagByte((byte)(Boolean.parseBoolean(this.jsonValue) ? 1 : 0));
}
}
catch (NumberFormatException var6)
{
this.jsonValue = this.jsonValue.replaceAll("\\\\\"", "\"");
return new TagString(this.jsonValue);
return new NBTTagString(this.jsonValue);
}
if (this.jsonValue.startsWith("[") && this.jsonValue.endsWith("]"))
@ -529,11 +529,11 @@ public class TagInterpreter
aint[j] = Integer.parseInt(astring[j].trim());
}
return new TagIntArray(aint);
return new NBTTagIntArray(aint);
}
catch (NumberFormatException var5)
{
return new TagString(this.jsonValue);
return new NBTTagString(this.jsonValue);
}
}
else
@ -559,7 +559,7 @@ public class TagInterpreter
}
}
return new TagString(stringbuilder.toString());
return new NBTTagString(stringbuilder.toString());
}
}
}

View file

@ -1,18 +1,18 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagByte extends Tag
class NBTTagByte extends NBTBase
{
private byte data;
TagByte()
NBTTagByte()
{
}
public TagByte(byte data)
public NBTTagByte(byte data)
{
this.data = data;
}
@ -38,16 +38,16 @@ class TagByte extends Tag
return "" + this.data + "b";
}
public Tag copy()
public NBTBase copy()
{
return new TagByte(this.data);
return new NBTTagByte(this.data);
}
public boolean equals(Object other)
{
if (super.equals(other))
{
TagByte nbttagbyte = (TagByte)other;
NBTTagByte nbttagbyte = (NBTTagByte)other;
return this.data == nbttagbyte.data;
}
else

View file

@ -1,17 +1,17 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Arrays;
class TagByteArray extends Tag {
class NBTTagByteArray extends NBTBase {
private byte[] data;
TagByteArray() {
NBTTagByteArray() {
}
public TagByteArray(byte[] data) {
public NBTTagByteArray(byte[] data) {
this.data = data;
}
@ -36,14 +36,14 @@ class TagByteArray extends Tag {
return "[" + this.data.length + " bytes]";
}
public Tag copy() {
public NBTBase copy() {
byte[] data = new byte[this.data.length];
System.arraycopy(this.data, 0, data, 0, this.data.length);
return new TagByteArray(data);
return new NBTTagByteArray(data);
}
public boolean equals(Object other) {
return super.equals(other) && Arrays.equals(this.data, ((TagByteArray)other).data);
return super.equals(other) && Arrays.equals(this.data, ((NBTTagByteArray)other).data);
}
public int hashCode() {

View file

@ -1,4 +1,4 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
@ -10,12 +10,12 @@ import common.collect.Maps;
import java.util.Set;
public class TagObject extends Tag {
private Map<String, Tag> tags = Maps.<String, Tag>newHashMap();
public class NBTTagCompound extends NBTBase {
private Map<String, NBTBase> tags = Maps.<String, NBTBase>newHashMap();
void write(DataOutput output) throws IOException {
for(String key : this.tags.keySet()) {
Tag tag = this.tags.get(key);
NBTBase tag = this.tags.get(key);
output.writeByte(tag.getId());
if(tag.getId() != 0) {
output.writeUTF(key);
@ -34,7 +34,7 @@ public class TagObject extends Tag {
while((id = input.readByte()) != 0) {
String key = input.readUTF();
tracker.read(28 + 2 * key.length());
Tag tag = Tag.createNewByType(id);
NBTBase tag = NBTBase.createNewByType(id);
tag.read(input, depth + 1, tracker);
if(this.tags.put(key, tag) != null)
tracker.read(36);
@ -49,80 +49,80 @@ public class TagObject extends Tag {
return (byte)10;
}
public void set(String key, Tag value) {
public void set(String key, NBTBase value) {
this.tags.put(key, value);
}
public void setTag(String key, TagObject value) {
public void setTag(String key, NBTTagCompound value) {
this.tags.put(key, value);
}
public void setFloatList(String key, TagFloatList value) {
public void setFloatList(String key, NBTTagFloatList value) {
this.tags.put(key, value);
}
public void setDoubleList(String key, TagDoubleList value) {
public void setDoubleList(String key, NBTTagDoubleList value) {
this.tags.put(key, value);
}
public void setStringList(String key, TagStringList value) {
public void setStringList(String key, NBTTagStringList value) {
this.tags.put(key, value);
}
public void setIntArrayList(String key, TagIntArrayList value) {
public void setIntArrayList(String key, NBTTagIntArrayList value) {
this.tags.put(key, value);
}
public void setTagList(String key, TagObjectList value) {
public void setTagList(String key, NBTTagTagList value) {
this.tags.put(key, value);
}
public void setByte(String key, byte value) {
this.tags.put(key, new TagByte(value));
this.tags.put(key, new NBTTagByte(value));
}
public void setShort(String key, short value) {
this.tags.put(key, new TagShort(value));
this.tags.put(key, new NBTTagShort(value));
}
public void setInt(String key, int value) {
this.tags.put(key, new TagInt(value));
this.tags.put(key, new NBTTagInt(value));
}
public void setLong(String key, long value) {
this.tags.put(key, new TagLong(value));
this.tags.put(key, new NBTTagLong(value));
}
public void setFloat(String key, float value) {
this.tags.put(key, new TagFloat(value));
this.tags.put(key, new NBTTagFloat(value));
}
public void setDouble(String key, double value) {
this.tags.put(key, new TagDouble(value));
this.tags.put(key, new NBTTagDouble(value));
}
public void setString(String key, String value) {
this.tags.put(key, new TagString(value));
this.tags.put(key, new NBTTagString(value));
}
public void setByteArray(String key, byte[] value) {
this.tags.put(key, new TagByteArray(value));
this.tags.put(key, new NBTTagByteArray(value));
}
public void setIntArray(String key, int[] value) {
this.tags.put(key, new TagIntArray(value));
this.tags.put(key, new NBTTagIntArray(value));
}
public void setBool(String key, boolean value) {
this.setByte(key, (byte)(value ? 1 : 0));
}
public Tag get(String key) {
public NBTBase get(String key) {
return this.tags.get(key);
}
public byte getTagId(String key) {
Tag tag = this.tags.get(key);
NBTBase tag = this.tags.get(key);
return tag != null ? tag.getId() : 0;
}
@ -196,63 +196,63 @@ public class TagObject extends Tag {
}
public byte getByte(String key) {
return !this.hasKey(key, 1) ? 0 : ((TagByte)this.tags.get(key)).getByte();
return !this.hasKey(key, 1) ? 0 : ((NBTTagByte)this.tags.get(key)).getByte();
}
public short getShort(String key) {
return !this.hasKey(key, 2) ? 0 : ((TagShort)this.tags.get(key)).getShort();
return !this.hasKey(key, 2) ? 0 : ((NBTTagShort)this.tags.get(key)).getShort();
}
public int getInt(String key) {
return !this.hasKey(key, 3) ? 0 : ((TagInt)this.tags.get(key)).getInt();
return !this.hasKey(key, 3) ? 0 : ((NBTTagInt)this.tags.get(key)).getInt();
}
public long getLong(String key) {
return !this.hasKey(key, 4) ? 0L : ((TagLong)this.tags.get(key)).getLong();
return !this.hasKey(key, 4) ? 0L : ((NBTTagLong)this.tags.get(key)).getLong();
}
public float getFloat(String key) {
return !this.hasKey(key, 5) ? 0.0F : ((TagFloat)this.tags.get(key)).getFloat();
return !this.hasKey(key, 5) ? 0.0F : ((NBTTagFloat)this.tags.get(key)).getFloat();
}
public double getDouble(String key) {
return !this.hasKey(key, 6) ? 0.0D : ((TagDouble)this.tags.get(key)).getDouble();
return !this.hasKey(key, 6) ? 0.0D : ((NBTTagDouble)this.tags.get(key)).getDouble();
}
public String getString(String key) {
return !this.hasKey(key, 8) ? "" : ((TagString)this.tags.get(key)).getString();
return !this.hasKey(key, 8) ? "" : ((NBTTagString)this.tags.get(key)).getString();
}
public byte[] getByteArray(String key) {
return !this.hasKey(key, 7) ? new byte[0] : ((TagByteArray)this.tags.get(key)).getByteArray();
return !this.hasKey(key, 7) ? new byte[0] : ((NBTTagByteArray)this.tags.get(key)).getByteArray();
}
public int[] getIntArray(String key) {
return !this.hasKey(key, 11) ? new int[0] : ((TagIntArray)this.tags.get(key)).getIntArray();
return !this.hasKey(key, 11) ? new int[0] : ((NBTTagIntArray)this.tags.get(key)).getIntArray();
}
public TagObject getTag(String key) {
return !this.hasKey(key, 10) ? new TagObject() : (TagObject)this.tags.get(key);
public NBTTagCompound getTag(String key) {
return !this.hasKey(key, 10) ? new NBTTagCompound() : (NBTTagCompound)this.tags.get(key);
}
public TagFloatList getFloatList(String key) {
return !this.hasKey(key, 13) ? new TagFloatList() : (TagFloatList)this.tags.get(key);
public NBTTagFloatList getFloatList(String key) {
return !this.hasKey(key, 13) ? new NBTTagFloatList() : (NBTTagFloatList)this.tags.get(key);
}
public TagDoubleList getDoubleList(String key) {
return !this.hasKey(key, 14) ? new TagDoubleList() : (TagDoubleList)this.tags.get(key);
public NBTTagDoubleList getDoubleList(String key) {
return !this.hasKey(key, 14) ? new NBTTagDoubleList() : (NBTTagDoubleList)this.tags.get(key);
}
public TagStringList getStringList(String key) {
return !this.hasKey(key, 9) ? new TagStringList() : (TagStringList)this.tags.get(key);
public NBTTagStringList getStringList(String key) {
return !this.hasKey(key, 9) ? new NBTTagStringList() : (NBTTagStringList)this.tags.get(key);
}
public TagIntArrayList getIntArrayList(String key) {
return !this.hasKey(key, 15) ? new TagIntArrayList() : (TagIntArrayList)this.tags.get(key);
public NBTTagIntArrayList getIntArrayList(String key) {
return !this.hasKey(key, 15) ? new NBTTagIntArrayList() : (NBTTagIntArrayList)this.tags.get(key);
}
public TagObjectList getTagList(String key) {
return !this.hasKey(key, 12) ? new TagObjectList() : (TagObjectList)this.tags.get(key);
public NBTTagTagList getTagList(String key) {
return !this.hasKey(key, 12) ? new NBTTagTagList() : (NBTTagTagList)this.tags.get(key);
}
public boolean getBool(String key) {
@ -265,7 +265,7 @@ public class TagObject extends Tag {
public String toString() {
StringBuilder sb = new StringBuilder("{");
for(Entry<String, Tag> entry : this.tags.entrySet()) {
for(Entry<String, NBTBase> entry : this.tags.entrySet()) {
if(sb.length() != 1)
sb.append(',');
sb.append(entry.getKey()).append(':').append(entry.getValue());
@ -277,8 +277,8 @@ public class TagObject extends Tag {
return this.tags.isEmpty();
}
public Tag copy() {
TagObject tag = new TagObject();
public NBTBase copy() {
NBTTagCompound tag = new NBTTagCompound();
for(String s : this.tags.keySet()) {
tag.set(s, this.tags.get(s).copy());
}
@ -286,7 +286,7 @@ public class TagObject extends Tag {
}
public boolean equals(Object other) {
return super.equals(other) && this.tags.entrySet().equals(((TagObject)other).tags.entrySet());
return super.equals(other) && this.tags.entrySet().equals(((NBTTagCompound)other).tags.entrySet());
}
public int hashCode() {
@ -298,13 +298,13 @@ public class TagObject extends Tag {
* merged using the same methods, other types of tags are overwritten from the
* given compound.
*/
public void merge(TagObject other) {
public void merge(NBTTagCompound other) {
for(String key : other.tags.keySet()) {
Tag tag = other.tags.get(key);
NBTBase tag = other.tags.get(key);
if(tag.getId() == 10) {
if(this.hasKey(key, 10)) {
TagObject comp = this.getTag(key);
comp.merge((TagObject)tag);
NBTTagCompound comp = this.getTag(key);
comp.merge((NBTTagCompound)tag);
}
else {
this.set(key, tag.copy());

View file

@ -1,18 +1,18 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagDouble extends Tag
class NBTTagDouble extends NBTBase
{
private double data;
TagDouble()
NBTTagDouble()
{
}
public TagDouble(double data)
public NBTTagDouble(double data)
{
this.data = data;
}
@ -38,16 +38,16 @@ class TagDouble extends Tag
return "" + this.data + "d";
}
public Tag copy()
public NBTBase copy()
{
return new TagDouble(this.data);
return new NBTTagDouble(this.data);
}
public boolean equals(Object other)
{
if (super.equals(other))
{
TagDouble nbttagdouble = (TagDouble)other;
NBTTagDouble nbttagdouble = (NBTTagDouble)other;
return this.data == nbttagdouble.data;
}
else

View file

@ -0,0 +1,27 @@
package common.nbt;
public class NBTTagDoubleList extends NBTTagList<NBTTagDouble> {
protected byte getId() {
return 14;
}
protected byte getType() {
return 6;
}
protected NBTTagList<NBTTagDouble> createInstance() {
return new NBTTagDoubleList();
}
protected NBTTagDouble getDefault() {
return new NBTTagDouble(0.0);
}
public double get(int index) {
return this.getElem(index).getDouble();
}
public void add(double value) {
this.addElem(new NBTTagDouble(value));
}
}

View file

@ -1,10 +1,10 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagNull extends Tag {
class NBTTagEnd extends NBTBase {
void read(DataInput input, int depth, SizeTracker tracker) throws IOException {
tracker.read(8);
}
@ -20,7 +20,7 @@ class TagNull extends Tag {
return "END";
}
public Tag copy() {
return new TagNull();
public NBTBase copy() {
return new NBTTagEnd();
}
}

View file

@ -1,18 +1,18 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagFloat extends Tag
class NBTTagFloat extends NBTBase
{
private float data;
TagFloat()
NBTTagFloat()
{
}
public TagFloat(float data)
public NBTTagFloat(float data)
{
this.data = data;
}
@ -38,16 +38,16 @@ class TagFloat extends Tag
return "" + this.data + "f";
}
public Tag copy()
public NBTBase copy()
{
return new TagFloat(this.data);
return new NBTTagFloat(this.data);
}
public boolean equals(Object other)
{
if (super.equals(other))
{
TagFloat nbttagfloat = (TagFloat)other;
NBTTagFloat nbttagfloat = (NBTTagFloat)other;
return this.data == nbttagfloat.data;
}
else

View file

@ -0,0 +1,27 @@
package common.nbt;
public class NBTTagFloatList extends NBTTagList<NBTTagFloat> {
protected byte getId() {
return 13;
}
protected byte getType() {
return 5;
}
protected NBTTagList<NBTTagFloat> createInstance() {
return new NBTTagFloatList();
}
protected NBTTagFloat getDefault() {
return new NBTTagFloat(0.0f);
}
public float get(int index) {
return this.getElem(index).getFloat();
}
public void add(float value) {
this.addElem(new NBTTagFloat(value));
}
}

View file

@ -1,18 +1,18 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagInt extends Tag
class NBTTagInt extends NBTBase
{
private int data;
TagInt()
NBTTagInt()
{
}
public TagInt(int data)
public NBTTagInt(int data)
{
this.data = data;
}
@ -38,16 +38,16 @@ class TagInt extends Tag
return "" + this.data;
}
public Tag copy()
public NBTBase copy()
{
return new TagInt(this.data);
return new NBTTagInt(this.data);
}
public boolean equals(Object other)
{
if (super.equals(other))
{
TagInt nbttagint = (TagInt)other;
NBTTagInt nbttagint = (NBTTagInt)other;
return this.data == nbttagint.data;
}
else

View file

@ -1,17 +1,17 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Arrays;
class TagIntArray extends Tag {
class NBTTagIntArray extends NBTBase {
private int[] data;
TagIntArray() {
NBTTagIntArray() {
}
public TagIntArray(int[] data) {
public NBTTagIntArray(int[] data) {
this.data = data;
}
@ -44,14 +44,14 @@ class TagIntArray extends Tag {
return sb.append("]").toString();
}
public Tag copy() {
public NBTBase copy() {
int[] data = new int[this.data.length];
System.arraycopy(this.data, 0, data, 0, this.data.length);
return new TagIntArray(data);
return new NBTTagIntArray(data);
}
public boolean equals(Object other) {
return super.equals(other) && Arrays.equals(this.data, ((TagIntArray)other).data);
return super.equals(other) && Arrays.equals(this.data, ((NBTTagIntArray)other).data);
}
public int hashCode() {

View file

@ -0,0 +1,27 @@
package common.nbt;
public class NBTTagIntArrayList extends NBTTagList<NBTTagIntArray> {
protected byte getId() {
return 15;
}
protected byte getType() {
return 11;
}
protected NBTTagList<NBTTagIntArray> createInstance() {
return new NBTTagIntArrayList();
}
protected NBTTagIntArray getDefault() {
return new NBTTagIntArray(new int[0]);
}
public int[] get(int index) {
return this.getElem(index).getIntArray();
}
public void add(int[] value) {
this.addElem(new NBTTagIntArray(value));
}
}

View file

@ -1,4 +1,4 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
@ -9,7 +9,7 @@ import java.util.List;
import common.collect.Lists;
import common.log.Log;
abstract class TagList<K extends Tag> extends Tag {
abstract class NBTTagList<K extends NBTBase> extends NBTBase {
private List<K> list = Lists.newArrayList();
void write(DataOutput output) throws IOException {
@ -27,7 +27,7 @@ abstract class TagList<K extends Tag> extends Tag {
tracker.read(4 * len);
this.list = new ArrayList<K>(len);
for(int z = 0; z < len; z++) {
K tag = (K)Tag.createNewByType(this.getType());
K tag = (K)NBTBase.createNewByType(this.getType());
tag.read(input, depth + 1, tracker);
this.list.add(tag);
}
@ -35,7 +35,7 @@ abstract class TagList<K extends Tag> extends Tag {
protected abstract byte getId();
protected abstract byte getType();
protected abstract TagList<K> createInstance();
protected abstract NBTTagList<K> createInstance();
protected abstract K getDefault();
public String toString() {
@ -76,8 +76,8 @@ abstract class TagList<K extends Tag> extends Tag {
return this.list.size();
}
public Tag copy() {
TagList<K> list = this.createInstance();
public NBTBase copy() {
NBTTagList<K> list = this.createInstance();
for(K tag : this.list) {
list.list.add((K)tag.copy());
}
@ -85,7 +85,7 @@ abstract class TagList<K extends Tag> extends Tag {
}
public boolean equals(Object other) {
return super.equals(other) && this.list.equals(((TagList)other).list);
return super.equals(other) && this.list.equals(((NBTTagList)other).list);
}
public int hashCode() {

View file

@ -1,18 +1,18 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagLong extends Tag
class NBTTagLong extends NBTBase
{
private long data;
TagLong()
NBTTagLong()
{
}
public TagLong(long data)
public NBTTagLong(long data)
{
this.data = data;
}
@ -38,16 +38,16 @@ class TagLong extends Tag
return "" + this.data + "L";
}
public Tag copy()
public NBTBase copy()
{
return new TagLong(this.data);
return new NBTTagLong(this.data);
}
public boolean equals(Object other)
{
if (super.equals(other))
{
TagLong nbttaglong = (TagLong)other;
NBTTagLong nbttaglong = (NBTTagLong)other;
return this.data == nbttaglong.data;
}
else

View file

@ -1,18 +1,18 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagShort extends Tag
class NBTTagShort extends NBTBase
{
private short data;
public TagShort()
public NBTTagShort()
{
}
public TagShort(short data)
public NBTTagShort(short data)
{
this.data = data;
}
@ -38,16 +38,16 @@ class TagShort extends Tag
return "" + this.data + "s";
}
public Tag copy()
public NBTBase copy()
{
return new TagShort(this.data);
return new NBTTagShort(this.data);
}
public boolean equals(Object other)
{
if (super.equals(other))
{
TagShort nbttagshort = (TagShort)other;
NBTTagShort nbttagshort = (NBTTagShort)other;
return this.data == nbttagshort.data;
}
else

View file

@ -1,17 +1,17 @@
package common.tags;
package common.nbt;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
class TagString extends Tag {
class NBTTagString extends NBTBase {
private String data;
public TagString() {
public NBTTagString() {
this.data = "";
}
public TagString(String data) {
public NBTTagString(String data) {
if(data == null)
throw new IllegalArgumentException("null is not allowed");
this.data = data;
@ -35,14 +35,14 @@ class TagString extends Tag {
return "\"" + this.data.replace("\"", "\\\"") + "\"";
}
public Tag copy() {
return new TagString(this.data);
public NBTBase copy() {
return new NBTTagString(this.data);
}
public boolean equals(Object other) {
if(!super.equals(other))
return false;
TagString tag = (TagString)other;
NBTTagString tag = (NBTTagString)other;
return this.data == null && tag.data == null || this.data != null && this.data.equals(tag.data);
}

View file

@ -0,0 +1,27 @@
package common.nbt;
public class NBTTagStringList extends NBTTagList<NBTTagString> {
protected byte getId() {
return 9;
}
protected byte getType() {
return 8;
}
protected NBTTagList<NBTTagString> createInstance() {
return new NBTTagStringList();
}
protected NBTTagString getDefault() {
return new NBTTagString("");
}
public String get(int index) {
return this.getElem(index).getString();
}
public void add(String value) {
this.addElem(new NBTTagString(value));
}
}

View file

@ -0,0 +1,27 @@
package common.nbt;
public class NBTTagTagList extends NBTTagList<NBTTagCompound> {
protected byte getId() {
return 12;
}
protected byte getType() {
return 10;
}
protected NBTTagList<NBTTagCompound> createInstance() {
return new NBTTagTagList();
}
protected NBTTagCompound getDefault() {
return new NBTTagCompound();
}
public NBTTagCompound get(int index) {
return this.getElem(index);
}
public void add(NBTTagCompound value) {
this.addElem(value);
}
}

View file

@ -1,4 +1,4 @@
package common.tags;
package common.nbt;
public class SizeTracker {
public static final SizeTracker INFINITE = new SizeTracker(0) {

View file

@ -5,14 +5,14 @@ import java.nio.charset.Charset;
import common.init.ItemRegistry;
import common.item.ItemStack;
import common.nbt.NBTLoader;
import common.nbt.SizeTracker;
import common.nbt.NBTTagCompound;
import common.net.buffer.ByteBuf;
import common.net.buffer.ByteBufInputStream;
import common.net.buffer.ByteBufOutputStream;
import common.net.handler.codec.DecoderException;
import common.net.handler.codec.EncoderException;
import common.tags.SizeTracker;
import common.tags.TagLoader;
import common.tags.TagObject;
import common.util.BlockPos;
public class PacketBuffer {
@ -92,26 +92,26 @@ public class PacketBuffer {
return v;
}
public void writeTag(TagObject tag) {
public void writeTag(NBTTagCompound tag) {
if(tag == null) {
this.writeByte(0);
return;
}
try {
TagLoader.write(tag, new ByteBufOutputStream(this.buf));
NBTLoader.write(tag, new ByteBufOutputStream(this.buf));
}
catch(IOException e) {
throw new EncoderException(e);
}
}
public TagObject readTag() throws IOException {
public NBTTagCompound readTag() throws IOException {
int i = this.buf.readerIndex();
byte b = this.readByte();
if(b == 0)
return null;
this.buf.readerIndex(i);
return TagLoader.read(new ByteBufInputStream(this.buf), new SizeTracker(2097152));
return NBTLoader.read(new ByteBufInputStream(this.buf), new SizeTracker(2097152));
}
public void writeItemStack(ItemStack stack) {

View file

@ -3,14 +3,14 @@ package common.packet;
import java.io.IOException;
import common.dimension.Dimension;
import common.nbt.NBTTagCompound;
import common.network.IClientPlayer;
import common.network.Packet;
import common.network.PacketBuffer;
import common.tags.TagObject;
public class SPacketJoinGame implements Packet<IClientPlayer> {
private int entityId;
private TagObject dimension;
private NBTTagCompound dimension;
private int type;
private boolean editor;

View file

@ -3,14 +3,14 @@ package common.packet;
import java.io.IOException;
import common.dimension.Dimension;
import common.nbt.NBTTagCompound;
import common.network.IClientPlayer;
import common.network.Packet;
import common.network.PacketBuffer;
import common.tags.TagObject;
public class SPacketRespawn implements Packet<IClientPlayer>
{
private TagObject dimension;
private NBTTagCompound dimension;
private int type;
private boolean editor;

View file

@ -3,22 +3,22 @@ package common.packet;
import java.io.IOException;
import common.entity.Entity;
import common.nbt.NBTTagCompound;
import common.network.IClientPlayer;
import common.network.Packet;
import common.network.PacketBuffer;
import common.tags.TagObject;
import common.world.World;
public class SPacketUpdateEntityNBT implements Packet<IClientPlayer>
{
private int entityId;
private TagObject tagCompound;
private NBTTagCompound tagCompound;
public SPacketUpdateEntityNBT()
{
}
public SPacketUpdateEntityNBT(int entityIdIn, TagObject tagCompoundIn)
public SPacketUpdateEntityNBT(int entityIdIn, NBTTagCompound tagCompoundIn)
{
this.entityId = entityIdIn;
this.tagCompound = tagCompoundIn;
@ -50,7 +50,7 @@ public class SPacketUpdateEntityNBT implements Packet<IClientPlayer>
handler.handleEntityNBT(this);
}
public TagObject getTagCompound()
public NBTTagCompound getTagCompound()
{
return this.tagCompound;
}

View file

@ -3,10 +3,10 @@ package common.packet;
import java.io.IOException;
import common.init.TileRegistry;
import common.nbt.NBTTagCompound;
import common.network.IClientPlayer;
import common.network.Packet;
import common.network.PacketBuffer;
import common.tags.TagObject;
import common.tileentity.TileEntity;
import common.util.BlockPos;
@ -14,7 +14,7 @@ public class SPacketUpdateTileEntity implements Packet<IClientPlayer>
{
private BlockPos blockPos;
private int type;
private TagObject nbt;
private NBTTagCompound nbt;
public SPacketUpdateTileEntity()
{
@ -24,7 +24,7 @@ public class SPacketUpdateTileEntity implements Packet<IClientPlayer>
{
this.blockPos = tile.getPos();
this.type = TileRegistry.CLASS_TO_ID.get(tile.getClass());
tile.writeToNBT(this.nbt = new TagObject());
tile.writeToNBT(this.nbt = new NBTTagCompound());
}
/**
@ -65,7 +65,7 @@ public class SPacketUpdateTileEntity implements Packet<IClientPlayer>
return this.type == TileRegistry.CLASS_TO_ID.get(tile.getClass());
}
public TagObject getNbtCompound()
public NBTTagCompound getNbtCompound()
{
return this.nbt;
}

View file

@ -2,7 +2,7 @@ package common.potion;
import common.entity.types.EntityLiving;
import common.log.Log;
import common.tags.TagObject;
import common.nbt.NBTTagCompound;
public class PotionEffect {
private final Potion potion;
@ -135,8 +135,8 @@ public class PotionEffect {
&& this.thrown == other.thrown && this.remaining == other.remaining && this.ambient == other.ambient;
}
public TagObject toNbt() {
TagObject nbt = new TagObject();
public NBTTagCompound toNbt() {
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("Type", this.potion.getName());
nbt.setByte("Amplifier", (byte)this.amplifier);
nbt.setInt("Duration", this.duration);
@ -146,7 +146,7 @@ public class PotionEffect {
return nbt;
}
public static PotionEffect fromNbt(TagObject nbt) {
public static PotionEffect fromNbt(NBTTagCompound nbt) {
Potion potion = Potion.getByName(nbt.getString("Type"));
return potion == null ? null : new PotionEffect(potion, nbt.getInt("Duration"), (int)(nbt.getByte("Amplifier") & 255), nbt.getBool("Ambient"), nbt.getBool("Particles"))
.setRemaining(nbt.getInt("Remaining"));

View file

@ -1,60 +0,0 @@
package common.tags;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public abstract class Tag {
protected static Tag createNewByType(byte id) {
switch(id) {
case 0:
return new TagNull();
case 1:
return new TagByte();
case 2:
return new TagShort();
case 3:
return new TagInt();
case 4:
return new TagLong();
case 5:
return new TagFloat();
case 6:
return new TagDouble();
case 7:
return new TagByteArray();
case 8:
return new TagString();
case 9:
return new TagStringList();
case 10:
return new TagObject();
case 11:
return new TagIntArray();
case 12:
return new TagObjectList();
case 13:
return new TagFloatList();
case 14:
return new TagDoubleList();
case 15:
return new TagIntArrayList();
default:
return null;
}
}
abstract void write(DataOutput output) throws IOException;
abstract void read(DataInput input, int depth, SizeTracker tracker) throws IOException;
public abstract String toString();
protected abstract byte getId();
public abstract Tag copy();
public boolean equals(Object other) {
return other instanceof Tag && this.getId() == ((Tag)other).getId();
}
public int hashCode() {
return this.getId();
}
}

View file

@ -1,27 +0,0 @@
package common.tags;
public class TagDoubleList extends TagList<TagDouble> {
protected byte getId() {
return 14;
}
protected byte getType() {
return 6;
}
protected TagList<TagDouble> createInstance() {
return new TagDoubleList();
}
protected TagDouble getDefault() {
return new TagDouble(0.0);
}
public double get(int index) {
return this.getElem(index).getDouble();
}
public void add(double value) {
this.addElem(new TagDouble(value));
}
}

View file

@ -1,7 +0,0 @@
package common.tags;
public class TagException extends Exception {
public TagException(String message) {
super(message);
}
}

View file

@ -1,27 +0,0 @@
package common.tags;
public class TagFloatList extends TagList<TagFloat> {
protected byte getId() {
return 13;
}
protected byte getType() {
return 5;
}
protected TagList<TagFloat> createInstance() {
return new TagFloatList();
}
protected TagFloat getDefault() {
return new TagFloat(0.0f);
}
public float get(int index) {
return this.getElem(index).getFloat();
}
public void add(float value) {
this.addElem(new TagFloat(value));
}
}

View file

@ -1,27 +0,0 @@
package common.tags;
public class TagIntArrayList extends TagList<TagIntArray> {
protected byte getId() {
return 15;
}
protected byte getType() {
return 11;
}
protected TagList<TagIntArray> createInstance() {
return new TagIntArrayList();
}
protected TagIntArray getDefault() {
return new TagIntArray(new int[0]);
}
public int[] get(int index) {
return this.getElem(index).getIntArray();
}
public void add(int[] value) {
this.addElem(new TagIntArray(value));
}
}

View file

@ -1,27 +0,0 @@
package common.tags;
public class TagObjectList extends TagList<TagObject> {
protected byte getId() {
return 12;
}
protected byte getType() {
return 10;
}
protected TagList<TagObject> createInstance() {
return new TagObjectList();
}
protected TagObject getDefault() {
return new TagObject();
}
public TagObject get(int index) {
return this.getElem(index);
}
public void add(TagObject value) {
this.addElem(value);
}
}

View file

@ -1,27 +0,0 @@
package common.tags;
public class TagStringList extends TagList<TagString> {
protected byte getId() {
return 9;
}
protected byte getType() {
return 8;
}
protected TagList<TagString> createInstance() {
return new TagStringList();
}
protected TagString getDefault() {
return new TagString("");
}
public String get(int index) {
return this.getElem(index).getString();
}
public void add(String value) {
this.addElem(new TagString(value));
}
}

Some files were not shown because too many files have changed in this diff Show more