resonant-induction/minecraft/liquidmechanics/common/handlers/UpdateConverter.java
Rseifert 30c461bbea more changes
Still working on converting to a more universal liquid system.
*Added a enum to tack colors without having to use strings or #s
*Fixed LiquidData to not need to feed a LiquidData to get vars of itself
*Started Converting Pipes to new system. They will use metadata now to
select colors, this will remove any need to use packets.
*Created a Update Converter so that older version pipe/tank/etc will be
converted to the new system automaticly

Issues with push
*Just about everything is broken at the moment just backing code up
2013-01-05 11:47:53 -05:00

28 lines
858 B
Java

package liquidmechanics.common.handlers;
import net.minecraft.nbt.NBTTagCompound;
import liquidmechanics.api.helpers.Colors;
import liquidmechanics.common.tileentity.TileEntityPipe;
/**
* used to help convert older system to newer systems.
*/
public class UpdateConverter
{
public static void convert(TileEntityPipe pipe, NBTTagCompound nbt)
{
Boolean converted24 = nbt.getBoolean("converted");
Boolean converted25 = nbt.getBoolean("converted025");
if (!converted24)
{
pipe.setColor(Colors.get(LiquidHandler.getFromMeta(nbt.getInteger("type"))));
}
else if (converted24 && !converted25)
{
pipe.setColor(Colors.get(LiquidHandler.get(nbt.getString("name"))));
}
nbt.setBoolean("converted", true);
nbt.setBoolean("converted025", true);
}
}