Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.ferdz.placeableitems.tileentity;
- import net.minecraft.init.Items;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.tileentity.TileEntity;
- public class TEArrow extends TileEntity {
- private ItemStack arrow;
- public TEArrow() {
- arrow = new ItemStack(Items.ARROW);
- }
- public ItemStack getType() {
- return this.arrow;
- }
- public void setType(ItemStack arrow) {
- this.arrow = arrow;
- }
- @Override
- public void readFromNBT(NBTTagCompound nbttagcompound) {
- super.readFromNBT(nbttagcompound);
- arrow.readFromNBT(nbttagcompound.getCompoundTag("arrow"));
- }
- @Override
- public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
- super.writeToNBT(nbttagcompound);
- NBTTagCompound nbt2 = new NBTTagCompound();
- nbt2 = arrow.writeToNBT(nbt2);
- nbttagcompound.setTag("arrow", nbt2);
- return nbttagcompound;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement