Search in sources :

Example 1 with IPipePropertyProviderEditable

use of buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyProviderEditable in project BuildCraft by BuildCraft.

the class PipeContentsEditableItem method readFromNBT.

@Override
public IPipeContentsEditableItem readFromNBT(NBTBase nbt) {
    NBTTagCompound tag = (NBTTagCompound) nbt;
    ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("stack"));
    EnumContentsJourneyPart journeyPart = NBTUtilBC.readEnum(tag.getTag("journeyPart"), EnumContentsJourneyPart.class);
    EnumFacing direction = NBTUtilBC.readEnum(tag.getTag("direction"), EnumFacing.class);
    double speed = tag.getDouble("speed");
    IPipePropertyProviderEditable provider = propertyProvider.readFromNBT(tag.getTag("properties"));
    return new PipeContentsEditableItem(provider, stack, journeyPart, direction, speed);
}
Also used : IPipePropertyProviderEditable(buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyProviderEditable) IPipeContentsEditableItem(buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableItem) EnumFacing(net.minecraft.util.EnumFacing) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) EnumContentsJourneyPart(buildcraft.api.transport.pipe_bc8.EnumContentsJourneyPart) ItemStack(net.minecraft.item.ItemStack)

Aggregations

EnumContentsJourneyPart (buildcraft.api.transport.pipe_bc8.EnumContentsJourneyPart)1 IPipeContentsEditableItem (buildcraft.api.transport.pipe_bc8.IPipeContentsEditable.IPipeContentsEditableItem)1 IPipePropertyProviderEditable (buildcraft.api.transport.pipe_bc8.IPipePropertyProvider.IPipePropertyProviderEditable)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 EnumFacing (net.minecraft.util.EnumFacing)1