b9833f6327
Still working on moving everything over to my new system. So far i've got it mostly done for the tank and pipe though i have no way to test them yet. I would list the change but meh its break time, i'm tired and the code says everything Things that are still broken *Lang file *release Valve *pipe *Tank *Some crafting
43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
package liquidmechanics.common.handlers;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
import liquidmechanics.api.helpers.PipeColor;
|
|
import liquidmechanics.common.tileentity.TileEntityPipe;
|
|
import liquidmechanics.common.tileentity.TileEntityTank;
|
|
|
|
/**
|
|
* 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(PipeColor.get(LiquidHandler.getFromMeta(nbt.getInteger("type"))));
|
|
}
|
|
else if (converted24 && !converted25)
|
|
{
|
|
pipe.setColor(PipeColor.get(LiquidHandler.get(nbt.getString("name"))));
|
|
}
|
|
nbt.setBoolean("converted", true);
|
|
nbt.setBoolean("converted025", true);
|
|
}
|
|
public static void convert(TileEntityTank pipe, NBTTagCompound nbt)
|
|
{
|
|
Boolean converted24 = nbt.getBoolean("converted");
|
|
Boolean converted25 = nbt.getBoolean("converted025");
|
|
if (!converted24)
|
|
{
|
|
pipe.setColor(PipeColor.get(LiquidHandler.getFromMeta(nbt.getInteger("type"))));
|
|
}
|
|
else if (converted24 && !converted25)
|
|
{
|
|
pipe.setColor(PipeColor.get(LiquidHandler.get(nbt.getString("name"))));
|
|
}
|
|
nbt.setBoolean("converted", true);
|
|
nbt.setBoolean("converted025", true);
|
|
}
|
|
}
|