Added custom tag saving
This commit is contained in:
parent
dcecd05b85
commit
e4ef150dbd
|
@ -162,7 +162,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.0Beta21")
|
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.0Beta22")
|
||||||
//@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class)
|
//@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class)
|
||||||
|
|
||||||
public class AlchemicalWizardry
|
public class AlchemicalWizardry
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package WayofTime.alchemicalWizardry.api.rituals;
|
package WayofTime.alchemicalWizardry.api.rituals;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ISegmentedReagentHandler;
|
||||||
|
|
||||||
public interface IMasterRitualStone extends ISegmentedReagentHandler
|
public interface IMasterRitualStone extends ISegmentedReagentHandler
|
||||||
{
|
{
|
||||||
|
@ -29,4 +29,8 @@ public interface IMasterRitualStone extends ISegmentedReagentHandler
|
||||||
public int getYCoord();
|
public int getYCoord();
|
||||||
|
|
||||||
public int getZCoord();
|
public int getZCoord();
|
||||||
|
|
||||||
|
public NBTTagCompound getCustomRitualTag();
|
||||||
|
|
||||||
|
public void setCustomRitualTag(NBTTagCompound tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
||||||
public boolean isRunning;
|
public boolean isRunning;
|
||||||
public int runningTime;
|
public int runningTime;
|
||||||
|
|
||||||
|
private NBTTagCompound customRitualTag;
|
||||||
|
|
||||||
protected ReagentContainer[] tanks;
|
protected ReagentContainer[] tanks;
|
||||||
protected Map<Reagent, Integer> attunedTankMap;
|
protected Map<Reagent, Integer> attunedTankMap;
|
||||||
|
|
||||||
|
@ -57,6 +59,8 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
||||||
currentRitualString = "";
|
currentRitualString = "";
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
runningTime = 0;
|
runningTime = 0;
|
||||||
|
|
||||||
|
this.customRitualTag = new NBTTagCompound();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readClientNBT(NBTTagCompound tag)
|
public void readClientNBT(NBTTagCompound tag)
|
||||||
|
@ -130,6 +134,8 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
||||||
Reagent reagent = ReagentRegistry.getReagentForKey(savedTag.getString("reagent"));
|
Reagent reagent = ReagentRegistry.getReagentForKey(savedTag.getString("reagent"));
|
||||||
this.attunedTankMap.put(reagent, savedTag.getInteger("amount"));
|
this.attunedTankMap.put(reagent, savedTag.getInteger("amount"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
customRitualTag = tag.getCompoundTag("customRitualTag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -170,6 +176,8 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
||||||
}
|
}
|
||||||
|
|
||||||
tag.setTag("attunedTankMap", attunedTagList);
|
tag.setTag("attunedTankMap", attunedTagList);
|
||||||
|
|
||||||
|
tag.setTag("customRitualTag", customRitualTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void activateRitual(World world, int crystalLevel, EntityPlayer player)
|
public void activateRitual(World world, int crystalLevel, EntityPlayer player)
|
||||||
|
@ -615,4 +623,16 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NBTTagCompound getCustomRitualTag()
|
||||||
|
{
|
||||||
|
return this.customRitualTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCustomRitualTag(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
this.customRitualTag = tag;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue