Laid foundation for Industrial Turbine and Thermoelectric Boiler

This commit is contained in:
Aidan C. Brady 2014-08-23 11:41:35 -04:00
parent 2383e0477b
commit b6b6276346
9 changed files with 109 additions and 14 deletions

View file

@ -38,12 +38,16 @@ import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.Tier.FactoryTier;
import mekanism.common.base.IFactory.RecipeType;
import mekanism.common.base.IModule;
import mekanism.common.content.boiler.BoilerCache;
import mekanism.common.content.boiler.SynchronizedBoilerData;
import mekanism.common.content.matrix.MatrixCache;
import mekanism.common.content.matrix.SynchronizedMatrixData;
import mekanism.common.content.tank.DynamicTankCache;
import mekanism.common.content.tank.SynchronizedTankData;
import mekanism.common.content.tank.TankCache;
import mekanism.common.content.transporter.PathfinderCache;
import mekanism.common.content.transporter.TransporterManager;
import mekanism.common.content.turbine.SynchronizedTurbineData;
import mekanism.common.content.turbine.TurbineCache;
import mekanism.common.entity.EntityBabySkeleton;
import mekanism.common.entity.EntityBalloon;
import mekanism.common.entity.EntityFlame;
@ -155,11 +159,11 @@ public class Mekanism
/** Map of Teleporters */
public static Map<Teleporter.Code, ArrayList<Coord4D>> teleporters = new HashMap<Teleporter.Code, ArrayList<Coord4D>>();
/** The Dynamic Tank multiblock manager */
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank", DynamicTankCache.class);
/** The Energized Induction Matrix multiblock manager */
/** MultiblockManagers for various structrures */
public static MultiblockManager<SynchronizedTankData> tankManager = new MultiblockManager<SynchronizedTankData>("dynamicTank", TankCache.class);
public static MultiblockManager<SynchronizedMatrixData> matrixManager = new MultiblockManager<SynchronizedMatrixData>("energizedInductionMatrix", MatrixCache.class);
public static MultiblockManager<SynchronizedTurbineData> turbineManager = new MultiblockManager<SynchronizedTurbineData>("industrialTurbine", TurbineCache.class);
public static MultiblockManager<SynchronizedBoilerData> boilerManager = new MultiblockManager<SynchronizedBoilerData>("thermoelectricBoiler", BoilerCache.class);
/** Mekanism creative tab */
public static CreativeTabMekanism tabMekanism = new CreativeTabMekanism();

View file

@ -0,0 +1,32 @@
package mekanism.common.content.boiler;
import mekanism.common.content.turbine.SynchronizedTurbineData;
import mekanism.common.multiblock.MultiblockCache;
import net.minecraft.nbt.NBTTagCompound;
public class BoilerCache extends MultiblockCache<SynchronizedBoilerData>
{
@Override
public void apply(SynchronizedBoilerData data)
{
}
@Override
public void sync(SynchronizedBoilerData data)
{
}
@Override
public void load(NBTTagCompound nbtTags)
{
}
@Override
public void save(NBTTagCompound nbtTags)
{
}
}

View file

@ -0,0 +1,6 @@
package mekanism.common.content.boiler;
public class BoilerUpdateProtocol
{
}

View file

@ -0,0 +1,8 @@
package mekanism.common.content.boiler;
import mekanism.common.multiblock.SynchronizedData;
public class SynchronizedBoilerData extends SynchronizedData<SynchronizedBoilerData>
{
}

View file

@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fluids.FluidStack;
public class DynamicTankCache extends MultiblockCache<SynchronizedTankData>
public class TankCache extends MultiblockCache<SynchronizedTankData>
{
public ItemStack[] inventory = new ItemStack[2];

View file

@ -33,9 +33,9 @@ public class TankUpdateProtocol extends UpdateProtocol<SynchronizedTankData>
}
@Override
protected DynamicTankCache getNewCache()
protected TankCache getNewCache()
{
return new DynamicTankCache();
return new TankCache();
}
@Override
@ -53,23 +53,23 @@ public class TankUpdateProtocol extends UpdateProtocol<SynchronizedTankData>
@Override
protected void mergeCaches(List<ItemStack> rejectedItems, MultiblockCache<SynchronizedTankData> cache, MultiblockCache<SynchronizedTankData> merge)
{
if(((DynamicTankCache)cache).fluid == null)
if(((TankCache)cache).fluid == null)
{
((DynamicTankCache)cache).fluid = ((DynamicTankCache)merge).fluid;
((TankCache)cache).fluid = ((TankCache)merge).fluid;
}
else if(((DynamicTankCache)merge).fluid != null && ((DynamicTankCache)cache).fluid.isFluidEqual(((DynamicTankCache)merge).fluid))
else if(((TankCache)merge).fluid != null && ((TankCache)cache).fluid.isFluidEqual(((TankCache)merge).fluid))
{
((DynamicTankCache)cache).fluid.amount += ((DynamicTankCache)merge).fluid.amount;
((TankCache)cache).fluid.amount += ((TankCache)merge).fluid.amount;
}
List<ItemStack> rejects = StackUtils.getMergeRejects(((DynamicTankCache)cache).inventory, ((DynamicTankCache)merge).inventory);
List<ItemStack> rejects = StackUtils.getMergeRejects(((TankCache)cache).inventory, ((TankCache)merge).inventory);
if(!rejects.isEmpty())
{
rejectedItems.addAll(rejects);
}
StackUtils.merge(((DynamicTankCache)cache).inventory, ((DynamicTankCache)merge).inventory);
StackUtils.merge(((TankCache)cache).inventory, ((TankCache)merge).inventory);
}
@Override

View file

@ -0,0 +1,8 @@
package mekanism.common.content.turbine;
import mekanism.common.multiblock.SynchronizedData;
public class SynchronizedTurbineData extends SynchronizedData<SynchronizedTurbineData>
{
}

View file

@ -0,0 +1,31 @@
package mekanism.common.content.turbine;
import mekanism.common.multiblock.MultiblockCache;
import net.minecraft.nbt.NBTTagCompound;
public class TurbineCache extends MultiblockCache<SynchronizedTurbineData>
{
@Override
public void apply(SynchronizedTurbineData data)
{
}
@Override
public void sync(SynchronizedTurbineData data)
{
}
@Override
public void load(NBTTagCompound nbtTags)
{
}
@Override
public void save(NBTTagCompound nbtTags)
{
}
}

View file

@ -0,0 +1,6 @@
package mekanism.common.content.turbine;
public class TurbineUpdateProtocol
{
}