Compare commits

..

3 commits

Author SHA1 Message Date
Sen
6c55d59f1f
cleanup, rename, nbt->cdt "compressed data tree" 2025-05-28 01:11:46 +02:00
Sen
753b4b8b5d
rename tag methods 2025-05-27 22:57:25 +02:00
Sen
c527989ada
locale fix 2025-05-27 22:51:30 +02:00
199 changed files with 1474 additions and 1884 deletions

View file

@ -1380,7 +1380,7 @@ public class Client implements IThreadListener {
if (this.world.getState(blockpos).getBlock() != Blocks.air)
{
int i = itemstack != null ? itemstack.stackSize : 0;
int i = itemstack != null ? itemstack.size : 0;
if (this.controller.clickRight(this.player, this.world, itemstack, blockpos, this.pointed.side, this.pointed.vec))
{
@ -1393,11 +1393,11 @@ public class Client implements IThreadListener {
return;
}
if (itemstack.stackSize == 0)
if (itemstack.size == 0)
{
this.player.inventory.mainInventory[this.player.inventory.currentItem] = null;
}
else if (itemstack.stackSize != i) // || this.controller.isCreative())
else if (itemstack.size != i) // || this.controller.isCreative())
{
this.entityRenderer.itemRenderer.resetEquippedProgress();
}
@ -1426,12 +1426,9 @@ public class Client implements IThreadListener {
return;
}
// boolean flag = this.thePlayer.creative;
int meta = 0;
boolean flag1 = false;
// TileEntity tileentity = null;
Item item = null;
// NBTTagCompound tag = null;
if (this.pointed.type == HitPosition.ObjectType.BLOCK)
{
@ -1902,7 +1899,7 @@ public class Client implements IThreadListener {
: "Rüstung: n/a, Pfeile: n/a") + "\n" +
// ItemStack held = ((EntityLiving)entity).getHeldItem();
(held != null ?
"Gegens.: " + ItemRegistry.REGISTRY.getNameForObject(held.getItem()) + " x" + held.stackSize + " (" + held.getMetadata() + ")" : "Gegens.: n/a") + "\n" +
"Gegens.: " + ItemRegistry.REGISTRY.getNameForObject(held.getItem()) + " x" + held.size + " (" + held.getMetadata() + ")" : "Gegens.: n/a") + "\n" +
"Eigens.: " + (entity.dead ? "D" : " ") + (entity.noClip ? "N" : " ") + (entity.onGround ? "G" : " ")
+ (entity.canBeCollidedWith() ? "C" : " ") + (entity.canBePushed() ? "P" : " ")
+ (entity.isBurning() ? "B" : " ") // + (entity.isInvisible() ? "I" : " ") // + (entity.isSilent() ? "S" : " ")

View file

@ -374,20 +374,20 @@ public abstract class GuiContainer extends Gui
if (this.draggedStack != null && this.isRightMouseClick)
{
itemstack = itemstack.copy();
itemstack.stackSize = ExtMath.ceilf((float)itemstack.stackSize / 2.0F);
itemstack.size = ExtMath.ceilf((float)itemstack.size / 2.0F);
}
else if (this.dragSplitting && this.dragSplittingSlots.size() > 1)
{
itemstack = itemstack.copy();
itemstack.stackSize = this.dragSplittingRemnant;
itemstack.size = this.dragSplittingRemnant;
if (itemstack.stackSize == 0)
if (itemstack.size == 0)
{
s = "" + TextColor.YELLOW + "0";
}
}
else if(itemstack == this.cheatStack) {
s = TextColor.DGREEN + "+" + TextColor.GREEN + ItemStack.formatAmount(itemstack.stackSize);
s = TextColor.DGREEN + "+" + TextColor.GREEN + ItemStack.formatAmount(itemstack.size);
}
this.drawItemStack(itemstack, mouseX - j2, mouseY - k2, s);
@ -518,7 +518,7 @@ public abstract class GuiContainer extends Gui
if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != null)
{
itemstack = itemstack.copy();
itemstack.stackSize /= 2;
itemstack.size /= 2;
}
else if (this.dragSplitting && this.dragSplittingSlots.contains(slotIn) && itemstack1 != null)
{
@ -531,18 +531,18 @@ public abstract class GuiContainer extends Gui
{
itemstack = itemstack1.copy();
flag = true;
Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack, slotIn.getStack() == null ? 0 : slotIn.getStack().stackSize);
Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack, slotIn.getStack() == null ? 0 : slotIn.getStack().size);
if (itemstack.stackSize > itemstack.getMaxStackSize())
if (itemstack.size > itemstack.getMaxStackSize())
{
s = TextColor.YELLOW + ItemStack.formatAmount(itemstack.getMaxStackSize());
itemstack.stackSize = itemstack.getMaxStackSize();
itemstack.size = itemstack.getMaxStackSize();
}
if (itemstack.stackSize > slotIn.getItemStackLimit(itemstack))
if (itemstack.size > slotIn.getItemStackLimit(itemstack))
{
s = TextColor.YELLOW + ItemStack.formatAmount(slotIn.getItemStackLimit(itemstack));
itemstack.stackSize = slotIn.getItemStackLimit(itemstack);
itemstack.size = slotIn.getItemStackLimit(itemstack);
}
}
else
@ -593,25 +593,25 @@ public abstract class GuiContainer extends Gui
if (itemstack != null && this.dragSplitting)
{
this.dragSplittingRemnant = itemstack.stackSize;
this.dragSplittingRemnant = itemstack.size;
for (Slot slot : this.dragSplittingSlots)
{
ItemStack itemstack1 = itemstack.copy();
int i = slot.getStack() == null ? 0 : slot.getStack().stackSize;
int i = slot.getStack() == null ? 0 : slot.getStack().size;
Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack1, i);
if (itemstack1.stackSize > itemstack1.getMaxStackSize())
if (itemstack1.size > itemstack1.getMaxStackSize())
{
itemstack1.stackSize = itemstack1.getMaxStackSize();
itemstack1.size = itemstack1.getMaxStackSize();
}
if (itemstack1.stackSize > slot.getItemStackLimit(itemstack1))
if (itemstack1.size > slot.getItemStackLimit(itemstack1))
{
itemstack1.stackSize = slot.getItemStackLimit(itemstack1);
itemstack1.size = slot.getItemStackLimit(itemstack1);
}
this.dragSplittingRemnant -= itemstack1.stackSize - i;
this.dragSplittingRemnant -= itemstack1.size - i;
}
}
}
@ -644,7 +644,7 @@ public abstract class GuiContainer extends Gui
if(this.cheatStack != null) {
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
if((mouseButton == 0 || mouseButton == 1) && slot != null && this.gm.player != null && slot.inventory == this.gm.player.inventory)
this.gm.player.client.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.stackSize > 1));
this.gm.player.client.addToSendQueue(new CPacketCheat(this.cheatStack, slot.getIndex(), mouseButton == 0 && this.cheatStack.size > 1));
if(mouseButton != 1 && !this.gm.ctrl())
this.cheatStack = null;
return;
@ -811,7 +811,7 @@ public abstract class GuiContainer extends Gui
// }
// }
// else
if (this.dragSplitting && slot != null && itemstack != null && itemstack.stackSize > this.dragSplittingSlots.size() && Container.canAddItemToSlot(slot, itemstack, true) && slot.isItemValid(itemstack) && this.inventorySlots.canDragIntoSlot(slot))
if (this.dragSplitting && slot != null && itemstack != null && itemstack.size > this.dragSplittingSlots.size() && Container.canAddItemToSlot(slot, itemstack, true) && slot.isItemValid(itemstack) && this.inventorySlots.canDragIntoSlot(slot))
{
this.dragSplittingSlots.add(slot);
this.updateDragSplitting();
@ -1090,13 +1090,13 @@ public abstract class GuiContainer extends Gui
{
if (stack != null)
{
if (stack.stackSize != 1 || text != null)
if (stack.size != 1 || text != null)
{
String s = text == null ? ItemStack.formatAmount(stack.stackSize) : text;
String s = text == null ? ItemStack.formatAmount(stack.size) : text;
if (text == null && stack.stackSize < 1)
if (text == null && stack.size < 1)
{
s = TextColor.RED + ItemStack.formatAmount(stack.stackSize);
s = TextColor.RED + ItemStack.formatAmount(stack.size);
}
// this.drawString(s, , );
// Vec2i size = Drawing.txt_size(0, 0, 0, 0, 65536, 65536, s);
@ -1201,7 +1201,7 @@ public abstract class GuiContainer extends Gui
}
else {
this.cheatStack = ITEM_LIST.get(i1).copy();
this.cheatStack.stackSize = full ? this.cheatStack.getMaxStackSize() : 1;
this.cheatStack.size = full ? this.cheatStack.getMaxStackSize() : 1;
}
return true;
}

View file

@ -96,7 +96,7 @@ import common.packet.SPacketSignEditorOpen;
import common.packet.SPacketPlayerListItem;
import common.packet.SPacketPlayerAbilities;
import common.packet.SPacketTabComplete;
import common.packet.SPacketUpdateEntityNBT;
import common.packet.SPacketUpdateEntityTags;
import common.packet.SPacketAnimation;
import common.packet.SPacketBiome;
import common.packet.SPacketBlockAction;
@ -1331,7 +1331,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
}
/**
* Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
* Updates the metadata of instances of the following entitytypes: Mob spawners, command blocks,
* beacons, skulls, flowerpot
*/
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
@ -1345,7 +1345,7 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
if (tileentity != null && packetIn.isTileEntityType(tileentity)) // i == 1 && tileentity instanceof TileEntityMobSpawner || /* i == 2 && tileentity instanceof TileEntityCommandBlock || */ i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || /* i == 5 && tileentity instanceof TileEntityFlowerPot || */ i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityMachine)
{
tileentity.readFromNBT(packetIn.getNbtCompound());
tileentity.readTags(packetIn.getTags());
}
}
}
@ -1714,14 +1714,14 @@ public class ClientPlayer extends NetHandler implements IClientPlayer
//// }
// }
public void handleEntityNBT(SPacketUpdateEntityNBT packetIn)
public void handleEntityTags(SPacketUpdateEntityTags packetIn)
{
NetHandler.checkThread(packetIn, this, this.gameController, this.clientWorldController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
entity.clientUpdateEntityNBT(packetIn.getTagCompound());
entity.clientUpdateEntityTags(packetIn.getTagCompound());
}
}

View file

@ -66,19 +66,19 @@ public class RenderEntityItem extends Render<EntityItem>
{
int i = 1;
if (stack.stackSize > 48)
if (stack.size > 48)
{
i = 5;
}
else if (stack.stackSize > 32)
else if (stack.size > 32)
{
i = 4;
}
else if (stack.stackSize > 16)
else if (stack.size > 16)
{
i = 3;
}
else if (stack.stackSize > 1)
else if (stack.size > 1)
{
i = 2;
}

View file

@ -208,16 +208,16 @@ 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.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tag)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
* (abstract) Protected helper method to read subclass entity data.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tag)
{
}

View file

@ -206,7 +206,7 @@ public class EntityFirework
if (p_i46464_15_ != null)
{
this.fireworkExplosions = p_i46464_15_.getTagList("Explosions");
this.fireworkExplosions = p_i46464_15_.getObjectList("Explosions");
if (this.fireworkExplosions.size() == 0)
{
@ -218,9 +218,9 @@ public class EntityFirework
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
{
TagObject nbttagcompound = this.fireworkExplosions.get(i);
TagObject tag = this.fireworkExplosions.get(i);
if (nbttagcompound.getBool("Flicker"))
if (tag.getBool("Flicker"))
{
this.twinkle = true;
this.particleMaxAge += 15;
@ -250,9 +250,9 @@ public class EntityFirework
{
for (int i = 0; i < this.fireworkExplosions.size(); ++i)
{
TagObject nbttagcompound = this.fireworkExplosions.get(i);
TagObject tag = this.fireworkExplosions.get(i);
if (nbttagcompound.getByte("Type") == 1)
if (tag.getByte("Type") == 1)
{
flag1 = true;
break;
@ -268,12 +268,12 @@ public class EntityFirework
if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.size())
{
int k = this.fireworkAge / 2;
TagObject nbttagcompound1 = this.fireworkExplosions.get(k);
int l = nbttagcompound1.getByte("Type");
boolean flag4 = nbttagcompound1.getBool("Trail");
boolean flag2 = nbttagcompound1.getBool("Flicker");
int[] aint = nbttagcompound1.getIntArray("Colors");
int[] aint1 = nbttagcompound1.getIntArray("FadeColors");
TagObject tag = this.fireworkExplosions.get(k);
int l = tag.getByte("Type");
boolean flag4 = tag.getBool("Trail");
boolean flag2 = tag.getBool("Flicker");
int[] aint = tag.getIntArray("Colors");
int[] aint1 = tag.getIntArray("FadeColors");
if (aint.length == 0)
{

View file

@ -30,18 +30,6 @@ public class TileEntityItemStackRenderer
}
else if (itemStackIn.getItem() == Items.skull)
{
// String user = null;
//
// if (itemStackIn.hasTagCompound())
// {
// NBTTagCompound nbttagcompound = itemStackIn.getTagCompound();
//
// if (nbttagcompound.hasString("SkullOwner") && nbttagcompound.getString("SkullOwner").length() > 0)
// {
// user = nbttagcompound.getString("SkullOwner");
// }
// }
if (TileEntitySkullRenderer.instance != null)
{
GL11.glPushMatrix();

View file

@ -64,7 +64,7 @@ public class PlayerController {
if(stack != null) {
stack.onBlockDestroyed(world, block, pos, this.gm.player);
if(stack.stackSize == 0) {
if(stack.size == 0) {
this.gm.player.destroyCurrentEquippedItem();
}
}
@ -256,13 +256,13 @@ public class PlayerController {
public boolean sendUseItem(EntityNPC player, World world, ItemStack stack) {
this.syncItem();
this.handler.addToSendQueue(new CPacketPlace(player.inventory.getCurrentItem()));
int size = stack.stackSize;
int size = stack.size;
ItemStack changed = stack.useItemRightClick(world, player);
if(changed != stack || changed != null && changed.stackSize != size) {
if(changed != stack || changed != null && changed.size != size) {
player.inventory.mainInventory[player.inventory.currentItem] = changed;
if(changed.stackSize == 0) {
if(changed.size == 0) {
player.inventory.mainInventory[player.inventory.currentItem] = null;
}

View file

@ -178,7 +178,7 @@ public class EntityAIControlledByPlayer extends EntityAIBase
{
itemstack.damageItem(1, entityplayer);
if (itemstack.stackSize == 0)
if (itemstack.size == 0)
{
ItemStack itemstack1 = new ItemStack(Items.fishing_rod);
itemstack1.setTagCompound(itemstack.getTagCompound());

View file

@ -60,21 +60,21 @@ public class EntityAIShareItems extends EntityAIWatchClosest2
{
Item item = itemstack.getItem();
if ((item == Items.bread || item == Items.potato || item == Items.carrot) && itemstack.stackSize > 3)
if ((item == Items.bread || item == Items.potato || item == Items.carrot) && itemstack.size > 3)
{
int l = itemstack.stackSize / 2;
itemstack.stackSize -= l;
int l = itemstack.size / 2;
itemstack.size -= l;
itemstack1 = new ItemStack(item, l, itemstack.getMetadata());
}
else if (item == Items.wheats && itemstack.stackSize > 5)
else if (item == Items.wheats && itemstack.size > 5)
{
int j = itemstack.stackSize / 2 / 3 * 3;
int j = itemstack.size / 2 / 3 * 3;
int k = j / 3;
itemstack.stackSize -= j;
itemstack.size -= j;
itemstack1 = new ItemStack(Items.bread, k, 0);
}
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
inventorybasic.setInventorySlotContents(i, (ItemStack)null);
}

View file

@ -114,8 +114,8 @@ public class EntityAITakePlace extends EntityAIBase
(float)this.entity.getVerticalFaceSpeed());
this.entity.swingItem();
world.setState(blockpos, state, 3);
--stack.stackSize;
if(stack.stackSize <= 0)
--stack.size;
if(stack.size <= 0)
this.entity.setItemNoUpdate(0, null);
}
}
@ -125,14 +125,14 @@ public class EntityAITakePlace extends EntityAIBase
if (STEALABLE.containsKey(state) &&
(this.entity.getHeldItem() == null || (ItemStack.areItemsEqual(STEALABLE.get(state),
this.entity.getHeldItem()) && this.entity.getHeldItem().stackSize < this.entity.getHeldItem().getMaxStackSize())))
this.entity.getHeldItem()) && this.entity.getHeldItem().size < this.entity.getHeldItem().getMaxStackSize())))
{
this.entity.getLookHelper().setLookPosition((double)i + 0.5, (double)j + 0.5, (double)k + 0.5, 10.0F,
(float)this.entity.getVerticalFaceSpeed());
this.entity.swingItem();
world.setState(blockpos, Blocks.air.getState());
if(this.entity.getHeldItem() != null)
++this.entity.getHeldItem().stackSize;
++this.entity.getHeldItem().size;
else
this.entity.setItemNoUpdate(0, STEALABLE.get(state).copy());
}

View file

@ -75,7 +75,7 @@ public class Attributes
}
}
nbttagcompound.setTagList("Modifiers", nbttaglist);
nbttagcompound.setObjectList("Modifiers", nbttaglist);
}
return nbttagcompound;
@ -116,9 +116,9 @@ public class Attributes
{
instance.setBaseValue(compound.getDouble("Base"));
if (compound.hasTagList("Modifiers"))
if (compound.hasObjectList("Modifiers"))
{
TagObjectList nbttaglist = compound.getTagList("Modifiers");
TagObjectList nbttaglist = compound.getObjectList("Modifiers");
for (int i = 0; i < nbttaglist.size(); ++i)
{

View file

@ -191,7 +191,7 @@ public class BlockFlowerPot extends Block // Container
// worldIn.markBlockForUpdate(pos);
// playerIn.triggerAchievement(StatRegistry.flowerPottedStat);
if (/* !playerIn.creative && */ --itemstack.stackSize <= 0)
if (/* !playerIn.creative && */ --itemstack.size <= 0)
{
playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null);
}

View file

@ -60,7 +60,7 @@ public class BlockOre extends Block
public int quantityDropped(Random random)
{
return this.dropItem == null ? 1 : (this.dropItem.stackSize + (this.dropChance > 0 ? random.zrange(this.dropChance + 1) : 0));
return this.dropItem == null ? 1 : (this.dropItem.size + (this.dropChance > 0 ? random.zrange(this.dropChance + 1) : 0));
// this == Blocks.lapis_ore ? 4 + random.nextInt(5) : 1;
}

View file

@ -525,9 +525,9 @@ public class BlockCauldron extends Block
}
// playerIn.triggerAchievement(StatRegistry.cauldronUsedStat);
--itemstack.stackSize;
--itemstack.size;
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, (ItemStack)null);
}
@ -556,10 +556,10 @@ public class BlockCauldron extends Block
if (i > 0 && item instanceof ItemBanner && TileEntityBanner.getPatterns(itemstack) > 0)
{
ItemStack itemstack1 = itemstack.copy();
itemstack1.stackSize = 1;
itemstack1.size = 1;
TileEntityBanner.removeBannerData(itemstack1);
if (itemstack.stackSize <= 1) // && !playerIn.creative)
if (itemstack.size <= 1) // && !playerIn.creative)
{
playerIn.inventory.setInventorySlotContents(playerIn.inventory.currentItem, itemstack1);
}
@ -578,7 +578,7 @@ public class BlockCauldron extends Block
// if (!playerIn.creative)
// {
--itemstack.stackSize;
--itemstack.size;
// }
}

View file

@ -144,7 +144,7 @@ public class BlockDispenser extends BlockContainer
if (ibehaviordispenseitem != IBehaviorDispenseItem.itemDispenseBehaviorProvider)
{
ItemStack itemstack1 = ibehaviordispenseitem.dispense(blocksourceimpl, itemstack);
tileentitydispenser.setInventorySlotContents(i, itemstack1.stackSize <= 0 ? null : itemstack1);
tileentitydispenser.setInventorySlotContents(i, itemstack1.size <= 0 ? null : itemstack1);
}
}
}

View file

@ -57,7 +57,7 @@ public class BlockDropper extends BlockDispenser
{
itemstack1 = this.dropBehavior.dispense(blocksourceimpl, itemstack);
if (itemstack1 != null && itemstack1.stackSize <= 0)
if (itemstack1 != null && itemstack1.size <= 0)
{
itemstack1 = null;
}
@ -70,7 +70,7 @@ public class BlockDropper extends BlockDispenser
{
itemstack1 = itemstack.copy();
if (--itemstack1.stackSize <= 0)
if (--itemstack1.size <= 0)
{
itemstack1 = null;
}

View file

@ -112,7 +112,7 @@ public class BlockTNT extends Block
}
else // if (!playerIn.creative)
{
--playerIn.getCurrentEquippedItem().stackSize;
--playerIn.getCurrentEquippedItem().size;
}
return true;

View file

@ -125,13 +125,13 @@ public class BlockBanner extends BlockContainer
if (tileentity instanceof TileEntityBanner)
{
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)tileentity).getBaseColor());
TagObject nbttagcompound = new TagObject();
tileentity.writeToNBT(nbttagcompound);
nbttagcompound.remove("x");
nbttagcompound.remove("y");
nbttagcompound.remove("z");
nbttagcompound.remove("id");
itemstack.setTagInfo("BlockEntityTag", nbttagcompound);
TagObject tag = new TagObject();
tileentity.writeTags(tag);
tag.remove("x");
tag.remove("y");
tag.remove("z");
tag.remove("id");
itemstack.setTagInfo("BlockEntityTag", tag);
spawnAsEntity(worldIn, pos, itemstack);
}
else
@ -151,9 +151,9 @@ public class BlockBanner extends BlockContainer
{
TileEntityBanner tileentitybanner = (TileEntityBanner)te;
ItemStack itemstack = new ItemStack(Items.banner, 1, ((TileEntityBanner)te).getBaseColor());
TagObject nbttagcompound = new TagObject();
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns());
itemstack.setTagInfo("BlockEntityTag", nbttagcompound);
TagObject tag = new TagObject();
TileEntityBanner.setBaseColorAndPatterns(tag, tileentitybanner.getBaseColor(), tileentitybanner.getPatterns());
itemstack.setTagInfo("BlockEntityTag", tag);
spawnAsEntity(worldIn, pos, itemstack);
}
else

View file

@ -110,13 +110,7 @@ public class BlockSkull extends BlockContainer
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntitySkull)
{
// TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
ItemStack itemstack = new ItemStack(Items.skull, 1, 0);
// if (tileentityskull.getUser() != null)
// {
// itemstack.setTagCompound(new NBTTagCompound());
// itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getUser());
// }
spawnAsEntity(worldIn, pos, itemstack);
}
super.onBlockRemoved(worldIn, pos, state);

View file

@ -802,15 +802,15 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
return other == null ? -1 : this.name.compareTo(other.name);
}
public static Dimension getByNbt(TagObject tag) {
return getByNbt(tag, true, false, false, false);
public static Dimension getByTag(TagObject tag) {
return getByTag(tag, true, false, false, false);
}
public static Dimension getByNbt(TagObject tag, boolean generator) {
return getByNbt(tag, false, generator, !generator, false);
public static Dimension getByTag(TagObject tag, boolean generator) {
return getByTag(tag, false, generator, !generator, false);
}
private static Dimension getByNbt(TagObject tag, boolean mapOnly, boolean generator, boolean partialGen, boolean all) {
private static Dimension getByTag(TagObject tag, boolean mapOnly, boolean generator, boolean partialGen, boolean all) {
Dimension dim;
DimType type = DimType.getByName(tag.getString("Type"));
int id = tag.getInt("ID");
@ -836,28 +836,28 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
dim = Space.INSTANCE;
}
if(!mapOnly)
dim.fromNbt(tag, generator, partialGen, all);
dim.fromTags(tag, generator, partialGen, all);
return dim;
}
public final Dimension copy() {
Dimension dim = getByNbt(this.toNbt(true, false, true), false, true, false, true);
Dimension dim = getByTag(this.toTags(true, false, true), false, true, false, true);
dim.setCustomName(this.getCustomName());
return dim;
}
public final Dimension copy(int id, String name) {
TagObject tag = this.toNbt(true, false, true);
TagObject tag = this.toTags(true, false, true);
tag.setInt("ID", id);
tag.setString("Name", name);
return getByNbt(tag, false, true, false, true);
return getByTag(tag, false, true, false, true);
}
public final void fromNbt(TagObject tag) {
this.fromNbt(tag, true, false, false);
public final void fromTags(TagObject tag) {
this.fromTags(tag, true, false, false);
}
private final void fromNbt(TagObject tag, boolean generator, boolean partialGen, boolean all) {
private final void fromTags(TagObject tag, boolean generator, boolean partialGen, boolean all) {
if(this == Space.INSTANCE) {
if(generator || partialGen)
this.seed = tag.getLong("Seed");
@ -1006,8 +1006,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
this.hotBiomes = null;
}
this.ores.clear();
if(tag.hasTagList("Ores")) {
TagObjectList list = tag.getTagList("Ores");
if(tag.hasObjectList("Ores")) {
TagObjectList list = tag.getObjectList("Ores");
for(int z = 0; z < list.size(); z++) {
TagObject gen = list.get(z);
this.ores.add(new Ore(BlockRegistry.getFromIdName(gen.getString("Block"), Blocks.iron_ore.getState()),
@ -1016,8 +1016,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
}
this.lakes.clear();
if(tag.hasTagList("Lakes")) {
TagObjectList list = tag.getTagList("Lakes");
if(tag.hasObjectList("Lakes")) {
TagObjectList list = tag.getObjectList("Lakes");
for(int z = 0; z < list.size(); z++) {
TagObject gen = list.get(z);
this.lakes.add(new Lake(
@ -1028,8 +1028,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
}
this.liquids.clear();
if(tag.hasTagList("Liquids")) {
TagObjectList list = tag.getTagList("Liquids");
if(tag.hasObjectList("Liquids")) {
TagObjectList list = tag.getObjectList("Liquids");
for(int z = 0; z < list.size(); z++) {
TagObject gen = list.get(z);
this.liquids.add(new Liquid(
@ -1042,9 +1042,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
else {
this.fullName = tag.getString("FullName");
this.readNbt(tag);
this.readTags(tag);
}
// this.readNbt(tag);
// this.customName = tag.hasString("CustomName") ? tag.getString("CustomName") : null;
if(all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) {
this.denseFog = tag.getBool("DenseFog");
@ -1067,8 +1066,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
if(tag.hasInt("StarColor")) {
this.setStarColor(tag.getInt("StarColor"));
}
else if(tag.hasTag("StarColorFnc")) {
TagObject fnc = tag.getTag("StarColorFnc");
else if(tag.hasObject("StarColorFnc")) {
TagObject fnc = tag.getObject("StarColorFnc");
this.setStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
}
@ -1078,8 +1077,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
if(tag.hasInt("DStarColor")) {
this.setDeepStarColor(tag.getInt("DStarColor"));
}
else if(tag.hasTag("DStarColorFnc")) {
TagObject fnc = tag.getTag("DStarColorFnc");
else if(tag.hasObject("DStarColorFnc")) {
TagObject fnc = tag.getObject("DStarColorFnc");
this.setDeepStarColorSin(fnc.getFloat("Period"), fnc.getFloat("Det"), fnc.getFloat("Dist"),
fnc.getInt("Color"), fnc.getByte("DetChn"), fnc.getByte("DistChn"));
}
@ -1089,12 +1088,12 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
}
public final TagObject toNbt(boolean generator) {
return this.toNbt(generator, !generator, false);
public final TagObject toTags(boolean generator) {
return this.toTags(generator, !generator, false);
}
private final TagObject toNbt(boolean generator, boolean partialGen, boolean all) {
TagObject tag = (all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) ? this.toNbt() : new TagObject();
private final TagObject toTags(boolean generator, boolean partialGen, boolean all) {
TagObject tag = (all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) ? this.toTags() : new TagObject();
if(this == Space.INSTANCE) {
if(generator || partialGen)
tag.setLong("Seed", this.seed);
@ -1212,7 +1211,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
ore.setInt("MaxS", gen.max);
list.add(ore);
}
tag.setTagList("Ores", list);
tag.setObjectList("Ores", list);
}
if(!this.lakes.isEmpty()) {
TagObjectList list = new TagObjectList();
@ -1229,7 +1228,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
lake.setInt("Max", gen.maxHeight);
list.add(lake);
}
tag.setTagList("Lakes", list);
tag.setObjectList("Lakes", list);
}
if(!this.liquids.isEmpty()) {
TagObjectList list = new TagObjectList();
@ -1242,7 +1241,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
liquid.setInt("Max", gen.maxHeight);
list.add(liquid);
}
tag.setTagList("Liquids", list);
tag.setObjectList("Liquids", list);
}
if(!this.populated)
tag.setBool("NoPopulation", true);
@ -1250,9 +1249,8 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
}
else {
tag.setString("FullName", this.getFormattedName(true));
this.writeNbt(tag);
this.writeTags(tag);
}
// this.writeNbt(tag);
// if(this.customName != null)
// tag.setString("CustomName", this.customName);
if(all || !generator || this.id >= UniverseRegistry.MORE_DIM_ID) {
@ -1284,7 +1282,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
fnc.setInt("Color", ((SinusColorGen)this.starColorFunc).color);
fnc.setByte("DetChn", (byte)((SinusColorGen)this.starColorFunc).detChn);
fnc.setByte("DistChn", (byte)((SinusColorGen)this.starColorFunc).distChn);
tag.setTag("StarColorFnc", fnc);
tag.setObject("StarColorFnc", fnc);
}
if(this.deepstarColorFunc instanceof SingleColorGen) {
tag.setInt("DStarColor", ((SingleColorGen)this.deepstarColorFunc).color);
@ -1297,13 +1295,13 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
fnc.setInt("Color", ((SinusColorGen)this.deepstarColorFunc).color);
fnc.setByte("DetChn", (byte)((SinusColorGen)this.deepstarColorFunc).detChn);
fnc.setByte("DistChn", (byte)((SinusColorGen)this.deepstarColorFunc).distChn);
tag.setTag("DStarColorFnc", fnc);
tag.setObject("DStarColorFnc", fnc);
}
}
return tag;
}
public final TagObject toNbt() {
public final TagObject toTags() {
TagObject tag = new TagObject();
tag.setInt("ID", this.id);
tag.setString("Name", this.name);

View file

@ -13,11 +13,11 @@ public abstract class Nameable {
this.customName = name;
}
public void readNbt(TagObject tag) {
public void readTags(TagObject tag) {
this.customName = tag.hasString("CustomName") ? tag.getString("CustomName") : null;
}
public void writeNbt(TagObject tag) {
public void writeTags(TagObject tag) {
if(this.customName != null)
tag.setString("CustomName", this.customName);
}
@ -32,12 +32,4 @@ public abstract class Nameable {
String.format(this.getNameIdentifier(), this.customName)) :
String.format(this.getNameIdentifier(), this.getIdentifier());
}
// public final Text getNameComponent() {
// return this.customName != null && !this.customName.isEmpty()
// ? (this.customName.startsWith("'") && this.customName.endsWith("'") && this.customName.length() > 2
// ? new Text(this.customName.substring(1, this.customName.length() - 1)) :
// new Text(this.getNameIdentifier(), this.customName)) :
// new Text(this.getNameIdentifier(), this.getIdentifier());
// }
}

View file

@ -45,18 +45,18 @@ public class EnchantmentHelper
}
else
{
TagObjectList nbttaglist = stack.getEnchantmentTagList();
TagObjectList list = stack.getEnchantmentTagList();
if (nbttaglist == null)
if (list == null)
{
return 0;
}
else
{
for (int i = 0; i < nbttaglist.size(); ++i)
for (int i = 0; i < list.size(); ++i)
{
int j = nbttaglist.get(i).getShort("id");
int k = nbttaglist.get(i).getShort("lvl");
int j = list.get(i).getShort("id");
int k = list.get(i).getShort("lvl");
if (j == enchID)
{
@ -72,14 +72,14 @@ public class EnchantmentHelper
public static Map<Integer, Integer> getEnchantments(ItemStack stack)
{
Map<Integer, Integer> map = Maps.<Integer, Integer>newLinkedHashMap();
TagObjectList nbttaglist = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList();
TagObjectList list = stack.getItem() == Items.enchanted_book ? Items.enchanted_book.getEnchantments(stack) : stack.getEnchantmentTagList();
if (nbttaglist != null)
if (list != null)
{
for (int i = 0; i < nbttaglist.size(); ++i)
for (int i = 0; i < list.size(); ++i)
{
int j = nbttaglist.get(i).getShort("id");
int k = nbttaglist.get(i).getShort("lvl");
int j = list.get(i).getShort("id");
int k = list.get(i).getShort("lvl");
map.put(j, k);
}
}
@ -92,7 +92,7 @@ public class EnchantmentHelper
*/
public static void setEnchantments(Map<Integer, Integer> enchMap, ItemStack stack)
{
TagObjectList nbttaglist = new TagObjectList();
TagObjectList list = new TagObjectList();
Iterator iterator = enchMap.keySet().iterator();
while (iterator.hasNext())
@ -102,10 +102,10 @@ public class EnchantmentHelper
if (enchantment != null)
{
TagObject nbttagcompound = new TagObject();
nbttagcompound.setShort("id", (short)i);
nbttagcompound.setShort("lvl", (short)enchMap.get(i).intValue());
nbttaglist.add(nbttagcompound);
TagObject tag = new TagObject();
tag.setShort("id", (short)i);
tag.setShort("lvl", (short)enchMap.get(i).intValue());
list.add(tag);
if (stack.getItem() == Items.enchanted_book)
{
@ -114,11 +114,11 @@ public class EnchantmentHelper
}
}
if (nbttaglist.size() > 0)
if (list.size() > 0)
{
if (stack.getItem() != Items.enchanted_book)
{
stack.setTagInfo("ench", nbttaglist);
stack.setTagInfo("ench", list);
}
}
else if (stack.hasTagCompound())
@ -161,14 +161,14 @@ public class EnchantmentHelper
{
if (stack != null)
{
TagObjectList nbttaglist = stack.getEnchantmentTagList();
TagObjectList list = stack.getEnchantmentTagList();
if (nbttaglist != null)
if (list != null)
{
for (int i = 0; i < nbttaglist.size(); ++i)
for (int i = 0; i < list.size(); ++i)
{
int j = nbttaglist.get(i).getShort("id");
int k = nbttaglist.get(i).getShort("lvl");
int j = list.get(i).getShort("id");
int k = list.get(i).getShort("lvl");
if (Enchantment.getEnchantmentById(j) != null)
{

View file

@ -1421,17 +1421,17 @@ public abstract class Entity
}
/**
* Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their
* Like writeOptional but does not check if the entity is ridden. Used for saving ridden entities with their
* riders.
*/
public boolean writeMountToNBT(TagObject tagCompund)
public boolean writeMount(TagObject tag)
{
String s = EntityRegistry.getEntityString(this);
if (!this.dead && !this.isPlayer() && s != null)
{
tagCompund.setString("id", s);
this.writeToNBT(tagCompund);
tag.setString("id", s);
this.writeTags(tag);
return true;
}
else
@ -1441,18 +1441,18 @@ public abstract class Entity
}
/**
* Either write this entity to the NBT tag given and return true, or return false without doing anything. If this
* Either write this entity to the tag given and return true, or return false without doing anything. If this
* returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their
* rider.
*/
public boolean writeToNBTOptional(TagObject tagCompund)
public boolean writeOptional(TagObject tag)
{
String s = EntityRegistry.getEntityString(this);
if (!this.dead && !this.isPlayer() && s != null && (this.passenger == null || this.passenger.isPlayer()))
{
tagCompund.setString("id", s);
this.writeToNBT(tagCompund);
tag.setString("id", s);
this.writeTags(tag);
return true;
}
else
@ -1486,9 +1486,9 @@ public abstract class Entity
// }
/**
* Save the entity to NBT (calls an abstract helper method to write extra data)
* Save the entity to tags (calls an abstract helper method to write extra data)
*/
public void writeToNBT(TagObject tagCompund)
public void writeTags(TagObject tag)
{
// if(this.persistentId != 0L) {
// tagCompund.setLong("PersistID", this.persistentId);
@ -1497,19 +1497,19 @@ public abstract class Entity
// tagCompund.setString("ObjectTag", this.tag);
// }
tagCompund.setDoubleList("Pos", this.newDoubleNBTList(this.posX, this.posY, this.posZ));
tagCompund.setDoubleList("Motion", this.newDoubleNBTList(this.motionX, this.motionY, this.motionZ));
tagCompund.setFloatList("Rotation", this.newFloatNBTList(this.rotYaw, this.rotPitch));
tagCompund.setFloat("FallDistance", this.fallDistance);
tagCompund.setShort("Fire", (short)this.fire);
tag.setDoubleList("Pos", this.newDoubleList(this.posX, this.posY, this.posZ));
tag.setDoubleList("Motion", this.newDoubleList(this.motionX, this.motionY, this.motionZ));
tag.setFloatList("Rotation", this.newFloatList(this.rotYaw, this.rotPitch));
tag.setFloat("FallDistance", this.fallDistance);
tag.setShort("Fire", (short)this.fire);
// tagCompund.setShort("Air", (short)this.getAir());
tagCompund.setBool("OnGround", this.onGround);
tag.setBool("OnGround", this.onGround);
// tagCompund.setBoolean("Invulnerable", this.invulnerable);
// tagCompund.setInteger("PortalCooldown", this.portalTimer);
if (this.getCustomNameTag() != null && this.getCustomNameTag().length() > 0)
{
tagCompund.setString("CustomName", this.getCustomNameTag());
tag.setString("CustomName", this.getCustomNameTag());
// tagCompund.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag());
}
@ -1519,36 +1519,36 @@ public abstract class Entity
// }
if(this.ignoreFall)
tagCompund.setBool("IgnoreFall", this.ignoreFall);
tag.setBool("IgnoreFall", this.ignoreFall);
this.writeEntityToNBT(tagCompund);
this.writeEntity(tag);
if (this.vehicle != null && !(this.isPlayer()))
{
TagObject nbttagcompound = new TagObject();
TagObject mount = new TagObject();
if (this.vehicle.writeMountToNBT(nbttagcompound))
if (this.vehicle.writeMount(mount))
{
tagCompund.setTag("Riding", nbttagcompound);
tag.setObject("Riding", mount);
}
}
}
/**
* Reads the entity from NBT (calls an abstract helper method to read specialized data)
* Reads the entity from tags (calls an abstract helper method to read specialized data)
*/
public void readFromNBT(TagObject tagCompund)
public void readTags(TagObject tag)
{
// if(tagCompund.hasLong("PersistID"))
// this.setPersistentId(tagCompund.getLong("PersistID"));
// this.setTag(tagCompund.getString("ObjectTag"));
TagDoubleList nbttaglist = tagCompund.getDoubleList("Pos");
TagDoubleList nbttaglist1 = tagCompund.getDoubleList("Motion");
TagFloatList nbttaglist2 = tagCompund.getFloatList("Rotation");
this.motionX = nbttaglist1.get(0);
this.motionY = nbttaglist1.get(1);
this.motionZ = nbttaglist1.get(2);
TagDoubleList pos = tag.getDoubleList("Pos");
TagDoubleList motion = tag.getDoubleList("Motion");
TagFloatList rotation = tag.getFloatList("Rotation");
this.motionX = motion.get(0);
this.motionY = motion.get(1);
this.motionZ = motion.get(2);
if (Math.abs(this.motionX) > 10.0D)
{
@ -1565,32 +1565,32 @@ public abstract class Entity
this.motionZ = 0.0D;
}
this.prevX = this.lastTickPosX = this.posX = nbttaglist.get(0);
this.prevY = this.lastTickPosY = this.posY = nbttaglist.get(1);
this.prevZ = this.lastTickPosZ = this.posZ = nbttaglist.get(2);
this.prevYaw = this.rotYaw = nbttaglist2.get(0);
this.prevPitch = this.rotPitch = nbttaglist2.get(1);
this.prevX = this.lastTickPosX = this.posX = pos.get(0);
this.prevY = this.lastTickPosY = this.posY = pos.get(1);
this.prevZ = this.lastTickPosZ = this.posZ = pos.get(2);
this.prevYaw = this.rotYaw = rotation.get(0);
this.prevPitch = this.rotPitch = rotation.get(1);
this.setRotationYawHead(this.rotYaw);
this.setRenderYawOffset(this.rotYaw);
this.fallDistance = tagCompund.getFloat("FallDistance");
this.fire = tagCompund.getShort("Fire");
this.fallDistance = tag.getFloat("FallDistance");
this.fire = tag.getShort("Fire");
// this.setAir(tagCompund.getShort("Air"));
this.onGround = tagCompund.getBool("OnGround");
this.onGround = tag.getBool("OnGround");
// this.invulnerable = tagCompund.getBoolean("Invulnerable");
// this.portalTimer = tagCompund.getInteger("PortalCooldown");
this.setPosition(this.posX, this.posY, this.posZ);
this.setRotation(this.rotYaw, this.rotPitch);
if (tagCompund.hasString("CustomName") && tagCompund.getString("CustomName").length() > 0)
if (tag.hasString("CustomName") && tag.getString("CustomName").length() > 0)
{
this.setCustomNameTag(tagCompund.getString("CustomName"));
this.setCustomNameTag(tag.getString("CustomName"));
}
// this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible"));
// this.setSilent(tagCompund.getBoolean("Silent"));
this.ignoreFall = tagCompund.getBool("IgnoreFall");
this.readEntityFromNBT(tagCompund);
this.ignoreFall = tag.getBool("IgnoreFall");
this.readEntity(tag);
if (this.shouldSetPosAfterLoading())
{
@ -1612,47 +1612,47 @@ 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 tags.
*/
protected abstract void readEntityFromNBT(TagObject tagCompund);
protected abstract void readEntity(TagObject tag);
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
* (abstract) Protected helper method to write subclass entity data to tags.
*/
protected abstract void writeEntityToNBT(TagObject tagCompound);
protected abstract void writeEntity(TagObject tag);
public void onChunkLoad()
{
}
/**
* creates a NBT list from the array of doubles passed to this function
* creates a list from the array of doubles passed to this function
*/
protected TagDoubleList newDoubleNBTList(double... numbers)
protected TagDoubleList newDoubleList(double... numbers)
{
TagDoubleList nbttaglist = new TagDoubleList();
TagDoubleList list = new TagDoubleList();
for (double d0 : numbers)
{
nbttaglist.add(d0);
list.add(d0);
}
return nbttaglist;
return list;
}
/**
* Returns a new NBTTagList filled with the specified floats
* Returns a new list filled with the specified floats
*/
protected TagFloatList newFloatNBTList(float... numbers)
protected TagFloatList newFloatList(float... numbers)
{
TagFloatList nbttaglist = new TagFloatList();
TagFloatList list = new TagFloatList();
for (float f : numbers)
{
nbttaglist.add(f);
list.add(f);
}
return nbttaglist;
return list;
}
public EntityItem dropItem(Item itemIn, int size)
@ -1670,7 +1670,7 @@ public abstract class Entity
*/
public EntityItem entityDropItem(ItemStack itemStackIn, float offsetY)
{
if (itemStackIn.stackSize != 0 && itemStackIn.getItem() != null)
if (itemStackIn.size != 0 && itemStackIn.getItem() != null)
{
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, itemStackIn);
entityitem.setDefaultPickupDelay();
@ -2346,13 +2346,13 @@ public abstract class Entity
}
/**
* Prepares this entity in new dimension by copying NBT data from entity in old dimension
* Prepares this entity in new dimension by copying data from entity in old dimension
*/
public void copyDataFromOld(Entity entityIn)
{
TagObject nbttagcompound = new TagObject();
entityIn.writeToNBT(nbttagcompound);
this.readFromNBT(nbttagcompound);
TagObject tag = new TagObject();
entityIn.writeTags(tag);
this.readTags(tag);
// this.portalTimer = entityIn.portalTimer;
// this.portalPos = entityIn.portalPos;
// this.portalVec = entityIn.portalVec;
@ -2549,25 +2549,6 @@ public abstract class Entity
return Facing.getHorizontal(ExtMath.floord((double)(this.rotYaw * 4.0F / 360.0F) + 0.5D) & 3);
}
// protected HoverEvent getHoverEvent()
// {
// NBTTagCompound nbttagcompound = new NBTTagCompound();
// String s = EntityRegistry.getEntityString(this);
// nbttagcompound.setString("id", "#" + this.getId());
// if(this.hasPersistentId())
// nbttagcompound.setString("pid", String.format("$%016x", this.getPersistentId()));
// if(this.hasTag())
// nbttagcompound.setString("otag", this.getTag());
//
// if (s != null)
// {
// nbttagcompound.setString("type", s);
// }
//
// nbttagcompound.setString("name", IChatComponent.Serializer.componentToJson(this.getTypeName()));
// return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new ChatComponentText(nbttagcompound.toString()));
// }
public boolean isVisibleTo(EntityNPC player)
{
return true;
@ -2612,15 +2593,15 @@ public abstract class Entity
return new BlockPos(this.posX, this.posY + 0.5D, this.posZ);
}
public TagObject getNBTTagCompound()
public TagObject getTag()
{
return null;
}
/**
* Called when client receives entity's NBTTagCompound from server.
* Called when client receives entity's tags from server.
*/
public void clientUpdateEntityNBT(TagObject compound)
public void clientUpdateEntityTags(TagObject compound)
{
}

View file

@ -22,7 +22,7 @@ import common.packet.SPacketEntityAttach;
import common.packet.SPacketEntityMetadata;
import common.packet.SPacketEntityEffect;
import common.packet.SPacketEntityProperties;
import common.packet.SPacketUpdateEntityNBT;
import common.packet.SPacketUpdateEntityTags;
import common.packet.SPacketEntityEquipment;
import common.packet.SPacketEntityVelocity;
import common.packet.SPacketSpawnMob;
@ -296,10 +296,10 @@ public class EntityTrackerEntry {
.sendPacket(new SPacketEntityMetadata(this.trackedEntity.getId(), this.trackedEntity.getDataWatcher(), true));
}
TagObject nbttagcompound = this.trackedEntity.getNBTTagCompound();
TagObject nbttagcompound = this.trackedEntity.getTag();
if(nbttagcompound != null) {
playerMP.connection.sendPacket(new SPacketUpdateEntityNBT(this.trackedEntity.getId(), nbttagcompound));
playerMP.connection.sendPacket(new SPacketUpdateEntityTags(this.trackedEntity.getId(), nbttagcompound));
}
if(this.trackedEntity instanceof EntityLiving) {

View file

@ -248,18 +248,18 @@ public class EntityBat extends EntityLiving
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.dataWatcher.updateObject(16, Byte.valueOf(tagCompund.getByte("BatFlags")));
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16));
}

View file

@ -175,9 +175,9 @@ public class EntityChicken extends EntityAnimal
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.chickenJockey = tagCompund.getBool("IsChickenJockey");
this.timeUntilNextEgg = tagCompund.getInt("EggLayTime");
}
@ -193,9 +193,9 @@ public class EntityChicken extends EntityAnimal
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setBool("IsChickenJockey", this.chickenJockey);
tagCompound.setInt("EggLayTime", this.timeUntilNextEgg);
}

View file

@ -125,7 +125,7 @@ public class EntityCow extends EntityAnimal
if (itemstack != null && itemstack.getItem() == Items.bucket /* && !player.creative */ && !this.isChild())
{
if (itemstack.stackSize-- == 1)
if (itemstack.size-- == 1)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.milk_bucket));
}

View file

@ -27,14 +27,14 @@ public class EntityDragonPart extends Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
}

View file

@ -958,7 +958,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (flag)
{
if (/* !player.creative && */ --itemstack.stackSize == 0)
if (/* !player.creative && */ --itemstack.size == 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}
@ -1387,9 +1387,9 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setBool("EatingHaystack", this.isEatingHaystack());
tagCompound.setBool("ChestedHorse", this.isChested());
tagCompound.setBool("HasReproduced", this.getHasReproduced());
@ -1412,31 +1412,31 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
{
TagObject nbttagcompound = new TagObject();
nbttagcompound.setByte("Slot", (byte)i);
itemstack.writeToNBT(nbttagcompound);
itemstack.writeTags(nbttagcompound);
nbttaglist.add(nbttagcompound);
}
}
tagCompound.setTagList("Items", nbttaglist);
tagCompound.setObjectList("Items", nbttaglist);
}
if (this.horseChest.getStackInSlot(1) != null)
{
tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new TagObject()));
tagCompound.setObject("ArmorItem", this.horseChest.getStackInSlot(1).writeTags(new TagObject()));
}
if (this.horseChest.getStackInSlot(0) != null)
{
tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new TagObject()));
tagCompound.setObject("SaddleItem", this.horseChest.getStackInSlot(0).writeTags(new TagObject()));
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setEatingHaystack(tagCompund.getBool("EatingHaystack"));
this.setBreeding(tagCompund.getBool("Bred"));
this.setChested(tagCompund.getBool("ChestedHorse"));
@ -1466,7 +1466,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (this.isChested())
{
TagObjectList nbttaglist = tagCompund.getTagList("Items");
TagObjectList nbttaglist = tagCompund.getObjectList("Items");
this.initHorseChest();
for (int i = 0; i < nbttaglist.size(); ++i)
@ -1476,14 +1476,14 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
if (j >= 2 && j < this.horseChest.getSizeInventory())
{
this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
this.horseChest.setInventorySlotContents(j, ItemStack.readFromTag(nbttagcompound));
}
}
}
if (tagCompund.hasTag("ArmorItem"))
if (tagCompund.hasObject("ArmorItem"))
{
ItemStack itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getTag("ArmorItem"));
ItemStack itemstack = ItemStack.readFromTag(tagCompund.getObject("ArmorItem"));
if (itemstack != null && isArmorItem(itemstack.getItem()))
{
@ -1491,9 +1491,9 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
}
}
if (tagCompund.hasTag("SaddleItem"))
if (tagCompund.hasObject("SaddleItem"))
{
ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(tagCompund.getTag("SaddleItem"));
ItemStack itemstack1 = ItemStack.readFromTag(tagCompund.getObject("SaddleItem"));
if (itemstack1 != null && itemstack1.getItem() == Items.saddle)
{

View file

@ -30,7 +30,7 @@ public class EntityMooshroom extends EntityCow
if (itemstack != null && itemstack.getItem() == Items.bowl && !this.isChild())
{
if (itemstack.stackSize == 1)
if (itemstack.size == 1)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.mushroom_stew));
return true;

View file

@ -123,18 +123,18 @@ public class EntityOcelot extends EntityTameable
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("CatType", this.getTameSkin());
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setTameSkin(tagCompund.getInt("CatType"));
}
@ -227,10 +227,10 @@ public class EntityOcelot extends EntityTameable
{
// if (!player.creative)
// {
--itemstack.stackSize;
--itemstack.size;
// }
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}

View file

@ -69,18 +69,18 @@ public class EntityPig extends EntityAnimal
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setBool("Saddle", this.getSaddled());
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setSaddled(tagCompund.getBool("Saddle"));
}

View file

@ -198,14 +198,14 @@ public class EntityRabbit extends EntityAnimal {
this.getEntityAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.30000001192092896D);
}
public void writeEntityToNBT(TagObject tagCompound) {
super.writeEntityToNBT(tagCompound);
public void writeEntity(TagObject tagCompound) {
super.writeEntity(tagCompound);
tagCompound.setInt("RabbitType", this.getRabbitType());
tagCompound.setInt("MoreCarrotTicks", this.foodCooldown);
}
public void readEntityFromNBT(TagObject tagCompund) {
super.readEntityFromNBT(tagCompund);
public void readEntity(TagObject tagCompund) {
super.readEntity(tagCompund);
this.setRabbitType(tagCompund.getInt("RabbitType"));
this.foodCooldown = tagCompund.getInt("MoreCarrotTicks");
}

View file

@ -210,9 +210,9 @@ public class EntitySheep extends EntityAnimal
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setBool("Sheared", this.getSheared());
tagCompound.setByte("Color", (byte)this.getFleeceColor().getMetadata());
}
@ -220,9 +220,9 @@ public class EntitySheep extends EntityAnimal
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setSheared(tagCompund.getBool("Sheared"));
this.setFleeceColor(DyeColor.byMetadata(tagCompund.getByte("Color")));
}

View file

@ -139,9 +139,9 @@ public class EntityWolf extends EntityTameable
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setBool("Angry", this.isAngry());
tagCompound.setByte("CollarColor", (byte)this.getCollarColor().getDyeDamage());
}
@ -149,9 +149,9 @@ public class EntityWolf extends EntityTameable
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setAngry(tagCompund.getBool("Angry"));
if (tagCompund.hasByte("CollarColor"))
@ -399,12 +399,12 @@ public class EntityWolf extends EntityTameable
{
// if (!player.creative)
// {
--itemstack.stackSize;
--itemstack.size;
// }
this.heal(itemfood.getHealAmount(itemstack));
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}
@ -420,7 +420,7 @@ public class EntityWolf extends EntityTameable
{
this.setCollarColor(enumdyecolor);
if (/* !player.creative && */ --itemstack.stackSize <= 0)
if (/* !player.creative && */ --itemstack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}
@ -442,10 +442,10 @@ public class EntityWolf extends EntityTameable
{
// if (!player.creative)
// {
--itemstack.stackSize;
--itemstack.size;
// }
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}

View file

@ -501,14 +501,14 @@ public class EntityBoat extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
}

View file

@ -753,7 +753,7 @@ public abstract class EntityCart extends Entity implements IWorldNameable
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
if (tagCompund.getBool("CustomDisplayTile"))
{
@ -798,7 +798,7 @@ public abstract class EntityCart extends Entity implements IWorldNameable
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
if (this.hasDisplayTile())
{

View file

@ -60,7 +60,7 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
{
if (this.minecartContainerItems[index] != null)
{
if (this.minecartContainerItems[index].stackSize <= count)
if (this.minecartContainerItems[index].size <= count)
{
ItemStack itemstack1 = this.minecartContainerItems[index];
this.minecartContainerItems[index] = null;
@ -70,7 +70,7 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
{
ItemStack itemstack = this.minecartContainerItems[index].splitStack(count);
if (this.minecartContainerItems[index].stackSize == 0)
if (this.minecartContainerItems[index].size == 0)
{
this.minecartContainerItems[index] = null;
}
@ -108,9 +108,9 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
{
this.minecartContainerItems[index] = stack;
if (stack != null && stack.stackSize > this.getInventoryStackLimit())
if (stack != null && stack.size > this.getInventoryStackLimit())
{
stack.stackSize = this.getInventoryStackLimit();
stack.size = this.getInventoryStackLimit();
}
}
@ -187,9 +187,9 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
TagObjectList nbttaglist = new TagObjectList();
for (int i = 0; i < this.minecartContainerItems.length; ++i)
@ -198,21 +198,21 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
{
TagObject nbttagcompound = new TagObject();
nbttagcompound.setByte("Slot", (byte)i);
this.minecartContainerItems[i].writeToNBT(nbttagcompound);
this.minecartContainerItems[i].writeTags(nbttagcompound);
nbttaglist.add(nbttagcompound);
}
}
tagCompound.setTagList("Items", nbttaglist);
tagCompound.setObjectList("Items", nbttaglist);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
TagObjectList nbttaglist = tagCompund.getTagList("Items");
super.readEntity(tagCompund);
TagObjectList nbttaglist = tagCompund.getObjectList("Items");
this.minecartContainerItems = new ItemStack[this.getSizeInventory()];
for (int i = 0; i < nbttaglist.size(); ++i)
@ -222,7 +222,7 @@ public abstract class EntityCartContainer extends EntityCart implements ILockabl
if (j >= 0 && j < this.minecartContainerItems.length)
{
this.minecartContainerItems[j] = ItemStack.loadItemStackFromNBT(nbttagcompound);
this.minecartContainerItems[j] = ItemStack.readFromTag(nbttagcompound);
}
}
}

View file

@ -63,14 +63,14 @@ public class EntityCrystal extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
}

View file

@ -62,13 +62,13 @@ public class EntityExplosion extends Entity
Explosion.doExplosionAlgo3(this.worldObj, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, this.rand, min + 6.0d, min);
}
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
tagCompound.setInt("Progress", this.progress);
tagCompound.setInt("Radius", this.radius);
}
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
this.progress = tagCompund.getInt("Progress");
this.radius = tagCompund.getInt("Radius");

View file

@ -149,7 +149,7 @@ public class EntityFalling extends Entity implements IObjectData
if (tileentity != null)
{
TagObject nbttagcompound = new TagObject();
tileentity.writeToNBT(nbttagcompound);
tileentity.writeTags(nbttagcompound);
for (String s : this.tileEntityData.getKeySet())
{
@ -161,7 +161,7 @@ public class EntityFalling extends Entity implements IObjectData
}
}
tileentity.readFromNBT(nbttagcompound);
tileentity.readTags(nbttagcompound);
tileentity.markDirty();
}
}
@ -228,7 +228,7 @@ public class EntityFalling extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
Block block = this.fallTile != null ? this.fallTile.getBlock() : Blocks.air;
String resourcelocation = BlockRegistry.REGISTRY.getNameForObject(block);
@ -242,14 +242,14 @@ public class EntityFalling extends Entity implements IObjectData
if (this.tileEntityData != null)
{
tagCompound.setTag("TileEntityData", this.tileEntityData);
tagCompound.setObject("TileEntityData", this.tileEntityData);
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
int i = tagCompund.getByte("Data") & 255;
@ -271,9 +271,9 @@ public class EntityFalling extends Entity implements IObjectData
this.shouldDropItem = tagCompund.getBool("DropItem");
if (tagCompund.hasTag("TileEntityData"))
if (tagCompund.hasObject("TileEntityData"))
{
this.tileEntityData = tagCompund.getTag("TileEntityData");
this.tileEntityData = tagCompund.getObject("TileEntityData");
}
if (block == null || block == Blocks.air)

View file

@ -52,7 +52,7 @@ public class EntityFireworks extends Entity
{
this.dataWatcher.updateObject(8, givenItem);
TagObject nbttagcompound = givenItem.getTagCompound();
TagObject nbttagcompound1 = nbttagcompound.getTag("Fireworks");
TagObject nbttagcompound1 = nbttagcompound.getObject("Fireworks");
if (nbttagcompound1 != null)
{
@ -155,7 +155,7 @@ public class EntityFireworks extends Entity
if (itemstack != null && itemstack.hasTagCompound())
{
nbttagcompound = itemstack.getTagCompound().getTag("Fireworks");
nbttagcompound = itemstack.getTagCompound().getObject("Fireworks");
}
((AWorldClient)this.worldObj).makeFireworks(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, nbttagcompound);
@ -167,7 +167,7 @@ public class EntityFireworks extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setInt("Life", this.fireworkAge);
tagCompound.setInt("LifeTime", this.lifetime);
@ -176,23 +176,23 @@ public class EntityFireworks extends Entity
if (itemstack != null)
{
TagObject nbttagcompound = new TagObject();
itemstack.writeToNBT(nbttagcompound);
tagCompound.setTag("FireworksItem", nbttagcompound);
itemstack.writeTags(nbttagcompound);
tagCompound.setObject("FireworksItem", nbttagcompound);
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.fireworkAge = tagCompund.getInt("Life");
this.lifetime = tagCompund.getInt("LifeTime");
TagObject nbttagcompound = tagCompund.getTag("FireworksItem");
TagObject nbttagcompound = tagCompund.getObject("FireworksItem");
if (nbttagcompound != null)
{
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);
ItemStack itemstack = ItemStack.readFromTag(nbttagcompound);
if (itemstack != null)
{

View file

@ -201,18 +201,18 @@ public class EntityHopperCart extends EntityCartContainer implements IHopper
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("TransferCooldown", this.transferTicker);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.transferTicker = tagCompund.getInt("TransferCooldown");
}

View file

@ -237,17 +237,17 @@ public class EntityItem extends Entity
{
return false;
}
else if (itemstack1.stackSize < itemstack.stackSize)
else if (itemstack1.size < itemstack.size)
{
return other.combineItems(this);
}
else if (itemstack1.stackSize + itemstack.stackSize > itemstack1.getMaxStackSize())
else if (itemstack1.size + itemstack.size > itemstack1.getMaxStackSize())
{
return false;
}
else
{
itemstack1.stackSize += itemstack.stackSize;
itemstack1.size += itemstack.size;
other.delayBeforeCanPickup = Math.max(other.delayBeforeCanPickup, this.delayBeforeCanPickup);
other.age = Math.min(other.age, this.age);
other.setEntityItemStack(itemstack1);
@ -342,7 +342,7 @@ public class EntityItem extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setShort("Health", (short)((byte)this.health));
tagCompound.setShort("Age", (short)this.age);
@ -360,14 +360,14 @@ public class EntityItem extends Entity
if (this.getEntityItem() != null)
{
tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new TagObject()));
tagCompound.setObject("Item", this.getEntityItem().writeTags(new TagObject()));
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.health = tagCompund.getShort("Health") & 255;
this.age = tagCompund.getShort("Age");
@ -384,8 +384,8 @@ public class EntityItem extends Entity
// this.thrower = tagCompund.getString("Thrower");
// }
TagObject nbttagcompound = tagCompund.getTag("Item");
this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound));
TagObject nbttagcompound = tagCompund.getObject("Item");
this.setEntityItemStack(ItemStack.readFromTag(nbttagcompound));
if (this.getEntityItem() == null)
{
@ -401,7 +401,7 @@ public class EntityItem extends Entity
if (!this.worldObj.client)
{
ItemStack itemstack = this.getEntityItem();
int i = itemstack.stackSize;
int i = itemstack.size;
if (this.delayBeforeCanPickup == 0 // && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getUser()))
&& entityIn.inventory.addItemStackToInventory(itemstack))
@ -448,7 +448,7 @@ public class EntityItem extends Entity
entityIn.onItemPickup(this, i);
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
this.setDead();
}
@ -464,7 +464,7 @@ public class EntityItem extends Entity
if(this.hasCustomName())
return this.getCustomNameTag();
String comp = super.getTypeName();
comp += " (" + this.getEntityItem().stackSize + " * " +
comp += " (" + this.getEntityItem().size + " * " +
ItemRegistry.REGISTRY.getNameForObject(this.getEntityItem().getItem()) + ":" + this.getEntityItem().getMetadata() + ")";
return comp;
}
@ -612,9 +612,9 @@ public class EntityItem extends Entity
public String getDisplayName()
{
ItemStack stack = this.getEntityItem();
if(stack.stackSize <= 1)
if(stack.size <= 1)
return null;
return TextColor.DGREEN + "" + stack.stackSize;
return TextColor.DGREEN + "" + stack.size;
}
public EntityType getType() {

View file

@ -375,7 +375,7 @@ public class EntityLeashKnot extends Entity
* returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their
* rider.
*/
public boolean writeToNBTOptional(TagObject tagCompund)
public boolean writeOptional(TagObject tagCompund)
{
return false;
}
@ -383,14 +383,14 @@ public class EntityLeashKnot extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
}

View file

@ -93,12 +93,12 @@ public class EntityNuke extends Entity
// Explosion.doExplosionAlgo3(this.worldObj, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, this.rand, min + 6.0d, min);
// }
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
tagCompound.setInt("Fuse", this.fuse);
}
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
this.fuse = tagCompund.getInt("Fuse");
}

View file

@ -109,7 +109,7 @@ public class EntityTnt extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
tagCompound.setByte("Fuse", (byte)this.fuse);
tagCompound.setByte("Power", (byte)this.explosionSize);
@ -118,7 +118,7 @@ public class EntityTnt extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
this.fuse = tagCompund.getByte("Fuse");
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;

View file

@ -206,18 +206,18 @@ public class EntityTntCart extends EntityCart
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
protected void readEntityFromNBT(TagObject tagCompund)
protected void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.minecartTNTFuse = tagCompund.getInt("TNTFuse");
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
protected void writeEntityToNBT(TagObject tagCompound)
protected void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("TNTFuse", this.minecartTNTFuse);
}
}

View file

@ -293,7 +293,7 @@ public class EntityXp extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setShort("Health", (short)((byte)this.xpOrbHealth));
tagCompound.setShort("Age", (short)this.xpOrbAge);
@ -303,7 +303,7 @@ public class EntityXp extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.xpOrbHealth = tagCompund.getShort("Health") & 255;
this.xpOrbAge = tagCompund.getShort("Age");

View file

@ -35,15 +35,15 @@ public class EntityGargoyle extends EntityFlyingNPC
this.dataWatcher.addObject(23, 0);
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("Invul", this.getInvulTime());
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setInvulTime(tagCompund.getInt("Invul"));
}

View file

@ -58,9 +58,9 @@ public class EntityHaunter extends EntityNPC {
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
if (this.isCharged())
{
@ -74,9 +74,9 @@ public class EntityHaunter extends EntityNPC {
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setCharged(tagCompund.getBool("Charge"));
this.fuseTime = tagCompund.getShort("Fuse");

View file

@ -107,9 +107,9 @@ public abstract class EntityMobNPC extends EntityNPC
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setShort("Anger", (short)this.angerLevel);
// if (this.angerTarget != null)
@ -125,9 +125,9 @@ public abstract class EntityMobNPC extends EntityNPC
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.angerLevel = tagCompund.getShort("Anger");
// String s = tagCompund.getString("HurtBy");
//

View file

@ -562,9 +562,9 @@ public abstract class EntityNPC extends EntityLiving
{
// if (!player.creative)
// {
--stack.stackSize;
--stack.size;
if (stack.stackSize <= 0)
if (stack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}
@ -1445,7 +1445,7 @@ public abstract class EntityNPC extends EntityLiving
}
else
{
stack.stackSize = remain.stackSize;
stack.size = remain.size;
}
}
}
@ -1973,7 +1973,7 @@ public abstract class EntityNPC extends EntityLiving
this.client.addToSendQueue(new CPacketBreak(c07packetplayerdigging$action, BlockPos.ORIGIN, Facing.DOWN));
return null;
}
return this.dropItem(this.inventory.decrStackSize(this.inventory.currentItem, dropAll && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false, true);
return this.dropItem(this.inventory.decrStackSize(this.inventory.currentItem, dropAll && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().size : 1), false, true);
}
/**
@ -2958,14 +2958,14 @@ public abstract class EntityNPC extends EntityLiving
if (this.itemInUse != null)
{
this.updateItemUse(this.itemInUse, 16);
int i = this.itemInUse.stackSize;
int i = this.itemInUse.size;
ItemStack itemstack = this.itemInUse.onItemUseFinish(this.worldObj, this);
if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i)
if (itemstack != this.itemInUse || itemstack != null && itemstack.size != i)
{
this.inventory.mainInventory[this.inventory.currentItem] = itemstack;
if (itemstack.stackSize == 0)
if (itemstack.size == 0)
{
this.inventory.mainInventory[this.inventory.currentItem] = null;
}
@ -3264,7 +3264,7 @@ public abstract class EntityNPC extends EntityLiving
{
return null;
}
else if (droppedItem.stackSize == 0)
else if (droppedItem.size == 0)
{
return null;
}
@ -3380,20 +3380,20 @@ public abstract class EntityNPC extends EntityLiving
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
// super.readEntityFromNBT(tagCompund);
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
// if(tagCompund.hasBoolean("CanPickUpLoot")) {
// this.setCanPickUpLoot(tagCompund.getBoolean("CanPickUpLoot"));
// }
if(tagCompund.hasTagList("Equipment")) {
TagObjectList nbttaglist = tagCompund.getTagList("Equipment");
if(tagCompund.hasObjectList("Equipment")) {
TagObjectList nbttaglist = tagCompund.getObjectList("Equipment");
for(int i = 0; i < this.equipment.length; ++i) {
this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.get(i));
this.equipment[i] = ItemStack.readFromTag(nbttaglist.get(i));
}
}
// this.setSpecies(tagCompund.getString("Species"));
@ -3423,11 +3423,11 @@ public abstract class EntityNPC extends EntityLiving
this.setNpcClass(type);
this.setHeight(tagCompund.hasFloat("Height") ? tagCompund.getFloat("Height") : this.getBaseSize());
TagObjectList nbttaglist = tagCompund.getTagList("Items");
TagObjectList nbttaglist = tagCompund.getObjectList("Items");
for (int i = 0; i < nbttaglist.size(); ++i)
{
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttaglist.get(i));
ItemStack itemstack = ItemStack.readFromTag(nbttaglist.get(i));
if (itemstack != null)
{
@ -3435,9 +3435,9 @@ public abstract class EntityNPC extends EntityLiving
}
}
if(tagCompund.hasTagList("Offers")) {
if(tagCompund.hasObjectList("Offers")) {
this.trades = new MerchantRecipeList();
this.trades.fromNbt(tagCompund.getTagList("Offers"));
this.trades.fromTags(tagCompund.getObjectList("Offers"));
}
this.healTimer = tagCompund.getInt("healTimer");
if(tagCompund.hasByteArray("Skin"))
@ -3448,7 +3448,7 @@ public abstract class EntityNPC extends EntityLiving
if(this.isPlayer()) {
// this.entityUniqueID = getOfflineUUID(this.user);
TagObjectList nbttaglist0 = tagCompund.getTagList("Inventory");
TagObjectList nbttaglist0 = tagCompund.getObjectList("Inventory");
this.inventory.readFromNBT(nbttaglist0);
this.inventory.currentItem = tagCompund.getInt("SelectedItemSlot");
// this.sleeping = tagCompund.getBoolean("Sleeping");
@ -3495,10 +3495,10 @@ public abstract class EntityNPC extends EntityLiving
// this.allowFlyingPersist = tagCompund.getBoolean("alwaysFly");
this.noclip = tagCompund.getBool("noClip");
if (tagCompund.hasTagList("WarpItems"))
if (tagCompund.hasObjectList("WarpItems"))
{
TagObjectList nbttaglist1 = tagCompund.getTagList("WarpItems");
this.warpChest.loadInventoryFromNBT(nbttaglist1);
TagObjectList nbttaglist1 = tagCompund.getObjectList("WarpItems");
this.warpChest.readTags(nbttaglist1);
}
// ModelType // model;
@ -3518,7 +3518,7 @@ public abstract class EntityNPC extends EntityLiving
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
if(this.isPlayer()) {
for (int z = 0; z < this.inventory.mainInventory.length; z++)
@ -3526,12 +3526,12 @@ public abstract class EntityNPC extends EntityLiving
ItemStack itemstack = this.inventory.mainInventory[z];
if (itemstack != null)
{
this.getAttributeMap().removeAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.stackSize);
this.getAttributeMap().removeAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.size);
}
}
}
// super.writeEntityToNBT(tagCompound);
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
// tagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot());
TagObjectList nbttaglist0 = new TagObjectList();
@ -3540,13 +3540,13 @@ public abstract class EntityNPC extends EntityLiving
TagObject nbttagcompound = new TagObject();
if(this.equipment[i] != null) {
this.equipment[i].writeToNBT(nbttagcompound);
this.equipment[i].writeTags(nbttagcompound);
}
nbttaglist0.add(nbttagcompound);
}
tagCompound.setTagList("Equipment", nbttaglist0);
tagCompound.setObjectList("Equipment", nbttaglist0);
// tagCompound.setString("Species", this.getSpecies());
tagCompound.setString("Char", this.getChar());
tagCompound.setString("Cape", this.getCape());
@ -3567,13 +3567,13 @@ public abstract class EntityNPC extends EntityLiving
if (itemstack != null)
{
nbttaglist.add(itemstack.writeToNBT(new TagObject()));
nbttaglist.add(itemstack.writeTags(new TagObject()));
}
}
tagCompound.setTagList("Items", nbttaglist);
tagCompound.setObjectList("Items", nbttaglist);
if(this.trades != null)
tagCompound.setTagList("Offers", this.trades.toNbt());
tagCompound.setObjectList("Offers", this.trades.toTags());
tagCompound.setInt("healTimer", this.healTimer);
if(this.skin != null)
tagCompound.setByteArray("Skin", this.skin);
@ -3584,10 +3584,10 @@ public abstract class EntityNPC extends EntityLiving
ItemStack itemstack = this.inventory.mainInventory[z];
if (itemstack != null)
{
this.getAttributeMap().applyAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.stackSize);
this.getAttributeMap().applyAttributeModifiers(itemstack.getAttributeModifiers(2), z, itemstack.size);
}
}
tagCompound.setTagList("Inventory", this.inventory.writeToNBT(new TagObjectList()));
tagCompound.setObjectList("Inventory", this.inventory.writeToNBT(new TagObjectList()));
tagCompound.setInt("SelectedItemSlot", this.inventory.currentItem);
// tagCompound.setBoolean("Sleeping", this.sleeping);
// tagCompound.setShort("SleepTimer", (short)this.sleepTimer);
@ -3624,12 +3624,12 @@ public abstract class EntityNPC extends EntityLiving
// tagCompound.setBoolean("alwaysFly", this.allowFlyingPersist);
tagCompound.setBool("noClip", this.noclip);
tagCompound.setTagList("WarpItems", this.warpChest.saveInventoryToNBT());
tagCompound.setObjectList("WarpItems", this.warpChest.writeTags());
ItemStack itemstack = this.inventory.getCurrentItem();
if (itemstack != null && itemstack.getItem() != null)
{
tagCompound.setTag("SelectedItem", itemstack.writeToNBT(new TagObject()));
tagCompound.setObject("SelectedItem", itemstack.writeTags(new TagObject()));
}
// tagCompound.setString("Model", this.getModel().name);
@ -3679,7 +3679,7 @@ public abstract class EntityNPC extends EntityLiving
if (itemstack.interactWithEntity(this, (EntityLiving)targetEntity))
{
if (itemstack.stackSize <= 0) // && !this.creative)
if (itemstack.size <= 0) // && !this.creative)
{
this.destroyCurrentEquippedItem();
}
@ -3694,7 +3694,7 @@ public abstract class EntityNPC extends EntityLiving
{
if (itemstack != null && itemstack == this.getCurrentEquippedItem())
{
if (itemstack.stackSize <= 0) // && !this.creative)
if (itemstack.size <= 0) // && !this.creative)
{
this.destroyCurrentEquippedItem();
}
@ -3847,7 +3847,7 @@ public abstract class EntityNPC extends EntityLiving
{
itemstack.hitEntity((EntityLiving)entity, this);
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
this.destroyCurrentEquippedItem();
}

View file

@ -134,9 +134,9 @@ public class EntitySlime extends EntityNPC
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
// tagCompound.setInteger("Size", this.getSlimeSize() - 1);
tagCompound.setBool("wasOnGround", this.wasOnGround);
}
@ -144,9 +144,9 @@ public class EntitySlime extends EntityNPC
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
// int i = tagCompund.getInteger("Size");
//
// if (i < 0)

View file

@ -471,7 +471,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -491,7 +491,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -347,13 +347,13 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData
// this.doBlockCollisions();
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setInt("damage", this.damage);
tagCompound.setInt("age", this.age);
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.damage = tagCompund.getInt("damage");
this.age = tagCompund.getInt("age");

View file

@ -64,17 +64,17 @@ public class EntityDie extends EntityThrowable implements IObjectData
return this.dataWatcher.getWatchableObjectInt(16);
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("Sides", this.sides);
tagCompound.setInt("Value", this.getValue());
tagCompound.setBool("NoPickup", this.noPickup);
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.sides = tagCompund.getInt("Sides");
this.setValue(tagCompund.getInt("Value"));
this.noPickup = tagCompund.getBool("NoPickup");

View file

@ -59,15 +59,15 @@ public class EntityDynamite extends EntityThrowable implements IObjectData
}
}
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setByte("Power", (byte)this.explosionSize);
}
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.explosionSize = ((int)tagCompund.getByte("Power")) & 7;
}

View file

@ -56,18 +56,18 @@ public class EntityFireball extends EntityProjectile
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("ExplosionPower", this.explosionPower);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.explosionPower = tagCompund.getInt("ExplosionPower");
}
}

View file

@ -121,7 +121,7 @@ public class EntityHook extends Entity implements IObjectData
{
}
public boolean writeToNBTOptional(TagObject tagCompund)
public boolean writeOptional(TagObject tagCompund)
{
return false;
}
@ -517,7 +517,7 @@ public class EntityHook extends Entity implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -533,7 +533,7 @@ public class EntityHook extends Entity implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -158,13 +158,13 @@ public class EntityPotion extends EntityThrowable implements IObjectData
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
if (tagCompund.hasTag("Potion"))
if (tagCompund.hasObject("Potion"))
{
this.potionDamage = ItemStack.loadItemStackFromNBT(tagCompund.getTag("Potion"));
this.potionDamage = ItemStack.readFromTag(tagCompund.getObject("Potion"));
}
else
{
@ -180,13 +180,13 @@ public class EntityPotion extends EntityThrowable implements IObjectData
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
if (this.potionDamage != null)
{
tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new TagObject()));
tagCompound.setObject("Potion", this.potionDamage.writeTags(new TagObject()));
}
}

View file

@ -254,7 +254,7 @@ public abstract class EntityProjectile extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -262,14 +262,14 @@ public abstract class EntityProjectile extends Entity
String resourcelocation = BlockRegistry.REGISTRY.getNameForObject(this.inTile);
tagCompound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
tagCompound.setDoubleList("direction", this.newDoubleNBTList(this.motionX, this.motionY, this.motionZ));
tagCompound.setDoubleList("direction", this.newDoubleList(this.motionX, this.motionY, this.motionZ));
tagCompound.setInt("Age", this.age);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -100,18 +100,18 @@ public abstract class EntityAnimal extends EntityLiving
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
tagCompound.setInt("InLove", this.inLove);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
this.setInLove(tagCompund.getInt("InLove"), true);
}
@ -200,9 +200,9 @@ public abstract class EntityAnimal extends EntityLiving
{
// if (!player.creative)
// {
--stack.stackSize;
--stack.size;
if (stack.stackSize <= 0)
if (stack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}

View file

@ -539,7 +539,7 @@ public abstract class EntityLiving extends Entity
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setInt("Health", this.getHealth());
// tagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth())));
@ -557,7 +557,7 @@ public abstract class EntityLiving extends Entity
}
}
tagCompound.setTagList("Attributes", Attributes.writeBaseAttributeMapToNBT(this.getAttributeMap()));
tagCompound.setObjectList("Attributes", Attributes.writeBaseAttributeMapToNBT(this.getAttributeMap()));
for (ItemStack itemstack1 : this.getInventory())
{
@ -573,10 +573,10 @@ public abstract class EntityLiving extends Entity
for (PotionEffect potioneffect : this.effects.values())
{
nbttaglist.add(potioneffect.toNbt());
nbttaglist.add(potioneffect.toTags());
}
tagCompound.setTagList("ActiveEffects", nbttaglist);
tagCompound.setObjectList("ActiveEffects", nbttaglist);
}
tagCompound.setBool("Leashed", this.leashed);
@ -595,7 +595,7 @@ public abstract class EntityLiving extends Entity
nbttagcompound1.setInt("Z", blockpos.getZ());
}
tagCompound.setTag("Leash", nbttagcompound1);
tagCompound.setObject("Leash", nbttagcompound1);
}
// if(this.isAIDisabled()) {
@ -609,23 +609,23 @@ public abstract class EntityLiving extends Entity
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.setAbsorptionAmount(tagCompund.getInt("Absorption"));
if (tagCompund.hasTagList("Attributes") && this.worldObj != null && !this.worldObj.client)
if (tagCompund.hasObjectList("Attributes") && this.worldObj != null && !this.worldObj.client)
{
Attributes.setAttributeModifiers(this.getAttributeMap(), tagCompund.getTagList("Attributes"));
Attributes.setAttributeModifiers(this.getAttributeMap(), tagCompund.getObjectList("Attributes"));
}
if (tagCompund.hasTagList("ActiveEffects"))
if (tagCompund.hasObjectList("ActiveEffects"))
{
TagObjectList nbttaglist = tagCompund.getTagList("ActiveEffects");
TagObjectList nbttaglist = tagCompund.getObjectList("ActiveEffects");
for (int i = 0; i < nbttaglist.size(); ++i)
{
TagObject nbttagcompound = nbttaglist.get(i);
PotionEffect potioneffect = PotionEffect.fromNbt(nbttagcompound);
PotionEffect potioneffect = PotionEffect.fromTags(nbttagcompound);
if (potioneffect != null && !potioneffect.getPotion().isInstant())
{
@ -664,8 +664,8 @@ public abstract class EntityLiving extends Entity
if(!(this.isPlayer())) {
this.leashed = tagCompund.getBool("Leashed");
if(this.leashed && tagCompund.hasTag("Leash")) {
this.leashTag = tagCompund.getTag("Leash");
if(this.leashed && tagCompund.hasObject("Leash")) {
this.leashTag = tagCompund.getObject("Leash");
}
}
@ -2775,13 +2775,13 @@ public abstract class EntityLiving extends Entity
if(stack != null && stack.getItem() == Items.lead && this.allowLeashing()) {
if(!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) {
this.setLeashedTo(player, true);
--stack.stackSize;
--stack.size;
return true;
}
if(((EntityTameable)this).isOwner(player)) {
this.setLeashedTo(player, true);
--stack.stackSize;
--stack.size;
return true;
}
}
@ -3222,9 +3222,9 @@ public abstract class EntityLiving extends Entity
// if (!player.creative)
// {
--itemstack.stackSize;
--itemstack.size;
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null);
}

View file

@ -25,9 +25,9 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
super.writeEntityToNBT(tagCompound);
super.writeEntity(tagCompound);
// if (this.getOwnerId() == null)
// {
@ -45,9 +45,9 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
super.readEntityFromNBT(tagCompund);
super.readEntity(tagCompund);
// String s = "";
//
// if (tagCompund.hasString("Owner"))

View file

@ -303,7 +303,7 @@ public abstract class EntityThrowable extends Entity implements IProjectile
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(TagObject tagCompound)
public void writeEntity(TagObject tagCompound)
{
tagCompound.setShort("xTile", (short)this.xTile);
tagCompound.setShort("yTile", (short)this.yTile);
@ -326,7 +326,7 @@ public abstract class EntityThrowable extends Entity implements IProjectile
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(TagObject tagCompund)
public void readEntity(TagObject tagCompund)
{
this.xTile = tagCompund.getShort("xTile");
this.yTile = tagCompund.getShort("yTile");

View file

@ -25,10 +25,10 @@ public abstract class EntityWeatherEffect extends Entity {
protected final void entityInit() {
}
protected final void readEntityFromNBT(TagObject tagCompund) {
protected final void readEntity(TagObject tagCompund) {
}
protected final void writeEntityToNBT(TagObject tagCompound) {
protected final void writeEntity(TagObject tagCompound) {
}
public final EntityType getType() {

View file

@ -594,14 +594,14 @@ public abstract class CraftingRegistry
if (itemstack1 != null && itemstack1.getItem() == Items.banner)
{
itemstack = itemstack1.copy();
itemstack.stackSize = 1;
itemstack.size = 1;
break;
}
}
TileEntityBanner.EnumBannerPattern tileentitybanner$enumbannerpattern = this.getBannerPattern(inv);
TileEntityBanner.EnumBannerPattern type = this.getBannerPattern(inv);
if (tileentitybanner$enumbannerpattern != null)
if (type != null)
{
int k = 0;
@ -616,23 +616,23 @@ public abstract class CraftingRegistry
}
}
TagObject nbttagcompound1 = itemstack.getSubCompound("BlockEntityTag", true);
TagObjectList nbttaglist = null;
TagObject tag = itemstack.getSubCompound("BlockEntityTag", true);
TagObjectList list = null;
if (nbttagcompound1.hasTagList("Patterns"))
if (tag.hasObjectList("Patterns"))
{
nbttaglist = nbttagcompound1.getTagList("Patterns");
list = tag.getObjectList("Patterns");
}
else
{
nbttaglist = new TagObjectList();
nbttagcompound1.setTagList("Patterns", nbttaglist);
list = new TagObjectList();
tag.setObjectList("Patterns", list);
}
TagObject nbttagcompound = new TagObject();
nbttagcompound.setString("Pattern", tileentitybanner$enumbannerpattern.getPatternID());
nbttagcompound.setInt("Color", k);
nbttaglist.add(nbttagcompound);
TagObject pattern = new TagObject();
pattern.setString("Pattern", type.getPatternID());
pattern.setInt("Color", k);
list.add(pattern);
}
return itemstack;
@ -844,7 +844,7 @@ public abstract class CraftingRegistry
if (itemstack != null && TileEntityBanner.getPatterns(itemstack) > 0)
{
ItemStack itemstack1 = itemstack.copy();
itemstack1.stackSize = 1;
itemstack1.size = 1;
return itemstack1;
}
}
@ -879,7 +879,7 @@ public abstract class CraftingRegistry
else if (itemstack.hasTagCompound() && TileEntityBanner.getPatterns(itemstack) > 0)
{
aitemstack[i] = itemstack.copy();
aitemstack[i].stackSize = 1;
aitemstack[i].size = 1;
}
}
}
@ -969,24 +969,24 @@ public abstract class CraftingRegistry
if (l > 0)
{
TagObject nbttagcompound1 = new TagObject();
TagObject nbttagcompound3 = new TagObject();
TagObjectList nbttaglist = new TagObjectList();
TagObject tag = new TagObject();
TagObject data = new TagObject();
TagObjectList list = new TagObjectList();
for (int k2 = 0; k2 < inv.getSizeInventory(); ++k2)
{
ItemStack itemstack3 = inv.getStackInSlot(k2);
if (itemstack3 != null && itemstack3.getItem() == Items.firework_charge && itemstack3.hasTagCompound() && itemstack3.getTagCompound().hasTag("Explosion"))
if (itemstack3 != null && itemstack3.getItem() == Items.firework_charge && itemstack3.hasTagCompound() && itemstack3.getTagCompound().hasObject("Explosion"))
{
nbttaglist.add(itemstack3.getTagCompound().getTag("Explosion"));
list.add(itemstack3.getTagCompound().getObject("Explosion"));
}
}
nbttagcompound3.setTagList("Explosions", nbttaglist);
nbttagcompound3.setByte("Flight", (byte)j);
nbttagcompound1.setTag("Fireworks", nbttagcompound3);
this.field_92102_a.setTagCompound(nbttagcompound1);
data.setObjectList("Explosions", list);
data.setByte("Flight", (byte)j);
tag.setObject("Fireworks", data);
this.field_92102_a.setTagCompound(tag);
}
return true;
@ -994,8 +994,8 @@ public abstract class CraftingRegistry
else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1)
{
this.field_92102_a = new ItemStack(Items.firework_charge);
TagObject nbttagcompound = new TagObject();
TagObject nbttagcompound2 = new TagObject();
TagObject tag = new TagObject();
TagObject data = new TagObject();
byte b0 = 0;
List<Integer> list = Lists.<Integer>newArrayList();
@ -1011,11 +1011,11 @@ public abstract class CraftingRegistry
}
else if (itemstack2.getItem() == Items.glowstone_dust)
{
nbttagcompound2.setBool("Flicker", true);
data.setBool("Flicker", true);
}
else if (itemstack2.getItem() == Items.diamond)
{
nbttagcompound2.setBool("Trail", true);
data.setBool("Trail", true);
}
else if (itemstack2.getItem() == Items.fire_charge)
{
@ -1043,10 +1043,10 @@ public abstract class CraftingRegistry
aint1[l2] = ((Integer)list.get(l2)).intValue();
}
nbttagcompound2.setIntArray("Colors", aint1);
nbttagcompound2.setByte("Type", b0);
nbttagcompound.setTag("Explosion", nbttagcompound2);
this.field_92102_a.setTagCompound(nbttagcompound);
data.setIntArray("Colors", aint1);
data.setByte("Type", b0);
tag.setObject("Explosion", data);
this.field_92102_a.setTagCompound(tag);
return true;
}
else if (j == 0 && i == 0 && l == 1 && k > 0 && k == i1)
@ -1066,7 +1066,7 @@ public abstract class CraftingRegistry
else if (itemstack1.getItem() == Items.firework_charge)
{
this.field_92102_a = itemstack1.copy();
this.field_92102_a.stackSize = 1;
this.field_92102_a.size = 1;
}
}
}
@ -1080,15 +1080,15 @@ public abstract class CraftingRegistry
if (this.field_92102_a != null && this.field_92102_a.hasTagCompound())
{
TagObject nbttagcompound4 = this.field_92102_a.getTagCompound().getTag("Explosion");
TagObject tag = this.field_92102_a.getTagCompound().getObject("Explosion");
if (nbttagcompound4 == null)
if (tag == null)
{
return false;
}
else
{
nbttagcompound4.setIntArray("FadeColors", aint);
tag.setIntArray("FadeColors", aint);
return true;
}
}
@ -1168,7 +1168,7 @@ public abstract class CraftingRegistry
{
ItemStack itemstack1 = (ItemStack)list.get(0);
if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable())
if (itemstack.getItem() != itemstack1.getItem() || itemstack1.size != 1 || itemstack.size != 1 || !itemstack1.getItem().isDamageable())
{
return false;
}
@ -1198,7 +1198,7 @@ public abstract class CraftingRegistry
{
ItemStack itemstack1 = (ItemStack)list.get(0);
if (itemstack.getItem() != itemstack1.getItem() || itemstack1.stackSize != 1 || itemstack.stackSize != 1 || !itemstack1.getItem().isDamageable())
if (itemstack.getItem() != itemstack1.getItem() || itemstack1.size != 1 || itemstack.size != 1 || !itemstack1.getItem().isDamageable())
{
return null;
}
@ -1211,7 +1211,7 @@ public abstract class CraftingRegistry
ItemStack itemstack2 = (ItemStack)list.get(0);
ItemStack itemstack3 = (ItemStack)list.get(1);
if (itemstack2.getItem() == itemstack3.getItem() && itemstack2.stackSize == 1 && itemstack3.stackSize == 1 && itemstack2.getItem().isDamageable())
if (itemstack2.getItem() == itemstack3.getItem() && itemstack2.size == 1 && itemstack3.size == 1 && itemstack2.getItem().isDamageable())
{
Item item = itemstack2.getItem();
int j = item.getMaxDamage() - itemstack2.getItemDamage();
@ -1331,7 +1331,7 @@ public abstract class CraftingRegistry
}
itemstack = itemstack1.copy();
itemstack.stackSize = 1;
itemstack.size = 1;
if (itemarmor.hasColor(itemstack1))
{
@ -1431,7 +1431,7 @@ public abstract class CraftingRegistry
/** Is the ItemStack that you get when craft the recipe. */
private final ItemStack recipeOutput;
private boolean copyIngredientNBT;
private boolean copyIngredientTag;
public ShapedRecipes(int width, int height, ItemStack[] p_i1917_3_, ItemStack output)
{
@ -1544,7 +1544,7 @@ public abstract class CraftingRegistry
{
ItemStack itemstack = this.getRecipeOutput().copy();
if (this.copyIngredientNBT)
if (this.copyIngredientTag)
{
for (int i = 0; i < inv.getSizeInventory(); ++i)
{

View file

@ -243,7 +243,7 @@ public abstract class DispenserRegistry {
if (itembucket.tryPlaceContainedLiquid(source.getWorld(), blockpos))
{
stack.setItem(Items.bucket);
stack.stackSize = 1;
stack.size = 1;
return stack;
}
else
@ -300,10 +300,10 @@ public abstract class DispenserRegistry {
world.setBlockToAir(blockpos);
if (--stack.stackSize == 0)
if (--stack.size == 0)
{
stack.setItem(item);
stack.stackSize = 1;
stack.size = 1;
}
else if (((TileEntityDispenser)source.getBlockTileEntity()).addItemStack(new ItemStack(item)) < 0)
{
@ -327,7 +327,7 @@ public abstract class DispenserRegistry {
if (stack.attemptDamageItem(1, world.rand))
{
stack.stackSize = 0;
stack.size = 0;
}
}
else if (world.getState(blockpos).getBlock() == Blocks.tnt)
@ -404,112 +404,9 @@ public abstract class DispenserRegistry {
EntityTnt entitytntprimed = new EntityTnt(world, (double)blockpos.getX() + 0.5D, (double)blockpos.getY(), (double)blockpos.getZ() + 0.5D, (EntityLiving)null, stack.getMetadata());
world.spawnEntityInWorld(entitytntprimed);
world.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F);
--stack.stackSize;
--stack.size;
return stack;
}
});
// REGISTRY.putObject(Items.skull, new BehaviorDefaultDispenseItem()
// {
// private boolean field_179240_b = true;
// protected ItemStack dispenseStack(IBlockSource source, ItemStack stack)
// {
// World world = source.getWorld();
// EnumFacing enumfacing = BlockDispenser.getFacing(source.getBlockMetadata());
// BlockPos blockpos = source.getBlockPos().offset(enumfacing);
// BlockSkull blockskull = Blocks.skull;
//
// if (world.isAirBlock(blockpos) && blockskull.canDispenserPlace(world, blockpos, stack))
// {
// if (!world.client)
// {
// world.setBlockState(blockpos, blockskull.getDefaultState().withProperty(BlockSkull.FACING, EnumFacing.UP), 3);
// TileEntity tileentity = world.getTileEntity(blockpos);
//
// if (tileentity instanceof TileEntitySkull)
// {
// if (stack.getMetadata() == 3)
// {
// String user = null;
//
// if (stack.hasTagCompound())
// {
// NBTTagCompound nbttagcompound = stack.getTagCompound();
//
// if (nbttagcompound.hasString("SkullOwner") && nbttagcompound.getString("SkullOwner").length() > 0)
// {
// user = nbttagcompound.getString("SkullOwner");
// }
// }
//
// ((TileEntitySkull)tileentity).setUser(user);
// }
// else
// {
// ((TileEntitySkull)tileentity).setType(stack.getMetadata());
// }
//
// ((TileEntitySkull)tileentity).setSkullRotation(enumfacing.getOpposite().getHorizontalIndex() * 4);
//// Blocks.skull.checkWitherSpawn(world, blockpos, (TileEntitySkull)tileentity);
// }
//
// --stack.stackSize;
// }
// }
// else
// {
// this.field_179240_b = false;
// }
//
// return stack;
// }
// protected void playDispenseSound(IBlockSource source)
// {
// if (this.field_179240_b)
// {
// source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0);
// }
// else
// {
// source.getWorld().playAuxSFX(1001, source.getBlockPos(), 0);
// }
// }
// });
// REGISTRY.putObject(ItemRegistry.getItemFromBlock(Blocks.pumpkin), new BehaviorDefaultDispenseItem()
// {
// private boolean field_179241_b = true;
// protected ItemStack dispenseStack(IBlockSource source, ItemStack stack)
// {
// World world = source.getWorld();
// BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata()));
// BlockPumpkin blockpumpkin = (BlockPumpkin)Blocks.pumpkin;
//
// if (world.isAirBlock(blockpos) && blockpumpkin.canDispenserPlace(world, blockpos))
// {
// if (!world.client)
// {
// world.setBlockState(blockpos, blockpumpkin.getDefaultState(), 3);
// }
//
// --stack.stackSize;
// }
// else
// {
// this.field_179241_b = false;
// }
//
// return stack;
// }
// protected void playDispenseSound(IBlockSource source)
// {
// if (this.field_179241_b)
// {
// source.getWorld().playAuxSFX(1000, source.getBlockPos(), 0);
// }
// else
// {
// source.getWorld().playAuxSFX(1001, source.getBlockPos(), 0);
// }
// }
// });
}
}

View file

@ -117,19 +117,14 @@ public abstract class EntityRegistry {
return entity;
}
public static Entity createEntityFromNBT(TagObject nbt, World worldIn) {
public static Entity createFromTags(TagObject tag, World world) {
Entity entity = null;
// if("Minecart".equals(nbt.getString("id"))) {
// nbt.setString("id", EntityMinecart.EnumMinecartType.byNetworkID(nbt.getInteger("Type")).getName());
// nbt.removeTag("Type");
// }
try {
Class<? extends Entity> oclass = (Class)STRING_TO_CLASS.get(nbt.getString("id"));
Class<? extends Entity> oclass = (Class)STRING_TO_CLASS.get(tag.getString("id"));
if(oclass != null) {
entity = (Entity)oclass.getConstructor(World.class).newInstance(worldIn);
entity = (Entity)oclass.getConstructor(World.class).newInstance(world);
}
}
catch(Exception exception) {
@ -137,10 +132,10 @@ public abstract class EntityRegistry {
}
if(entity != null) {
entity.readFromNBT(nbt);
entity.readTags(tag);
}
else {
Log.TICK.warn("Ignoriere Objekt mit Name " + nbt.getString("id"));
Log.TICK.warn("Ignoriere Objekt mit Name " + tag.getString("id"));
}
return entity;

View file

@ -92,56 +92,56 @@ public abstract class UniverseRegistry {
}
}
public static void loadNbt(TagObject tag) {
TagObjectList list = tag.getTagList("Dimensions");
public static void fromTags(TagObject tag) {
TagObjectList list = tag.getObjectList("Dimensions");
for(int z = 0; z < list.size(); z++) {
Dimension dim = Dimension.getByNbt(list.get(z));
Dimension dim = Dimension.getByTag(list.get(z));
if(!REGISTRY.containsKey(dim.getDimensionId()) && !ALIASES.containsKey(dim.getDimensionName()))
register(dim);
}
list = tag.getTagList("Names");
list = tag.getObjectList("Names");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
String id = data.getString("ID");
// if(BASE_ALIASES.containsKey(id)) {
Dimension dim = ALIASES.get(id);
if(dim != null && dim != Space.INSTANCE)
dim.readNbt(data);
dim.readTags(data);
// }
}
list = tag.getTagList("Sectors");
list = tag.getObjectList("Sectors");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
String id = data.getString("ID");
Sector sector = SECTORS.get(id);
if(sector == null)
SECTORS.put(id, sector = new Sector(id));
sector.readNbt(data);
sector.readTags(data);
}
list = tag.getTagList("Galaxies");
list = tag.getObjectList("Galaxies");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
String id = data.getString("ID");
Galaxy galaxy = GALAXIES.get(id);
if(galaxy == null)
GALAXIES.put(id, galaxy = new Galaxy(id));
galaxy.readNbt(data);
galaxy.readTags(data);
}
list = tag.getTagList("Domains");
list = tag.getObjectList("Domains");
for(int z = 0; z < list.size(); z++) {
TagObject data = list.get(z);
String id = data.getString("ID");
Domain domain = DOMAINS.get(id);
if(domain == null)
DOMAINS.put(id, domain = new Domain(id));
domain.readNbt(data);
domain.readTags(data);
}
list = tag.getTagList("Barycenters");
list = tag.getObjectList("Barycenters");
for(int z = 0; z < list.size(); z++) {
TagObject link = list.get(z);
if(!assign(link.getString("Celestial"), link.getString("Center")))
@ -149,22 +149,22 @@ public abstract class UniverseRegistry {
}
}
public static TagObject saveNbt() {
public static TagObject toTags() {
TagObject tag = new TagObject();
TagObjectList list = new TagObjectList();
for(Dimension dim : DIMENSIONS) {
if(!BASE_REGISTRY.containsKey(dim.getDimensionId()) && dim != Space.INSTANCE)
list.add(dim.toNbt());
list.add(dim.toTags());
}
if(!list.isEmpty())
tag.setTagList("Dimensions", list);
tag.setObjectList("Dimensions", list);
list = new TagObjectList();
for(Dimension dim : DIMENSIONS) {
if(/* BASE_REGISTRY.containsKey(dim.getDimensionId()) */ dim != Space.INSTANCE) {
TagObject data = new TagObject();
dim.writeNbt(data);
dim.writeTags(data);
if(!data.isEmpty()) {
data.setString("ID", dim.getDimensionName());
list.add(data);
@ -172,43 +172,43 @@ public abstract class UniverseRegistry {
}
}
if(!list.isEmpty())
tag.setTagList("Names", list);
tag.setObjectList("Names", list);
list = new TagObjectList();
for(Sector sector : SECTORS.values()) {
TagObject data = new TagObject();
sector.writeNbt(data);
sector.writeTags(data);
if(!data.isEmpty()) {
data.setString("ID", sector.id);
list.add(data);
}
}
if(!list.isEmpty())
tag.setTagList("Sectors", list);
tag.setObjectList("Sectors", list);
list = new TagObjectList();
for(Galaxy galaxy : GALAXIES.values()) {
TagObject data = new TagObject();
galaxy.writeNbt(data);
galaxy.writeTags(data);
if(!data.isEmpty()) {
data.setString("ID", galaxy.id);
list.add(data);
}
}
if(!list.isEmpty())
tag.setTagList("Galaxies", list);
tag.setObjectList("Galaxies", list);
list = new TagObjectList();
for(Domain domain : DOMAINS.values()) {
TagObject data = new TagObject();
domain.writeNbt(data);
domain.writeTags(data);
if(!data.isEmpty()) {
data.setString("ID", domain.id);
list.add(data);
}
}
if(!list.isEmpty())
tag.setTagList("Domains", list);
tag.setObjectList("Domains", list);
list = new TagObjectList();
for(Entry<Moon, Planet> entry : MOON_MAP.entrySet()) {
@ -252,7 +252,7 @@ public abstract class UniverseRegistry {
list.add(link);
}
if(!list.isEmpty())
tag.setTagList("Barycenters", list);
tag.setObjectList("Barycenters", list);
return tag;
}
@ -708,7 +708,7 @@ public abstract class UniverseRegistry {
catch(TagException e) {
throw new RuntimeException(e);
}
TagObject dtag = dim.toNbt(true);
TagObject dtag = dim.toTags(true);
if(ptag.getBool("ClearGenerator")) {
ptag.remove("ClearGenerator");
dtag.remove("FloorBlock");
@ -754,7 +754,7 @@ public abstract class UniverseRegistry {
dtag.setString("CaveFillBlock", BlockRegistry.toIdName(Blocks.air.getState()));
}
dtag.merge(ptag);
dim.fromNbt(dtag);
dim.fromTags(dtag);
dim.setCustomName(name);
// BASE_DIMS.add(dim);
return dim;

View file

@ -173,7 +173,7 @@ public abstract class Container
{
Slot slot = (Slot)this.inventorySlots.get(slotId);
if (slot != null && canAddItemToSlot(slot, inventoryplayer.getItemStack(), true) && slot.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().stackSize > this.dragSlots.size() && this.canDragIntoSlot(slot))
if (slot != null && canAddItemToSlot(slot, inventoryplayer.getItemStack(), true) && slot.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().size > this.dragSlots.size() && this.canDragIntoSlot(slot))
{
this.dragSlots.add(slot);
}
@ -183,34 +183,34 @@ public abstract class Container
if (!this.dragSlots.isEmpty())
{
ItemStack itemstack3 = inventoryplayer.getItemStack().copy();
int j = inventoryplayer.getItemStack().stackSize;
int j = inventoryplayer.getItemStack().size;
for (Slot slot1 : this.dragSlots)
{
if (slot1 != null && canAddItemToSlot(slot1, inventoryplayer.getItemStack(), true) && slot1.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().stackSize >= this.dragSlots.size() && this.canDragIntoSlot(slot1))
if (slot1 != null && canAddItemToSlot(slot1, inventoryplayer.getItemStack(), true) && slot1.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().size >= this.dragSlots.size() && this.canDragIntoSlot(slot1))
{
ItemStack itemstack1 = itemstack3.copy();
int k = slot1.getHasStack() ? slot1.getStack().stackSize : 0;
int k = slot1.getHasStack() ? slot1.getStack().size : 0;
computeStackSize(this.dragSlots, this.dragMode, itemstack1, k);
if (itemstack1.stackSize > itemstack1.getMaxStackSize())
if (itemstack1.size > itemstack1.getMaxStackSize())
{
itemstack1.stackSize = itemstack1.getMaxStackSize();
itemstack1.size = itemstack1.getMaxStackSize();
}
if (itemstack1.stackSize > slot1.getItemStackLimit(itemstack1))
if (itemstack1.size > slot1.getItemStackLimit(itemstack1))
{
itemstack1.stackSize = slot1.getItemStackLimit(itemstack1);
itemstack1.size = slot1.getItemStackLimit(itemstack1);
}
j -= itemstack1.stackSize - k;
j -= itemstack1.size - k;
slot1.putStack(itemstack1);
}
}
itemstack3.stackSize = j;
itemstack3.size = j;
if (itemstack3.stackSize <= 0)
if (itemstack3.size <= 0)
{
itemstack3 = null;
}
@ -245,7 +245,7 @@ public abstract class Container
{
playerIn.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack().splitStack(1), true);
if (inventoryplayer.getItemStack().stackSize == 0)
if (inventoryplayer.getItemStack().size == 0)
{
inventoryplayer.setItemStack((ItemStack)null);
}
@ -300,19 +300,19 @@ public abstract class Container
{
if (itemstack10 != null && slot7.isItemValid(itemstack10))
{
int k2 = clickedButton == 0 ? itemstack10.stackSize : 1;
int k2 = clickedButton == 0 ? itemstack10.size : 1;
if (k2 > slot7.getItemStackLimit(itemstack10))
{
k2 = slot7.getItemStackLimit(itemstack10);
}
if (itemstack10.stackSize >= k2)
if (itemstack10.size >= k2)
{
slot7.putStack(itemstack10.splitStack(k2));
}
if (itemstack10.stackSize == 0)
if (itemstack10.size == 0)
{
inventoryplayer.setItemStack((ItemStack)null);
}
@ -322,11 +322,11 @@ public abstract class Container
{
if (itemstack10 == null)
{
int j2 = clickedButton == 0 ? itemstack9.stackSize : (itemstack9.stackSize + 1) / 2;
int j2 = clickedButton == 0 ? itemstack9.size : (itemstack9.size + 1) / 2;
ItemStack itemstack12 = slot7.decrStackSize(j2);
inventoryplayer.setItemStack(itemstack12);
if (itemstack9.stackSize == 0)
if (itemstack9.size == 0)
{
slot7.putStack((ItemStack)null);
}
@ -337,28 +337,28 @@ public abstract class Container
{
if (itemstack9.getItem() == itemstack10.getItem() && itemstack9.getMetadata() == itemstack10.getMetadata() && ItemStack.areItemStackTagsEqual(itemstack9, itemstack10))
{
int i2 = clickedButton == 0 ? itemstack10.stackSize : 1;
int i2 = clickedButton == 0 ? itemstack10.size : 1;
if (i2 > slot7.getItemStackLimit(itemstack10) - itemstack9.stackSize)
if (i2 > slot7.getItemStackLimit(itemstack10) - itemstack9.size)
{
i2 = slot7.getItemStackLimit(itemstack10) - itemstack9.stackSize;
i2 = slot7.getItemStackLimit(itemstack10) - itemstack9.size;
}
if (i2 > itemstack10.getMaxStackSize() - itemstack9.stackSize)
if (i2 > itemstack10.getMaxStackSize() - itemstack9.size)
{
i2 = itemstack10.getMaxStackSize() - itemstack9.stackSize;
i2 = itemstack10.getMaxStackSize() - itemstack9.size;
}
itemstack10.splitStack(i2);
if (itemstack10.stackSize == 0)
if (itemstack10.size == 0)
{
inventoryplayer.setItemStack((ItemStack)null);
}
itemstack9.stackSize += i2;
itemstack9.size += i2;
}
else if (itemstack10.stackSize <= slot7.getItemStackLimit(itemstack10))
else if (itemstack10.size <= slot7.getItemStackLimit(itemstack10))
{
slot7.putStack(itemstack10);
inventoryplayer.setItemStack(itemstack9);
@ -366,14 +366,14 @@ public abstract class Container
}
else if (itemstack9.getItem() == itemstack10.getItem() && itemstack10.getMaxStackSize() > 1 && (!itemstack9.getHasSubtypes() || itemstack9.getMetadata() == itemstack10.getMetadata()) && ItemStack.areItemStackTagsEqual(itemstack9, itemstack10))
{
int l1 = itemstack9.stackSize;
int l1 = itemstack9.size;
if (l1 > 0 && l1 + itemstack10.stackSize <= itemstack10.getMaxStackSize())
if (l1 > 0 && l1 + itemstack10.size <= itemstack10.getMaxStackSize())
{
itemstack10.stackSize += l1;
itemstack10.size += l1;
itemstack9 = slot7.decrStackSize(l1);
if (itemstack9.stackSize == 0)
if (itemstack9.size == 0)
{
slot7.putStack((ItemStack)null);
}
@ -413,14 +413,14 @@ public abstract class Container
if (k1 > -1)
{
inventoryplayer.addItemStackToInventory(itemstack7);
slot5.decrStackSize(itemstack11.stackSize);
slot5.decrStackSize(itemstack11.size);
slot5.putStack((ItemStack)null);
slot5.onPickupFromSlot(playerIn, itemstack11);
}
}
else
{
slot5.decrStackSize(itemstack11.stackSize);
slot5.decrStackSize(itemstack11.size);
slot5.putStack(itemstack7);
slot5.onPickupFromSlot(playerIn, itemstack11);
}
@ -449,7 +449,7 @@ public abstract class Container
if (slot3 != null && slot3.getHasStack() && slot3.canTakeStack(playerIn))
{
ItemStack itemstack5 = slot3.decrStackSize(clickedButton == 0 ? 1 : slot3.getStack().stackSize);
ItemStack itemstack5 = slot3.decrStackSize(clickedButton == 0 ? 1 : slot3.getStack().size);
slot3.onPickupFromSlot(playerIn, itemstack5);
playerIn.dropPlayerItemWithRandomChoice(itemstack5, true);
}
@ -466,17 +466,17 @@ public abstract class Container
for (int l2 = 0; l2 < 2; ++l2)
{
for (int i3 = i1; i3 >= 0 && i3 < this.inventorySlots.size() && itemstack4.stackSize < itemstack4.getMaxStackSize(); i3 += j1)
for (int i3 = i1; i3 >= 0 && i3 < this.inventorySlots.size() && itemstack4.size < itemstack4.getMaxStackSize(); i3 += j1)
{
Slot slot8 = (Slot)this.inventorySlots.get(i3);
if (slot8.getHasStack() && canAddItemToSlot(slot8, itemstack4, true) && slot8.canTakeStack(playerIn) && this.canMergeSlot(itemstack4, slot8) && (l2 != 0 || slot8.getStack().stackSize != slot8.getStack().getMaxStackSize()))
if (slot8.getHasStack() && canAddItemToSlot(slot8, itemstack4, true) && slot8.canTakeStack(playerIn) && this.canMergeSlot(itemstack4, slot8) && (l2 != 0 || slot8.getStack().size != slot8.getStack().getMaxStackSize()))
{
int l = Math.min(itemstack4.getMaxStackSize() - itemstack4.stackSize, slot8.getStack().stackSize);
int l = Math.min(itemstack4.getMaxStackSize() - itemstack4.size, slot8.getStack().size);
ItemStack itemstack2 = slot8.decrStackSize(l);
itemstack4.stackSize += l;
itemstack4.size += l;
if (itemstack2.stackSize <= 0)
if (itemstack2.size <= 0)
{
slot8.putStack((ItemStack)null);
}
@ -606,26 +606,26 @@ public abstract class Container
if (stack.isStackable())
{
while (stack.stackSize > 0 && (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex))
while (stack.size > 0 && (!reverseDirection && i < endIndex || reverseDirection && i >= startIndex))
{
Slot slot = (Slot)this.inventorySlots.get(i);
ItemStack itemstack = slot.getStack();
if (itemstack != null && itemstack.getItem() == stack.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == itemstack.getMetadata()) && ItemStack.areItemStackTagsEqual(stack, itemstack))
{
int j = itemstack.stackSize + stack.stackSize;
int j = itemstack.size + stack.size;
if (j <= stack.getMaxStackSize())
{
stack.stackSize = 0;
itemstack.stackSize = j;
stack.size = 0;
itemstack.size = j;
slot.onSlotChanged();
flag = true;
}
else if (itemstack.stackSize < stack.getMaxStackSize())
else if (itemstack.size < stack.getMaxStackSize())
{
stack.stackSize -= stack.getMaxStackSize() - itemstack.stackSize;
itemstack.stackSize = stack.getMaxStackSize();
stack.size -= stack.getMaxStackSize() - itemstack.size;
itemstack.size = stack.getMaxStackSize();
slot.onSlotChanged();
flag = true;
}
@ -642,7 +642,7 @@ public abstract class Container
}
}
if (stack.stackSize > 0)
if (stack.size > 0)
{
if (reverseDirection)
{
@ -662,7 +662,7 @@ public abstract class Container
{
slot1.putStack(stack.copy());
slot1.onSlotChanged();
stack.stackSize = 0;
stack.size = 0;
flag = true;
break;
}
@ -729,7 +729,7 @@ public abstract class Container
if (slotIn != null && slotIn.getHasStack() && stack != null && stack.isItemEqual(slotIn.getStack()) && ItemStack.areItemStackTagsEqual(slotIn.getStack(), stack))
{
flag |= slotIn.getStack().stackSize + (stackSizeMatters ? 0 : stack.stackSize) <= stack.getMaxStackSize();
flag |= slotIn.getStack().size + (stackSizeMatters ? 0 : stack.size) <= stack.getMaxStackSize();
}
return flag;
@ -744,18 +744,18 @@ public abstract class Container
switch (p_94525_1_)
{
case 0:
p_94525_2_.stackSize = ExtMath.floorf((float)p_94525_2_.stackSize / (float)p_94525_0_.size());
p_94525_2_.size = ExtMath.floorf((float)p_94525_2_.size / (float)p_94525_0_.size());
break;
case 1:
p_94525_2_.stackSize = 1;
p_94525_2_.size = 1;
break;
case 2:
p_94525_2_.stackSize = p_94525_2_.getItem().getItemStackLimit();
p_94525_2_.size = p_94525_2_.getItem().getItemStackLimit();
}
p_94525_2_.stackSize += p_94525_3_;
p_94525_2_.size += p_94525_3_;
}
/**
@ -792,7 +792,7 @@ public abstract class Container
if (itemstack != null)
{
f += (float)itemstack.stackSize / (float)Math.min(inv.getInventoryStackLimit(), itemstack.getMaxStackSize());
f += (float)itemstack.size / (float)Math.min(inv.getInventoryStackLimit(), itemstack.getMaxStackSize());
++i;
}
}

View file

@ -128,7 +128,7 @@ public class ContainerBrewingStand extends Container
slot.onSlotChange(itemstack1, itemstack);
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -137,7 +137,7 @@ public class ContainerBrewingStand extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -67,7 +67,7 @@ public class ContainerChest extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}

View file

@ -63,7 +63,7 @@ public class ContainerDispenser extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -72,7 +72,7 @@ public class ContainerDispenser extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -390,19 +390,19 @@ public class ContainerEnchantment extends Container
return null;
}
if (itemstack1.hasTagCompound() && itemstack1.stackSize == 1)
if (itemstack1.hasTagCompound() && itemstack1.size == 1)
{
((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy());
itemstack1.stackSize = 0;
itemstack1.size = 0;
}
else if (itemstack1.stackSize >= 1)
else if (itemstack1.size >= 1)
{
((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata()));
--itemstack1.stackSize;
--itemstack1.size;
}
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -411,7 +411,7 @@ public class ContainerEnchantment extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -143,7 +143,7 @@ public class ContainerFurnace extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -152,7 +152,7 @@ public class ContainerFurnace extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -62,7 +62,7 @@ public class ContainerHopper extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}

View file

@ -105,7 +105,7 @@ public class ContainerHorseInventory extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}

View file

@ -77,7 +77,7 @@ public class ContainerMachine extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}

View file

@ -115,7 +115,7 @@ public class ContainerMerchant extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -124,7 +124,7 @@ public class ContainerMerchant extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -90,12 +90,12 @@ public class ContainerPlayer extends Container
{
if (last != null)
{
this.attributes.removeAttributeModifiers(last.getAttributeModifiers(2), slot.getIndex(), last.stackSize);
this.attributes.removeAttributeModifiers(last.getAttributeModifiers(2), slot.getIndex(), last.size);
}
if (current != null)
{
this.attributes.applyAttributeModifiers(current.getAttributeModifiers(2), slot.getIndex(), current.stackSize);
this.attributes.applyAttributeModifiers(current.getAttributeModifiers(2), slot.getIndex(), current.size);
}
last = current == null ? null : current.copy();
@ -202,7 +202,7 @@ public class ContainerPlayer extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -211,7 +211,7 @@ public class ContainerPlayer extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -81,9 +81,9 @@ public class ContainerRepair extends Container
{
ItemStack itemstack = ContainerRepair.this.inputSlots.getStackInSlot(1);
if (itemstack != null && itemstack.stackSize > ContainerRepair.this.materialCost)
if (itemstack != null && itemstack.size > ContainerRepair.this.materialCost)
{
itemstack.stackSize -= ContainerRepair.this.materialCost;
itemstack.size -= ContainerRepair.this.materialCost;
ContainerRepair.this.inputSlots.setInventorySlotContents(1, itemstack);
}
else
@ -198,7 +198,7 @@ public class ContainerRepair extends Container
int cost;
for (cost = 0; damage > 0 && cost < repStack.stackSize; ++cost)
for (cost = 0; damage > 0 && cost < repStack.size; ++cost)
{
int j5 = newStack.getItemDamage() - damage;
newStack.setItemDamage(j5);
@ -458,7 +458,7 @@ public class ContainerRepair extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -467,7 +467,7 @@ public class ContainerRepair extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -125,7 +125,7 @@ public class ContainerWorkbench extends Container
return null;
}
if (itemstack1.stackSize == 0)
if (itemstack1.size == 0)
{
slot.putStack((ItemStack)null);
}
@ -134,7 +134,7 @@ public class ContainerWorkbench extends Container
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
if (itemstack1.size == itemstack.size)
{
return null;
}

View file

@ -68,7 +68,7 @@ public class InventoryBasic implements IInventory
{
if (this.inventoryContents[index] != null)
{
if (this.inventoryContents[index].stackSize <= count)
if (this.inventoryContents[index].size <= count)
{
ItemStack itemstack1 = this.inventoryContents[index];
this.inventoryContents[index] = null;
@ -79,7 +79,7 @@ public class InventoryBasic implements IInventory
{
ItemStack itemstack = this.inventoryContents[index].splitStack(count);
if (this.inventoryContents[index].stackSize == 0)
if (this.inventoryContents[index].size == 0)
{
this.inventoryContents[index] = null;
}
@ -112,14 +112,14 @@ public class InventoryBasic implements IInventory
if (ItemStack.areItemsEqual(itemstack1, itemstack))
{
int j = Math.min(this.getInventoryStackLimit(), itemstack1.getMaxStackSize());
int k = Math.min(itemstack.stackSize, j - itemstack1.stackSize);
int k = Math.min(itemstack.size, j - itemstack1.size);
if (k > 0)
{
itemstack1.stackSize += k;
itemstack.stackSize -= k;
itemstack1.size += k;
itemstack.size -= k;
if (itemstack.stackSize <= 0)
if (itemstack.size <= 0)
{
this.markDirty();
return null;
@ -128,7 +128,7 @@ public class InventoryBasic implements IInventory
}
}
if (itemstack.stackSize != stack.stackSize)
if (itemstack.size != stack.size)
{
this.markDirty();
}
@ -160,9 +160,9 @@ public class InventoryBasic implements IInventory
{
this.inventoryContents[index] = stack;
if (stack != null && stack.stackSize > this.getInventoryStackLimit())
if (stack != null && stack.size > this.getInventoryStackLimit())
{
stack.stackSize = this.getInventoryStackLimit();
stack.size = this.getInventoryStackLimit();
}
this.markDirty();

View file

@ -98,7 +98,7 @@ public class InventoryCrafting implements IInventory
{
if (this.stackList[index] != null)
{
if (this.stackList[index].stackSize <= count)
if (this.stackList[index].size <= count)
{
ItemStack itemstack1 = this.stackList[index];
this.stackList[index] = null;
@ -109,7 +109,7 @@ public class InventoryCrafting implements IInventory
{
ItemStack itemstack = this.stackList[index].splitStack(count);
if (this.stackList[index].stackSize == 0)
if (this.stackList[index].size == 0)
{
this.stackList[index] = null;
}

View file

@ -41,16 +41,16 @@ public class InventoryHelper
float f1 = RANDOM.floatv() * 0.8F + 0.1F;
float f2 = RANDOM.floatv() * 0.8F + 0.1F;
while (stack.stackSize > 0)
while (stack.size > 0)
{
int i = stack.stackSize > 64 ? stack.stackSize : (RANDOM.zrange(21) + 10);
int i = stack.size > 64 ? stack.size : (RANDOM.zrange(21) + 10);
if (i > stack.stackSize)
if (i > stack.size)
{
i = stack.stackSize;
i = stack.size;
}
stack.stackSize -= i;
stack.size -= i;
EntityItem entityitem = new EntityItem(worldIn, x + (double)f, y + (double)f1, z + (double)f2, new ItemStack(stack.getItem(), i, stack.getMetadata()));
if (stack.hasTagCompound())

View file

@ -59,7 +59,7 @@ public class InventoryMerchant implements IInventory
this.theInventory[index] = null;
return itemstack2;
}
else if (this.theInventory[index].stackSize <= count)
else if (this.theInventory[index].size <= count)
{
ItemStack itemstack1 = this.theInventory[index];
this.theInventory[index] = null;
@ -75,7 +75,7 @@ public class InventoryMerchant implements IInventory
{
ItemStack itemstack = this.theInventory[index].splitStack(count);
if (this.theInventory[index].stackSize == 0)
if (this.theInventory[index].size == 0)
{
this.theInventory[index] = null;
}
@ -126,9 +126,9 @@ public class InventoryMerchant implements IInventory
{
this.theInventory[index] = stack;
if (stack != null && stack.stackSize > this.getInventoryStackLimit())
if (stack != null && stack.size > this.getInventoryStackLimit())
{
stack.stackSize = this.getInventoryStackLimit();
stack.size = this.getInventoryStackLimit();
}
if (this.inventoryResetNeededOnSlotChange(index))

View file

@ -85,7 +85,7 @@ public class InventoryPlayer implements IInventory
{
for (int i = 0; i < this.mainInventory.length; ++i)
{
if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemStackIn.getItem() && this.mainInventory[i].isStackable() && this.mainInventory[i].stackSize < this.mainInventory[i].getMaxStackSize() && this.mainInventory[i].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[i].getHasSubtypes() || this.mainInventory[i].getMetadata() == itemStackIn.getMetadata()) && ItemStack.areItemStackTagsEqual(this.mainInventory[i], itemStackIn))
if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemStackIn.getItem() && this.mainInventory[i].isStackable() && this.mainInventory[i].size < this.mainInventory[i].getMaxStackSize() && this.mainInventory[i].size < this.getInventoryStackLimit() && (!this.mainInventory[i].getHasSubtypes() || this.mainInventory[i].getMetadata() == itemStackIn.getMetadata()) && ItemStack.areItemStackTagsEqual(this.mainInventory[i], itemStackIn))
{
return i;
}
@ -196,7 +196,7 @@ public class InventoryPlayer implements IInventory
private int storePartialItemStack(ItemStack itemStackIn)
{
Item item = itemStackIn.getItem();
int i = itemStackIn.stackSize;
int i = itemStackIn.size;
int j = this.storeItemStack(itemStackIn);
if (j < 0)
@ -222,14 +222,14 @@ public class InventoryPlayer implements IInventory
int k = i;
if (i > this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize)
if (i > this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].size)
{
k = this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize;
k = this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].size;
}
if (k > this.getInventoryStackLimit() - this.mainInventory[j].stackSize)
if (k > this.getInventoryStackLimit() - this.mainInventory[j].size)
{
k = this.getInventoryStackLimit() - this.mainInventory[j].stackSize;
k = this.getInventoryStackLimit() - this.mainInventory[j].size;
}
if (k == 0)
@ -239,7 +239,7 @@ public class InventoryPlayer implements IInventory
else
{
i = i - k;
this.mainInventory[j].stackSize += k;
this.mainInventory[j].size += k;
// this.mainInventory[j].animationsToGo = 5;
return i;
}
@ -274,7 +274,7 @@ public class InventoryPlayer implements IInventory
}
else
{
if (--this.mainInventory[i].stackSize <= 0)
if (--this.mainInventory[i].size <= 0)
{
this.mainInventory[i] = null;
}
@ -297,7 +297,7 @@ public class InventoryPlayer implements IInventory
*/
public boolean addItemStackToInventory(final ItemStack itemStackIn)
{
if (itemStackIn != null && itemStackIn.stackSize != 0 && itemStackIn.getItem() != null)
if (itemStackIn != null && itemStackIn.size != 0 && itemStackIn.getItem() != null)
{
if (itemStackIn.isItemDamaged())
{
@ -307,7 +307,7 @@ public class InventoryPlayer implements IInventory
{
this.mainInventory[j] = ItemStack.copyItemStack(itemStackIn);
// this.mainInventory[j].animationsToGo = 5;
itemStackIn.stackSize = 0;
itemStackIn.size = 0;
return true;
}
// else if (this.player.creative)
@ -326,10 +326,10 @@ public class InventoryPlayer implements IInventory
while (true)
{
i = itemStackIn.stackSize;
itemStackIn.stackSize = this.storePartialItemStack(itemStackIn);
i = itemStackIn.size;
itemStackIn.size = this.storePartialItemStack(itemStackIn);
if (itemStackIn.stackSize <= 0 || itemStackIn.stackSize >= i)
if (itemStackIn.size <= 0 || itemStackIn.size >= i)
{
break;
}
@ -342,7 +342,7 @@ public class InventoryPlayer implements IInventory
// }
// else
// {
return itemStackIn.stackSize < i;
return itemStackIn.size < i;
// }
}
}
@ -367,7 +367,7 @@ public class InventoryPlayer implements IInventory
if (aitemstack[index] != null)
{
if (aitemstack[index].stackSize <= count)
if (aitemstack[index].size <= count)
{
ItemStack itemstack1 = aitemstack[index];
aitemstack[index] = null;
@ -377,7 +377,7 @@ public class InventoryPlayer implements IInventory
{
ItemStack itemstack = aitemstack[index].splitStack(count);
if (aitemstack[index].stackSize == 0)
if (aitemstack[index].size == 0)
{
aitemstack[index] = null;
}
@ -458,7 +458,7 @@ public class InventoryPlayer implements IInventory
{
TagObject nbttagcompound = new TagObject();
nbttagcompound.setByte("Slot", (byte)i);
this.mainInventory[i].writeToNBT(nbttagcompound);
this.mainInventory[i].writeTags(nbttagcompound);
nbtTagListIn.add(nbttagcompound);
}
}
@ -469,7 +469,7 @@ public class InventoryPlayer implements IInventory
{
TagObject nbttagcompound1 = new TagObject();
nbttagcompound1.setByte("Slot", (byte)(j + 100));
this.armorInventory[j].writeToNBT(nbttagcompound1);
this.armorInventory[j].writeTags(nbttagcompound1);
nbtTagListIn.add(nbttagcompound1);
}
}
@ -491,7 +491,7 @@ public class InventoryPlayer implements IInventory
{
TagObject nbttagcompound = nbtTagListIn.get(i);
int j = nbttagcompound.getByte("Slot") & 255;
ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);
ItemStack itemstack = ItemStack.readFromTag(nbttagcompound);
if (itemstack != null)
{
@ -618,7 +618,7 @@ public class InventoryPlayer implements IInventory
{
this.armorInventory[i].damageItem(damage, this.player);
if (this.armorInventory[i].stackSize == 0)
if (this.armorInventory[i].size == 0)
{
this.armorInventory[i] = null;
}

View file

@ -21,28 +21,28 @@ public class InventoryWarpChest extends InventoryBasic
this.associatedChest = chestTileEntity;
}
public void loadInventoryFromNBT(TagObjectList p_70486_1_)
public void readTags(TagObjectList list)
{
for (int i = 0; i < this.getSizeInventory(); ++i)
{
this.setInventorySlotContents(i, (ItemStack)null);
}
for (int k = 0; k < p_70486_1_.size(); ++k)
for (int k = 0; k < list.size(); ++k)
{
TagObject nbttagcompound = p_70486_1_.get(k);
int j = nbttagcompound.getByte("Slot") & 255;
TagObject tag = list.get(k);
int j = tag.getByte("Slot") & 255;
if (j >= 0 && j < this.getSizeInventory())
{
this.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
this.setInventorySlotContents(j, ItemStack.readFromTag(tag));
}
}
}
public TagObjectList saveInventoryToNBT()
public TagObjectList writeTags()
{
TagObjectList nbttaglist = new TagObjectList();
TagObjectList list = new TagObjectList();
for (int i = 0; i < this.getSizeInventory(); ++i)
{
@ -50,14 +50,14 @@ public class InventoryWarpChest extends InventoryBasic
if (itemstack != null)
{
TagObject nbttagcompound = new TagObject();
nbttagcompound.setByte("Slot", (byte)i);
itemstack.writeToNBT(nbttagcompound);
nbttaglist.add(nbttagcompound);
TagObject tag = new TagObject();
tag.setByte("Slot", (byte)i);
itemstack.writeTags(tag);
list.add(tag);
}
}
return nbttaglist;
return list;
}
public boolean isUseableByPlayer(EntityNPC player)

View file

@ -37,7 +37,7 @@ public class Slot
{
if (p_75220_1_.getItem() == p_75220_2_.getItem())
{
int i = p_75220_2_.stackSize - p_75220_1_.stackSize;
int i = p_75220_2_.size - p_75220_1_.size;
if (i > 0)
{

View file

@ -40,7 +40,7 @@ public class SlotCrafting extends Slot
{
if (this.getHasStack())
{
this.amountCrafted += Math.min(amount, this.getStack().stackSize);
this.amountCrafted += Math.min(amount, this.getStack().size);
}
return super.decrStackSize(amount);

View file

@ -35,7 +35,7 @@ public class SlotFurnaceOutput extends Slot
{
if (this.getHasStack())
{
this.smelted += Math.min(amount, this.getStack().stackSize);
this.smelted += Math.min(amount, this.getStack().size);
}
return super.decrStackSize(amount);

View file

@ -35,7 +35,7 @@ public class SlotMerchantResult extends Slot
{
if (this.getHasStack())
{
this.traded += Math.min(amount, this.getStack().stackSize);
this.traded += Math.min(amount, this.getStack().size);
}
return super.decrStackSize(amount);
@ -76,12 +76,12 @@ public class SlotMerchantResult extends Slot
// this.theMerchant.useRecipe(merchantrecipe);
// playerIn.triggerAchievement(StatRegistry.timesTradedWithNpcStat);
if (itemstack != null && itemstack.stackSize <= 0)
if (itemstack != null && itemstack.size <= 0)
{
itemstack = null;
}
if (itemstack1 != null && itemstack1.stackSize <= 0)
if (itemstack1 != null && itemstack1.size <= 0)
{
itemstack1 = null;
}
@ -101,14 +101,14 @@ public class SlotMerchantResult extends Slot
{
if (itemstack1 != null && secondItem != null && itemstack1.getItem() == secondItem.getItem())
{
firstItem.stackSize -= itemstack.stackSize;
secondItem.stackSize -= itemstack1.stackSize;
firstItem.size -= itemstack.size;
secondItem.size -= itemstack1.size;
return true;
}
if (itemstack1 == null && secondItem == null)
{
firstItem.stackSize -= itemstack.stackSize;
firstItem.size -= itemstack.size;
return true;
}
}

View file

@ -50,7 +50,7 @@ public class ItemArmor extends Item
int l = entitylivingbase.isPlayer() ? 1 : 0;
int i1 = ItemArmor.getArmorPosition(stack);
ItemStack itemstack = stack.copy();
itemstack.stackSize = 1;
itemstack.size = 1;
entitylivingbase.setItem(i1 - l, itemstack);
// if (entitylivingbase instanceof EntityLiving)
@ -58,7 +58,7 @@ public class ItemArmor extends Item
// ((EntityLiving)entitylivingbase).setDropChance(i1, 2.0F);
// }
--stack.stackSize;
--stack.size;
return stack;
}
else
@ -246,7 +246,7 @@ public class ItemArmor extends Item
if (itemstack == null)
{
playerIn.setItem(i, itemStackIn.copy());
itemStackIn.stackSize = 0;
itemStackIn.size = 0;
}
return itemStackIn;

View file

@ -70,7 +70,7 @@ public class ItemBanner extends ItemBlock
worldIn.setState(pos, Blocks.wall_banner.getState().withProperty(BlockWallSign.FACING, side), 3);
}
--stack.stackSize;
--stack.size;
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityBanner)
@ -98,9 +98,9 @@ public class ItemBanner extends ItemBlock
{
TagObject nbttagcompound = stack.getSubCompound("BlockEntityTag", false);
if (nbttagcompound != null && nbttagcompound.hasTagList("Patterns"))
if (nbttagcompound != null && nbttagcompound.hasObjectList("Patterns"))
{
TagObjectList nbttaglist = nbttagcompound.getTagList("Patterns");
TagObjectList nbttaglist = nbttagcompound.getObjectList("Patterns");
for (int i = 0; i < nbttaglist.size() && i < 6; ++i)
{
@ -140,7 +140,7 @@ public class ItemBanner extends ItemBlock
TagObject nbttagcompound = new TagObject();
TileEntityBanner.setBaseColorAndPatterns(nbttagcompound, enumdyecolor.getDyeDamage(), null);
TagObject nbttagcompound1 = new TagObject();
nbttagcompound1.setTag("BlockEntityTag", nbttagcompound);
nbttagcompound1.setObject("BlockEntityTag", nbttagcompound);
ItemStack itemstack = new ItemStack(itemIn, 1, enumdyecolor.getDyeDamage());
itemstack.setTagCompound(nbttagcompound1);
subItems.add(itemstack);

View file

@ -68,7 +68,7 @@ public class ItemBed extends Item
worldIn.setState(blockpos, iblockstate2, 3);
}
--stack.stackSize;
--stack.size;
return true;
}
else

View file

@ -62,7 +62,7 @@ public class ItemBlock extends Item
pos = pos.offset(side);
}
if (stack.stackSize == 0)
if (stack.size == 0)
{
return false;
}
@ -86,7 +86,7 @@ public class ItemBlock extends Item
}
worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 1.0F);
--stack.stackSize;
--stack.size;
}
return true;
@ -107,7 +107,7 @@ public class ItemBlock extends Item
// }
// else
// {
if (p_179224_3_.hasTagCompound() && p_179224_3_.getTagCompound().hasTag("BlockEntityTag"))
if (p_179224_3_.hasTagCompound() && p_179224_3_.getTagCompound().hasObject("BlockEntityTag"))
{
TileEntity tileentity = worldIn.getTileEntity(stack);
@ -120,7 +120,7 @@ public class ItemBlock extends Item
TagObject nbttagcompound = new TagObject();
TagObject nbttagcompound1 = (TagObject)nbttagcompound.copy();
tileentity.writeToNBT(nbttagcompound);
tileentity.writeTags(nbttagcompound);
TagObject nbttagcompound2 = (TagObject)p_179224_3_.getTagCompound().get("BlockEntityTag");
nbttagcompound.merge(nbttagcompound2);
nbttagcompound.setInt("x", stack.getX());
@ -129,7 +129,7 @@ public class ItemBlock extends Item
if (!nbttagcompound.equals(nbttagcompound1))
{
tileentity.readFromNBT(nbttagcompound);
tileentity.readTags(nbttagcompound);
tileentity.markDirty();
return true;
}

View file

@ -100,7 +100,7 @@ public class ItemBoat extends Item
// if (!playerIn.creative)
// {
--itemStackIn.stackSize;
--itemStackIn.size;
// }
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]);

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