mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 14:19:49 +00:00
22 lines
673 B
Java
22 lines
673 B
Java
package noppes.npcs.blocks.tiles;
|
|
|
|
import net.minecraft.init.Items;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
|
public class TileBook extends TileVariant {
|
|
public ItemStack book = new ItemStack(Items.writable_book);
|
|
public void readFromNBT(NBTTagCompound compound){
|
|
super.readFromNBT(compound);
|
|
book = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("Items"));
|
|
if(book == null)
|
|
book = new ItemStack(Items.writable_book);
|
|
}
|
|
|
|
public void writeToNBT(NBTTagCompound compound){
|
|
super.writeToNBT(compound);
|
|
compound.setTag("Items", book.writeToNBT(new NBTTagCompound()));
|
|
}
|
|
}
|