mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-05 04:49:10 +01:00
33 lines
984 B
Java
33 lines
984 B
Java
|
package de.ellpeck.naturesaura.blocks.tiles;
|
||
|
|
||
|
import net.minecraft.nbt.NBTTagCompound;
|
||
|
import net.minecraft.util.EnumFacing;
|
||
|
import net.minecraftforge.items.IItemHandlerModifiable;
|
||
|
import net.minecraftforge.items.ItemStackHandler;
|
||
|
|
||
|
public class TileEntityOfferingTable extends TileEntityImpl {
|
||
|
public final ItemStackHandler items = new ItemStackHandlerNA(1, this, true);
|
||
|
|
||
|
@Override
|
||
|
public void writeNBT(NBTTagCompound compound, SaveType type) {
|
||
|
super.writeNBT(compound, type);
|
||
|
if (type != SaveType.BLOCK) {
|
||
|
compound.setTag("items", this.items.serializeNBT());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void readNBT(NBTTagCompound compound, SaveType type) {
|
||
|
super.readNBT(compound, type);
|
||
|
if (type != SaveType.BLOCK) {
|
||
|
this.items.deserializeNBT(compound.getCompoundTag("items"));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public IItemHandlerModifiable getItemHandler(EnumFacing facing) {
|
||
|
return this.items;
|
||
|
}
|
||
|
|
||
|
}
|