change nbt format: change class names
This commit is contained in:
parent
4433d3b3df
commit
47a69ce8bc
143 changed files with 1207 additions and 1207 deletions
|
@ -5,7 +5,7 @@ import client.renderer.RenderBuffer;
|
||||||
import client.renderer.texture.TextureAtlasSprite;
|
import client.renderer.texture.TextureAtlasSprite;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.EntityType;
|
import common.entity.EntityType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -210,14 +210,14 @@ public class EntityFX extends Entity
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ import client.world.WorldClient;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemDye;
|
import common.item.ItemDye;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -192,10 +192,10 @@ public class EntityFirework
|
||||||
{
|
{
|
||||||
private int fireworkAge;
|
private int fireworkAge;
|
||||||
private final EffectRenderer theEffectRenderer;
|
private final EffectRenderer theEffectRenderer;
|
||||||
private NBTTagTagList fireworkExplosions;
|
private TagObjectList fireworkExplosions;
|
||||||
boolean twinkle;
|
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_, NBTTagCompound 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_, TagObject p_i46464_15_)
|
||||||
{
|
{
|
||||||
super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D);
|
super(p_i46464_1_, p_i46464_2_, p_i46464_4_, p_i46464_6_, 0.0D, 0.0D, 0.0D);
|
||||||
this.motionX = p_i46464_8_;
|
this.motionX = p_i46464_8_;
|
||||||
|
@ -218,7 +218,7 @@ public class EntityFirework
|
||||||
|
|
||||||
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
|
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = this.fireworkExplosions.get(i);
|
TagObject nbttagcompound = this.fireworkExplosions.get(i);
|
||||||
|
|
||||||
if (nbttagcompound.getBool("Flicker"))
|
if (nbttagcompound.getBool("Flicker"))
|
||||||
{
|
{
|
||||||
|
@ -250,7 +250,7 @@ public class EntityFirework
|
||||||
{
|
{
|
||||||
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
|
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = this.fireworkExplosions.get(i);
|
TagObject nbttagcompound = this.fireworkExplosions.get(i);
|
||||||
|
|
||||||
if (nbttagcompound.getByte("Type") == 1)
|
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())
|
if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.size())
|
||||||
{
|
{
|
||||||
int k = this.fireworkAge / 2;
|
int k = this.fireworkAge / 2;
|
||||||
NBTTagCompound nbttagcompound1 = this.fireworkExplosions.get(k);
|
TagObject nbttagcompound1 = this.fireworkExplosions.get(k);
|
||||||
int l = nbttagcompound1.getByte("Type");
|
int l = nbttagcompound1.getByte("Type");
|
||||||
boolean flag4 = nbttagcompound1.getBool("Trail");
|
boolean flag4 = nbttagcompound1.getBool("Trail");
|
||||||
boolean flag2 = nbttagcompound1.getBool("Flicker");
|
boolean flag2 = nbttagcompound1.getBool("Flicker");
|
||||||
|
|
|
@ -22,7 +22,7 @@ import common.init.SoundEvent;
|
||||||
import common.item.ItemDye;
|
import common.item.ItemDye;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.sound.MovingSoundMinecart;
|
import common.sound.MovingSoundMinecart;
|
||||||
import common.sound.PositionedSound;
|
import common.sound.PositionedSound;
|
||||||
|
@ -381,7 +381,7 @@ public class WorldClient extends AWorldClient
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund)
|
public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, TagObject compund)
|
||||||
{
|
{
|
||||||
this.gm.effectRenderer.addEffect(new EntityFirework.StarterFX(this.gm.world, x, y, z, motionX, motionY, motionZ, this.gm.effectRenderer, compund));
|
this.gm.effectRenderer.addEffect(new EntityFirework.StarterFX(this.gm.world, x, y, z, motionX, motionY, motionZ, this.gm.effectRenderer, compund));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ package common.attributes;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
|
|
||||||
public class Attributes
|
public class Attributes
|
||||||
{
|
{
|
||||||
|
@ -40,9 +40,9 @@ public class Attributes
|
||||||
/**
|
/**
|
||||||
* Creates an NBTTagList from a BaseAttributeMap, including all its AttributeInstances
|
* Creates an NBTTagList from a BaseAttributeMap, including all its AttributeInstances
|
||||||
*/
|
*/
|
||||||
public static NBTTagTagList writeBaseAttributeMapToNBT(AttributeMap map)
|
public static TagObjectList writeBaseAttributeMapToNBT(AttributeMap map)
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (AttributeInstance iattributeinstance : map.getAllAttributes())
|
for (AttributeInstance iattributeinstance : map.getAllAttributes())
|
||||||
{
|
{
|
||||||
|
@ -55,9 +55,9 @@ public class Attributes
|
||||||
/**
|
/**
|
||||||
* Creates an NBTTagCompound from an AttributeInstance, including its AttributeModifiers
|
* Creates an NBTTagCompound from an AttributeInstance, including its AttributeModifiers
|
||||||
*/
|
*/
|
||||||
private static NBTTagCompound writeAttributeInstanceToNBT(AttributeInstance instance)
|
private static TagObject writeAttributeInstanceToNBT(AttributeInstance instance)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
Attribute iattribute = instance.getAttribute();
|
Attribute iattribute = instance.getAttribute();
|
||||||
nbttagcompound.setString("Name", iattribute.getUnlocalizedName());
|
nbttagcompound.setString("Name", iattribute.getUnlocalizedName());
|
||||||
nbttagcompound.setDouble("Base", instance.getBaseValue());
|
nbttagcompound.setDouble("Base", instance.getBaseValue());
|
||||||
|
@ -65,7 +65,7 @@ public class Attributes
|
||||||
|
|
||||||
if (collection != null && !collection.isEmpty())
|
if (collection != null && !collection.isEmpty())
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (AttributeModifier attributemodifier : collection)
|
for (AttributeModifier attributemodifier : collection)
|
||||||
{
|
{
|
||||||
|
@ -84,9 +84,9 @@ public class Attributes
|
||||||
/**
|
/**
|
||||||
* Creates an NBTTagCompound from an AttributeModifier
|
* Creates an NBTTagCompound from an AttributeModifier
|
||||||
*/
|
*/
|
||||||
private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier modifier)
|
private static TagObject writeAttributeModifierToNBT(AttributeModifier modifier)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setString("Name", modifier.getName());
|
nbttagcompound.setString("Name", modifier.getName());
|
||||||
nbttagcompound.setDouble("Amount", modifier.getAmount());
|
nbttagcompound.setDouble("Amount", modifier.getAmount());
|
||||||
nbttagcompound.setBool("Multiply", modifier.isMultiplied());
|
nbttagcompound.setBool("Multiply", modifier.isMultiplied());
|
||||||
|
@ -94,11 +94,11 @@ public class Attributes
|
||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setAttributeModifiers(AttributeMap map, NBTTagTagList list)
|
public static void setAttributeModifiers(AttributeMap map, TagObjectList list)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < list.size(); ++i)
|
for (int i = 0; i < list.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = list.get(i);
|
TagObject nbttagcompound = list.get(i);
|
||||||
AttributeInstance iattributeinstance = map.getAttributeInstanceByName(nbttagcompound.getString("Name"));
|
AttributeInstance iattributeinstance = map.getAttributeInstanceByName(nbttagcompound.getString("Name"));
|
||||||
|
|
||||||
if (iattributeinstance != null)
|
if (iattributeinstance != null)
|
||||||
|
@ -112,13 +112,13 @@ public class Attributes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyModifiersToAttributeInstance(AttributeInstance instance, NBTTagCompound compound)
|
private static void applyModifiersToAttributeInstance(AttributeInstance instance, TagObject compound)
|
||||||
{
|
{
|
||||||
instance.setBaseValue(compound.getDouble("Base"));
|
instance.setBaseValue(compound.getDouble("Base"));
|
||||||
|
|
||||||
if (compound.hasTagList("Modifiers"))
|
if (compound.hasTagList("Modifiers"))
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = compound.getTagList("Modifiers");
|
TagObjectList nbttaglist = compound.getTagList("Modifiers");
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -142,7 +142,7 @@ public class Attributes
|
||||||
/**
|
/**
|
||||||
* Creates an AttributeModifier from an NBTTagCompound
|
* Creates an AttributeModifier from an NBTTagCompound
|
||||||
*/
|
*/
|
||||||
public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound compound)
|
public static AttributeModifier readAttributeModifierFromNBT(TagObject compound)
|
||||||
{
|
{
|
||||||
long id = compound.getLong("AttrId");
|
long id = compound.getLong("AttrId");
|
||||||
if(id == 0L)
|
if(id == 0L)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import common.init.Items;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.Transforms;
|
import common.model.Transforms;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.properties.IProperty;
|
import common.properties.IProperty;
|
||||||
import common.properties.PropertyDirection;
|
import common.properties.PropertyDirection;
|
||||||
import common.properties.PropertyInteger;
|
import common.properties.PropertyInteger;
|
||||||
|
@ -125,7 +125,7 @@ public class BlockBanner extends BlockContainer
|
||||||
if (tileentity instanceof TileEntityBanner)
|
if (tileentity instanceof TileEntityBanner)
|
||||||
{
|
{
|
||||||
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor());
|
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor());
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
tileentity.writeToNBT(nbttagcompound);
|
tileentity.writeToNBT(nbttagcompound);
|
||||||
nbttagcompound.remove("x");
|
nbttagcompound.remove("x");
|
||||||
nbttagcompound.remove("y");
|
nbttagcompound.remove("y");
|
||||||
|
@ -151,7 +151,7 @@ public class BlockBanner extends BlockContainer
|
||||||
{
|
{
|
||||||
TileEntityBanner tileentitybanner = (TileEntityBanner)te;
|
TileEntityBanner tileentitybanner = (TileEntityBanner)te;
|
||||||
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)te).getBaseColor());
|
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)te).getBaseColor());
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns());
|
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns());
|
||||||
itemstack.setTagInfo("BlockEntityTag", nbttagcompound);
|
itemstack.setTagInfo("BlockEntityTag", nbttagcompound);
|
||||||
spawnAsEntity(worldIn, pos, itemstack);
|
spawnAsEntity(worldIn, pos, itemstack);
|
||||||
|
|
|
@ -11,9 +11,9 @@ import common.init.BlockRegistry;
|
||||||
import common.init.Blocks;
|
import common.init.Blocks;
|
||||||
import common.init.MetalType;
|
import common.init.MetalType;
|
||||||
import common.init.UniverseRegistry;
|
import common.init.UniverseRegistry;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagStringList;
|
import common.nbt.TagStringList;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.util.Vec3;
|
import common.util.Vec3;
|
||||||
import common.world.State;
|
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);
|
return other == null ? -1 : this.name.compareTo(other.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dimension getByNbt(NBTTagCompound tag) {
|
public static Dimension getByNbt(TagObject tag) {
|
||||||
return getByNbt(tag, true, false, false, false);
|
return getByNbt(tag, true, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dimension getByNbt(NBTTagCompound tag, boolean generator) {
|
public static Dimension getByNbt(TagObject tag, boolean generator) {
|
||||||
return getByNbt(tag, false, generator, !generator, false);
|
return getByNbt(tag, false, generator, !generator, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Dimension getByNbt(NBTTagCompound tag, boolean mapOnly, boolean generator, boolean partialGen, boolean all) {
|
private static Dimension getByNbt(TagObject tag, boolean mapOnly, boolean generator, boolean partialGen, boolean all) {
|
||||||
Dimension dim;
|
Dimension dim;
|
||||||
DimType type = DimType.getByName(tag.getString("Type"));
|
DimType type = DimType.getByName(tag.getString("Type"));
|
||||||
int id = tag.getInt("ID");
|
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) {
|
public final Dimension copy(int id, String name) {
|
||||||
NBTTagCompound tag = this.toNbt(true, false, true);
|
TagObject tag = this.toNbt(true, false, true);
|
||||||
tag.setInt("ID", id);
|
tag.setInt("ID", id);
|
||||||
tag.setString("Name", name);
|
tag.setString("Name", name);
|
||||||
return getByNbt(tag, false, true, false, true);
|
return getByNbt(tag, false, true, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void fromNbt(NBTTagCompound tag) {
|
public final void fromNbt(TagObject tag) {
|
||||||
this.fromNbt(tag, true, false, false);
|
this.fromNbt(tag, true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void fromNbt(NBTTagCompound tag, boolean generator, boolean partialGen, boolean all) {
|
private final void fromNbt(TagObject tag, boolean generator, boolean partialGen, boolean all) {
|
||||||
if(this == Space.INSTANCE) {
|
if(this == Space.INSTANCE) {
|
||||||
if(generator || partialGen)
|
if(generator || partialGen)
|
||||||
this.seed = tag.getLong("Seed");
|
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.alt2 = BlockRegistry.getFromIdName(tag.getString("AltBlock2"), Blocks.sand.getState());
|
||||||
this.caveFiller = BlockRegistry.getFromIdName(tag.getString("CaveFillBlock"), Blocks.lava.getState());
|
this.caveFiller = BlockRegistry.getFromIdName(tag.getString("CaveFillBlock"), Blocks.lava.getState());
|
||||||
if(tag.hasStringList("Layers")) {
|
if(tag.hasStringList("Layers")) {
|
||||||
NBTTagStringList list = tag.getStringList("Layers");
|
TagStringList list = tag.getStringList("Layers");
|
||||||
this.layers = new State[list.size()];
|
this.layers = new State[list.size()];
|
||||||
for(int z = 0; z < this.layers.length; z++) {
|
for(int z = 0; z < this.layers.length; z++) {
|
||||||
this.layers[z] = BlockRegistry.getFromIdName(list.get(z), Blocks.stone.getState());
|
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;
|
this.layers = null;
|
||||||
}
|
}
|
||||||
if(tag.hasStringList("AddBiomes")) {
|
if(tag.hasStringList("AddBiomes")) {
|
||||||
NBTTagStringList list = tag.getStringList("AddBiomes");
|
TagStringList list = tag.getStringList("AddBiomes");
|
||||||
if(list.isEmpty()) {
|
if(list.isEmpty()) {
|
||||||
this.addBiomes = null;
|
this.addBiomes = null;
|
||||||
}
|
}
|
||||||
|
@ -946,7 +946,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
this.addBiomes = null;
|
this.addBiomes = null;
|
||||||
}
|
}
|
||||||
if(tag.hasStringList("FrostBiomes")) {
|
if(tag.hasStringList("FrostBiomes")) {
|
||||||
NBTTagStringList list = tag.getStringList("FrostBiomes");
|
TagStringList list = tag.getStringList("FrostBiomes");
|
||||||
if(list.isEmpty()) {
|
if(list.isEmpty()) {
|
||||||
this.frostBiomes = null;
|
this.frostBiomes = null;
|
||||||
}
|
}
|
||||||
|
@ -961,7 +961,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
this.frostBiomes = null;
|
this.frostBiomes = null;
|
||||||
}
|
}
|
||||||
if(tag.hasStringList("ColdBiomes")) {
|
if(tag.hasStringList("ColdBiomes")) {
|
||||||
NBTTagStringList list = tag.getStringList("ColdBiomes");
|
TagStringList list = tag.getStringList("ColdBiomes");
|
||||||
if(list.isEmpty()) {
|
if(list.isEmpty()) {
|
||||||
this.coldBiomes = null;
|
this.coldBiomes = null;
|
||||||
}
|
}
|
||||||
|
@ -976,7 +976,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
this.coldBiomes = null;
|
this.coldBiomes = null;
|
||||||
}
|
}
|
||||||
if(tag.hasStringList("MediumBiomes")) {
|
if(tag.hasStringList("MediumBiomes")) {
|
||||||
NBTTagStringList list = tag.getStringList("MediumBiomes");
|
TagStringList list = tag.getStringList("MediumBiomes");
|
||||||
if(list.isEmpty()) {
|
if(list.isEmpty()) {
|
||||||
this.mediumBiomes = null;
|
this.mediumBiomes = null;
|
||||||
}
|
}
|
||||||
|
@ -991,7 +991,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
this.mediumBiomes = null;
|
this.mediumBiomes = null;
|
||||||
}
|
}
|
||||||
if(tag.hasStringList("HotBiomes")) {
|
if(tag.hasStringList("HotBiomes")) {
|
||||||
NBTTagStringList list = tag.getStringList("HotBiomes");
|
TagStringList list = tag.getStringList("HotBiomes");
|
||||||
if(list.isEmpty()) {
|
if(list.isEmpty()) {
|
||||||
this.hotBiomes = null;
|
this.hotBiomes = null;
|
||||||
}
|
}
|
||||||
|
@ -1007,9 +1007,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
}
|
}
|
||||||
this.ores.clear();
|
this.ores.clear();
|
||||||
if(tag.hasTagList("Ores")) {
|
if(tag.hasTagList("Ores")) {
|
||||||
NBTTagTagList list = tag.getTagList("Ores");
|
TagObjectList list = tag.getTagList("Ores");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound gen = list.get(z);
|
TagObject gen = list.get(z);
|
||||||
this.ores.add(new Ore(BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
|
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("Count"), gen.getInt("Add"), gen.getInt("Size"),
|
||||||
gen.getInt("MinC"), gen.getInt("MaxS"), gen.getBool("Distrib")));
|
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();
|
this.lakes.clear();
|
||||||
if(tag.hasTagList("Lakes")) {
|
if(tag.hasTagList("Lakes")) {
|
||||||
NBTTagTagList list = tag.getTagList("Lakes");
|
TagObjectList list = tag.getTagList("Lakes");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound gen = list.get(z);
|
TagObject gen = list.get(z);
|
||||||
this.lakes.add(new Lake(
|
this.lakes.add(new Lake(
|
||||||
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
|
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
|
||||||
gen.hasString("Filler") ? BlockRegistry.getFromIdName(gen.getString("Filler"), null) : null,
|
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();
|
this.liquids.clear();
|
||||||
if(tag.hasTagList("Liquids")) {
|
if(tag.hasTagList("Liquids")) {
|
||||||
NBTTagTagList list = tag.getTagList("Liquids");
|
TagObjectList list = tag.getTagList("Liquids");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound gen = list.get(z);
|
TagObject gen = list.get(z);
|
||||||
this.liquids.add(new Liquid(
|
this.liquids.add(new Liquid(
|
||||||
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
|
BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
|
||||||
gen.getInt("Chance"), gen.getInt("Min"), gen.getInt("Max"), gen.getBool("Lower")));
|
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"));
|
this.setStarColor(tag.getInt("StarColor"));
|
||||||
}
|
}
|
||||||
else if(tag.hasTag("StarColorFnc")) {
|
else if(tag.hasTag("StarColorFnc")) {
|
||||||
NBTTagCompound fnc = tag.getTag("StarColorFnc");
|
TagObject fnc = tag.getTag("StarColorFnc");
|
||||||
this.setStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
|
this.setStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
|
||||||
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
|
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"));
|
this.setDeepStarColor(tag.getInt("DStarColor"));
|
||||||
}
|
}
|
||||||
else if(tag.hasTag("DStarColorFnc")) {
|
else if(tag.hasTag("DStarColorFnc")) {
|
||||||
NBTTagCompound fnc = tag.getTag("DStarColorFnc");
|
TagObject fnc = tag.getTag("DStarColorFnc");
|
||||||
this.setDeepStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
|
this.setDeepStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
|
||||||
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
|
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
|
||||||
}
|
}
|
||||||
|
@ -1089,12 +1089,12 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final NBTTagCompound toNbt(boolean generator) {
|
public final TagObject toNbt(boolean generator) {
|
||||||
return this.toNbt(generator, !generator, false);
|
return this.toNbt(generator, !generator, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final NBTTagCompound toNbt(boolean generator, boolean partialGen, boolean all) {
|
private final TagObject toNbt(boolean generator, boolean partialGen, boolean all) {
|
||||||
NBTTagCompound tag = (all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) ? this.toNbt() : new NBTTagCompound();
|
TagObject tag = (all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) ? this.toNbt() : new TagObject();
|
||||||
if(this == Space.INSTANCE) {
|
if(this == Space.INSTANCE) {
|
||||||
if(generator || partialGen)
|
if(generator || partialGen)
|
||||||
tag.setLong("Seed", this.seed);
|
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("AltBlock2", BlockRegistry.toIdName(this.alt2));
|
||||||
tag.setString("CaveFillBlock", BlockRegistry.toIdName(this.caveFiller));
|
tag.setString("CaveFillBlock", BlockRegistry.toIdName(this.caveFiller));
|
||||||
if(this.layers != null) {
|
if(this.layers != null) {
|
||||||
NBTTagStringList list = new NBTTagStringList();
|
TagStringList list = new TagStringList();
|
||||||
for(State gen : this.layers) {
|
for(State gen : this.layers) {
|
||||||
list.add(BlockRegistry.toIdName(gen));
|
list.add(BlockRegistry.toIdName(gen));
|
||||||
}
|
}
|
||||||
tag.setStringList("Layers", list);
|
tag.setStringList("Layers", list);
|
||||||
}
|
}
|
||||||
if(this.addBiomes != null) {
|
if(this.addBiomes != null) {
|
||||||
NBTTagStringList list = new NBTTagStringList();
|
TagStringList list = new TagStringList();
|
||||||
for(Biome biome : this.addBiomes) {
|
for(Biome biome : this.addBiomes) {
|
||||||
list.add(biome.name.toLowerCase());
|
list.add(biome.name.toLowerCase());
|
||||||
}
|
}
|
||||||
tag.setStringList("AddBiomes", list);
|
tag.setStringList("AddBiomes", list);
|
||||||
}
|
}
|
||||||
if(this.frostBiomes != null) {
|
if(this.frostBiomes != null) {
|
||||||
NBTTagStringList list = new NBTTagStringList();
|
TagStringList list = new TagStringList();
|
||||||
for(Biome biome : this.frostBiomes) {
|
for(Biome biome : this.frostBiomes) {
|
||||||
list.add(biome.name.toLowerCase());
|
list.add(biome.name.toLowerCase());
|
||||||
}
|
}
|
||||||
tag.setStringList("FrostBiomes", list);
|
tag.setStringList("FrostBiomes", list);
|
||||||
}
|
}
|
||||||
if(this.coldBiomes != null) {
|
if(this.coldBiomes != null) {
|
||||||
NBTTagStringList list = new NBTTagStringList();
|
TagStringList list = new TagStringList();
|
||||||
for(Biome biome : this.coldBiomes) {
|
for(Biome biome : this.coldBiomes) {
|
||||||
list.add(biome.name.toLowerCase());
|
list.add(biome.name.toLowerCase());
|
||||||
}
|
}
|
||||||
tag.setStringList("ColdBiomes", list);
|
tag.setStringList("ColdBiomes", list);
|
||||||
}
|
}
|
||||||
if(this.mediumBiomes != null) {
|
if(this.mediumBiomes != null) {
|
||||||
NBTTagStringList list = new NBTTagStringList();
|
TagStringList list = new TagStringList();
|
||||||
for(Biome biome : this.mediumBiomes) {
|
for(Biome biome : this.mediumBiomes) {
|
||||||
list.add(biome.name.toLowerCase());
|
list.add(biome.name.toLowerCase());
|
||||||
}
|
}
|
||||||
tag.setStringList("MediumBiomes", list);
|
tag.setStringList("MediumBiomes", list);
|
||||||
}
|
}
|
||||||
if(this.hotBiomes != null) {
|
if(this.hotBiomes != null) {
|
||||||
NBTTagStringList list = new NBTTagStringList();
|
TagStringList list = new TagStringList();
|
||||||
for(Biome biome : this.hotBiomes) {
|
for(Biome biome : this.hotBiomes) {
|
||||||
list.add(biome.name.toLowerCase());
|
list.add(biome.name.toLowerCase());
|
||||||
}
|
}
|
||||||
tag.setStringList("HotBiomes", list);
|
tag.setStringList("HotBiomes", list);
|
||||||
}
|
}
|
||||||
if(!this.ores.isEmpty()) {
|
if(!this.ores.isEmpty()) {
|
||||||
NBTTagTagList list = new NBTTagTagList();
|
TagObjectList list = new TagObjectList();
|
||||||
for(Ore gen : this.ores) {
|
for(Ore gen : this.ores) {
|
||||||
NBTTagCompound ore = new NBTTagCompound();
|
TagObject ore = new TagObject();
|
||||||
ore.setString("Block", BlockRegistry.toIdName(gen.state));
|
ore.setString("Block", BlockRegistry.toIdName(gen.state));
|
||||||
ore.setBool("Distrib", gen.dist);
|
ore.setBool("Distrib", gen.dist);
|
||||||
ore.setInt("Size", gen.size);
|
ore.setInt("Size", gen.size);
|
||||||
|
@ -1215,9 +1215,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
tag.setTagList("Ores", list);
|
tag.setTagList("Ores", list);
|
||||||
}
|
}
|
||||||
if(!this.lakes.isEmpty()) {
|
if(!this.lakes.isEmpty()) {
|
||||||
NBTTagTagList list = new NBTTagTagList();
|
TagObjectList list = new TagObjectList();
|
||||||
for(Lake gen : this.lakes) {
|
for(Lake gen : this.lakes) {
|
||||||
NBTTagCompound lake = new NBTTagCompound();
|
TagObject lake = new TagObject();
|
||||||
lake.setString("Block", BlockRegistry.toIdName(gen.state));
|
lake.setString("Block", BlockRegistry.toIdName(gen.state));
|
||||||
if(gen.filler != null)
|
if(gen.filler != null)
|
||||||
lake.setString("Filler", BlockRegistry.toIdName(gen.filler));
|
lake.setString("Filler", BlockRegistry.toIdName(gen.filler));
|
||||||
|
@ -1232,9 +1232,9 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
tag.setTagList("Lakes", list);
|
tag.setTagList("Lakes", list);
|
||||||
}
|
}
|
||||||
if(!this.liquids.isEmpty()) {
|
if(!this.liquids.isEmpty()) {
|
||||||
NBTTagTagList list = new NBTTagTagList();
|
TagObjectList list = new TagObjectList();
|
||||||
for(Liquid gen : this.liquids) {
|
for(Liquid gen : this.liquids) {
|
||||||
NBTTagCompound liquid = new NBTTagCompound();
|
TagObject liquid = new TagObject();
|
||||||
liquid.setString("Block", BlockRegistry.toIdName(gen.state));
|
liquid.setString("Block", BlockRegistry.toIdName(gen.state));
|
||||||
liquid.setBool("Lower", gen.lower);
|
liquid.setBool("Lower", gen.lower);
|
||||||
liquid.setInt("Chance", gen.chance);
|
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);
|
tag.setInt("StarColor", ((SingleColorGen)this.starColorFunc).color);
|
||||||
}
|
}
|
||||||
else if(this.starColorFunc instanceof SinusColorGen) {
|
else if(this.starColorFunc instanceof SinusColorGen) {
|
||||||
NBTTagCompound fnc = new NBTTagCompound();
|
TagObject fnc = new TagObject();
|
||||||
fnc.setFloat("Period", ((SinusColorGen)this.starColorFunc).period);
|
fnc.setFloat("Period", ((SinusColorGen)this.starColorFunc).period);
|
||||||
fnc.setFloat("Det", ((SinusColorGen)this.starColorFunc).det);
|
fnc.setFloat("Det", ((SinusColorGen)this.starColorFunc).det);
|
||||||
fnc.setFloat("Dist", ((SinusColorGen)this.starColorFunc).dist);
|
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);
|
tag.setInt("DStarColor", ((SingleColorGen)this.deepstarColorFunc).color);
|
||||||
}
|
}
|
||||||
else if(this.deepstarColorFunc instanceof SinusColorGen) {
|
else if(this.deepstarColorFunc instanceof SinusColorGen) {
|
||||||
NBTTagCompound fnc = new NBTTagCompound();
|
TagObject fnc = new TagObject();
|
||||||
fnc.setFloat("Period", ((SinusColorGen)this.deepstarColorFunc).period);
|
fnc.setFloat("Period", ((SinusColorGen)this.deepstarColorFunc).period);
|
||||||
fnc.setFloat("Det", ((SinusColorGen)this.deepstarColorFunc).det);
|
fnc.setFloat("Det", ((SinusColorGen)this.deepstarColorFunc).det);
|
||||||
fnc.setFloat("Dist", ((SinusColorGen)this.deepstarColorFunc).dist);
|
fnc.setFloat("Dist", ((SinusColorGen)this.deepstarColorFunc).dist);
|
||||||
|
@ -1303,8 +1303,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final NBTTagCompound toNbt() {
|
public final TagObject toNbt() {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
TagObject tag = new TagObject();
|
||||||
tag.setInt("ID", this.id);
|
tag.setInt("ID", this.id);
|
||||||
tag.setString("Name", this.name);
|
tag.setString("Name", this.name);
|
||||||
tag.setString("Type", this.getType().getName());
|
tag.setString("Type", this.getType().getName());
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package common.dimension;
|
package common.dimension;
|
||||||
|
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
|
|
||||||
public abstract class Nameable {
|
public abstract class Nameable {
|
||||||
protected String customName = null;
|
protected String customName = null;
|
||||||
|
@ -13,11 +13,11 @@ public abstract class Nameable {
|
||||||
this.customName = name;
|
this.customName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readNbt(NBTTagCompound tag) {
|
public void readNbt(TagObject tag) {
|
||||||
this.customName = tag.hasString("CustomName") ? tag.getString("CustomName") : null;
|
this.customName = tag.hasString("CustomName") ? tag.getString("CustomName") : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeNbt(NBTTagCompound tag) {
|
public void writeNbt(TagObject tag) {
|
||||||
if(this.customName != null)
|
if(this.customName != null)
|
||||||
tag.setString("CustomName", this.customName);
|
tag.setString("CustomName", this.customName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@ import common.entity.types.EntityLiving;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.rng.WeightedList;
|
import common.rng.WeightedList;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class EnchantmentHelper
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = stack.getEnchantmentTagList();
|
TagObjectList nbttaglist = stack.getEnchantmentTagList();
|
||||||
|
|
||||||
if (nbttaglist == null)
|
if (nbttaglist == null)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ public class EnchantmentHelper
|
||||||
public static Map<Integer, Integer> getEnchantments(ItemStack stack)
|
public static Map<Integer, Integer> getEnchantments(ItemStack stack)
|
||||||
{
|
{
|
||||||
Map<Integer, Integer> map = Maps.<Integer, Integer>newLinkedHashMap();
|
Map<Integer, Integer> map = Maps.<Integer, Integer>newLinkedHashMap();
|
||||||
NBTTagTagList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList();
|
TagObjectList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList();
|
||||||
|
|
||||||
if (nbttaglist != null)
|
if (nbttaglist != null)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ public class EnchantmentHelper
|
||||||
*/
|
*/
|
||||||
public static void setEnchantments(Map<Integer, Integer> enchMap, ItemStack stack)
|
public static void setEnchantments(Map<Integer, Integer> enchMap, ItemStack stack)
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
Iterator iterator = enchMap.keySet().iterator();
|
Iterator iterator = enchMap.keySet().iterator();
|
||||||
|
|
||||||
while (iterator.hasNext())
|
while (iterator.hasNext())
|
||||||
|
@ -102,7 +102,7 @@ public class EnchantmentHelper
|
||||||
|
|
||||||
if (enchantment != null)
|
if (enchantment != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setShort("id", (short)i);
|
nbttagcompound.setShort("id", (short)i);
|
||||||
nbttagcompound.setShort("lvl", (short)enchMap.get(i).intValue());
|
nbttagcompound.setShort("lvl", (short)enchMap.get(i).intValue());
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
|
@ -161,7 +161,7 @@ public class EnchantmentHelper
|
||||||
{
|
{
|
||||||
if (stack != null)
|
if (stack != null)
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = stack.getEnchantmentTagList();
|
TagObjectList nbttaglist = stack.getEnchantmentTagList();
|
||||||
|
|
||||||
if (nbttaglist != null)
|
if (nbttaglist != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,9 +27,9 @@ import common.init.UniverseRegistry;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagDoubleList;
|
import common.nbt.TagDoubleList;
|
||||||
import common.nbt.NBTTagFloatList;
|
import common.nbt.TagFloatList;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
|
@ -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
|
* Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their
|
||||||
* riders.
|
* riders.
|
||||||
*/
|
*/
|
||||||
public boolean writeMountToNBT(NBTTagCompound tagCompund)
|
public boolean writeMountToNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
String s = EntityRegistry.getEntityString(this);
|
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
|
* returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their
|
||||||
* rider.
|
* rider.
|
||||||
*/
|
*/
|
||||||
public boolean writeToNBTOptional(NBTTagCompound tagCompund)
|
public boolean writeToNBTOptional(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
String s = EntityRegistry.getEntityString(this);
|
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)
|
* Save the entity to NBT (calls an abstract helper method to write extra data)
|
||||||
*/
|
*/
|
||||||
public void writeToNBT(NBTTagCompound tagCompund)
|
public void writeToNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
// if(this.persistentId != 0L) {
|
// if(this.persistentId != 0L) {
|
||||||
// tagCompund.setLong("PersistID", this.persistentId);
|
// tagCompund.setLong("PersistID", this.persistentId);
|
||||||
|
@ -1525,7 +1525,7 @@ public abstract class Entity
|
||||||
|
|
||||||
if (this.vehicle != null && !(this.isPlayer()))
|
if (this.vehicle != null && !(this.isPlayer()))
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
|
|
||||||
if (this.vehicle.writeMountToNBT(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)
|
* Reads the entity from NBT (calls an abstract helper method to read specialized data)
|
||||||
*/
|
*/
|
||||||
public void readFromNBT(NBTTagCompound tagCompund)
|
public void readFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
// if(tagCompund.hasLong("PersistID"))
|
// if(tagCompund.hasLong("PersistID"))
|
||||||
// this.setPersistentId(tagCompund.getLong("PersistID"));
|
// this.setPersistentId(tagCompund.getLong("PersistID"));
|
||||||
// this.setTag(tagCompund.getString("ObjectTag"));
|
// this.setTag(tagCompund.getString("ObjectTag"));
|
||||||
|
|
||||||
NBTTagDoubleList nbttaglist = tagCompund.getDoubleList("Pos");
|
TagDoubleList nbttaglist = tagCompund.getDoubleList("Pos");
|
||||||
NBTTagDoubleList nbttaglist1 = tagCompund.getDoubleList("Motion");
|
TagDoubleList nbttaglist1 = tagCompund.getDoubleList("Motion");
|
||||||
NBTTagFloatList nbttaglist2 = tagCompund.getFloatList("Rotation");
|
TagFloatList nbttaglist2 = tagCompund.getFloatList("Rotation");
|
||||||
this.motionX = nbttaglist1.get(0);
|
this.motionX = nbttaglist1.get(0);
|
||||||
this.motionY = nbttaglist1.get(1);
|
this.motionY = nbttaglist1.get(1);
|
||||||
this.motionZ = nbttaglist1.get(2);
|
this.motionZ = nbttaglist1.get(2);
|
||||||
|
@ -1614,12 +1614,12 @@ public abstract class Entity
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected abstract void readEntityFromNBT(NBTTagCompound tagCompund);
|
protected abstract void readEntityFromNBT(TagObject tagCompund);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected abstract void writeEntityToNBT(NBTTagCompound tagCompound);
|
protected abstract void writeEntityToNBT(TagObject tagCompound);
|
||||||
|
|
||||||
public void onChunkLoad()
|
public void onChunkLoad()
|
||||||
{
|
{
|
||||||
|
@ -1628,9 +1628,9 @@ public abstract class Entity
|
||||||
/**
|
/**
|
||||||
* creates a NBT list from the array of doubles passed to this function
|
* creates a NBT list from the array of doubles passed to this function
|
||||||
*/
|
*/
|
||||||
protected NBTTagDoubleList newDoubleNBTList(double... numbers)
|
protected TagDoubleList newDoubleNBTList(double... numbers)
|
||||||
{
|
{
|
||||||
NBTTagDoubleList nbttaglist = new NBTTagDoubleList();
|
TagDoubleList nbttaglist = new TagDoubleList();
|
||||||
|
|
||||||
for (double d0 : numbers)
|
for (double d0 : numbers)
|
||||||
{
|
{
|
||||||
|
@ -1643,9 +1643,9 @@ public abstract class Entity
|
||||||
/**
|
/**
|
||||||
* Returns a new NBTTagList filled with the specified floats
|
* Returns a new NBTTagList filled with the specified floats
|
||||||
*/
|
*/
|
||||||
protected NBTTagFloatList newFloatNBTList(float... numbers)
|
protected TagFloatList newFloatNBTList(float... numbers)
|
||||||
{
|
{
|
||||||
NBTTagFloatList nbttaglist = new NBTTagFloatList();
|
TagFloatList nbttaglist = new TagFloatList();
|
||||||
|
|
||||||
for (float f : numbers)
|
for (float f : numbers)
|
||||||
{
|
{
|
||||||
|
@ -2350,7 +2350,7 @@ public abstract class Entity
|
||||||
*/
|
*/
|
||||||
public void copyDataFromOld(Entity entityIn)
|
public void copyDataFromOld(Entity entityIn)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
entityIn.writeToNBT(nbttagcompound);
|
entityIn.writeToNBT(nbttagcompound);
|
||||||
this.readFromNBT(nbttagcompound);
|
this.readFromNBT(nbttagcompound);
|
||||||
// this.portalTimer = entityIn.portalTimer;
|
// this.portalTimer = entityIn.portalTimer;
|
||||||
|
@ -2612,7 +2612,7 @@ public abstract class Entity
|
||||||
return new BlockPos(this.posX, this.posY + 0.5D, this.posZ);
|
return new BlockPos(this.posX, this.posY + 0.5D, this.posZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound getNBTTagCompound()
|
public TagObject getNBTTagCompound()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -2620,7 +2620,7 @@ public abstract class Entity
|
||||||
/**
|
/**
|
||||||
* Called when client receives entity's NBTTagCompound from server.
|
* Called when client receives entity's NBTTagCompound from server.
|
||||||
*/
|
*/
|
||||||
public void clientUpdateEntityNBT(NBTTagCompound compound)
|
public void clientUpdateEntityNBT(TagObject compound)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import common.entity.projectile.EntityArrow;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.network.Packet;
|
import common.network.Packet;
|
||||||
import common.packet.SPacketEntityRelMove;
|
import common.packet.SPacketEntityRelMove;
|
||||||
import common.packet.SPacketEntityLook;
|
import common.packet.SPacketEntityLook;
|
||||||
|
@ -296,7 +296,7 @@ public class EntityTrackerEntry {
|
||||||
.sendPacket(new SPacketEntityMetadata(this.trackedEntity.getId(), this.trackedEntity.getDataWatcher(), true));
|
.sendPacket(new SPacketEntityMetadata(this.trackedEntity.getId(), this.trackedEntity.getDataWatcher(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound nbttagcompound = this.trackedEntity.getNBTTagCompound();
|
TagObject nbttagcompound = this.trackedEntity.getNBTTagCompound();
|
||||||
|
|
||||||
if(nbttagcompound != null) {
|
if(nbttagcompound != null) {
|
||||||
playerMP.connection.sendPacket(new SPacketUpdateEntityNBT(this.trackedEntity.getId(), nbttagcompound));
|
playerMP.connection.sendPacket(new SPacketUpdateEntityNBT(this.trackedEntity.getId(), nbttagcompound));
|
||||||
|
|
|
@ -8,7 +8,7 @@ import common.entity.npc.Alignment;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -248,7 +248,7 @@ public class EntityBat extends EntityLiving
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.dataWatcher.updateObject(16, Byte.valueOf(tagCompund.getByte("BatFlags")));
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16));
|
tagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16));
|
||||||
|
|
|
@ -17,7 +17,7 @@ import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ public class EntityChicken extends EntityAnimal
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.chickenJockey = tagCompund.getBool("IsChickenJockey");
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setBool("IsChickenJockey", this.chickenJockey);
|
tagCompound.setBool("IsChickenJockey", this.chickenJockey);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import common.entity.DamageSource;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.EntityType;
|
import common.entity.EntityType;
|
||||||
import common.entity.types.IEntityMultiPart;
|
import common.entity.types.IEntityMultiPart;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
|
|
||||||
public class EntityDragonPart extends Entity
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ import common.item.Item;
|
||||||
import common.item.ItemMonsterPlacer;
|
import common.item.ItemMonsterPlacer;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.potion.Potion;
|
import common.potion.Potion;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
|
@ -1387,7 +1387,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setBool("EatingHaystack", this.isEatingHaystack());
|
tagCompound.setBool("EatingHaystack", this.isEatingHaystack());
|
||||||
|
@ -1402,7 +1402,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
||||||
|
|
||||||
if (this.isChested())
|
if (this.isChested())
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (int i = 2; i < this.horseChest.getSizeInventory(); ++i)
|
for (int i = 2; i < this.horseChest.getSizeInventory(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -1410,7 +1410,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
||||||
|
|
||||||
if (itemstack != null)
|
if (itemstack != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setByte("Slot", (byte)i);
|
nbttagcompound.setByte("Slot", (byte)i);
|
||||||
itemstack.writeToNBT(nbttagcompound);
|
itemstack.writeToNBT(nbttagcompound);
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
|
@ -1422,19 +1422,19 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
||||||
|
|
||||||
if (this.horseChest.getStackInSlot(1) != null)
|
if (this.horseChest.getStackInSlot(1) != null)
|
||||||
{
|
{
|
||||||
tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound()));
|
tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new TagObject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.horseChest.getStackInSlot(0) != null)
|
if (this.horseChest.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound()));
|
tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new TagObject()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setEatingHaystack(tagCompund.getBool("EatingHaystack"));
|
this.setEatingHaystack(tagCompund.getBool("EatingHaystack"));
|
||||||
|
@ -1466,12 +1466,12 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
|
||||||
|
|
||||||
if (this.isChested())
|
if (this.isChested())
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = tagCompund.getTagList("Items");
|
TagObjectList nbttaglist = tagCompund.getTagList("Items");
|
||||||
this.initHorseChest();
|
this.initHorseChest();
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = nbttaglist.get(i);
|
TagObject nbttagcompound = nbttaglist.get(i);
|
||||||
int j = nbttagcompound.getByte("Slot") & 255;
|
int j = nbttagcompound.getByte("Slot") & 255;
|
||||||
|
|
||||||
if (j >= 2 && j < this.horseChest.getSizeInventory())
|
if (j >= 2 && j < this.horseChest.getSizeInventory())
|
||||||
|
|
|
@ -26,7 +26,7 @@ import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public class EntityOcelot extends EntityTameable
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("CatType", this.getTameSkin());
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setTameSkin(tagCompund.getInt("CatType"));
|
this.setTameSkin(tagCompund.getInt("CatType"));
|
||||||
|
|
|
@ -17,7 +17,7 @@ import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public class EntityPig extends EntityAnimal
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setBool("Saddle", this.getSaddled());
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setSaddled(tagCompund.getBool("Saddle"));
|
this.setSaddled(tagCompund.getBool("Saddle"));
|
||||||
|
|
|
@ -33,7 +33,7 @@ import common.init.SoundEvent;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.pathfinding.PathEntity;
|
import common.pathfinding.PathEntity;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.potion.Potion;
|
import common.potion.Potion;
|
||||||
|
@ -198,13 +198,13 @@ public class EntityRabbit extends EntityAnimal {
|
||||||
this.getEntityAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);
|
this.getEntityAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound) {
|
public void writeEntityToNBT(TagObject tagCompound) {
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("RabbitType", this.getRabbitType());
|
tagCompound.setInt("RabbitType", this.getRabbitType());
|
||||||
tagCompound.setInt("MoreCarrotTicks", this.foodCooldown);
|
tagCompound.setInt("MoreCarrotTicks", this.foodCooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund) {
|
public void readEntityFromNBT(TagObject tagCompund) {
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setRabbitType(tagCompund.getInt("RabbitType"));
|
this.setRabbitType(tagCompund.getInt("RabbitType"));
|
||||||
this.foodCooldown = tagCompund.getInt("MoreCarrotTicks");
|
this.foodCooldown = tagCompund.getInt("MoreCarrotTicks");
|
||||||
|
|
|
@ -29,7 +29,7 @@ import common.inventory.InventoryCrafting;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemShears;
|
import common.item.ItemShears;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
@ -210,7 +210,7 @@ public class EntitySheep extends EntityAnimal
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setBool("Sheared", this.getSheared());
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setSheared(tagCompund.getBool("Sheared"));
|
this.setSheared(tagCompund.getBool("Sheared"));
|
||||||
|
|
|
@ -31,7 +31,7 @@ import common.item.Item;
|
||||||
import common.item.ItemFood;
|
import common.item.ItemFood;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -139,7 +139,7 @@ public class EntityWolf extends EntityTameable
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setBool("Angry", this.isAngry());
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setAngry(tagCompund.getBool("Angry"));
|
this.setAngry(tagCompund.getBool("Angry"));
|
||||||
|
|
|
@ -15,7 +15,7 @@ import common.init.ItemRegistry;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
@ -501,14 +501,14 @@ public class EntityBoat extends Entity
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import common.init.Config;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.tileentity.IWorldNameable;
|
import common.tileentity.IWorldNameable;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
if (tagCompund.getBool("CustomDisplayTile"))
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
if (this.hasDisplayTile())
|
if (this.hasDisplayTile())
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,8 +7,8 @@ import common.init.Config;
|
||||||
import common.inventory.Container;
|
import common.inventory.Container;
|
||||||
import common.inventory.InventoryHelper;
|
import common.inventory.InventoryHelper;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.tileentity.ILockableContainer;
|
import common.tileentity.ILockableContainer;
|
||||||
import common.tileentity.LockCode;
|
import common.tileentity.LockCode;
|
||||||
import common.util.BlockPos;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (int i = 0; i < this.minecartContainerItems.length; ++i)
|
for (int i = 0; i < this.minecartContainerItems.length; ++i)
|
||||||
{
|
{
|
||||||
if (this.minecartContainerItems[i] != null)
|
if (this.minecartContainerItems[i] != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setByte("Slot", (byte)i);
|
nbttagcompound.setByte("Slot", (byte)i);
|
||||||
this.minecartContainerItems[i].writeToNBT(nbttagcompound);
|
this.minecartContainerItems[i].writeToNBT(nbttagcompound);
|
||||||
nbttaglist.add(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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
NBTTagTagList nbttaglist = tagCompund.getTagList("Items");
|
TagObjectList nbttaglist = tagCompund.getTagList("Items");
|
||||||
this.minecartContainerItems = new ItemStack[this.getSizeInventory()];
|
this.minecartContainerItems = new ItemStack[this.getSizeInventory()];
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = nbttaglist.get(i);
|
TagObject nbttagcompound = nbttaglist.get(i);
|
||||||
int j = nbttagcompound.getByte("Slot") & 255;
|
int j = nbttagcompound.getByte("Slot") & 255;
|
||||||
|
|
||||||
if (j >= 0 && j < this.minecartContainerItems.length)
|
if (j >= 0 && j < this.minecartContainerItems.length)
|
||||||
|
|
|
@ -3,7 +3,7 @@ package common.entity.item;
|
||||||
import common.entity.DamageSource;
|
import common.entity.DamageSource;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.EntityType;
|
import common.entity.EntityType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public class EntityCrystal extends Entity
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package common.entity.item;
|
||||||
|
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.EntityType;
|
import common.entity.EntityType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.Explosion;
|
import common.world.Explosion;
|
||||||
import common.world.World;
|
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);
|
Explosion.doExplosionAlgo3(this.worldObj, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, this.rand, min + 6.0d, min);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setInt("Progress", this.progress);
|
tagCompound.setInt("Progress", this.progress);
|
||||||
tagCompound.setInt("Radius", this.radius);
|
tagCompound.setInt("Radius", this.radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.progress = tagCompund.getInt("Progress");
|
this.progress = tagCompund.getInt("Progress");
|
||||||
this.radius = tagCompund.getInt("Radius");
|
this.radius = tagCompund.getInt("Radius");
|
||||||
|
|
|
@ -15,8 +15,8 @@ import common.init.BlockRegistry;
|
||||||
import common.init.Blocks;
|
import common.init.Blocks;
|
||||||
import common.init.Config;
|
import common.init.Config;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTBase;
|
import common.nbt.Tag;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.tileentity.TileEntity;
|
import common.tileentity.TileEntity;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
@ -33,7 +33,7 @@ public class EntityFalling extends Entity implements IObjectData
|
||||||
private boolean hurtEntities;
|
private boolean hurtEntities;
|
||||||
private int fallHurtMax = 40;
|
private int fallHurtMax = 40;
|
||||||
private float fallHurtAmount = 2.0F;
|
private float fallHurtAmount = 2.0F;
|
||||||
public NBTTagCompound tileEntityData;
|
public TagObject tileEntityData;
|
||||||
|
|
||||||
public EntityFalling(World worldIn)
|
public EntityFalling(World worldIn)
|
||||||
{
|
{
|
||||||
|
@ -148,12 +148,12 @@ public class EntityFalling extends Entity implements IObjectData
|
||||||
|
|
||||||
if (tileentity != null)
|
if (tileentity != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
tileentity.writeToNBT(nbttagcompound);
|
tileentity.writeToNBT(nbttagcompound);
|
||||||
|
|
||||||
for (String s : this.tileEntityData.getKeySet())
|
for (String s : this.tileEntityData.getKeySet())
|
||||||
{
|
{
|
||||||
NBTBase nbtbase = this.tileEntityData.get(s);
|
Tag nbtbase = this.tileEntityData.get(s);
|
||||||
|
|
||||||
if (!s.equals("x") && !s.equals("y") && !s.equals("z"))
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air;
|
Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air;
|
||||||
String resourcelocation = BlockRegistry.REGISTRY.getNameForObject(block);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
int i = tagCompund.getByte("Data") & 255;
|
int i = tagCompund.getByte("Data") & 255;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import common.entity.EntityType;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.AWorldClient;
|
import common.world.AWorldClient;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -51,8 +51,8 @@ public class EntityFireworks extends Entity
|
||||||
if (givenItem != null && givenItem.hasTagCompound())
|
if (givenItem != null && givenItem.hasTagCompound())
|
||||||
{
|
{
|
||||||
this.dataWatcher.updateObject(8, givenItem);
|
this.dataWatcher.updateObject(8, givenItem);
|
||||||
NBTTagCompound nbttagcompound = givenItem.getTagCompound();
|
TagObject nbttagcompound = givenItem.getTagCompound();
|
||||||
NBTTagCompound nbttagcompound1 = nbttagcompound.getTag("Fireworks");
|
TagObject nbttagcompound1 = nbttagcompound.getTag("Fireworks");
|
||||||
|
|
||||||
if (nbttagcompound1 != null)
|
if (nbttagcompound1 != null)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@ public class EntityFireworks extends Entity
|
||||||
if (id == 17 && this.worldObj.client)
|
if (id == 17 && this.worldObj.client)
|
||||||
{
|
{
|
||||||
ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8);
|
ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8);
|
||||||
NBTTagCompound nbttagcompound = null;
|
TagObject nbttagcompound = null;
|
||||||
|
|
||||||
if (itemstack != null && itemstack.hasTagCompound())
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setInt("Life", this.fireworkAge);
|
tagCompound.setInt("Life", this.fireworkAge);
|
||||||
tagCompound.setInt("LifeTime", this.lifetime);
|
tagCompound.setInt("LifeTime", this.lifetime);
|
||||||
|
@ -175,7 +175,7 @@ public class EntityFireworks extends Entity
|
||||||
|
|
||||||
if (itemstack != null)
|
if (itemstack != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
itemstack.writeToNBT(nbttagcompound);
|
itemstack.writeToNBT(nbttagcompound);
|
||||||
tagCompound.setTag("FireworksItem", 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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.fireworkAge = tagCompund.getInt("Life");
|
this.fireworkAge = tagCompund.getInt("Life");
|
||||||
this.lifetime = tagCompund.getInt("LifeTime");
|
this.lifetime = tagCompund.getInt("LifeTime");
|
||||||
NBTTagCompound nbttagcompound = tagCompund.getTag("FireworksItem");
|
TagObject nbttagcompound = tagCompund.getTag("FireworksItem");
|
||||||
|
|
||||||
if (nbttagcompound != null)
|
if (nbttagcompound != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ import common.init.ItemRegistry;
|
||||||
import common.inventory.Container;
|
import common.inventory.Container;
|
||||||
import common.inventory.ContainerHopper;
|
import common.inventory.ContainerHopper;
|
||||||
import common.inventory.InventoryPlayer;
|
import common.inventory.InventoryPlayer;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.tileentity.IHopper;
|
import common.tileentity.IHopper;
|
||||||
import common.tileentity.TileEntityHopper;
|
import common.tileentity.TileEntityHopper;
|
||||||
import common.util.BlockPos;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("TransferCooldown", this.transferTicker);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.transferTicker = tagCompund.getInt("TransferCooldown");
|
this.transferTicker = tagCompund.getInt("TransferCooldown");
|
||||||
|
|
|
@ -14,7 +14,7 @@ import common.init.SoundEvent;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.util.PortalType;
|
import common.util.PortalType;
|
||||||
|
@ -342,7 +342,7 @@ public class EntityItem extends Entity
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setShort("Health", (short)((byte)this.health));
|
tagCompound.setShort("Health", (short)((byte)this.health));
|
||||||
tagCompound.setShort("Age", (short)this.age);
|
tagCompound.setShort("Age", (short)this.age);
|
||||||
|
@ -360,14 +360,14 @@ public class EntityItem extends Entity
|
||||||
|
|
||||||
if (this.getEntityItem() != null)
|
if (this.getEntityItem() != null)
|
||||||
{
|
{
|
||||||
tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound()));
|
tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new TagObject()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.health = tagCompund.getShort("Health") & 255;
|
this.health = tagCompund.getShort("Health") & 255;
|
||||||
this.age = tagCompund.getShort("Age");
|
this.age = tagCompund.getShort("Age");
|
||||||
|
@ -384,7 +384,7 @@ public class EntityItem extends Entity
|
||||||
// this.thrower = tagCompund.getString("Thrower");
|
// this.thrower = tagCompund.getString("Thrower");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
NBTTagCompound nbttagcompound = tagCompund.getTag("Item");
|
TagObject nbttagcompound = tagCompund.getTag("Item");
|
||||||
this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound));
|
this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound));
|
||||||
|
|
||||||
if (this.getEntityItem() == null)
|
if (this.getEntityItem() == null)
|
||||||
|
|
|
@ -9,7 +9,7 @@ import common.entity.types.EntityLiving;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
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
|
* returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their
|
||||||
* rider.
|
* rider.
|
||||||
*/
|
*/
|
||||||
public boolean writeToNBTOptional(NBTTagCompound tagCompund)
|
public boolean writeToNBTOptional(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -383,14 +383,14 @@ public class EntityLeashKnot extends Entity
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package common.entity.item;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.EntityType;
|
import common.entity.EntityType;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public class EntityNuke extends Entity
|
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);
|
// Explosion.doExplosionAlgo3(this.worldObj, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, this.rand, min + 6.0d, min);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setInt("Fuse", this.fuse);
|
tagCompound.setInt("Fuse", this.fuse);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.fuse = tagCompund.getInt("Fuse");
|
this.fuse = tagCompund.getInt("Fuse");
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import common.entity.EntityType;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.entity.types.IObjectData;
|
import common.entity.types.IObjectData;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public class EntityTnt extends Entity implements IObjectData
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setByte("Fuse", (byte)this.fuse);
|
tagCompound.setByte("Fuse", (byte)this.fuse);
|
||||||
tagCompound.setByte("Power", (byte)this.explosionSize);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.fuse = tagCompund.getByte("Fuse");
|
this.fuse = tagCompund.getByte("Fuse");
|
||||||
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;
|
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import common.init.Config;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.world.Explosion;
|
import common.world.Explosion;
|
||||||
import common.world.State;
|
import common.world.State;
|
||||||
|
@ -206,7 +206,7 @@ public class EntityTntCart extends EntityCart
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
protected void readEntityFromNBT(NBTTagCompound tagCompund)
|
protected void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.minecartTNTFuse = tagCompund.getInt("TNTFuse");
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
protected void writeEntityToNBT(NBTTagCompound tagCompound)
|
protected void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("TNTFuse", this.minecartTNTFuse);
|
tagCompound.setInt("TNTFuse", this.minecartTNTFuse);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import common.entity.types.IObjectData;
|
||||||
import common.init.Config;
|
import common.init.Config;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.util.PortalType;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setShort("Health", (short)((byte)this.xpOrbHealth));
|
tagCompound.setShort("Health", (short)((byte)this.xpOrbHealth));
|
||||||
tagCompound.setShort("Age", (short)this.xpOrbAge);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.xpOrbHealth = tagCompund.getShort("Health") & 255;
|
this.xpOrbHealth = tagCompund.getShort("Health") & 255;
|
||||||
this.xpOrbAge = tagCompund.getShort("Age");
|
this.xpOrbAge = tagCompund.getShort("Age");
|
||||||
|
|
|
@ -6,7 +6,7 @@ import common.entity.DamageSource;
|
||||||
import common.init.Config;
|
import common.init.Config;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ public class EntityGargoyle extends EntityFlyingNPC
|
||||||
this.dataWatcher.addObject(23, 0);
|
this.dataWatcher.addObject(23, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("Invul", this.getInvulTime());
|
tagCompound.setInt("Invul", this.getInvulTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setInvulTime(tagCompund.getInt("Invul"));
|
this.setInvulTime(tagCompund.getInt("Invul"));
|
||||||
|
|
|
@ -9,7 +9,7 @@ import common.init.Config;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
import common.world.AWorldServer;
|
import common.world.AWorldServer;
|
||||||
|
@ -58,7 +58,7 @@ public class EntityHaunter extends EntityNPC {
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public class EntityHaunter extends EntityNPC {
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setCharged(tagCompund.getBool("Charge"));
|
this.setCharged(tagCompund.getBool("Charge"));
|
||||||
|
|
|
@ -6,7 +6,7 @@ import common.attributes.Attributes;
|
||||||
import common.entity.DamageSource;
|
import common.entity.DamageSource;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public abstract class EntityMobNPC extends EntityNPC
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setShort("Anger", (short)this.angerLevel);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.angerLevel = tagCompund.getShort("Anger");
|
this.angerLevel = tagCompund.getShort("Anger");
|
||||||
|
|
|
@ -67,8 +67,8 @@ import common.item.ItemStack;
|
||||||
import common.item.ItemSword;
|
import common.item.ItemSword;
|
||||||
import common.item.ItemTool;
|
import common.item.ItemTool;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.network.IClientPlayer;
|
import common.network.IClientPlayer;
|
||||||
import common.network.IPlayer;
|
import common.network.IPlayer;
|
||||||
import common.packet.CPacketPlayerPosition;
|
import common.packet.CPacketPlayerPosition;
|
||||||
|
@ -3380,7 +3380,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
// super.readEntityFromNBT(tagCompund);
|
// super.readEntityFromNBT(tagCompund);
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
|
@ -3390,7 +3390,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(tagCompund.hasTagList("Equipment")) {
|
if(tagCompund.hasTagList("Equipment")) {
|
||||||
NBTTagTagList nbttaglist = tagCompund.getTagList("Equipment");
|
TagObjectList nbttaglist = tagCompund.getTagList("Equipment");
|
||||||
|
|
||||||
for(int i = 0; i < this.equipment.length; ++i) {
|
for(int i = 0; i < this.equipment.length; ++i) {
|
||||||
this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.get(i));
|
this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.get(i));
|
||||||
|
@ -3423,7 +3423,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
this.setNpcClass(type);
|
this.setNpcClass(type);
|
||||||
this.setHeight(tagCompund.hasFloat("Height") ? tagCompund.getFloat("Height") : this.getBaseSize());
|
this.setHeight(tagCompund.hasFloat("Height") ? tagCompund.getFloat("Height") : this.getBaseSize());
|
||||||
|
|
||||||
NBTTagTagList nbttaglist = tagCompund.getTagList("Items");
|
TagObjectList nbttaglist = tagCompund.getTagList("Items");
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -3448,7 +3448,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
|
|
||||||
if(this.isPlayer()) {
|
if(this.isPlayer()) {
|
||||||
// this.entityUniqueID = getOfflineUUID(this.user);
|
// this.entityUniqueID = getOfflineUUID(this.user);
|
||||||
NBTTagTagList nbttaglist0 = tagCompund.getTagList("Inventory");
|
TagObjectList nbttaglist0 = tagCompund.getTagList("Inventory");
|
||||||
this.inventory.readFromNBT(nbttaglist0);
|
this.inventory.readFromNBT(nbttaglist0);
|
||||||
this.inventory.currentItem = tagCompund.getInt("SelectedItemSlot");
|
this.inventory.currentItem = tagCompund.getInt("SelectedItemSlot");
|
||||||
// this.sleeping = tagCompund.getBoolean("Sleeping");
|
// this.sleeping = tagCompund.getBoolean("Sleeping");
|
||||||
|
@ -3497,7 +3497,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
|
|
||||||
if (tagCompund.hasTagList("WarpItems"))
|
if (tagCompund.hasTagList("WarpItems"))
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist1 = tagCompund.getTagList("WarpItems");
|
TagObjectList nbttaglist1 = tagCompund.getTagList("WarpItems");
|
||||||
this.warpChest.loadInventoryFromNBT(nbttaglist1);
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
if(this.isPlayer()) {
|
if(this.isPlayer()) {
|
||||||
for (int z = 0; z < this.inventory.mainInventory.length; z++)
|
for (int z = 0; z < this.inventory.mainInventory.length; z++)
|
||||||
|
@ -3534,10 +3534,10 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
|
|
||||||
// tagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot());
|
// tagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot());
|
||||||
NBTTagTagList nbttaglist0 = new NBTTagTagList();
|
TagObjectList nbttaglist0 = new TagObjectList();
|
||||||
|
|
||||||
for(int i = 0; i < this.equipment.length; ++i) {
|
for(int i = 0; i < this.equipment.length; ++i) {
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
|
|
||||||
if(this.equipment[i] != null) {
|
if(this.equipment[i] != null) {
|
||||||
this.equipment[i].writeToNBT(nbttagcompound);
|
this.equipment[i].writeToNBT(nbttagcompound);
|
||||||
|
@ -3559,7 +3559,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
if(type != null)
|
if(type != null)
|
||||||
tagCompound.setString("ClassType", this.species.classnames.inverse().get(type));
|
tagCompound.setString("ClassType", this.species.classnames.inverse().get(type));
|
||||||
|
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (int i = 0; i < this.extraInventory.getSizeInventory(); ++i)
|
for (int i = 0; i < this.extraInventory.getSizeInventory(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -3567,7 +3567,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
|
|
||||||
if (itemstack != null)
|
if (itemstack != null)
|
||||||
{
|
{
|
||||||
nbttaglist.add(itemstack.writeToNBT(new NBTTagCompound()));
|
nbttaglist.add(itemstack.writeToNBT(new TagObject()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3587,7 +3587,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
this.getAttributeMap().applyAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.stackSize);
|
this.getAttributeMap().applyAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.stackSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tagCompound.setTagList("Inventory", this.inventory.writeToNBT(new NBTTagTagList()));
|
tagCompound.setTagList("Inventory", this.inventory.writeToNBT(new TagObjectList()));
|
||||||
tagCompound.setInt("SelectedItemSlot", this.inventory.currentItem);
|
tagCompound.setInt("SelectedItemSlot", this.inventory.currentItem);
|
||||||
// tagCompound.setBoolean("Sleeping", this.sleeping);
|
// tagCompound.setBoolean("Sleeping", this.sleeping);
|
||||||
// tagCompound.setShort("SleepTimer", (short)this.sleepTimer);
|
// tagCompound.setShort("SleepTimer", (short)this.sleepTimer);
|
||||||
|
@ -3629,7 +3629,7 @@ public abstract class EntityNPC extends EntityLiving
|
||||||
|
|
||||||
if (itemstack != null && itemstack.getItem() != null)
|
if (itemstack != null && itemstack.getItem() != null)
|
||||||
{
|
{
|
||||||
tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new NBTTagCompound()));
|
tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new TagObject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// tagCompound.setString("Model", this.getModel().name);
|
// tagCompound.setString("Model", this.getModel().name);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import common.entity.types.EntityLiving;
|
||||||
import common.init.Config;
|
import common.init.Config;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.pathfinding.PathNavigateGround;
|
import common.pathfinding.PathNavigateGround;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
|
@ -134,7 +134,7 @@ public class EntitySlime extends EntityNPC
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
// tagCompound.setInteger("Size", this.getSlimeSize() - 1);
|
// 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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
// int i = tagCompund.getInteger("Size");
|
// int i = tagCompund.getInteger("Size");
|
||||||
|
|
|
@ -18,7 +18,7 @@ import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setShort("xTile", (short)this.xTile);
|
tagCompound.setShort("xTile", (short)this.xTile);
|
||||||
tagCompound.setShort("yTile", (short)this.yTile);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.xTile = tagCompund.getShort("xTile");
|
this.xTile = tagCompund.getShort("xTile");
|
||||||
this.yTile = tagCompund.getShort("yTile");
|
this.yTile = tagCompund.getShort("yTile");
|
||||||
|
|
|
@ -11,7 +11,7 @@ import common.entity.types.IObjectData;
|
||||||
import common.entity.types.IProjectile;
|
import common.entity.types.IProjectile;
|
||||||
import common.init.Config;
|
import common.init.Config;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.util.HitPosition;
|
import common.util.HitPosition;
|
||||||
|
@ -347,13 +347,13 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData
|
||||||
// this.doBlockCollisions();
|
// this.doBlockCollisions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setInt("damage", this.damage);
|
tagCompound.setInt("damage", this.damage);
|
||||||
tagCompound.setInt("age", this.age);
|
tagCompound.setInt("age", this.age);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.damage = tagCompund.getInt("damage");
|
this.damage = tagCompund.getInt("damage");
|
||||||
this.age = tagCompund.getInt("age");
|
this.age = tagCompund.getInt("age");
|
||||||
|
|
|
@ -9,7 +9,7 @@ import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemDie;
|
import common.item.ItemDie;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.HitPosition;
|
import common.util.HitPosition;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public class EntityDie extends EntityThrowable implements IObjectData
|
||||||
return this.dataWatcher.getWatchableObjectInt(16);
|
return this.dataWatcher.getWatchableObjectInt(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("Sides", this.sides);
|
tagCompound.setInt("Sides", this.sides);
|
||||||
|
@ -72,7 +72,7 @@ public class EntityDie extends EntityThrowable implements IObjectData
|
||||||
tagCompound.setBool("NoPickup", this.noPickup);
|
tagCompound.setBool("NoPickup", this.noPickup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.sides = tagCompund.getInt("Sides");
|
this.sides = tagCompund.getInt("Sides");
|
||||||
|
|
|
@ -9,7 +9,7 @@ import common.init.Config;
|
||||||
import common.init.ItemRegistry;
|
import common.init.ItemRegistry;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.HitPosition;
|
import common.util.HitPosition;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -59,13 +59,13 @@ public class EntityDynamite extends EntityThrowable implements IObjectData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setByte("Power", (byte)this.explosionSize);
|
tagCompound.setByte("Power", (byte)this.explosionSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;
|
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;
|
||||||
|
|
|
@ -3,7 +3,7 @@ package common.entity.projectile;
|
||||||
import common.entity.DamageSource;
|
import common.entity.DamageSource;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.init.Config;
|
import common.init.Config;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.HitPosition;
|
import common.util.HitPosition;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class EntityFireball extends EntityProjectile
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("ExplosionPower", this.explosionPower);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.explosionPower = tagCompund.getInt("ExplosionPower");
|
this.explosionPower = tagCompund.getInt("ExplosionPower");
|
||||||
|
|
|
@ -18,7 +18,7 @@ import common.init.Items;
|
||||||
import common.init.SoundEvent;
|
import common.init.SoundEvent;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
@ -121,7 +121,7 @@ public class EntityHook extends Entity implements IObjectData
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean writeToNBTOptional(NBTTagCompound tagCompund)
|
public boolean writeToNBTOptional(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -517,7 +517,7 @@ public class EntityHook extends Entity implements IObjectData
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setShort("xTile", (short)this.xTile);
|
tagCompound.setShort("xTile", (short)this.xTile);
|
||||||
tagCompound.setShort("yTile", (short)this.yTile);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.xTile = tagCompund.getShort("xTile");
|
this.xTile = tagCompund.getShort("xTile");
|
||||||
this.yTile = tagCompund.getShort("yTile");
|
this.yTile = tagCompund.getShort("yTile");
|
||||||
|
|
|
@ -7,7 +7,7 @@ import common.entity.types.EntityThrowable;
|
||||||
import common.entity.types.IObjectData;
|
import common.entity.types.IObjectData;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.potion.Potion;
|
import common.potion.Potion;
|
||||||
import common.potion.PotionEffect;
|
import common.potion.PotionEffect;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
|
@ -158,7 +158,7 @@ public class EntityPotion extends EntityThrowable implements IObjectData
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
|
|
||||||
if (this.potionDamage != null)
|
if (this.potionDamage != null)
|
||||||
{
|
{
|
||||||
tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound()));
|
tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new TagObject()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ import common.entity.EntityType;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.init.BlockRegistry;
|
import common.init.BlockRegistry;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagDoubleList;
|
import common.nbt.TagDoubleList;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setShort("xTile", (short)this.xTile);
|
tagCompound.setShort("xTile", (short)this.xTile);
|
||||||
tagCompound.setShort("yTile", (short)this.yTile);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.xTile = tagCompund.getShort("xTile");
|
this.xTile = tagCompund.getShort("xTile");
|
||||||
this.yTile = tagCompund.getShort("yTile");
|
this.yTile = tagCompund.getShort("yTile");
|
||||||
|
@ -288,7 +288,7 @@ public abstract class EntityProjectile extends Entity
|
||||||
|
|
||||||
if (tagCompund.hasDoubleList("direction"))
|
if (tagCompund.hasDoubleList("direction"))
|
||||||
{
|
{
|
||||||
NBTTagDoubleList nbttaglist = tagCompund.getDoubleList("direction");
|
TagDoubleList nbttaglist = tagCompund.getDoubleList("direction");
|
||||||
this.motionX = nbttaglist.get(0);
|
this.motionX = nbttaglist.get(0);
|
||||||
this.motionY = nbttaglist.get(1);
|
this.motionY = nbttaglist.get(1);
|
||||||
this.motionZ = nbttaglist.get(2);
|
this.motionZ = nbttaglist.get(2);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import common.init.Blocks;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
import common.world.World;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(tagCompound);
|
super.writeEntityToNBT(tagCompound);
|
||||||
tagCompound.setInt("InLove", this.inLove);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
this.setInLove(tagCompund.getInt("InLove"), true);
|
this.setInLove(tagCompund.getInt("InLove"), true);
|
||||||
|
|
|
@ -47,8 +47,8 @@ import common.item.ItemArmor;
|
||||||
import common.item.ItemMonsterPlacer;
|
import common.item.ItemMonsterPlacer;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.network.IPlayer;
|
import common.network.IPlayer;
|
||||||
import common.packet.SPacketEntityAttach;
|
import common.packet.SPacketEntityAttach;
|
||||||
import common.packet.SPacketAnimation;
|
import common.packet.SPacketAnimation;
|
||||||
|
@ -87,7 +87,7 @@ public abstract class EntityLiving extends Entity
|
||||||
private EntitySenses senses;
|
private EntitySenses senses;
|
||||||
private boolean leashed;
|
private boolean leashed;
|
||||||
private Entity leashedTo;
|
private Entity leashedTo;
|
||||||
private NBTTagCompound leashTag;
|
private TagObject leashTag;
|
||||||
|
|
||||||
public float prevCamPitch;
|
public float prevCamPitch;
|
||||||
public float camPitch;
|
public float camPitch;
|
||||||
|
@ -539,7 +539,7 @@ public abstract class EntityLiving extends Entity
|
||||||
/**
|
/**
|
||||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setInt("Health", this.getHealth());
|
tagCompound.setInt("Health", this.getHealth());
|
||||||
// tagCompound.setShort("Health", (short)((int)Math.ceil((double)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())
|
if (!this.effects.isEmpty())
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (PotionEffect potioneffect : this.effects.values())
|
for (PotionEffect potioneffect : this.effects.values())
|
||||||
{
|
{
|
||||||
|
@ -582,7 +582,7 @@ public abstract class EntityLiving extends Entity
|
||||||
tagCompound.setBool("Leashed", this.leashed);
|
tagCompound.setBool("Leashed", this.leashed);
|
||||||
|
|
||||||
if(this.leashedTo != null) {
|
if(this.leashedTo != null) {
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
TagObject nbttagcompound1 = new TagObject();
|
||||||
|
|
||||||
// if(this.leashedTo.isPlayer()) {
|
// if(this.leashedTo.isPlayer()) {
|
||||||
// nbttagcompound1.setString("PlayerName", ((EntityNPC)this.leashedTo).getUser());
|
// 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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.setAbsorptionAmount(tagCompund.getInt("Absorption"));
|
this.setAbsorptionAmount(tagCompund.getInt("Absorption"));
|
||||||
|
|
||||||
|
@ -620,11 +620,11 @@ public abstract class EntityLiving extends Entity
|
||||||
|
|
||||||
if (tagCompund.hasTagList("ActiveEffects"))
|
if (tagCompund.hasTagList("ActiveEffects"))
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = tagCompund.getTagList("ActiveEffects");
|
TagObjectList nbttaglist = tagCompund.getTagList("ActiveEffects");
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = nbttaglist.get(i);
|
TagObject nbttagcompound = nbttaglist.get(i);
|
||||||
PotionEffect potioneffect = PotionEffect.fromNbt(nbttagcompound);
|
PotionEffect potioneffect = PotionEffect.fromNbt(nbttagcompound);
|
||||||
|
|
||||||
if (potioneffect != null && !potioneffect.getPotion().isInstant())
|
if (potioneffect != null && !potioneffect.getPotion().isInstant())
|
||||||
|
|
|
@ -2,7 +2,7 @@ package common.entity.types;
|
||||||
|
|
||||||
import common.ai.EntityAISit;
|
import common.ai.EntityAISit;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public abstract class EntityTameable extends EntityAnimal implements IEntityOwnable
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
super.writeEntityToNBT(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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
super.readEntityFromNBT(tagCompund);
|
super.readEntityFromNBT(tagCompund);
|
||||||
// String s = "";
|
// String s = "";
|
||||||
|
|
|
@ -9,7 +9,7 @@ import common.entity.EntityType;
|
||||||
import common.init.BlockRegistry;
|
import common.init.BlockRegistry;
|
||||||
import common.init.Blocks;
|
import common.init.Blocks;
|
||||||
import common.model.ParticleType;
|
import common.model.ParticleType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.util.ExtMath;
|
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.
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||||
*/
|
*/
|
||||||
public void writeEntityToNBT(NBTTagCompound tagCompound)
|
public void writeEntityToNBT(TagObject tagCompound)
|
||||||
{
|
{
|
||||||
tagCompound.setShort("xTile", (short)this.xTile);
|
tagCompound.setShort("xTile", (short)this.xTile);
|
||||||
tagCompound.setShort("yTile", (short)this.yTile);
|
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.
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||||
*/
|
*/
|
||||||
public void readEntityFromNBT(NBTTagCompound tagCompund)
|
public void readEntityFromNBT(TagObject tagCompund)
|
||||||
{
|
{
|
||||||
this.xTile = tagCompund.getShort("xTile");
|
this.xTile = tagCompund.getShort("xTile");
|
||||||
this.yTile = tagCompund.getShort("yTile");
|
this.yTile = tagCompund.getShort("yTile");
|
||||||
|
|
|
@ -2,7 +2,7 @@ package common.entity.types;
|
||||||
|
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.EntityType;
|
import common.entity.EntityType;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public abstract class EntityWeatherEffect extends Entity {
|
public abstract class EntityWeatherEffect extends Entity {
|
||||||
|
@ -25,10 +25,10 @@ public abstract class EntityWeatherEffect extends Entity {
|
||||||
protected final void entityInit() {
|
protected final void entityInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void readEntityFromNBT(NBTTagCompound tagCompund) {
|
protected final void readEntityFromNBT(TagObject tagCompund) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void writeEntityToNBT(NBTTagCompound tagCompound) {
|
protected final void writeEntityToNBT(TagObject tagCompound) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final EntityType getType() {
|
public final EntityType getType() {
|
||||||
|
|
|
@ -25,8 +25,8 @@ import common.item.Item;
|
||||||
import common.item.ItemArmor;
|
import common.item.ItemArmor;
|
||||||
import common.item.ItemDye;
|
import common.item.ItemDye;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.tileentity.TileEntityBanner;
|
import common.tileentity.TileEntityBanner;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
|
@ -616,8 +616,8 @@ public abstract class CraftingRegistry
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true);
|
TagObject nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true);
|
||||||
NBTTagTagList nbttaglist = null;
|
TagObjectList nbttaglist = null;
|
||||||
|
|
||||||
if (nbttagcompound1.hasTagList("Patterns"))
|
if (nbttagcompound1.hasTagList("Patterns"))
|
||||||
{
|
{
|
||||||
|
@ -625,11 +625,11 @@ public abstract class CraftingRegistry
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nbttaglist = new NBTTagTagList();
|
nbttaglist = new TagObjectList();
|
||||||
nbttagcompound1.setTagList("Patterns", nbttaglist);
|
nbttagcompound1.setTagList("Patterns", nbttaglist);
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID());
|
nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID());
|
||||||
nbttagcompound.setInt("Color", k);
|
nbttagcompound.setInt("Color", k);
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
|
@ -969,9 +969,9 @@ public abstract class CraftingRegistry
|
||||||
|
|
||||||
if (l > 0)
|
if (l > 0)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
TagObject nbttagcompound1 = new TagObject();
|
||||||
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
|
TagObject nbttagcompound3 = new TagObject();
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (int k2 = 0; k2 < inv.getSizeInventory(); ++k2)
|
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)
|
else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1)
|
||||||
{
|
{
|
||||||
this.field_92102_a = new ItemStack(Items.firework_charge);
|
this.field_92102_a = new ItemStack(Items.firework_charge);
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
TagObject nbttagcompound2 = new TagObject();
|
||||||
byte b0 = 0;
|
byte b0 = 0;
|
||||||
List<Integer> list = Lists.<Integer>newArrayList();
|
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())
|
if (this.field_92102_a != null && this.field_92102_a.hasTagCompound())
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound4 = this.field_92102_a.getTagCompound().getTag("Explosion");
|
TagObject nbttagcompound4 = this.field_92102_a.getTagCompound().getTag("Explosion");
|
||||||
|
|
||||||
if (nbttagcompound4 == null)
|
if (nbttagcompound4 == null)
|
||||||
{
|
{
|
||||||
|
@ -1552,7 +1552,7 @@ public abstract class CraftingRegistry
|
||||||
|
|
||||||
if (itemstack1 != null && itemstack1.hasTagCompound())
|
if (itemstack1 != null && itemstack1.hasTagCompound())
|
||||||
{
|
{
|
||||||
itemstack.setTagCompound((NBTTagCompound)itemstack1.getTagCompound().copy());
|
itemstack.setTagCompound((TagObject)itemstack1.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ import common.entity.projectile.EntitySnowball;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.entity.types.IObjectData;
|
import common.entity.types.IObjectData;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
|
||||||
public abstract class EntityRegistry {
|
public abstract class EntityRegistry {
|
||||||
|
@ -117,7 +117,7 @@ public abstract class EntityRegistry {
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Entity createEntityFromNBT(NBTTagCompound nbt, World worldIn) {
|
public static Entity createEntityFromNBT(TagObject nbt, World worldIn) {
|
||||||
Entity entity = null;
|
Entity entity = null;
|
||||||
|
|
||||||
// if("Minecart".equals(nbt.getString("id"))) {
|
// if("Minecart".equals(nbt.getString("id"))) {
|
||||||
|
|
|
@ -27,10 +27,10 @@ import common.dimension.Star;
|
||||||
import common.dimension.Dimension.GeneratorType;
|
import common.dimension.Dimension.GeneratorType;
|
||||||
import common.dimension.Dimension.ReplacerType;
|
import common.dimension.Dimension.ReplacerType;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.nbt.NBTException;
|
import common.nbt.TagException;
|
||||||
import common.nbt.NBTParser;
|
import common.nbt.TagInterpreter;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.PortalType;
|
import common.util.PortalType;
|
||||||
import common.world.State;
|
import common.world.State;
|
||||||
|
@ -92,8 +92,8 @@ public abstract class UniverseRegistry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadNbt(NBTTagCompound tag) {
|
public static void loadNbt(TagObject tag) {
|
||||||
NBTTagTagList list = tag.getTagList("Dimensions");
|
TagObjectList list = tag.getTagList("Dimensions");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
Dimension dim = Dimension.getByNbt(list.get(z));
|
Dimension dim = Dimension.getByNbt(list.get(z));
|
||||||
if(!REGISTRY.containsKey(dim.getDimensionId()) && !ALIASES.containsKey(dim.getDimensionName()))
|
if(!REGISTRY.containsKey(dim.getDimensionId()) && !ALIASES.containsKey(dim.getDimensionName()))
|
||||||
|
@ -102,7 +102,7 @@ public abstract class UniverseRegistry {
|
||||||
|
|
||||||
list = tag.getTagList("Names");
|
list = tag.getTagList("Names");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound data = list.get(z);
|
TagObject data = list.get(z);
|
||||||
String id = data.getString("ID");
|
String id = data.getString("ID");
|
||||||
// if(BASE_ALIASES.containsKey(id)) {
|
// if(BASE_ALIASES.containsKey(id)) {
|
||||||
Dimension dim = ALIASES.get(id);
|
Dimension dim = ALIASES.get(id);
|
||||||
|
@ -113,7 +113,7 @@ public abstract class UniverseRegistry {
|
||||||
|
|
||||||
list = tag.getTagList("Sectors");
|
list = tag.getTagList("Sectors");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound data = list.get(z);
|
TagObject data = list.get(z);
|
||||||
String id = data.getString("ID");
|
String id = data.getString("ID");
|
||||||
Sector sector = SECTORS.get(id);
|
Sector sector = SECTORS.get(id);
|
||||||
if(sector == null)
|
if(sector == null)
|
||||||
|
@ -123,7 +123,7 @@ public abstract class UniverseRegistry {
|
||||||
|
|
||||||
list = tag.getTagList("Galaxies");
|
list = tag.getTagList("Galaxies");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound data = list.get(z);
|
TagObject data = list.get(z);
|
||||||
String id = data.getString("ID");
|
String id = data.getString("ID");
|
||||||
Galaxy galaxy = GALAXIES.get(id);
|
Galaxy galaxy = GALAXIES.get(id);
|
||||||
if(galaxy == null)
|
if(galaxy == null)
|
||||||
|
@ -133,7 +133,7 @@ public abstract class UniverseRegistry {
|
||||||
|
|
||||||
list = tag.getTagList("Domains");
|
list = tag.getTagList("Domains");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound data = list.get(z);
|
TagObject data = list.get(z);
|
||||||
String id = data.getString("ID");
|
String id = data.getString("ID");
|
||||||
Domain domain = DOMAINS.get(id);
|
Domain domain = DOMAINS.get(id);
|
||||||
if(domain == null)
|
if(domain == null)
|
||||||
|
@ -143,16 +143,16 @@ public abstract class UniverseRegistry {
|
||||||
|
|
||||||
list = tag.getTagList("Barycenters");
|
list = tag.getTagList("Barycenters");
|
||||||
for(int z = 0; z < list.size(); z++) {
|
for(int z = 0; z < list.size(); z++) {
|
||||||
NBTTagCompound link = list.get(z);
|
TagObject link = list.get(z);
|
||||||
if(!assign(link.getString("Celestial"), link.getString("Center")))
|
if(!assign(link.getString("Celestial"), link.getString("Center")))
|
||||||
Log.TICK.warn("Konnte '" + link.getString("Celestial") + "' nicht zu '" + link.getString("Center") + "' zuweisen");
|
Log.TICK.warn("Konnte '" + link.getString("Celestial") + "' nicht zu '" + link.getString("Center") + "' zuweisen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NBTTagCompound saveNbt() {
|
public static TagObject saveNbt() {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
TagObject tag = new TagObject();
|
||||||
|
|
||||||
NBTTagTagList list = new NBTTagTagList();
|
TagObjectList list = new TagObjectList();
|
||||||
for(Dimension dim : DIMENSIONS) {
|
for(Dimension dim : DIMENSIONS) {
|
||||||
if(!BASE_REGISTRY.containsKey(dim.getDimensionId()) && dim != Space.INSTANCE)
|
if(!BASE_REGISTRY.containsKey(dim.getDimensionId()) && dim != Space.INSTANCE)
|
||||||
list.add(dim.toNbt());
|
list.add(dim.toNbt());
|
||||||
|
@ -160,10 +160,10 @@ public abstract class UniverseRegistry {
|
||||||
if(!list.isEmpty())
|
if(!list.isEmpty())
|
||||||
tag.setTagList("Dimensions", list);
|
tag.setTagList("Dimensions", list);
|
||||||
|
|
||||||
list = new NBTTagTagList();
|
list = new TagObjectList();
|
||||||
for(Dimension dim : DIMENSIONS) {
|
for(Dimension dim : DIMENSIONS) {
|
||||||
if(/* BASE_REGISTRY.containsKey(dim.getDimensionId()) */ dim != Space.INSTANCE) {
|
if(/* BASE_REGISTRY.containsKey(dim.getDimensionId()) */ dim != Space.INSTANCE) {
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
TagObject data = new TagObject();
|
||||||
dim.writeNbt(data);
|
dim.writeNbt(data);
|
||||||
if(!data.isEmpty()) {
|
if(!data.isEmpty()) {
|
||||||
data.setString("ID", dim.getDimensionName());
|
data.setString("ID", dim.getDimensionName());
|
||||||
|
@ -174,9 +174,9 @@ public abstract class UniverseRegistry {
|
||||||
if(!list.isEmpty())
|
if(!list.isEmpty())
|
||||||
tag.setTagList("Names", list);
|
tag.setTagList("Names", list);
|
||||||
|
|
||||||
list = new NBTTagTagList();
|
list = new TagObjectList();
|
||||||
for(Sector sector : SECTORS.values()) {
|
for(Sector sector : SECTORS.values()) {
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
TagObject data = new TagObject();
|
||||||
sector.writeNbt(data);
|
sector.writeNbt(data);
|
||||||
if(!data.isEmpty()) {
|
if(!data.isEmpty()) {
|
||||||
data.setString("ID", sector.id);
|
data.setString("ID", sector.id);
|
||||||
|
@ -186,9 +186,9 @@ public abstract class UniverseRegistry {
|
||||||
if(!list.isEmpty())
|
if(!list.isEmpty())
|
||||||
tag.setTagList("Sectors", list);
|
tag.setTagList("Sectors", list);
|
||||||
|
|
||||||
list = new NBTTagTagList();
|
list = new TagObjectList();
|
||||||
for(Galaxy galaxy : GALAXIES.values()) {
|
for(Galaxy galaxy : GALAXIES.values()) {
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
TagObject data = new TagObject();
|
||||||
galaxy.writeNbt(data);
|
galaxy.writeNbt(data);
|
||||||
if(!data.isEmpty()) {
|
if(!data.isEmpty()) {
|
||||||
data.setString("ID", galaxy.id);
|
data.setString("ID", galaxy.id);
|
||||||
|
@ -198,9 +198,9 @@ public abstract class UniverseRegistry {
|
||||||
if(!list.isEmpty())
|
if(!list.isEmpty())
|
||||||
tag.setTagList("Galaxies", list);
|
tag.setTagList("Galaxies", list);
|
||||||
|
|
||||||
list = new NBTTagTagList();
|
list = new TagObjectList();
|
||||||
for(Domain domain : DOMAINS.values()) {
|
for(Domain domain : DOMAINS.values()) {
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
TagObject data = new TagObject();
|
||||||
domain.writeNbt(data);
|
domain.writeNbt(data);
|
||||||
if(!data.isEmpty()) {
|
if(!data.isEmpty()) {
|
||||||
data.setString("ID", domain.id);
|
data.setString("ID", domain.id);
|
||||||
|
@ -210,11 +210,11 @@ public abstract class UniverseRegistry {
|
||||||
if(!list.isEmpty())
|
if(!list.isEmpty())
|
||||||
tag.setTagList("Domains", list);
|
tag.setTagList("Domains", list);
|
||||||
|
|
||||||
list = new NBTTagTagList();
|
list = new TagObjectList();
|
||||||
for(Entry<Moon, Planet> entry : MOON_MAP.entrySet()) {
|
for(Entry<Moon, Planet> entry : MOON_MAP.entrySet()) {
|
||||||
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
||||||
continue;
|
continue;
|
||||||
NBTTagCompound link = new NBTTagCompound();
|
TagObject link = new TagObject();
|
||||||
link.setString("Celestial", entry.getKey().getDimensionName());
|
link.setString("Celestial", entry.getKey().getDimensionName());
|
||||||
link.setString("Center", entry.getValue().getDimensionName());
|
link.setString("Center", entry.getValue().getDimensionName());
|
||||||
list.add(link);
|
list.add(link);
|
||||||
|
@ -222,7 +222,7 @@ public abstract class UniverseRegistry {
|
||||||
for(Entry<Planet, Star> entry : PLANET_MAP.entrySet()) {
|
for(Entry<Planet, Star> entry : PLANET_MAP.entrySet()) {
|
||||||
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
||||||
continue;
|
continue;
|
||||||
NBTTagCompound link = new NBTTagCompound();
|
TagObject link = new TagObject();
|
||||||
link.setString("Celestial", entry.getKey().getDimensionName());
|
link.setString("Celestial", entry.getKey().getDimensionName());
|
||||||
link.setString("Center", entry.getValue().getDimensionName());
|
link.setString("Center", entry.getValue().getDimensionName());
|
||||||
list.add(link);
|
list.add(link);
|
||||||
|
@ -230,7 +230,7 @@ public abstract class UniverseRegistry {
|
||||||
for(Entry<Star, Sector> entry : STAR_MAP.entrySet()) {
|
for(Entry<Star, Sector> entry : STAR_MAP.entrySet()) {
|
||||||
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
||||||
continue;
|
continue;
|
||||||
NBTTagCompound link = new NBTTagCompound();
|
TagObject link = new TagObject();
|
||||||
link.setString("Celestial", entry.getKey().getDimensionName());
|
link.setString("Celestial", entry.getKey().getDimensionName());
|
||||||
link.setString("Center", entry.getValue().id);
|
link.setString("Center", entry.getValue().id);
|
||||||
list.add(link);
|
list.add(link);
|
||||||
|
@ -238,7 +238,7 @@ public abstract class UniverseRegistry {
|
||||||
for(Entry<Sector, Galaxy> entry : SECTOR_MAP.entrySet()) {
|
for(Entry<Sector, Galaxy> entry : SECTOR_MAP.entrySet()) {
|
||||||
if(BASE_MAP.containsKey(entry.getKey().id))
|
if(BASE_MAP.containsKey(entry.getKey().id))
|
||||||
continue;
|
continue;
|
||||||
NBTTagCompound link = new NBTTagCompound();
|
TagObject link = new TagObject();
|
||||||
link.setString("Celestial", entry.getKey().id);
|
link.setString("Celestial", entry.getKey().id);
|
||||||
link.setString("Center", entry.getValue().id);
|
link.setString("Center", entry.getValue().id);
|
||||||
list.add(link);
|
list.add(link);
|
||||||
|
@ -246,7 +246,7 @@ public abstract class UniverseRegistry {
|
||||||
for(Entry<Area, Domain> entry : AREA_MAP.entrySet()) {
|
for(Entry<Area, Domain> entry : AREA_MAP.entrySet()) {
|
||||||
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
if(BASE_REGISTRY.containsKey(entry.getKey().getDimensionId()))
|
||||||
continue;
|
continue;
|
||||||
NBTTagCompound link = new NBTTagCompound();
|
TagObject link = new TagObject();
|
||||||
link.setString("Celestial", entry.getKey().getDimensionName());
|
link.setString("Celestial", entry.getKey().getDimensionName());
|
||||||
link.setString("Center", entry.getValue().id);
|
link.setString("Center", entry.getValue().id);
|
||||||
list.add(link);
|
list.add(link);
|
||||||
|
@ -701,14 +701,14 @@ public abstract class UniverseRegistry {
|
||||||
|
|
||||||
private static Dimension addPreset(String name, String base, String data) {
|
private static Dimension addPreset(String name, String base, String data) {
|
||||||
Dimension dim = BASE_ALIASES.get(base).copy(UniverseRegistry.MORE_DIM_ID, "preset");
|
Dimension dim = BASE_ALIASES.get(base).copy(UniverseRegistry.MORE_DIM_ID, "preset");
|
||||||
NBTTagCompound ptag;
|
TagObject ptag;
|
||||||
try {
|
try {
|
||||||
ptag = NBTParser.parseTag("{" + data + "}");
|
ptag = TagInterpreter.parseTag("{" + data + "}");
|
||||||
}
|
}
|
||||||
catch(NBTException e) {
|
catch(TagException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
NBTTagCompound dtag = dim.toNbt(true);
|
TagObject dtag = dim.toNbt(true);
|
||||||
if(ptag.getBool("ClearGenerator")) {
|
if(ptag.getBool("ClearGenerator")) {
|
||||||
ptag.remove("ClearGenerator");
|
ptag.remove("ClearGenerator");
|
||||||
dtag.remove("FloorBlock");
|
dtag.remove("FloorBlock");
|
||||||
|
|
|
@ -3,7 +3,7 @@ package common.inventory;
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.entity.item.EntityItem;
|
import common.entity.item.EntityItem;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -55,7 +55,7 @@ public class InventoryHelper
|
||||||
|
|
||||||
if (stack.hasTagCompound())
|
if (stack.hasTagCompound())
|
||||||
{
|
{
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy());
|
entityitem.getEntityItem().setTagCompound((TagObject)stack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
|
|
|
@ -5,8 +5,8 @@ import common.entity.npc.EntityNPC;
|
||||||
import common.item.Item;
|
import common.item.Item;
|
||||||
import common.item.ItemArmor;
|
import common.item.ItemArmor;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
|
|
||||||
public class InventoryPlayer implements IInventory
|
public class InventoryPlayer implements IInventory
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,7 @@ public class InventoryPlayer implements IInventory
|
||||||
|
|
||||||
if (itemStackIn.hasTagCompound())
|
if (itemStackIn.hasTagCompound())
|
||||||
{
|
{
|
||||||
this.mainInventory[j].setTagCompound((NBTTagCompound)itemStackIn.getTagCompound().copy());
|
this.mainInventory[j].setTagCompound((TagObject)itemStackIn.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -450,13 +450,13 @@ public class InventoryPlayer implements IInventory
|
||||||
*
|
*
|
||||||
* @param nbtTagListIn List to append tags to
|
* @param nbtTagListIn List to append tags to
|
||||||
*/
|
*/
|
||||||
public NBTTagTagList writeToNBT(NBTTagTagList nbtTagListIn)
|
public TagObjectList writeToNBT(TagObjectList nbtTagListIn)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < this.mainInventory.length; ++i)
|
for (int i = 0; i < this.mainInventory.length; ++i)
|
||||||
{
|
{
|
||||||
if (this.mainInventory[i] != null)
|
if (this.mainInventory[i] != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setByte("Slot", (byte)i);
|
nbttagcompound.setByte("Slot", (byte)i);
|
||||||
this.mainInventory[i].writeToNBT(nbttagcompound);
|
this.mainInventory[i].writeToNBT(nbttagcompound);
|
||||||
nbtTagListIn.add(nbttagcompound);
|
nbtTagListIn.add(nbttagcompound);
|
||||||
|
@ -467,7 +467,7 @@ public class InventoryPlayer implements IInventory
|
||||||
{
|
{
|
||||||
if (this.armorInventory[j] != null)
|
if (this.armorInventory[j] != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
TagObject nbttagcompound1 = new TagObject();
|
||||||
nbttagcompound1.setByte("Slot", (byte)(j + 100));
|
nbttagcompound1.setByte("Slot", (byte)(j + 100));
|
||||||
this.armorInventory[j].writeToNBT(nbttagcompound1);
|
this.armorInventory[j].writeToNBT(nbttagcompound1);
|
||||||
nbtTagListIn.add(nbttagcompound1);
|
nbtTagListIn.add(nbttagcompound1);
|
||||||
|
@ -482,14 +482,14 @@ public class InventoryPlayer implements IInventory
|
||||||
*
|
*
|
||||||
* @param nbtTagListIn tagList to read from
|
* @param nbtTagListIn tagList to read from
|
||||||
*/
|
*/
|
||||||
public void readFromNBT(NBTTagTagList nbtTagListIn)
|
public void readFromNBT(TagObjectList nbtTagListIn)
|
||||||
{
|
{
|
||||||
this.mainInventory = new ItemStack[36];
|
this.mainInventory = new ItemStack[36];
|
||||||
this.armorInventory = new ItemStack[4];
|
this.armorInventory = new ItemStack[4];
|
||||||
|
|
||||||
for (int i = 0; i < nbtTagListIn.size(); ++i)
|
for (int i = 0; i < nbtTagListIn.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = nbtTagListIn.get(i);
|
TagObject nbttagcompound = nbtTagListIn.get(i);
|
||||||
int j = nbttagcompound.getByte("Slot") & 255;
|
int j = nbttagcompound.getByte("Slot") & 255;
|
||||||
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);
|
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package common.inventory;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.init.Blocks;
|
import common.init.Blocks;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
|
|
||||||
public class InventoryWarpChest extends InventoryBasic
|
public class InventoryWarpChest extends InventoryBasic
|
||||||
|
@ -21,7 +21,7 @@ public class InventoryWarpChest extends InventoryBasic
|
||||||
this.associatedChest = chestTileEntity;
|
this.associatedChest = chestTileEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadInventoryFromNBT(NBTTagTagList p_70486_1_)
|
public void loadInventoryFromNBT(TagObjectList p_70486_1_)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < this.getSizeInventory(); ++i)
|
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)
|
for (int k = 0; k < p_70486_1_.size(); ++k)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = p_70486_1_.get(k);
|
TagObject nbttagcompound = p_70486_1_.get(k);
|
||||||
int j = nbttagcompound.getByte("Slot") & 255;
|
int j = nbttagcompound.getByte("Slot") & 255;
|
||||||
|
|
||||||
if (j >= 0 && j < this.getSizeInventory())
|
if (j >= 0 && j < this.getSizeInventory())
|
||||||
|
@ -40,9 +40,9 @@ public class InventoryWarpChest extends InventoryBasic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagTagList saveInventoryToNBT()
|
public TagObjectList saveInventoryToNBT()
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = new NBTTagTagList();
|
TagObjectList nbttaglist = new TagObjectList();
|
||||||
|
|
||||||
for (int i = 0; i < this.getSizeInventory(); ++i)
|
for (int i = 0; i < this.getSizeInventory(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ public class InventoryWarpChest extends InventoryBasic
|
||||||
|
|
||||||
if (itemstack != null)
|
if (itemstack != null)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setByte("Slot", (byte)i);
|
nbttagcompound.setByte("Slot", (byte)i);
|
||||||
itemstack.writeToNBT(nbttagcompound);
|
itemstack.writeToNBT(nbttagcompound);
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
|
|
|
@ -16,7 +16,7 @@ import common.model.ItemMeshDefinition;
|
||||||
import common.model.Model;
|
import common.model.Model;
|
||||||
import common.model.ModelProvider;
|
import common.model.ModelProvider;
|
||||||
import common.model.Transforms;
|
import common.model.Transforms;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.ExtMath;
|
import common.util.ExtMath;
|
||||||
|
@ -105,7 +105,7 @@ public class Item
|
||||||
/**
|
/**
|
||||||
* Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data
|
* Called when an ItemStack with NBT data is read to potentially that ItemStack's NBT data
|
||||||
*/
|
*/
|
||||||
public boolean updateItemStackNBT(NBTTagCompound nbt)
|
public boolean updateItemStackNBT(TagObject nbt)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ public class Item
|
||||||
|
|
||||||
// private static final Set<String> VALID_TAGS = Sets.newHashSet("Name", "ench", "RepairCost");
|
// private static final Set<String> VALID_TAGS = Sets.newHashSet("Name", "ench", "RepairCost");
|
||||||
|
|
||||||
protected final boolean validateNbt(NBTTagCompound tag) {
|
protected final boolean validateNbt(TagObject tag) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import common.init.ToolMaterial;
|
||||||
import common.model.Model;
|
import common.model.Model;
|
||||||
import common.model.ModelProvider;
|
import common.model.ModelProvider;
|
||||||
import common.model.Transforms;
|
import common.model.Transforms;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.BoundingBox;
|
import common.util.BoundingBox;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -158,7 +158,7 @@ public class ItemArmor extends Item
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound();
|
TagObject nbttagcompound = stack.getTagCompound();
|
||||||
|
|
||||||
if (nbttagcompound != null && nbttagcompound.hasInt("color"))
|
if (nbttagcompound != null && nbttagcompound.hasInt("color"))
|
||||||
{
|
{
|
||||||
|
@ -181,7 +181,7 @@ public class ItemArmor extends Item
|
||||||
{
|
{
|
||||||
if (this.material.canBeDyed())
|
if (this.material.canBeDyed())
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound();
|
TagObject nbttagcompound = stack.getTagCompound();
|
||||||
|
|
||||||
if (nbttagcompound != null)
|
if (nbttagcompound != null)
|
||||||
{
|
{
|
||||||
|
@ -208,11 +208,11 @@ public class ItemArmor extends Item
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound();
|
TagObject nbttagcompound = stack.getTagCompound();
|
||||||
|
|
||||||
if (nbttagcompound == null)
|
if (nbttagcompound == null)
|
||||||
{
|
{
|
||||||
nbttagcompound = new NBTTagCompound();
|
nbttagcompound = new TagObject();
|
||||||
stack.setTagCompound(nbttagcompound);
|
stack.setTagCompound(nbttagcompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ import common.init.Blocks;
|
||||||
import common.model.ItemMeshDefinition;
|
import common.model.ItemMeshDefinition;
|
||||||
import common.model.Model;
|
import common.model.Model;
|
||||||
import common.model.ModelProvider;
|
import common.model.ModelProvider;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.tileentity.TileEntity;
|
import common.tileentity.TileEntity;
|
||||||
import common.tileentity.TileEntityBanner;
|
import common.tileentity.TileEntityBanner;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
|
@ -96,15 +96,15 @@ public class ItemBanner extends ItemBlock
|
||||||
*/
|
*/
|
||||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
|
TagObject nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
|
||||||
|
|
||||||
if (nbttagcompound != null && nbttagcompound.hasTagList("Patterns"))
|
if (nbttagcompound != null && nbttagcompound.hasTagList("Patterns"))
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = nbttagcompound.getTagList("Patterns");
|
TagObjectList nbttaglist = nbttagcompound.getTagList("Patterns");
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size() && i < 6; ++i)
|
for (int i = 0; i < nbttaglist.size() && i < 6; ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
|
TagObject nbttagcompound1 = nbttaglist.get(i);
|
||||||
DyeColor enumdyecolor = DyeColor.byDyeDamage(nbttagcompound1.getInt("Color"));
|
DyeColor enumdyecolor = DyeColor.byDyeDamage(nbttagcompound1.getInt("Color"));
|
||||||
TileEntityBanner.EnumBannerPattern pattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));
|
TileEntityBanner.EnumBannerPattern pattern = TileEntityBanner.EnumBannerPattern.getPatternByID(nbttagcompound1.getString("Pattern"));
|
||||||
|
|
||||||
|
@ -137,9 +137,9 @@ public class ItemBanner extends ItemBlock
|
||||||
{
|
{
|
||||||
for (DyeColor enumdyecolor : DyeColor.values())
|
for (DyeColor enumdyecolor : DyeColor.values())
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, enumdyecolor.getDyeDamage(), null);
|
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, enumdyecolor.getDyeDamage(), null);
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
TagObject nbttagcompound1 = new TagObject();
|
||||||
nbttagcompound1.setTag("BlockEntityTag", nbttagcompound);
|
nbttagcompound1.setTag("BlockEntityTag", nbttagcompound);
|
||||||
ItemStack itemstack = new ItemStack(itemIn, 1, enumdyecolor.getDyeDamage());
|
ItemStack itemstack = new ItemStack(itemIn, 1, enumdyecolor.getDyeDamage());
|
||||||
itemstack.setTagCompound(nbttagcompound1);
|
itemstack.setTagCompound(nbttagcompound1);
|
||||||
|
@ -157,7 +157,7 @@ public class ItemBanner extends ItemBlock
|
||||||
|
|
||||||
private DyeColor getBaseColor(ItemStack stack)
|
private DyeColor getBaseColor(ItemStack stack)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
|
TagObject nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
|
||||||
DyeColor enumdyecolor = null;
|
DyeColor enumdyecolor = null;
|
||||||
|
|
||||||
if (nbttagcompound != null && nbttagcompound.hasInt("Base"))
|
if (nbttagcompound != null && nbttagcompound.hasInt("Base"))
|
||||||
|
|
|
@ -11,7 +11,7 @@ import common.init.Blocks;
|
||||||
import common.model.Model;
|
import common.model.Model;
|
||||||
import common.model.ModelProvider;
|
import common.model.ModelProvider;
|
||||||
import common.model.Transforms;
|
import common.model.Transforms;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.tileentity.TileEntity;
|
import common.tileentity.TileEntity;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.Facing;
|
import common.util.Facing;
|
||||||
|
@ -118,10 +118,10 @@ public class ItemBlock extends Item
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttagcompound.copy();
|
TagObject nbttagcompound1 = (TagObject)nbttagcompound.copy();
|
||||||
tileentity.writeToNBT(nbttagcompound);
|
tileentity.writeToNBT(nbttagcompound);
|
||||||
NBTTagCompound nbttagcompound2 = (NBTTagCompound)p_179224_3_.getTagCompound().get("BlockEntityTag");
|
TagObject nbttagcompound2 = (TagObject)p_179224_3_.getTagCompound().get("BlockEntityTag");
|
||||||
nbttagcompound.merge(nbttagcompound2);
|
nbttagcompound.merge(nbttagcompound2);
|
||||||
nbttagcompound.setInt("x", stack.getX());
|
nbttagcompound.setInt("x", stack.getX());
|
||||||
nbttagcompound.setInt("y", stack.getY());
|
nbttagcompound.setInt("y", stack.getY());
|
||||||
|
|
|
@ -9,8 +9,8 @@ import common.enchantment.RngEnchantment;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.init.Items;
|
import common.init.Items;
|
||||||
import common.model.ItemMeshDefinition;
|
import common.model.ItemMeshDefinition;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
|
|
||||||
public class ItemEnchantedBook extends Item
|
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);
|
// return this.getEnchantments(stack).tagCount() > 0 ? ChatFormat.YELLOW : super.getColor(stack);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public NBTTagTagList getEnchantments(ItemStack stack)
|
public TagObjectList getEnchantments(ItemStack stack)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound();
|
TagObject nbttagcompound = stack.getTagCompound();
|
||||||
return nbttagcompound != null && nbttagcompound.hasTagList("StoredEnchantments") ? nbttagcompound.getTagList("StoredEnchantments") : new NBTTagTagList();
|
return nbttagcompound != null && nbttagcompound.hasTagList("StoredEnchantments") ? nbttagcompound.getTagList("StoredEnchantments") : new TagObjectList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ public class ItemEnchantedBook extends Item
|
||||||
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
public void addInformation(ItemStack stack, EntityNPC playerIn, List<String> tooltip)
|
||||||
{
|
{
|
||||||
super.addInformation(stack, playerIn, tooltip);
|
super.addInformation(stack, playerIn, tooltip);
|
||||||
NBTTagTagList nbttaglist = this.getEnchantments(stack);
|
TagObjectList nbttaglist = this.getEnchantments(stack);
|
||||||
|
|
||||||
if (nbttaglist != null)
|
if (nbttaglist != null)
|
||||||
{
|
{
|
||||||
|
@ -82,12 +82,12 @@ public class ItemEnchantedBook extends Item
|
||||||
*/
|
*/
|
||||||
public void addEnchantment(ItemStack stack, RngEnchantment enchantment)
|
public void addEnchantment(ItemStack stack, RngEnchantment enchantment)
|
||||||
{
|
{
|
||||||
NBTTagTagList nbttaglist = this.getEnchantments(stack);
|
TagObjectList nbttaglist = this.getEnchantments(stack);
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
|
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = nbttaglist.get(i);
|
TagObject nbttagcompound = nbttaglist.get(i);
|
||||||
|
|
||||||
if (nbttagcompound.getShort("id") == enchantment.enchantmentobj.effectId)
|
if (nbttagcompound.getShort("id") == enchantment.enchantmentobj.effectId)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ public class ItemEnchantedBook extends Item
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
TagObject nbttagcompound1 = new TagObject();
|
||||||
nbttagcompound1.setShort("id", (short)enchantment.enchantmentobj.effectId);
|
nbttagcompound1.setShort("id", (short)enchantment.enchantmentobj.effectId);
|
||||||
nbttagcompound1.setShort("lvl", (short)enchantment.enchantmentLevel);
|
nbttagcompound1.setShort("lvl", (short)enchantment.enchantmentLevel);
|
||||||
nbttaglist.add(nbttagcompound1);
|
nbttaglist.add(nbttagcompound1);
|
||||||
|
@ -111,7 +111,7 @@ public class ItemEnchantedBook extends Item
|
||||||
|
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
{
|
{
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new TagObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.getTagCompound().setTagList("StoredEnchantments", nbttaglist);
|
stack.getTagCompound().setTagList("StoredEnchantments", nbttaglist);
|
||||||
|
|
|
@ -5,8 +5,8 @@ import java.util.List;
|
||||||
import common.collect.Lists;
|
import common.collect.Lists;
|
||||||
import common.entity.item.EntityFireworks;
|
import common.entity.item.EntityFireworks;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.Facing;
|
import common.util.Facing;
|
||||||
import common.world.World;
|
import common.world.World;
|
||||||
|
@ -43,7 +43,7 @@ public class ItemFirework extends Item
|
||||||
{
|
{
|
||||||
if (stack.hasTagCompound())
|
if (stack.hasTagCompound())
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound().getTag("Fireworks");
|
TagObject nbttagcompound = stack.getTagCompound().getTag("Fireworks");
|
||||||
|
|
||||||
if (nbttagcompound != null)
|
if (nbttagcompound != null)
|
||||||
{
|
{
|
||||||
|
@ -52,13 +52,13 @@ public class ItemFirework extends Item
|
||||||
tooltip.add("Flugdauer: " + nbttagcompound.getByte("Flight"));
|
tooltip.add("Flugdauer: " + nbttagcompound.getByte("Flight"));
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagTagList nbttaglist = nbttagcompound.getTagList("Explosions");
|
TagObjectList nbttaglist = nbttagcompound.getTagList("Explosions");
|
||||||
|
|
||||||
if (nbttaglist != null && nbttaglist.size() > 0)
|
if (nbttaglist != null && nbttaglist.size() > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < nbttaglist.size(); ++i)
|
for (int i = 0; i < nbttaglist.size(); ++i)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
|
TagObject nbttagcompound1 = nbttaglist.get(i);
|
||||||
List<String> list = Lists.<String>newArrayList();
|
List<String> list = Lists.<String>newArrayList();
|
||||||
ItemFireworkCharge.addExplosionInfo(nbttagcompound1, list);
|
ItemFireworkCharge.addExplosionInfo(nbttagcompound1, list);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import common.color.DyeColor;
|
||||||
import common.entity.npc.EntityNPC;
|
import common.entity.npc.EntityNPC;
|
||||||
import common.model.Model;
|
import common.model.Model;
|
||||||
import common.model.ModelProvider;
|
import common.model.ModelProvider;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
|
|
||||||
public class ItemFireworkCharge extends Item
|
public class ItemFireworkCharge extends Item
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ public class ItemFireworkCharge extends Item
|
||||||
{
|
{
|
||||||
if (stack.hasTagCompound())
|
if (stack.hasTagCompound())
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound().getTag("Explosion");
|
TagObject nbttagcompound = stack.getTagCompound().getTag("Explosion");
|
||||||
|
|
||||||
if (nbttagcompound != null)
|
if (nbttagcompound != null)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ public class ItemFireworkCharge extends Item
|
||||||
{
|
{
|
||||||
if (stack.hasTagCompound())
|
if (stack.hasTagCompound())
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = stack.getTagCompound().getTag("Explosion");
|
TagObject nbttagcompound = stack.getTagCompound().getTag("Explosion");
|
||||||
|
|
||||||
if (nbttagcompound != null)
|
if (nbttagcompound != null)
|
||||||
{
|
{
|
||||||
|
@ -74,7 +74,7 @@ public class ItemFireworkCharge extends Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addExplosionInfo(NBTTagCompound nbt, List<String> tooltip)
|
public static void addExplosionInfo(TagObject nbt, List<String> tooltip)
|
||||||
{
|
{
|
||||||
byte b0 = nbt.getByte("Type");
|
byte b0 = nbt.getByte("Type");
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ import common.entity.npc.EntityNPC;
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.init.BlockRegistry;
|
import common.init.BlockRegistry;
|
||||||
import common.init.ItemRegistry;
|
import common.init.ItemRegistry;
|
||||||
import common.nbt.NBTBase;
|
import common.nbt.Tag;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.nbt.NBTTagTagList;
|
import common.nbt.TagObjectList;
|
||||||
import common.rng.Random;
|
import common.rng.Random;
|
||||||
import common.util.BlockPos;
|
import common.util.BlockPos;
|
||||||
import common.util.Facing;
|
import common.util.Facing;
|
||||||
|
@ -46,7 +46,7 @@ public final class ItemStack
|
||||||
/**
|
/**
|
||||||
* A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items
|
* A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items
|
||||||
*/
|
*/
|
||||||
private NBTTagCompound stackTagCompound;
|
private TagObject stackTagCompound;
|
||||||
private int itemDamage;
|
private int itemDamage;
|
||||||
|
|
||||||
/** Item frame this stack is on, or null if not on an item frame. */
|
/** 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+";
|
return (amount / 1000000000) + "B+";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack loadItemStackFromNBT(NBTTagCompound nbt)
|
public static ItemStack loadItemStackFromNBT(TagObject nbt)
|
||||||
{
|
{
|
||||||
ItemStack itemstack = new ItemStack();
|
ItemStack itemstack = new ItemStack();
|
||||||
itemstack.readFromNBT(nbt);
|
itemstack.readFromNBT(nbt);
|
||||||
|
@ -138,7 +138,7 @@ public final class ItemStack
|
||||||
|
|
||||||
if (this.stackTagCompound != null)
|
if (this.stackTagCompound != null)
|
||||||
{
|
{
|
||||||
itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy();
|
itemstack.stackTagCompound = (TagObject)this.stackTagCompound.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stackSize -= amount;
|
this.stackSize -= amount;
|
||||||
|
@ -194,7 +194,7 @@ public final class ItemStack
|
||||||
/**
|
/**
|
||||||
* Write the stack fields to a NBT object. Return the new NBT object.
|
* Write the stack fields to a NBT object. Return the new NBT object.
|
||||||
*/
|
*/
|
||||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
|
public TagObject writeToNBT(TagObject nbt)
|
||||||
{
|
{
|
||||||
String resourcelocation = ItemRegistry.REGISTRY.getNameForObject(this.item);
|
String resourcelocation = ItemRegistry.REGISTRY.getNameForObject(this.item);
|
||||||
nbt.setString("id", resourcelocation == null ? "air" : resourcelocation.toString());
|
nbt.setString("id", resourcelocation == null ? "air" : resourcelocation.toString());
|
||||||
|
@ -212,7 +212,7 @@ public final class ItemStack
|
||||||
/**
|
/**
|
||||||
* Read the stack fields from a NBT object.
|
* Read the stack fields from a NBT object.
|
||||||
*/
|
*/
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
public void readFromNBT(TagObject nbt)
|
||||||
{
|
{
|
||||||
if (nbt.hasString("id"))
|
if (nbt.hasString("id"))
|
||||||
{
|
{
|
||||||
|
@ -450,7 +450,7 @@ public final class ItemStack
|
||||||
|
|
||||||
if (this.stackTagCompound != null)
|
if (this.stackTagCompound != null)
|
||||||
{
|
{
|
||||||
itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy();
|
itemstack.stackTagCompound = (TagObject)this.stackTagCompound.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
return itemstack;
|
return itemstack;
|
||||||
|
@ -571,7 +571,7 @@ public final class ItemStack
|
||||||
/**
|
/**
|
||||||
* Returns the NBTTagCompound of the ItemStack.
|
* Returns the NBTTagCompound of the ItemStack.
|
||||||
*/
|
*/
|
||||||
public NBTTagCompound getTagCompound()
|
public TagObject getTagCompound()
|
||||||
{
|
{
|
||||||
return this.stackTagCompound;
|
return this.stackTagCompound;
|
||||||
}
|
}
|
||||||
|
@ -579,7 +579,7 @@ public final class ItemStack
|
||||||
/**
|
/**
|
||||||
* Get an NBTTagCompound from this stack's NBT data.
|
* Get an NBTTagCompound from this stack's NBT data.
|
||||||
*/
|
*/
|
||||||
public NBTTagCompound getSubCompound(String key, boolean create)
|
public TagObject getSubCompound(String key, boolean create)
|
||||||
{
|
{
|
||||||
if (this.stackTagCompound != null && this.stackTagCompound.hasTag(key))
|
if (this.stackTagCompound != null && this.stackTagCompound.hasTag(key))
|
||||||
{
|
{
|
||||||
|
@ -587,7 +587,7 @@ public final class ItemStack
|
||||||
}
|
}
|
||||||
else if (create)
|
else if (create)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
this.setTagInfo(key, nbttagcompound);
|
this.setTagInfo(key, nbttagcompound);
|
||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
}
|
}
|
||||||
|
@ -597,7 +597,7 @@ public final class ItemStack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagTagList getEnchantmentTagList()
|
public TagObjectList getEnchantmentTagList()
|
||||||
{
|
{
|
||||||
return this.stackTagCompound == null ? null : this.stackTagCompound.getTagList("ench");
|
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.
|
* Assigns a NBTTagCompound to the ItemStack, does not validate that only non-stackable items can have it.
|
||||||
*/
|
*/
|
||||||
public void setTagCompound(NBTTagCompound nbt)
|
public void setTagCompound(TagObject nbt)
|
||||||
{
|
{
|
||||||
this.stackTagCompound = nbt;
|
this.stackTagCompound = nbt;
|
||||||
}
|
}
|
||||||
|
@ -642,7 +642,7 @@ public final class ItemStack
|
||||||
{
|
{
|
||||||
if (this.stackTagCompound == null)
|
if (this.stackTagCompound == null)
|
||||||
{
|
{
|
||||||
this.stackTagCompound = new NBTTagCompound();
|
this.stackTagCompound = new TagObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!this.stackTagCompound.hasTag("display"))
|
// if (!this.stackTagCompound.hasTag("display"))
|
||||||
|
@ -842,7 +842,7 @@ public final class ItemStack
|
||||||
{
|
{
|
||||||
// if ((i1 & 1) == 0)
|
// if ((i1 & 1) == 0)
|
||||||
// {
|
// {
|
||||||
NBTTagTagList nbttaglist = this.getEnchantmentTagList();
|
TagObjectList nbttaglist = this.getEnchantmentTagList();
|
||||||
|
|
||||||
if (nbttaglist != null)
|
if (nbttaglist != null)
|
||||||
{
|
{
|
||||||
|
@ -1033,16 +1033,16 @@ public final class ItemStack
|
||||||
{
|
{
|
||||||
if (this.stackTagCompound == null)
|
if (this.stackTagCompound == null)
|
||||||
{
|
{
|
||||||
this.setTagCompound(new NBTTagCompound());
|
this.setTagCompound(new TagObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.stackTagCompound.hasTagList("ench"))
|
if (!this.stackTagCompound.hasTagList("ench"))
|
||||||
{
|
{
|
||||||
this.stackTagCompound.setTagList("ench", new NBTTagTagList());
|
this.stackTagCompound.setTagList("ench", new TagObjectList());
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagTagList nbttaglist = this.stackTagCompound.getTagList("ench");
|
TagObjectList nbttaglist = this.stackTagCompound.getTagList("ench");
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
nbttagcompound.setShort("id", (short)ench.effectId);
|
nbttagcompound.setShort("id", (short)ench.effectId);
|
||||||
nbttagcompound.setShort("lvl", (short)(/* (byte) */ level));
|
nbttagcompound.setShort("lvl", (short)(/* (byte) */ level));
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
|
@ -1058,10 +1058,10 @@ public final class ItemStack
|
||||||
if(!this.stackTagCompound.hasTagList("ench")) {
|
if(!this.stackTagCompound.hasTagList("ench")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
NBTTagTagList oldEnch = this.stackTagCompound.getTagList("ench");
|
TagObjectList oldEnch = this.stackTagCompound.getTagList("ench");
|
||||||
NBTTagTagList newEnch = new NBTTagTagList();
|
TagObjectList newEnch = new TagObjectList();
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
NBTTagCompound tag;
|
TagObject tag;
|
||||||
for(int z = 0; z < oldEnch.size(); z++) {
|
for(int z = 0; z < oldEnch.size(); z++) {
|
||||||
tag = oldEnch.get(z);
|
tag = oldEnch.get(z);
|
||||||
if(tag.getShort("id") != ench.effectId) {
|
if(tag.getShort("id") != ench.effectId) {
|
||||||
|
@ -1111,11 +1111,11 @@ public final class ItemStack
|
||||||
return this.stackTagCompound != null && this.stackTagCompound.hasTagList("ench");
|
return this.stackTagCompound != null && this.stackTagCompound.hasTagList("ench");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTagInfo(String key, NBTBase value)
|
public void setTagInfo(String key, Tag value)
|
||||||
{
|
{
|
||||||
if (this.stackTagCompound == null)
|
if (this.stackTagCompound == null)
|
||||||
{
|
{
|
||||||
this.setTagCompound(new NBTTagCompound());
|
this.setTagCompound(new TagObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stackTagCompound.set(key, value);
|
this.stackTagCompound.set(key, value);
|
||||||
|
@ -1179,7 +1179,7 @@ public final class ItemStack
|
||||||
|
|
||||||
if (!this.hasTagCompound())
|
if (!this.hasTagCompound())
|
||||||
{
|
{
|
||||||
this.stackTagCompound = new NBTTagCompound();
|
this.stackTagCompound = new TagObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stackTagCompound.setInt("RepairCost", cost);
|
this.stackTagCompound.setInt("RepairCost", cost);
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package common.nbt;
|
|
||||||
|
|
||||||
public class NBTException extends Exception {
|
|
||||||
public NBTException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
60
common/src/main/java/common/nbt/Tag.java
Executable file
60
common/src/main/java/common/nbt/Tag.java
Executable file
|
@ -0,0 +1,60 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,15 +4,15 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagByte extends NBTBase
|
class TagByte extends Tag
|
||||||
{
|
{
|
||||||
private byte data;
|
private byte data;
|
||||||
|
|
||||||
NBTTagByte()
|
TagByte()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagByte(byte data)
|
public TagByte(byte data)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class NBTTagByte extends NBTBase
|
||||||
return "" + this.data + "b";
|
return "" + this.data + "b";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy()
|
public Tag copy()
|
||||||
{
|
{
|
||||||
return new NBTTagByte(this.data);
|
return new TagByte(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
if (super.equals(other))
|
if (super.equals(other))
|
||||||
{
|
{
|
||||||
NBTTagByte nbttagbyte = (NBTTagByte)other;
|
TagByte nbttagbyte = (TagByte)other;
|
||||||
return this.data == nbttagbyte.data;
|
return this.data == nbttagbyte.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
|
@ -5,13 +5,13 @@ import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
class NBTTagByteArray extends NBTBase {
|
class TagByteArray extends Tag {
|
||||||
private byte[] data;
|
private byte[] data;
|
||||||
|
|
||||||
NBTTagByteArray() {
|
TagByteArray() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagByteArray(byte[] data) {
|
public TagByteArray(byte[] data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,14 +36,14 @@ class NBTTagByteArray extends NBTBase {
|
||||||
return "[" + this.data.length + " bytes]";
|
return "[" + this.data.length + " bytes]";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy() {
|
public Tag copy() {
|
||||||
byte[] data = new byte[this.data.length];
|
byte[] data = new byte[this.data.length];
|
||||||
System.arraycopy(this.data, 0, data, 0, this.data.length);
|
System.arraycopy(this.data, 0, data, 0, this.data.length);
|
||||||
return new NBTTagByteArray(data);
|
return new TagByteArray(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
return super.equals(other) && Arrays.equals(this.data, ((NBTTagByteArray)other).data);
|
return super.equals(other) && Arrays.equals(this.data, ((TagByteArray)other).data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int hashCode() {
|
public int hashCode() {
|
|
@ -4,15 +4,15 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagDouble extends NBTBase
|
class TagDouble extends Tag
|
||||||
{
|
{
|
||||||
private double data;
|
private double data;
|
||||||
|
|
||||||
NBTTagDouble()
|
TagDouble()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagDouble(double data)
|
public TagDouble(double data)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class NBTTagDouble extends NBTBase
|
||||||
return "" + this.data + "d";
|
return "" + this.data + "d";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy()
|
public Tag copy()
|
||||||
{
|
{
|
||||||
return new NBTTagDouble(this.data);
|
return new TagDouble(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
if (super.equals(other))
|
if (super.equals(other))
|
||||||
{
|
{
|
||||||
NBTTagDouble nbttagdouble = (NBTTagDouble)other;
|
TagDouble nbttagdouble = (TagDouble)other;
|
||||||
return this.data == nbttagdouble.data;
|
return this.data == nbttagdouble.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
27
common/src/main/java/common/nbt/TagDoubleList.java
Normal file
27
common/src/main/java/common/nbt/TagDoubleList.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
7
common/src/main/java/common/nbt/TagException.java
Executable file
7
common/src/main/java/common/nbt/TagException.java
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
public class TagException extends Exception {
|
||||||
|
public TagException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,15 +4,15 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagFloat extends NBTBase
|
class TagFloat extends Tag
|
||||||
{
|
{
|
||||||
private float data;
|
private float data;
|
||||||
|
|
||||||
NBTTagFloat()
|
TagFloat()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagFloat(float data)
|
public TagFloat(float data)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class NBTTagFloat extends NBTBase
|
||||||
return "" + this.data + "f";
|
return "" + this.data + "f";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy()
|
public Tag copy()
|
||||||
{
|
{
|
||||||
return new NBTTagFloat(this.data);
|
return new TagFloat(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
if (super.equals(other))
|
if (super.equals(other))
|
||||||
{
|
{
|
||||||
NBTTagFloat nbttagfloat = (NBTTagFloat)other;
|
TagFloat nbttagfloat = (TagFloat)other;
|
||||||
return this.data == nbttagfloat.data;
|
return this.data == nbttagfloat.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
27
common/src/main/java/common/nbt/TagFloatList.java
Normal file
27
common/src/main/java/common/nbt/TagFloatList.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,15 +4,15 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagInt extends NBTBase
|
class TagInt extends Tag
|
||||||
{
|
{
|
||||||
private int data;
|
private int data;
|
||||||
|
|
||||||
NBTTagInt()
|
TagInt()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagInt(int data)
|
public TagInt(int data)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class NBTTagInt extends NBTBase
|
||||||
return "" + this.data;
|
return "" + this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy()
|
public Tag copy()
|
||||||
{
|
{
|
||||||
return new NBTTagInt(this.data);
|
return new TagInt(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
if (super.equals(other))
|
if (super.equals(other))
|
||||||
{
|
{
|
||||||
NBTTagInt nbttagint = (NBTTagInt)other;
|
TagInt nbttagint = (TagInt)other;
|
||||||
return this.data == nbttagint.data;
|
return this.data == nbttagint.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
|
@ -5,13 +5,13 @@ import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
class NBTTagIntArray extends NBTBase {
|
class TagIntArray extends Tag {
|
||||||
private int[] data;
|
private int[] data;
|
||||||
|
|
||||||
NBTTagIntArray() {
|
TagIntArray() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagIntArray(int[] data) {
|
public TagIntArray(int[] data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,14 +44,14 @@ class NBTTagIntArray extends NBTBase {
|
||||||
return sb.append("]").toString();
|
return sb.append("]").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy() {
|
public Tag copy() {
|
||||||
int[] data = new int[this.data.length];
|
int[] data = new int[this.data.length];
|
||||||
System.arraycopy(this.data, 0, data, 0, this.data.length);
|
System.arraycopy(this.data, 0, data, 0, this.data.length);
|
||||||
return new NBTTagIntArray(data);
|
return new TagIntArray(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
return super.equals(other) && Arrays.equals(this.data, ((NBTTagIntArray)other).data);
|
return super.equals(other) && Arrays.equals(this.data, ((TagIntArray)other).data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int hashCode() {
|
public int hashCode() {
|
27
common/src/main/java/common/nbt/TagIntArrayList.java
Normal file
27
common/src/main/java/common/nbt/TagIntArrayList.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,29 +5,29 @@ import java.util.regex.Pattern;
|
||||||
|
|
||||||
import common.collect.Lists;
|
import common.collect.Lists;
|
||||||
|
|
||||||
public class NBTParser
|
public class TagInterpreter
|
||||||
{
|
{
|
||||||
private static final Pattern PATTERN = Pattern.compile("\\[[-+\\d|,\\s]+\\]");
|
private static final Pattern PATTERN = Pattern.compile("\\[[-+\\d|,\\s]+\\]");
|
||||||
|
|
||||||
public static NBTTagCompound parseTag(String jsonString) throws NBTException
|
public static TagObject parseTag(String jsonString) throws TagException
|
||||||
{
|
{
|
||||||
jsonString = jsonString.trim();
|
jsonString = jsonString.trim();
|
||||||
|
|
||||||
if (!jsonString.startsWith("{"))
|
if (!jsonString.startsWith("{"))
|
||||||
{
|
{
|
||||||
throw new NBTException("Invalid tag encountered, expected \'{\' as first char.");
|
throw new TagException("Invalid tag encountered, expected \'{\' as first char.");
|
||||||
}
|
}
|
||||||
else if (func_150310_b(jsonString) != 1)
|
else if (func_150310_b(jsonString) != 1)
|
||||||
{
|
{
|
||||||
throw new NBTException("Encountered multiple top tags, only one expected");
|
throw new TagException("Encountered multiple top tags, only one expected");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (NBTTagCompound)func_150316_a("tag", jsonString).parse();
|
return (TagObject)func_150316_a("tag", jsonString).parse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int func_150310_b(String p_150310_0_) throws NBTException
|
static int func_150310_b(String p_150310_0_) throws TagException
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
|
@ -43,7 +43,7 @@ public class NBTParser
|
||||||
{
|
{
|
||||||
if (!flag)
|
if (!flag)
|
||||||
{
|
{
|
||||||
throw new NBTException("Illegal use of \\\": " + p_150310_0_);
|
throw new TagException("Illegal use of \\\": " + p_150310_0_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -57,12 +57,12 @@ public class NBTParser
|
||||||
{
|
{
|
||||||
if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123))
|
if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123))
|
||||||
{
|
{
|
||||||
throw new NBTException("Unbalanced curly brackets {}: " + p_150310_0_);
|
throw new TagException("Unbalanced curly brackets {}: " + p_150310_0_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91))
|
if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91))
|
||||||
{
|
{
|
||||||
throw new NBTException("Unbalanced square brackets []: " + p_150310_0_);
|
throw new TagException("Unbalanced square brackets []: " + p_150310_0_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -79,11 +79,11 @@ public class NBTParser
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
throw new NBTException("Unbalanced quotation: " + p_150310_0_);
|
throw new TagException("Unbalanced quotation: " + p_150310_0_);
|
||||||
}
|
}
|
||||||
else if (!stack.isEmpty())
|
else if (!stack.isEmpty())
|
||||||
{
|
{
|
||||||
throw new NBTException("Unbalanced brackets: " + p_150310_0_);
|
throw new TagException("Unbalanced brackets: " + p_150310_0_);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -101,17 +101,17 @@ public class NBTParser
|
||||||
// return func_150316_a(s1, s2);
|
// return func_150316_a(s1, s2);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
static NBTParser.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws NBTException
|
static TagInterpreter.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws TagException
|
||||||
{
|
{
|
||||||
p_150316_1_ = p_150316_1_.trim();
|
p_150316_1_ = p_150316_1_.trim();
|
||||||
|
|
||||||
if (p_150316_1_.startsWith("{"))
|
if (p_150316_1_.startsWith("{"))
|
||||||
{
|
{
|
||||||
p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1);
|
p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1);
|
||||||
NBTParser.Compound jsontonbt$compound;
|
TagInterpreter.Compound jsontonbt$compound;
|
||||||
String s1;
|
String s1;
|
||||||
|
|
||||||
for (jsontonbt$compound = new NBTParser.Compound(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s1.length() + 1))
|
for (jsontonbt$compound = new TagInterpreter.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);
|
s1 = func_150314_a(p_150316_1_, true);
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ public class NBTParser
|
||||||
|
|
||||||
if (c1 != 44 && c1 != 123 && c1 != 125 && c1 != 91 && c1 != 93)
|
if (c1 != 44 && c1 != 123 && c1 != 125 && c1 != 91 && c1 != 93)
|
||||||
{
|
{
|
||||||
throw new NBTException("Unexpected token \'" + c1 + "\' at: " + p_150316_1_.substring(s1.length()));
|
throw new TagException("Unexpected token \'" + c1 + "\' at: " + p_150316_1_.substring(s1.length()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,10 +139,10 @@ public class NBTParser
|
||||||
else if (p_150316_1_.startsWith("[") && !PATTERN.matcher(p_150316_1_).matches())
|
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);
|
p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1);
|
||||||
NBTParser.List jsontonbt$list;
|
TagInterpreter.List jsontonbt$list;
|
||||||
String s;
|
String s;
|
||||||
|
|
||||||
for (jsontonbt$list = new NBTParser.List(p_150316_0_); p_150316_1_.length() > 0; p_150316_1_ = p_150316_1_.substring(s.length() + 1))
|
for (jsontonbt$list = new TagInterpreter.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);
|
s = func_150314_a(p_150316_1_, false);
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ public class NBTParser
|
||||||
|
|
||||||
if (c0 != 44 && c0 != 123 && c0 != 125 && c0 != 91 && c0 != 93)
|
if (c0 != 44 && c0 != 123 && c0 != 125 && c0 != 91 && c0 != 93)
|
||||||
{
|
{
|
||||||
throw new NBTException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s.length()));
|
throw new TagException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s.length()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,18 +169,18 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return new NBTParser.Primitive(p_150316_0_, p_150316_1_);
|
return new TagInterpreter.Primitive(p_150316_0_, p_150316_1_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static NBTParser.Any func_179270_a(String p_179270_0_, boolean p_179270_1_) throws NBTException
|
private static TagInterpreter.Any func_179270_a(String p_179270_0_, boolean p_179270_1_) throws TagException
|
||||||
{
|
{
|
||||||
String s = func_150313_b(p_179270_0_, p_179270_1_);
|
String s = func_150313_b(p_179270_0_, p_179270_1_);
|
||||||
String s1 = func_150311_c(p_179270_0_, p_179270_1_);
|
String s1 = func_150311_c(p_179270_0_, p_179270_1_);
|
||||||
return func_150316_a(s, s1);
|
return func_150316_a(s, s1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws NBTException
|
private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws TagException
|
||||||
{
|
{
|
||||||
int i = func_150312_a(p_150314_0_, ':');
|
int i = func_150312_a(p_150314_0_, ':');
|
||||||
int j = func_150312_a(p_150314_0_, ',');
|
int j = func_150312_a(p_150314_0_, ',');
|
||||||
|
@ -189,12 +189,12 @@ public class NBTParser
|
||||||
{
|
{
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
{
|
{
|
||||||
throw new NBTException("Unable to locate name/value separator for string: " + p_150314_0_);
|
throw new TagException("Unable to locate name/value separator for string: " + p_150314_0_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j != -1 && j < i)
|
if (j != -1 && j < i)
|
||||||
{
|
{
|
||||||
throw new NBTException("Name error at: " + p_150314_0_);
|
throw new TagException("Name error at: " + p_150314_0_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (i == -1 || i > j)
|
else if (i == -1 || i > j)
|
||||||
|
@ -205,7 +205,7 @@ public class NBTParser
|
||||||
return func_179269_a(p_150314_0_, i);
|
return func_179269_a(p_150314_0_, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String func_179269_a(String p_179269_0_, int p_179269_1_) throws NBTException
|
private static String func_179269_a(String p_179269_0_, int p_179269_1_) throws TagException
|
||||||
{
|
{
|
||||||
Stack<Character> stack = new Stack();
|
Stack<Character> stack = new Stack();
|
||||||
int i = p_179269_1_ + 1;
|
int i = p_179269_1_ + 1;
|
||||||
|
@ -223,7 +223,7 @@ public class NBTParser
|
||||||
{
|
{
|
||||||
if (!flag)
|
if (!flag)
|
||||||
{
|
{
|
||||||
throw new NBTException("Illegal use of \\\": " + p_179269_0_);
|
throw new TagException("Illegal use of \\\": " + p_179269_0_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -247,12 +247,12 @@ public class NBTParser
|
||||||
{
|
{
|
||||||
if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123))
|
if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123))
|
||||||
{
|
{
|
||||||
throw new NBTException("Unbalanced curly brackets {}: " + p_179269_0_);
|
throw new TagException("Unbalanced curly brackets {}: " + p_179269_0_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91))
|
if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91))
|
||||||
{
|
{
|
||||||
throw new NBTException("Unbalanced square brackets []: " + p_179269_0_);
|
throw new TagException("Unbalanced square brackets []: " + p_179269_0_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c0 == 44 && stack.isEmpty())
|
if (c0 == 44 && stack.isEmpty())
|
||||||
|
@ -280,7 +280,7 @@ public class NBTParser
|
||||||
return p_179269_0_.substring(0, i);
|
return p_179269_0_.substring(0, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws NBTException
|
private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws TagException
|
||||||
{
|
{
|
||||||
if (p_150313_1_)
|
if (p_150313_1_)
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,7 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new NBTException("Unable to locate name/value separator for string: " + p_150313_0_);
|
throw new TagException("Unable to locate name/value separator for string: " + p_150313_0_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -311,7 +311,7 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws NBTException
|
private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws TagException
|
||||||
{
|
{
|
||||||
if (p_150311_1_)
|
if (p_150311_1_)
|
||||||
{
|
{
|
||||||
|
@ -333,7 +333,7 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new NBTException("Unable to locate name/value separator for string: " + p_150311_0_);
|
throw new TagException("Unable to locate name/value separator for string: " + p_150311_0_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -383,23 +383,23 @@ public class NBTParser
|
||||||
{
|
{
|
||||||
protected String json;
|
protected String json;
|
||||||
|
|
||||||
public abstract NBTBase parse() throws NBTException;
|
public abstract Tag parse() throws TagException;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class Compound extends NBTParser.Any
|
static class Compound extends TagInterpreter.Any
|
||||||
{
|
{
|
||||||
protected java.util.List<NBTParser.Any> field_150491_b = Lists.<NBTParser.Any>newArrayList();
|
protected java.util.List<TagInterpreter.Any> field_150491_b = Lists.<TagInterpreter.Any>newArrayList();
|
||||||
|
|
||||||
public Compound(String p_i45137_1_)
|
public Compound(String p_i45137_1_)
|
||||||
{
|
{
|
||||||
this.json = p_i45137_1_;
|
this.json = p_i45137_1_;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase parse() throws NBTException
|
public Tag parse() throws TagException
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
TagObject nbttagcompound = new TagObject();
|
||||||
|
|
||||||
for (NBTParser.Any jsontonbt$any : this.field_150491_b)
|
for (TagInterpreter.Any jsontonbt$any : this.field_150491_b)
|
||||||
{
|
{
|
||||||
nbttagcompound.set(jsontonbt$any.json, jsontonbt$any.parse());
|
nbttagcompound.set(jsontonbt$any.json, jsontonbt$any.parse());
|
||||||
}
|
}
|
||||||
|
@ -408,36 +408,36 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class List extends NBTParser.Any
|
static class List extends TagInterpreter.Any
|
||||||
{
|
{
|
||||||
protected java.util.List<NBTParser.Any> field_150492_b = Lists.<NBTParser.Any>newArrayList();
|
protected java.util.List<TagInterpreter.Any> field_150492_b = Lists.<TagInterpreter.Any>newArrayList();
|
||||||
|
|
||||||
public List(String json)
|
public List(String json)
|
||||||
{
|
{
|
||||||
this.json = json;
|
this.json = json;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase parse() throws NBTException
|
public Tag parse() throws TagException
|
||||||
{
|
{
|
||||||
NBTTagList nbttaglist = null;
|
TagList nbttaglist = null;
|
||||||
|
|
||||||
for (NBTParser.Any jsontonbt$any : this.field_150492_b)
|
for (TagInterpreter.Any jsontonbt$any : this.field_150492_b)
|
||||||
{
|
{
|
||||||
NBTBase tag = jsontonbt$any.parse();
|
Tag tag = jsontonbt$any.parse();
|
||||||
if(nbttaglist == null) {
|
if(nbttaglist == null) {
|
||||||
switch(tag.getId()) {
|
switch(tag.getId()) {
|
||||||
case 8:
|
case 8:
|
||||||
nbttaglist = new NBTTagStringList();
|
nbttaglist = new TagStringList();
|
||||||
case 10:
|
case 10:
|
||||||
nbttaglist = new NBTTagTagList();
|
nbttaglist = new TagObjectList();
|
||||||
case 5:
|
case 5:
|
||||||
nbttaglist = new NBTTagFloatList();
|
nbttaglist = new TagFloatList();
|
||||||
case 6:
|
case 6:
|
||||||
nbttaglist = new NBTTagDoubleList();
|
nbttaglist = new TagDoubleList();
|
||||||
case 11:
|
case 11:
|
||||||
nbttaglist = new NBTTagIntArrayList();
|
nbttaglist = new TagIntArrayList();
|
||||||
default:
|
default:
|
||||||
throw new NBTException("Type cannot be put in a list: " + jsontonbt$any.json);
|
throw new TagException("Type cannot be put in a list: " + jsontonbt$any.json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nbttaglist.addElem(tag);
|
nbttaglist.addElem(tag);
|
||||||
|
@ -447,7 +447,7 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class Primitive extends NBTParser.Any
|
static class Primitive extends TagInterpreter.Any
|
||||||
{
|
{
|
||||||
private static final Pattern DOUBLE = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+[d|D]");
|
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]");
|
private static final Pattern FLOAT = Pattern.compile("[-+]?[0-9]*\\.?[0-9]+[f|F]");
|
||||||
|
@ -465,54 +465,54 @@ public class NBTParser
|
||||||
this.jsonValue = p_i45139_2_;
|
this.jsonValue = p_i45139_2_;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase parse() throws NBTException
|
public Tag parse() throws TagException
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (DOUBLE.matcher(this.jsonValue).matches())
|
if (DOUBLE.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagDouble(Double.parseDouble(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
return new TagDouble(Double.parseDouble(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FLOAT.matcher(this.jsonValue).matches())
|
if (FLOAT.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagFloat(Float.parseFloat(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
return new TagFloat(Float.parseFloat(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BYTE.matcher(this.jsonValue).matches())
|
if (BYTE.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagByte(Byte.parseByte(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
return new TagByte(Byte.parseByte(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LONG.matcher(this.jsonValue).matches())
|
if (LONG.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagLong(Long.parseLong(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
return new TagLong(Long.parseLong(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SHORT.matcher(this.jsonValue).matches())
|
if (SHORT.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagShort(Short.parseShort(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
return new TagShort(Short.parseShort(this.jsonValue.substring(0, this.jsonValue.length() - 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (INTEGER.matcher(this.jsonValue).matches())
|
if (INTEGER.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagInt(Integer.parseInt(this.jsonValue));
|
return new TagInt(Integer.parseInt(this.jsonValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DOUBLE_UNTYPED.matcher(this.jsonValue).matches())
|
if (DOUBLE_UNTYPED.matcher(this.jsonValue).matches())
|
||||||
{
|
{
|
||||||
return new NBTTagDouble(Double.parseDouble(this.jsonValue));
|
return new TagDouble(Double.parseDouble(this.jsonValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.jsonValue.equalsIgnoreCase("true") || this.jsonValue.equalsIgnoreCase("false"))
|
if (this.jsonValue.equalsIgnoreCase("true") || this.jsonValue.equalsIgnoreCase("false"))
|
||||||
{
|
{
|
||||||
return new NBTTagByte((byte)(Boolean.parseBoolean(this.jsonValue) ? 1 : 0));
|
return new TagByte((byte)(Boolean.parseBoolean(this.jsonValue) ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NumberFormatException var6)
|
catch (NumberFormatException var6)
|
||||||
{
|
{
|
||||||
this.jsonValue = this.jsonValue.replaceAll("\\\\\"", "\"");
|
this.jsonValue = this.jsonValue.replaceAll("\\\\\"", "\"");
|
||||||
return new NBTTagString(this.jsonValue);
|
return new TagString(this.jsonValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.jsonValue.startsWith("[") && this.jsonValue.endsWith("]"))
|
if (this.jsonValue.startsWith("[") && this.jsonValue.endsWith("]"))
|
||||||
|
@ -529,11 +529,11 @@ public class NBTParser
|
||||||
aint[j] = Integer.parseInt(astring[j].trim());
|
aint[j] = Integer.parseInt(astring[j].trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new NBTTagIntArray(aint);
|
return new TagIntArray(aint);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException var5)
|
catch (NumberFormatException var5)
|
||||||
{
|
{
|
||||||
return new NBTTagString(this.jsonValue);
|
return new TagString(this.jsonValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -559,7 +559,7 @@ public class NBTParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new NBTTagString(stringbuilder.toString());
|
return new TagString(stringbuilder.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||||
import common.collect.Lists;
|
import common.collect.Lists;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
|
|
||||||
abstract class NBTTagList<K extends NBTBase> extends NBTBase {
|
abstract class TagList<K extends Tag> extends Tag {
|
||||||
private List<K> list = Lists.newArrayList();
|
private List<K> list = Lists.newArrayList();
|
||||||
|
|
||||||
void write(DataOutput output) throws IOException {
|
void write(DataOutput output) throws IOException {
|
||||||
|
@ -27,7 +27,7 @@ abstract class NBTTagList<K extends NBTBase> extends NBTBase {
|
||||||
tracker.read(4 * len);
|
tracker.read(4 * len);
|
||||||
this.list = new ArrayList<K>(len);
|
this.list = new ArrayList<K>(len);
|
||||||
for(int z = 0; z < len; z++) {
|
for(int z = 0; z < len; z++) {
|
||||||
K tag = (K)NBTBase.createNewByType(this.getType());
|
K tag = (K)Tag.createNewByType(this.getType());
|
||||||
tag.read(input, depth + 1, tracker);
|
tag.read(input, depth + 1, tracker);
|
||||||
this.list.add(tag);
|
this.list.add(tag);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ abstract class NBTTagList<K extends NBTBase> extends NBTBase {
|
||||||
|
|
||||||
protected abstract byte getId();
|
protected abstract byte getId();
|
||||||
protected abstract byte getType();
|
protected abstract byte getType();
|
||||||
protected abstract NBTTagList<K> createInstance();
|
protected abstract TagList<K> createInstance();
|
||||||
protected abstract K getDefault();
|
protected abstract K getDefault();
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -76,8 +76,8 @@ abstract class NBTTagList<K extends NBTBase> extends NBTBase {
|
||||||
return this.list.size();
|
return this.list.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy() {
|
public Tag copy() {
|
||||||
NBTTagList<K> list = this.createInstance();
|
TagList<K> list = this.createInstance();
|
||||||
for(K tag : this.list) {
|
for(K tag : this.list) {
|
||||||
list.list.add((K)tag.copy());
|
list.list.add((K)tag.copy());
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ abstract class NBTTagList<K extends NBTBase> extends NBTBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
return super.equals(other) && this.list.equals(((NBTTagList)other).list);
|
return super.equals(other) && this.list.equals(((TagList)other).list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int hashCode() {
|
public int hashCode() {
|
|
@ -13,10 +13,10 @@ import java.io.IOException;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
|
|
||||||
public class NBTLoader {
|
public class TagLoader {
|
||||||
public static NBTTagCompound readGZip(File file) throws IOException {
|
public static TagObject readGZip(File file) throws IOException {
|
||||||
DataInputStream in = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))));
|
DataInputStream in = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))));
|
||||||
NBTTagCompound tag;
|
TagObject tag;
|
||||||
try {
|
try {
|
||||||
tag = read(in, SizeTracker.INFINITE);
|
tag = read(in, SizeTracker.INFINITE);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public class NBTLoader {
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void writeGZip(NBTTagCompound tag, File file) throws IOException {
|
public static void writeGZip(TagObject tag, File file) throws IOException {
|
||||||
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file))));
|
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(file))));
|
||||||
try {
|
try {
|
||||||
write(tag, out);
|
write(tag, out);
|
||||||
|
@ -36,13 +36,13 @@ public class NBTLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NBTTagCompound read(DataInput in, SizeTracker tracker) throws IOException {
|
public static TagObject read(DataInput in, SizeTracker tracker) throws IOException {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
TagObject tag = new TagObject();
|
||||||
tag.read(in, 0, tracker);
|
tag.read(in, 0, tracker);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void write(NBTTagCompound tag, DataOutput out) throws IOException {
|
public static void write(TagObject tag, DataOutput out) throws IOException {
|
||||||
tag.write(out);
|
tag.write(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,15 +4,15 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagLong extends NBTBase
|
class TagLong extends Tag
|
||||||
{
|
{
|
||||||
private long data;
|
private long data;
|
||||||
|
|
||||||
NBTTagLong()
|
TagLong()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagLong(long data)
|
public TagLong(long data)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class NBTTagLong extends NBTBase
|
||||||
return "" + this.data + "L";
|
return "" + this.data + "L";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy()
|
public Tag copy()
|
||||||
{
|
{
|
||||||
return new NBTTagLong(this.data);
|
return new TagLong(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
if (super.equals(other))
|
if (super.equals(other))
|
||||||
{
|
{
|
||||||
NBTTagLong nbttaglong = (NBTTagLong)other;
|
TagLong nbttaglong = (TagLong)other;
|
||||||
return this.data == nbttaglong.data;
|
return this.data == nbttaglong.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
|
@ -4,7 +4,7 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagEnd extends NBTBase {
|
class TagNull extends Tag {
|
||||||
void read(DataInput input, int depth, SizeTracker tracker) throws IOException {
|
void read(DataInput input, int depth, SizeTracker tracker) throws IOException {
|
||||||
tracker.read(8);
|
tracker.read(8);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ class NBTTagEnd extends NBTBase {
|
||||||
return "END";
|
return "END";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy() {
|
public Tag copy() {
|
||||||
return new NBTTagEnd();
|
return new TagNull();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,12 +10,12 @@ import common.collect.Maps;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class NBTTagCompound extends NBTBase {
|
public class TagObject extends Tag {
|
||||||
private Map<String, NBTBase> tags = Maps.<String, NBTBase>newHashMap();
|
private Map<String, Tag> tags = Maps.<String, Tag>newHashMap();
|
||||||
|
|
||||||
void write(DataOutput output) throws IOException {
|
void write(DataOutput output) throws IOException {
|
||||||
for(String key : this.tags.keySet()) {
|
for(String key : this.tags.keySet()) {
|
||||||
NBTBase tag = this.tags.get(key);
|
Tag tag = this.tags.get(key);
|
||||||
output.writeByte(tag.getId());
|
output.writeByte(tag.getId());
|
||||||
if(tag.getId() != 0) {
|
if(tag.getId() != 0) {
|
||||||
output.writeUTF(key);
|
output.writeUTF(key);
|
||||||
|
@ -34,7 +34,7 @@ public class NBTTagCompound extends NBTBase {
|
||||||
while((id = input.readByte()) != 0) {
|
while((id = input.readByte()) != 0) {
|
||||||
String key = input.readUTF();
|
String key = input.readUTF();
|
||||||
tracker.read(28 + 2 * key.length());
|
tracker.read(28 + 2 * key.length());
|
||||||
NBTBase tag = NBTBase.createNewByType(id);
|
Tag tag = Tag.createNewByType(id);
|
||||||
tag.read(input, depth + 1, tracker);
|
tag.read(input, depth + 1, tracker);
|
||||||
if(this.tags.put(key, tag) != null)
|
if(this.tags.put(key, tag) != null)
|
||||||
tracker.read(36);
|
tracker.read(36);
|
||||||
|
@ -49,80 +49,80 @@ public class NBTTagCompound extends NBTBase {
|
||||||
return (byte)10;
|
return (byte)10;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(String key, NBTBase value) {
|
public void set(String key, Tag value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTag(String key, NBTTagCompound value) {
|
public void setTag(String key, TagObject value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFloatList(String key, NBTTagFloatList value) {
|
public void setFloatList(String key, TagFloatList value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDoubleList(String key, NBTTagDoubleList value) {
|
public void setDoubleList(String key, TagDoubleList value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStringList(String key, NBTTagStringList value) {
|
public void setStringList(String key, TagStringList value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIntArrayList(String key, NBTTagIntArrayList value) {
|
public void setIntArrayList(String key, TagIntArrayList value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTagList(String key, NBTTagTagList value) {
|
public void setTagList(String key, TagObjectList value) {
|
||||||
this.tags.put(key, value);
|
this.tags.put(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setByte(String key, byte value) {
|
public void setByte(String key, byte value) {
|
||||||
this.tags.put(key, new NBTTagByte(value));
|
this.tags.put(key, new TagByte(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShort(String key, short value) {
|
public void setShort(String key, short value) {
|
||||||
this.tags.put(key, new NBTTagShort(value));
|
this.tags.put(key, new TagShort(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInt(String key, int value) {
|
public void setInt(String key, int value) {
|
||||||
this.tags.put(key, new NBTTagInt(value));
|
this.tags.put(key, new TagInt(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLong(String key, long value) {
|
public void setLong(String key, long value) {
|
||||||
this.tags.put(key, new NBTTagLong(value));
|
this.tags.put(key, new TagLong(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFloat(String key, float value) {
|
public void setFloat(String key, float value) {
|
||||||
this.tags.put(key, new NBTTagFloat(value));
|
this.tags.put(key, new TagFloat(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDouble(String key, double value) {
|
public void setDouble(String key, double value) {
|
||||||
this.tags.put(key, new NBTTagDouble(value));
|
this.tags.put(key, new TagDouble(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setString(String key, String value) {
|
public void setString(String key, String value) {
|
||||||
this.tags.put(key, new NBTTagString(value));
|
this.tags.put(key, new TagString(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setByteArray(String key, byte[] value) {
|
public void setByteArray(String key, byte[] value) {
|
||||||
this.tags.put(key, new NBTTagByteArray(value));
|
this.tags.put(key, new TagByteArray(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIntArray(String key, int[] value) {
|
public void setIntArray(String key, int[] value) {
|
||||||
this.tags.put(key, new NBTTagIntArray(value));
|
this.tags.put(key, new TagIntArray(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBool(String key, boolean value) {
|
public void setBool(String key, boolean value) {
|
||||||
this.setByte(key, (byte)(value ? 1 : 0));
|
this.setByte(key, (byte)(value ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase get(String key) {
|
public Tag get(String key) {
|
||||||
return this.tags.get(key);
|
return this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getTagId(String key) {
|
public byte getTagId(String key) {
|
||||||
NBTBase tag = this.tags.get(key);
|
Tag tag = this.tags.get(key);
|
||||||
return tag != null ? tag.getId() : 0;
|
return tag != null ? tag.getId() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,63 +196,63 @@ public class NBTTagCompound extends NBTBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByte(String key) {
|
public byte getByte(String key) {
|
||||||
return !this.hasKey(key, 1) ? 0 : ((NBTTagByte)this.tags.get(key)).getByte();
|
return !this.hasKey(key, 1) ? 0 : ((TagByte)this.tags.get(key)).getByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
public short getShort(String key) {
|
public short getShort(String key) {
|
||||||
return !this.hasKey(key, 2) ? 0 : ((NBTTagShort)this.tags.get(key)).getShort();
|
return !this.hasKey(key, 2) ? 0 : ((TagShort)this.tags.get(key)).getShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getInt(String key) {
|
public int getInt(String key) {
|
||||||
return !this.hasKey(key, 3) ? 0 : ((NBTTagInt)this.tags.get(key)).getInt();
|
return !this.hasKey(key, 3) ? 0 : ((TagInt)this.tags.get(key)).getInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getLong(String key) {
|
public long getLong(String key) {
|
||||||
return !this.hasKey(key, 4) ? 0L : ((NBTTagLong)this.tags.get(key)).getLong();
|
return !this.hasKey(key, 4) ? 0L : ((TagLong)this.tags.get(key)).getLong();
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getFloat(String key) {
|
public float getFloat(String key) {
|
||||||
return !this.hasKey(key, 5) ? 0.0F : ((NBTTagFloat)this.tags.get(key)).getFloat();
|
return !this.hasKey(key, 5) ? 0.0F : ((TagFloat)this.tags.get(key)).getFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDouble(String key) {
|
public double getDouble(String key) {
|
||||||
return !this.hasKey(key, 6) ? 0.0D : ((NBTTagDouble)this.tags.get(key)).getDouble();
|
return !this.hasKey(key, 6) ? 0.0D : ((TagDouble)this.tags.get(key)).getDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getString(String key) {
|
public String getString(String key) {
|
||||||
return !this.hasKey(key, 8) ? "" : ((NBTTagString)this.tags.get(key)).getString();
|
return !this.hasKey(key, 8) ? "" : ((TagString)this.tags.get(key)).getString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getByteArray(String key) {
|
public byte[] getByteArray(String key) {
|
||||||
return !this.hasKey(key, 7) ? new byte[0] : ((NBTTagByteArray)this.tags.get(key)).getByteArray();
|
return !this.hasKey(key, 7) ? new byte[0] : ((TagByteArray)this.tags.get(key)).getByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getIntArray(String key) {
|
public int[] getIntArray(String key) {
|
||||||
return !this.hasKey(key, 11) ? new int[0] : ((NBTTagIntArray)this.tags.get(key)).getIntArray();
|
return !this.hasKey(key, 11) ? new int[0] : ((TagIntArray)this.tags.get(key)).getIntArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound getTag(String key) {
|
public TagObject getTag(String key) {
|
||||||
return !this.hasKey(key, 10) ? new NBTTagCompound() : (NBTTagCompound)this.tags.get(key);
|
return !this.hasKey(key, 10) ? new TagObject() : (TagObject)this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagFloatList getFloatList(String key) {
|
public TagFloatList getFloatList(String key) {
|
||||||
return !this.hasKey(key, 13) ? new NBTTagFloatList() : (NBTTagFloatList)this.tags.get(key);
|
return !this.hasKey(key, 13) ? new TagFloatList() : (TagFloatList)this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagDoubleList getDoubleList(String key) {
|
public TagDoubleList getDoubleList(String key) {
|
||||||
return !this.hasKey(key, 14) ? new NBTTagDoubleList() : (NBTTagDoubleList)this.tags.get(key);
|
return !this.hasKey(key, 14) ? new TagDoubleList() : (TagDoubleList)this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagStringList getStringList(String key) {
|
public TagStringList getStringList(String key) {
|
||||||
return !this.hasKey(key, 9) ? new NBTTagStringList() : (NBTTagStringList)this.tags.get(key);
|
return !this.hasKey(key, 9) ? new TagStringList() : (TagStringList)this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagIntArrayList getIntArrayList(String key) {
|
public TagIntArrayList getIntArrayList(String key) {
|
||||||
return !this.hasKey(key, 15) ? new NBTTagIntArrayList() : (NBTTagIntArrayList)this.tags.get(key);
|
return !this.hasKey(key, 15) ? new TagIntArrayList() : (TagIntArrayList)this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagTagList getTagList(String key) {
|
public TagObjectList getTagList(String key) {
|
||||||
return !this.hasKey(key, 12) ? new NBTTagTagList() : (NBTTagTagList)this.tags.get(key);
|
return !this.hasKey(key, 12) ? new TagObjectList() : (TagObjectList)this.tags.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getBool(String key) {
|
public boolean getBool(String key) {
|
||||||
|
@ -265,7 +265,7 @@ public class NBTTagCompound extends NBTBase {
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder("{");
|
StringBuilder sb = new StringBuilder("{");
|
||||||
for(Entry<String, NBTBase> entry : this.tags.entrySet()) {
|
for(Entry<String, Tag> entry : this.tags.entrySet()) {
|
||||||
if(sb.length() != 1)
|
if(sb.length() != 1)
|
||||||
sb.append(',');
|
sb.append(',');
|
||||||
sb.append(entry.getKey()).append(':').append(entry.getValue());
|
sb.append(entry.getKey()).append(':').append(entry.getValue());
|
||||||
|
@ -277,8 +277,8 @@ public class NBTTagCompound extends NBTBase {
|
||||||
return this.tags.isEmpty();
|
return this.tags.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy() {
|
public Tag copy() {
|
||||||
NBTTagCompound tag = new NBTTagCompound();
|
TagObject tag = new TagObject();
|
||||||
for(String s : this.tags.keySet()) {
|
for(String s : this.tags.keySet()) {
|
||||||
tag.set(s, this.tags.get(s).copy());
|
tag.set(s, this.tags.get(s).copy());
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ public class NBTTagCompound extends NBTBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
return super.equals(other) && this.tags.entrySet().equals(((NBTTagCompound)other).tags.entrySet());
|
return super.equals(other) && this.tags.entrySet().equals(((TagObject)other).tags.entrySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
@ -298,13 +298,13 @@ public class NBTTagCompound extends NBTBase {
|
||||||
* merged using the same methods, other types of tags are overwritten from the
|
* merged using the same methods, other types of tags are overwritten from the
|
||||||
* given compound.
|
* given compound.
|
||||||
*/
|
*/
|
||||||
public void merge(NBTTagCompound other) {
|
public void merge(TagObject other) {
|
||||||
for(String key : other.tags.keySet()) {
|
for(String key : other.tags.keySet()) {
|
||||||
NBTBase tag = other.tags.get(key);
|
Tag tag = other.tags.get(key);
|
||||||
if(tag.getId() == 10) {
|
if(tag.getId() == 10) {
|
||||||
if(this.hasKey(key, 10)) {
|
if(this.hasKey(key, 10)) {
|
||||||
NBTTagCompound comp = this.getTag(key);
|
TagObject comp = this.getTag(key);
|
||||||
comp.merge((NBTTagCompound)tag);
|
comp.merge((TagObject)tag);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.set(key, tag.copy());
|
this.set(key, tag.copy());
|
27
common/src/main/java/common/nbt/TagObjectList.java
Normal file
27
common/src/main/java/common/nbt/TagObjectList.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,15 +4,15 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagShort extends NBTBase
|
class TagShort extends Tag
|
||||||
{
|
{
|
||||||
private short data;
|
private short data;
|
||||||
|
|
||||||
public NBTTagShort()
|
public TagShort()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagShort(short data)
|
public TagShort(short data)
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ class NBTTagShort extends NBTBase
|
||||||
return "" + this.data + "s";
|
return "" + this.data + "s";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy()
|
public Tag copy()
|
||||||
{
|
{
|
||||||
return new NBTTagShort(this.data);
|
return new TagShort(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other)
|
public boolean equals(Object other)
|
||||||
{
|
{
|
||||||
if (super.equals(other))
|
if (super.equals(other))
|
||||||
{
|
{
|
||||||
NBTTagShort nbttagshort = (NBTTagShort)other;
|
TagShort nbttagshort = (TagShort)other;
|
||||||
return this.data == nbttagshort.data;
|
return this.data == nbttagshort.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
|
@ -4,14 +4,14 @@ import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class NBTTagString extends NBTBase {
|
class TagString extends Tag {
|
||||||
private String data;
|
private String data;
|
||||||
|
|
||||||
public NBTTagString() {
|
public TagString() {
|
||||||
this.data = "";
|
this.data = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagString(String data) {
|
public TagString(String data) {
|
||||||
if(data == null)
|
if(data == null)
|
||||||
throw new IllegalArgumentException("null is not allowed");
|
throw new IllegalArgumentException("null is not allowed");
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
@ -35,14 +35,14 @@ class NBTTagString extends NBTBase {
|
||||||
return "\"" + this.data.replace("\"", "\\\"") + "\"";
|
return "\"" + this.data.replace("\"", "\\\"") + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTBase copy() {
|
public Tag copy() {
|
||||||
return new NBTTagString(this.data);
|
return new TagString(this.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(Object other) {
|
public boolean equals(Object other) {
|
||||||
if(!super.equals(other))
|
if(!super.equals(other))
|
||||||
return false;
|
return false;
|
||||||
NBTTagString tag = (NBTTagString)other;
|
TagString tag = (TagString)other;
|
||||||
return this.data == null && tag.data == null || this.data != null && this.data.equals(tag.data);
|
return this.data == null && tag.data == null || this.data != null && this.data.equals(tag.data);
|
||||||
}
|
}
|
||||||
|
|
27
common/src/main/java/common/nbt/TagStringList.java
Normal file
27
common/src/main/java/common/nbt/TagStringList.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package common.nbt;
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,9 +5,9 @@ import java.nio.charset.Charset;
|
||||||
|
|
||||||
import common.init.ItemRegistry;
|
import common.init.ItemRegistry;
|
||||||
import common.item.ItemStack;
|
import common.item.ItemStack;
|
||||||
import common.nbt.NBTLoader;
|
import common.nbt.TagLoader;
|
||||||
import common.nbt.SizeTracker;
|
import common.nbt.SizeTracker;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.net.buffer.ByteBuf;
|
import common.net.buffer.ByteBuf;
|
||||||
import common.net.buffer.ByteBufInputStream;
|
import common.net.buffer.ByteBufInputStream;
|
||||||
import common.net.buffer.ByteBufOutputStream;
|
import common.net.buffer.ByteBufOutputStream;
|
||||||
|
@ -92,26 +92,26 @@ public class PacketBuffer {
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeTag(NBTTagCompound tag) {
|
public void writeTag(TagObject tag) {
|
||||||
if(tag == null) {
|
if(tag == null) {
|
||||||
this.writeByte(0);
|
this.writeByte(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
NBTLoader.write(tag, new ByteBufOutputStream(this.buf));
|
TagLoader.write(tag, new ByteBufOutputStream(this.buf));
|
||||||
}
|
}
|
||||||
catch(IOException e) {
|
catch(IOException e) {
|
||||||
throw new EncoderException(e);
|
throw new EncoderException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound readTag() throws IOException {
|
public TagObject readTag() throws IOException {
|
||||||
int i = this.buf.readerIndex();
|
int i = this.buf.readerIndex();
|
||||||
byte b = this.readByte();
|
byte b = this.readByte();
|
||||||
if(b == 0)
|
if(b == 0)
|
||||||
return null;
|
return null;
|
||||||
this.buf.readerIndex(i);
|
this.buf.readerIndex(i);
|
||||||
return NBTLoader.read(new ByteBufInputStream(this.buf), new SizeTracker(2097152));
|
return TagLoader.read(new ByteBufInputStream(this.buf), new SizeTracker(2097152));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeItemStack(ItemStack stack) {
|
public void writeItemStack(ItemStack stack) {
|
||||||
|
|
|
@ -3,14 +3,14 @@ package common.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import common.dimension.Dimension;
|
import common.dimension.Dimension;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.network.IClientPlayer;
|
import common.network.IClientPlayer;
|
||||||
import common.network.Packet;
|
import common.network.Packet;
|
||||||
import common.network.PacketBuffer;
|
import common.network.PacketBuffer;
|
||||||
|
|
||||||
public class SPacketJoinGame implements Packet<IClientPlayer> {
|
public class SPacketJoinGame implements Packet<IClientPlayer> {
|
||||||
private int entityId;
|
private int entityId;
|
||||||
private NBTTagCompound dimension;
|
private TagObject dimension;
|
||||||
private int type;
|
private int type;
|
||||||
private boolean editor;
|
private boolean editor;
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ package common.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import common.dimension.Dimension;
|
import common.dimension.Dimension;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.network.IClientPlayer;
|
import common.network.IClientPlayer;
|
||||||
import common.network.Packet;
|
import common.network.Packet;
|
||||||
import common.network.PacketBuffer;
|
import common.network.PacketBuffer;
|
||||||
|
|
||||||
public class SPacketRespawn implements Packet<IClientPlayer>
|
public class SPacketRespawn implements Packet<IClientPlayer>
|
||||||
{
|
{
|
||||||
private NBTTagCompound dimension;
|
private TagObject dimension;
|
||||||
private int type;
|
private int type;
|
||||||
private boolean editor;
|
private boolean editor;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package common.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import common.entity.Entity;
|
import common.entity.Entity;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.network.IClientPlayer;
|
import common.network.IClientPlayer;
|
||||||
import common.network.Packet;
|
import common.network.Packet;
|
||||||
import common.network.PacketBuffer;
|
import common.network.PacketBuffer;
|
||||||
|
@ -12,13 +12,13 @@ import common.world.World;
|
||||||
public class SPacketUpdateEntityNBT implements Packet<IClientPlayer>
|
public class SPacketUpdateEntityNBT implements Packet<IClientPlayer>
|
||||||
{
|
{
|
||||||
private int entityId;
|
private int entityId;
|
||||||
private NBTTagCompound tagCompound;
|
private TagObject tagCompound;
|
||||||
|
|
||||||
public SPacketUpdateEntityNBT()
|
public SPacketUpdateEntityNBT()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public SPacketUpdateEntityNBT(int entityIdIn, NBTTagCompound tagCompoundIn)
|
public SPacketUpdateEntityNBT(int entityIdIn, TagObject tagCompoundIn)
|
||||||
{
|
{
|
||||||
this.entityId = entityIdIn;
|
this.entityId = entityIdIn;
|
||||||
this.tagCompound = tagCompoundIn;
|
this.tagCompound = tagCompoundIn;
|
||||||
|
@ -50,7 +50,7 @@ public class SPacketUpdateEntityNBT implements Packet<IClientPlayer>
|
||||||
handler.handleEntityNBT(this);
|
handler.handleEntityNBT(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound getTagCompound()
|
public TagObject getTagCompound()
|
||||||
{
|
{
|
||||||
return this.tagCompound;
|
return this.tagCompound;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package common.packet;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import common.init.TileRegistry;
|
import common.init.TileRegistry;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
import common.network.IClientPlayer;
|
import common.network.IClientPlayer;
|
||||||
import common.network.Packet;
|
import common.network.Packet;
|
||||||
import common.network.PacketBuffer;
|
import common.network.PacketBuffer;
|
||||||
|
@ -14,7 +14,7 @@ public class SPacketUpdateTileEntity implements Packet<IClientPlayer>
|
||||||
{
|
{
|
||||||
private BlockPos blockPos;
|
private BlockPos blockPos;
|
||||||
private int type;
|
private int type;
|
||||||
private NBTTagCompound nbt;
|
private TagObject nbt;
|
||||||
|
|
||||||
public SPacketUpdateTileEntity()
|
public SPacketUpdateTileEntity()
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ public class SPacketUpdateTileEntity implements Packet<IClientPlayer>
|
||||||
{
|
{
|
||||||
this.blockPos = tile.getPos();
|
this.blockPos = tile.getPos();
|
||||||
this.type = TileRegistry.CLASS_TO_ID.get(tile.getClass());
|
this.type = TileRegistry.CLASS_TO_ID.get(tile.getClass());
|
||||||
tile.writeToNBT(this.nbt = new NBTTagCompound());
|
tile.writeToNBT(this.nbt = new TagObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ public class SPacketUpdateTileEntity implements Packet<IClientPlayer>
|
||||||
return this.type == TileRegistry.CLASS_TO_ID.get(tile.getClass());
|
return this.type == TileRegistry.CLASS_TO_ID.get(tile.getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound getNbtCompound()
|
public TagObject getNbtCompound()
|
||||||
{
|
{
|
||||||
return this.nbt;
|
return this.nbt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package common.potion;
|
||||||
|
|
||||||
import common.entity.types.EntityLiving;
|
import common.entity.types.EntityLiving;
|
||||||
import common.log.Log;
|
import common.log.Log;
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
|
|
||||||
public class PotionEffect {
|
public class PotionEffect {
|
||||||
private final Potion potion;
|
private final Potion potion;
|
||||||
|
@ -135,8 +135,8 @@ public class PotionEffect {
|
||||||
&& this.thrown == other.thrown && this.remaining == other.remaining && this.ambient == other.ambient;
|
&& this.thrown == other.thrown && this.remaining == other.remaining && this.ambient == other.ambient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound toNbt() {
|
public TagObject toNbt() {
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
TagObject nbt = new TagObject();
|
||||||
nbt.setString("Type", this.potion.getName());
|
nbt.setString("Type", this.potion.getName());
|
||||||
nbt.setByte("Amplifier", (byte)this.amplifier);
|
nbt.setByte("Amplifier", (byte)this.amplifier);
|
||||||
nbt.setInt("Duration", this.duration);
|
nbt.setInt("Duration", this.duration);
|
||||||
|
@ -146,7 +146,7 @@ public class PotionEffect {
|
||||||
return nbt;
|
return nbt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PotionEffect fromNbt(NBTTagCompound nbt) {
|
public static PotionEffect fromNbt(TagObject nbt) {
|
||||||
Potion potion = Potion.getByName(nbt.getString("Type"));
|
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"))
|
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"));
|
.setRemaining(nbt.getInt("Remaining"));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package common.tileentity;
|
package common.tileentity;
|
||||||
|
|
||||||
import common.nbt.NBTTagCompound;
|
import common.nbt.TagObject;
|
||||||
|
|
||||||
public class LockCode
|
public class LockCode
|
||||||
{
|
{
|
||||||
|
@ -22,12 +22,12 @@ public class LockCode
|
||||||
return this.lock;
|
return this.lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void toNBT(NBTTagCompound nbt)
|
public void toNBT(TagObject nbt)
|
||||||
{
|
{
|
||||||
nbt.setString("Lock", this.lock);
|
nbt.setString("Lock", this.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LockCode fromNBT(NBTTagCompound nbt)
|
public static LockCode fromNBT(TagObject nbt)
|
||||||
{
|
{
|
||||||
if (nbt.hasString("Lock"))
|
if (nbt.hasString("Lock"))
|
||||||
{
|
{
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue