Search in sources :

Example 6 with HeatBehaviour

use of pneumaticCraft.api.tileentity.HeatBehaviour in project PneumaticCraft by MineMaarten.

the class HeatExchangerLogic method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound tag) {
    tag.setDouble("temperature", temperature);
    NBTTagList tagList = new NBTTagList();
    for (HeatBehaviour behaviour : behaviours) {
        NBTTagCompound t = new NBTTagCompound();
        t.setString("id", behaviour.getId());
        behaviour.writeToNBT(t);
        tagList.appendTag(t);
    }
    tag.setTag("behaviours", tagList);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) HeatBehaviour(pneumaticCraft.api.tileentity.HeatBehaviour) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

HeatBehaviour (pneumaticCraft.api.tileentity.HeatBehaviour)6 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 NBTTagList (net.minecraft.nbt.NBTTagList)2 IHeatExchangerLogic (pneumaticCraft.api.IHeatExchangerLogic)2 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1