mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
i love to drink oil
This commit is contained in:
parent
9707c4c961
commit
3aef7e1577
57
changelog
57
changelog
@ -1,52 +1,11 @@
|
||||
## Added
|
||||
* Plushies
|
||||
* Bedrock sellafite
|
||||
* Replaces bedrock in the bottom of craters
|
||||
* Looks exactly like slaked sellafite while inheriting all other traits from bedrock (unbreakable, high blast resistance, no mob spawning)
|
||||
* Overall large craters no longer have the unsightly weird bedrock layer at the bottom
|
||||
|
||||
## Changed
|
||||
* Updated chinese localization
|
||||
* The fluid burner, heat exchanging heater and cooling tower now use the single steel pipe items instead of the larger steel pipes
|
||||
* Reduced the amount of condensers needed for crafting the cooling towers
|
||||
* Liquefactors and solidifiers now have a base processing time of 5 seconds per operation (instead of 10)
|
||||
* Added some info to the coltass about how the coltan deposit works
|
||||
* Moved some NEI handlers around, fluid containers are now listed last and radiolysis is now listed right after cracking, since they have the same recipes
|
||||
* The autocrafter's inputs are now limited to 4 items per slot
|
||||
* Autocrafters can now receive stacked items again (except for items with containers), if they do not exceed the 4 item threshold
|
||||
* Bedrock ores now produce bedrock ore fragments instead of straight outputs, one fragment is equivalent to a nugget
|
||||
* Fragments also differ in stack size when produced, most primary fractions yield 9 (equal to the previous full powder), but things with lower demands/higher value like bismuth now yield substantially less
|
||||
* The base speed of the large mining drill when mining bedrock has been reduced by 80%, it is now advisable to either invest in upgrades early on or use multiple drills
|
||||
* The bedrock ore processor now has a base speed of 30 seconds
|
||||
* Standard, special, HE artillery shells and most missiles now use updated explosion animations
|
||||
* Decreased hardness of slag blocks
|
||||
* Removed legacy circuits
|
||||
* Removed a bunch of random unused items
|
||||
* UF6 and PuF6 tanks are being phased out, the blocks will remain for now but functionality and recipes have been removed
|
||||
* Centrifuges are now configurable via `hbmMachines.json`
|
||||
* Updated refinery GUI
|
||||
* Crayons now require paper to craft, fixing an issue where some recipes conflict with the dye mixing ones
|
||||
* Halved energy consumption for night vision goggles
|
||||
* Solid rocket fuel now uses 100mB of nitric acid instead of redstone and niter
|
||||
* The nitric acid from sulfuric acid recipe in the chemical plant now yields 1,000mB instead of 500
|
||||
* Liquefacting niter now yields 750mB instead of 250
|
||||
* Increased demand for coking sour gas to 1,000mB instead of 250
|
||||
* This means that sour gas now has a lower concentration of sulfur, making reforming competitive again compared to the previously buffed coking + mixing
|
||||
* Disperser canisters are now listed below grenades in the creative tab
|
||||
* To address certain balancing concerns, the RF to HE conversion rate is now 2:5. The HE to RF rate however is still 5:1
|
||||
* Because of this, using chains of converters as batteries becomes exponentially lossy with size, therefore the input decay has been removed
|
||||
* Input decay can still be configured if desired
|
||||
* No input decay also means that converters are no longer infinite energy sinks
|
||||
* Power converter recipes have been updated
|
||||
* Soldering stations will no longer work if the recipe requires no input fluid while fluid is present
|
||||
* While this does complicate using the soldering station manually, as switching from milgrade to standard ICs requires emptying the solderer with a siphon, it does make automating easier, since soldering stations will no longer treat incomplete milgrade circuits as ICs
|
||||
|
||||
## Fixed
|
||||
* Fixed crash caused by decontaminating items with the radiolysis machine
|
||||
* Fixed ICFs not forming correctly depending on the orientation
|
||||
* Fixed electrolyzer metal recipe config not working
|
||||
* Fixed the meteor charms not working when used on helmets
|
||||
* Fixed NEI handler for the ICF's consturction showing inconsistent values
|
||||
* Fixed radiolysis recipes not showing up in NEI unless the usage recipes are loaded first
|
||||
* Fixed autocrafter's grid not properly updating when using NEI drag and drop for the filter
|
||||
* Fixed all carbon-based crucible materials having the wrong ID, this fix will shift IDs but prevent collisions with silicon
|
||||
* Fixed primary bedrock ore fraction roasting yielding one extra pile of crumbs
|
||||
* Fixed filing cabinets being unreasonably laggy due to the old packet code
|
||||
* Fixed the secure access door taking way longer to craft than any other door
|
||||
* Fixed issues with the spotlight crafting recipes
|
||||
* Fixed various issues with opencomputers integration
|
||||
* Fixed incorrect armor mod descriptions being shown for cards
|
||||
* Fixed mobs being able to spawn on bedrock ore and bedrock oil
|
||||
* Fixed some machines not sending fluid gauge syncs properly
|
||||
@ -1,13 +0,0 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
@Deprecated //legacy crap we can't get rid of because some ancient machines still use this for sync
|
||||
public interface IFluidContainer {
|
||||
|
||||
//Args: fill, what the fill should be set to; index, index for array if there are multiple tanks
|
||||
public void setFillForSync(int fill, int index);
|
||||
|
||||
//Args: type, what the type should be set to; index, index for array if there are multiple tanks
|
||||
public void setTypeForSync(FluidType type, int index);
|
||||
}
|
||||
@ -12,17 +12,13 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.gui.GuiInfoContainer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFluidPacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@ -40,7 +36,6 @@ public class FluidTank {
|
||||
FluidType type;
|
||||
int fluid;
|
||||
int maxFluid;
|
||||
@Deprecated public int index = 0;
|
||||
int pressure = 0;
|
||||
|
||||
public FluidTank(FluidType type, int maxFluid) {
|
||||
@ -56,13 +51,6 @@ public class FluidTank {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated // indices are no longer needed
|
||||
public FluidTank(FluidType type, int maxFluid, int index) {
|
||||
this.type = type;
|
||||
this.maxFluid = maxFluid;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void setFill(int i) {
|
||||
fluid = i;
|
||||
}
|
||||
@ -108,20 +96,6 @@ public class FluidTank {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Called on TE update
|
||||
@Deprecated public void updateTank(TileEntity te) {
|
||||
updateTank(te, 100);
|
||||
}
|
||||
@Deprecated public void updateTank(TileEntity te, int range) {
|
||||
updateTank(te.xCoord, te.yCoord, te.zCoord, te.getWorldObj().provider.dimensionId, range);
|
||||
}
|
||||
@Deprecated public void updateTank(int x, int y, int z, int dim) {
|
||||
updateTank(x, y, z, dim, 100);
|
||||
}
|
||||
@Deprecated public void updateTank(int x, int y, int z, int dim, int range) {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEFluidPacket(x, y, z, fluid, index, type), new TargetPoint(dim, x, y, z, range));
|
||||
}
|
||||
|
||||
//Fills tank from canisters
|
||||
public boolean loadTank(int in, int out, ItemStack[] slots) {
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.NAPHTHA_DS, 500)).setStack2(new FluidStack(Fluids.AROMATICS, 500)),
|
||||
new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.NAPHTHA_COKER, 500)).setStack2(new FluidStack(Fluids.AROMATICS, 500)));
|
||||
register(Fluids.SULFURIC_ACID, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.PEROXIDE, 800)).setSolid(new OreDictStack(S.dust())));
|
||||
register(Fluids.NITRIC_ACID, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new OreDictStack(KNO.dust())));
|
||||
register(Fluids.NITRIC_ACID, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new OreDictStack(KNO.dust())));
|
||||
register(Fluids.RADIOSOLVENT, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.REFORMGAS, 750)).setStack2(new FluidStack(Fluids.CHLORINE, 250)));
|
||||
register(Fluids.SCHRABIDIC, new MixerRecipe(16_000, 100).setStack1(new FluidStack(Fluids.SAS3, 8_000)).setStack2(new FluidStack(Fluids.PEROXIDE, 6_000)).setSolid(new ComparableStack(ModItems.pellet_charged)));
|
||||
|
||||
|
||||
@ -277,8 +277,8 @@ public class CraftingManager {
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.machine_coal_off, 1), new Object[] { "STS", "SCS", "SFS", 'S', STEEL.ingot(), 'T', ModItems.tank_steel, 'C', MINGRADE.ingot(), 'F', Blocks.furnace });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_wood_burner, 1), new Object[] { "PPP", "CFC", "I I" , 'P', STEEL.plate528(), 'C', ModItems.coil_copper, 'I', IRON.ingot(), 'F', Blocks.furnace});
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_turbine, 1), new Object[] { "SMS", "PTP", "SMS", 'S', STEEL.ingot(), 'T', ModItems.turbine_titanium, 'M', ModItems.coil_copper, 'P', ANY_PLASTIC.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_he_rf, 1), new Object[] { "SSS", "CRB", "SSS", 'S', STEEL.ingot(), 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', REDSTONE.block() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "SSS", "BRC", "SSS", 'S', BE.ingot(), 'C', ModItems.coil_copper, 'R', ModItems.coil_copper_torus, 'B', REDSTONE.block() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_he_rf, 1), new Object[] { "RRR", "WWW", "III", 'R', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CAPACITOR), 'W', REDSTONE.dust(), 'I', STEEL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_converter_rf_he, 1), new Object[] { "RRR", "WWW", "III", 'R', REDSTONE.dust(), 'W', MINGRADE.wireFine(), 'I', STEEL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crate_template, 1), new Object[] { "IPI", "P P", "IPI", 'I', IRON.ingot(), 'P', Items.paper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crate_iron, 1), new Object[] { "PPP", "I I", "III", 'P', IRON.plate(), 'I', IRON.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.crate_steel, 1), new Object[] { "PPP", "I I", "III", 'P', STEEL.plate(), 'I', STEEL.ingot() });
|
||||
|
||||
@ -15,8 +15,6 @@ public class PacketDispatcher {
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
//Fluid packet for GUI
|
||||
wrapper.registerMessage(TEFluidPacket.Handler.class, TEFluidPacket.class, i++, Side.CLIENT);
|
||||
//Sound packet that keeps client and server separated
|
||||
wrapper.registerMessage(LoopedSoundPacket.Handler.class, LoopedSoundPacket.class, i++, Side.CLIENT);
|
||||
//Signals server to consume items and create template
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@Deprecated
|
||||
public class TEFluidPacket implements IMessage {
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int fill;
|
||||
int index;
|
||||
int type;
|
||||
|
||||
public TEFluidPacket() { }
|
||||
|
||||
public TEFluidPacket(int x, int y, int z, int fill, int index, FluidType type)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.fill = fill;
|
||||
this.index = index;
|
||||
this.type = type.getID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
fill = buf.readInt();
|
||||
index = buf.readInt();
|
||||
type = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeInt(fill);
|
||||
buf.writeInt(index);
|
||||
buf.writeInt(type);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<TEFluidPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(TEFluidPacket m, MessageContext ctx) {
|
||||
try{
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if (te != null && te instanceof IFluidContainer) {
|
||||
|
||||
IFluidContainer gen = (IFluidContainer) te;
|
||||
gen.setFillForSync(m.fill, m.index);
|
||||
gen.setTypeForSync(Fluids.fromID(m.type), m.index);
|
||||
}
|
||||
} catch(Exception x) { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -119,7 +119,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer implements IItemR
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0, 0);
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
boolean exploded = false;
|
||||
if(item.hasTagCompound() && item.getTagCompound().hasKey(IPersistentNBT.NBT_PERSISTENT_KEY)) {
|
||||
tank.readFromNBT(item.getTagCompound().getCompoundTag(IPersistentNBT.NBT_PERSISTENT_KEY), "tank");
|
||||
|
||||
@ -1,9 +1,19 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface IBufPacketReceiver {
|
||||
|
||||
public void serialize(ByteBuf buf);
|
||||
public void deserialize(ByteBuf buf);
|
||||
|
||||
public default void sendStandard(int range) {
|
||||
TileEntity te = (TileEntity) this;
|
||||
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(te.xCoord, te.yCoord, te.zCoord, this), new TargetPoint(te.getWorldObj().provider.dimensionId, te.xCoord, te.yCoord, te.zCoord, range));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerCompactLauncher;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -17,10 +16,10 @@ import com.hbm.items.weapon.ItemCustomMissilePart.FuelType;
|
||||
import com.hbm.items.weapon.ItemCustomMissilePart.PartSize;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -32,6 +31,7 @@ import api.hbm.item.IDesignatorItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -47,7 +47,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCompactLauncher extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver {
|
||||
public class TileEntityCompactLauncher extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IBufPacketReceiver, IRadarCommandReceiver {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -66,8 +66,8 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
public TileEntityCompactLauncher() {
|
||||
slots = new ItemStack[8];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 25000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 25000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 25000);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 25000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -177,9 +177,6 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
|
||||
tanks[0].loadTank(2, 6, slots);
|
||||
tanks[1].loadTank(3, 7, slots);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 5, power, maxPower);
|
||||
|
||||
@ -192,8 +189,7 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0)
|
||||
this.updateConnections();
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, solid, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(xCoord, yCoord, zCoord, this), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
|
||||
MissileStruct multipart = getStruct(slots[0]);
|
||||
|
||||
@ -234,6 +230,20 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(power);
|
||||
buf.writeInt(solid);
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
this.solid = buf.readInt();
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
|
||||
@ -546,18 +556,6 @@ public class TileEntityCompactLauncher extends TileEntityLoadedBase implements I
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerLaunchTable;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -18,10 +17,10 @@ import com.hbm.items.weapon.ItemCustomMissilePart.FuelType;
|
||||
import com.hbm.items.weapon.ItemCustomMissilePart.PartSize;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -33,10 +32,10 @@ import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -53,7 +52,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidContainer, IFluidStandardReceiver, IGUIProvider, SimpleComponent, IRadarCommandReceiver, CompatHandler.OCComponent {
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IBufPacketReceiver, IRadarCommandReceiver, CompatHandler.OCComponent {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -74,8 +73,8 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
public TileEntityLaunchTable() {
|
||||
slots = new ItemStack[8];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 100000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 100000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 100000);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 100000);
|
||||
padSize = PartSize.SIZE_10;
|
||||
height = 10;
|
||||
}
|
||||
@ -190,9 +189,6 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
|
||||
tanks[0].loadTank(2, 6, slots);
|
||||
tanks[1].loadTank(3, 7, slots);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 5, power, maxPower);
|
||||
|
||||
@ -202,9 +198,7 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
solid += 250;
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, solid, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, padSize.ordinal(), 1), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(xCoord, yCoord, zCoord, this), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
|
||||
MissileStruct multipart = getStruct(slots[0]);
|
||||
|
||||
@ -239,6 +233,22 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(power);
|
||||
buf.writeInt(solid);
|
||||
buf.writeByte((byte) padSize.ordinal());
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
this.solid = buf.readInt();
|
||||
this.padSize = PartSize.values()[buf.readByte()];
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
|
||||
@ -543,18 +553,6 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
@ -49,8 +49,8 @@ public class TileEntityCore extends TileEntityMachineBase implements IGUIProvide
|
||||
public TileEntityCore() {
|
||||
super(3);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,10 +140,8 @@ public class TileEntityCore extends TileEntityMachineBase implements IGUIProvide
|
||||
radiation();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("tank0", tanks[0].getTankType().ordinal());
|
||||
data.setInteger("tank1", tanks[1].getTankType().ordinal());
|
||||
data.setInteger("fill0", tanks[0].getFill());
|
||||
data.setInteger("fill1", tanks[1].getFill());
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
data.setInteger("field", field);
|
||||
data.setInteger("heat", heat);
|
||||
data.setInteger("color", color);
|
||||
@ -167,10 +165,8 @@ public class TileEntityCore extends TileEntityMachineBase implements IGUIProvide
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
|
||||
tanks[0].setTankType(Fluids.fromID(data.getInteger("tank0")));
|
||||
tanks[1].setTankType(Fluids.fromID(data.getInteger("tank1")));
|
||||
tanks[0].setFill(data.getInteger("fill0"));
|
||||
tanks[1].setFill(data.getInteger("fill1"));
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
field = data.getInteger("field");
|
||||
heat = data.getInteger("heat");
|
||||
color = data.getInteger("color");
|
||||
|
||||
@ -53,7 +53,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
|
||||
public TileEntityCoreEmitter() {
|
||||
super(0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000, 0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerCoreInjector;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICoreInjector;
|
||||
@ -28,7 +26,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidContainer, IFluidStandardReceiver, SimpleComponent, IGUIProvider, CompatHandler.OCComponent {
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidStandardReceiver, SimpleComponent, IGUIProvider, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public static final int range = 15;
|
||||
@ -37,8 +35,8 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
public TileEntityCoreInjector() {
|
||||
super(4);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 128000);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 128000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,11 +101,10 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
|
||||
this.markDirty();
|
||||
|
||||
tanks[0].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
tanks[1].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("beam", beam);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
this.networkPack(data, 250);
|
||||
}
|
||||
}
|
||||
@ -115,29 +112,18 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
beam = data.getInteger("beam");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerCoreReceiver;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICoreReceiver;
|
||||
@ -33,7 +31,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidContainer, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyProviderMK2, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public long joules;
|
||||
@ -41,7 +39,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
|
||||
public TileEntityCoreReceiver() {
|
||||
super(0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000, 0);
|
||||
tank = new FluidTank(Fluids.CRYOGEL, 64000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -54,7 +52,6 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
this.subscribeToAllAround(tank.getTankType(), this);
|
||||
|
||||
power = joules * 5000;
|
||||
@ -74,6 +71,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("joules", joules);
|
||||
tank.writeToNBT(data, "t");
|
||||
this.networkPack(data, 50);
|
||||
|
||||
joules = 0;
|
||||
@ -83,6 +81,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
joules = data.getLong("joules");
|
||||
tank.readFromNBT(data, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -105,16 +104,6 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
return this.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
|
||||
|
||||
|
||||
@ -17,8 +17,8 @@ public class TileEntityDeuteriumTower extends TileEntityDeuteriumExtractor {
|
||||
|
||||
public TileEntityDeuteriumTower() {
|
||||
super();
|
||||
tanks[0] = new FluidTank(Fluids.WATER, 50000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEAVYWATER, 5000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.WATER, 50000);
|
||||
tanks[1] = new FluidTank(Fluids.HEAVYWATER, 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -43,8 +43,8 @@ public class TileEntityHeatBoilerIndustrial extends TileEntityLoadedBase impleme
|
||||
public TileEntityHeatBoilerIndustrial() {
|
||||
this.tanks = new FluidTank[2];
|
||||
|
||||
this.tanks[0] = new FluidTank(Fluids.WATER, 64_000, 0);
|
||||
this.tanks[1] = new FluidTank(Fluids.STEAM, 64_000 * 100, 1);
|
||||
this.tanks[0] = new FluidTank(Fluids.WATER, 64_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.STEAM, 64_000 * 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -37,8 +37,8 @@ public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHe
|
||||
public TileEntityHeaterHeatex() {
|
||||
super(1);
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.COOLANT_HOT, 24_000, 0);
|
||||
this.tanks[1] = new FluidTank(Fluids.COOLANT, 24_000, 1);
|
||||
this.tanks[0] = new FluidTank(Fluids.COOLANT_HOT, 24_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.COOLANT, 24_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.ExplosionNT;
|
||||
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerITER;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -52,7 +51,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityITER extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidContainer, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC, SimpleComponent, CompatHandler.OCComponent {
|
||||
public class TileEntityITER extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10000000;
|
||||
@ -78,9 +77,9 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
|
||||
public TileEntityITER() {
|
||||
super(5);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.WATER, 1280000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.ULTRAHOTSTEAM, 128000, 1);
|
||||
plasma = new FluidTank(Fluids.PLASMA_DT, 16000, 2);
|
||||
tanks[0] = new FluidTank(Fluids.WATER, 1280000);
|
||||
tanks[1] = new FluidTank(Fluids.ULTRAHOTSTEAM, 128000);
|
||||
plasma = new FluidTank(Fluids.PLASMA_DT, 16000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -152,9 +151,6 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
|
||||
/// END Processing part ///
|
||||
|
||||
/// START Notif packets ///
|
||||
for(int i = 0; i < tanks.length; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
plasma.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
if(tanks[1].getFill() > 0) {
|
||||
@ -166,6 +162,9 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
|
||||
data.setBoolean("isOn", isOn);
|
||||
data.setLong("power", power);
|
||||
data.setInteger("progress", progress);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
plasma.writeToNBT(data, "t2");
|
||||
|
||||
if(slots[3] == null) {
|
||||
data.setInteger("blanket", 0);
|
||||
@ -386,6 +385,9 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
|
||||
this.power = data.getLong("power");
|
||||
this.blanket = data.getInteger("blanket");
|
||||
this.progress = data.getInteger("progress"); //
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
plasma.readFromNBT(data, "t2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -399,24 +401,6 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
|
||||
@Override public long getPower() { return power; }
|
||||
@Override public long getMaxPower() { return maxPower; }
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
|
||||
if(index == 2)
|
||||
plasma.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
|
||||
if(index == 2)
|
||||
plasma.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
|
||||
@ -44,8 +44,8 @@ public class TileEntityMachineChemfac extends TileEntityMachineChemplantBase imp
|
||||
public TileEntityMachineChemfac() {
|
||||
super(77);
|
||||
|
||||
water = new FluidTank(Fluids.WATER, 64_000, tanks.length);
|
||||
steam = new FluidTank(Fluids.SPENTSTEAM, 64_000, tanks.length + 1);
|
||||
water = new FluidTank(Fluids.WATER, 64_000);
|
||||
steam = new FluidTank(Fluids.SPENTSTEAM, 64_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -54,7 +54,7 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa
|
||||
|
||||
tanks = new FluidTank[4 * count];
|
||||
for(int i = 0; i < 4 * count; i++) {
|
||||
tanks[i] = new FluidTank(Fluids.NONE, getTankCapacity(), i);
|
||||
tanks[i] = new FluidTank(Fluids.NONE, getTankCapacity());
|
||||
}
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa
|
||||
|
||||
for(int i = 0; i < tanks.length; i++) {
|
||||
FluidTank tank = tanks[i];
|
||||
if(tank.index % 4 < 2) {
|
||||
if(i % 4 < 2) {
|
||||
inTanks.add(tank);
|
||||
}
|
||||
}
|
||||
@ -493,7 +493,7 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa
|
||||
|
||||
for(int i = 0; i < tanks.length; i++) {
|
||||
FluidTank tank = tanks[i];
|
||||
if(tank.index % 4 > 1) {
|
||||
if(i % 4 > 1) {
|
||||
outTanks.add(tank);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.HashMap;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.container.ContainerMachineDiesel;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -37,7 +36,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineDiesel extends TileEntityMachinePolluting implements IEnergyProviderMK2, IFluidContainer, IFluidStandardTransceiver, IConfigurableMachine, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineDiesel extends TileEntityMachinePolluting implements IEnergyProviderMK2, IFluidStandardTransceiver, IConfigurableMachine, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public int soundCycle = 0;
|
||||
@ -61,7 +60,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
||||
|
||||
public TileEntityMachineDiesel() {
|
||||
super(5, 100);
|
||||
tank = new FluidTank(Fluids.DIESEL, 4_000, 0);
|
||||
tank = new FluidTank(Fluids.DIESEL, 4_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -138,7 +137,6 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
||||
FluidType last = tank.getTankType();
|
||||
if(tank.setType(3, 4, slots)) this.unsubscribeToAllAround(last, this);
|
||||
tank.loadTank(0, 1, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
this.subscribeToAllAround(tank.getTankType(), this);
|
||||
|
||||
@ -156,6 +154,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("power", (int) power);
|
||||
data.setInteger("powerCap", (int) powerCap);
|
||||
tank.writeToNBT(data, "t");
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
@ -165,6 +164,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
||||
|
||||
power = data.getInteger("power");
|
||||
powerCap = data.getInteger("powerCap");
|
||||
tank.readFromNBT(data, "t");
|
||||
}
|
||||
|
||||
public boolean hasAcceptableFuel() {
|
||||
@ -237,16 +237,6 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
||||
return this.maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tank};
|
||||
|
||||
@ -62,9 +62,9 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
public TileEntityMachineIGenerator() {
|
||||
super(21);
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(Fluids.WATER, waterCap, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HEATINGOIL, oilCap, 1);
|
||||
tanks[2] = new FluidTank(Fluids.LUBRICANT, lubeCap, 2);
|
||||
tanks[0] = new FluidTank(Fluids.WATER, waterCap);
|
||||
tanks[1] = new FluidTank(Fluids.HEATINGOIL, oilCap);
|
||||
tanks[2] = new FluidTank(Fluids.LUBRICANT, lubeCap);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerMachineLargeTurbine;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -40,7 +39,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IFluidContainer, IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000;
|
||||
@ -59,8 +58,8 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
super(7);
|
||||
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 512000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 10240000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 512000);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 10240000);
|
||||
|
||||
Random rand = new Random();
|
||||
audioDesync = rand.nextFloat() * 0.05F;
|
||||
@ -115,12 +114,11 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
|
||||
tanks[1].unloadTank(5, 6, slots);
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setBoolean("operational", operational);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
this.networkPack(data, 50);
|
||||
} else {
|
||||
this.lastRotor = this.rotor;
|
||||
@ -175,6 +173,8 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
|
||||
this.power = data.getLong("power");
|
||||
this.shouldTurn = data.getBoolean("operational");
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
}
|
||||
|
||||
public long getPowerScaled(int i) {
|
||||
@ -197,18 +197,6 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
nbt.setLong("power", power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
|
||||
@ -5,10 +5,8 @@ import java.util.Set;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMiningLaser;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMiningLaser;
|
||||
@ -52,7 +50,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidContainer, IMiningDrill, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider {
|
||||
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IEnergyReceiverMK2, IMiningDrill, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public int age = 0;
|
||||
@ -77,7 +75,7 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
//slots 1 - 8: upgrades
|
||||
//slots 9 - 29: output
|
||||
super(30);
|
||||
tank = new FluidTank(Fluids.OIL, 64000, 0);
|
||||
tank = new FluidTank(Fluids.OIL, 64_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -98,7 +96,6 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
this.sendFluid(tank, worldObj, xCoord, yCoord - 2, zCoord, Library.NEG_Z);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId);
|
||||
|
||||
//reset progress if the position changes
|
||||
if(lastTargetX != targetX ||
|
||||
@ -181,6 +178,7 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
data.setBoolean("beam", beam);
|
||||
data.setBoolean("isOn", isOn);
|
||||
data.setDouble("progress", clientBreakProgress);
|
||||
tank.writeToNBT(data, "t");
|
||||
|
||||
this.networkPack(data, 250);
|
||||
}
|
||||
@ -203,18 +201,15 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
this.beam = data.getBoolean("beam");
|
||||
this.isOn = data.getBoolean("isOn");
|
||||
this.breakProgress = data.getDouble("progress");
|
||||
tank.readFromNBT(data, "t");
|
||||
}
|
||||
|
||||
private void buildDam() {
|
||||
|
||||
if(worldObj.getBlock(targetX + 1, targetY, targetZ).getMaterial().isLiquid())
|
||||
worldObj.setBlock(targetX + 1, targetY, targetZ, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX - 1, targetY, targetZ).getMaterial().isLiquid())
|
||||
worldObj.setBlock(targetX - 1, targetY, targetZ, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX, targetY, targetZ + 1).getMaterial().isLiquid())
|
||||
worldObj.setBlock(targetX, targetY, targetZ + 1, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX, targetY, targetZ - 1).getMaterial().isLiquid())
|
||||
worldObj.setBlock(targetX, targetY, targetZ - 1, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX + 1, targetY, targetZ).getMaterial().isLiquid()) worldObj.setBlock(targetX + 1, targetY, targetZ, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX - 1, targetY, targetZ).getMaterial().isLiquid()) worldObj.setBlock(targetX - 1, targetY, targetZ, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX, targetY, targetZ + 1).getMaterial().isLiquid()) worldObj.setBlock(targetX, targetY, targetZ + 1, ModBlocks.barricade);
|
||||
if(worldObj.getBlock(targetX, targetY, targetZ - 1).getMaterial().isLiquid()) worldObj.setBlock(targetX, targetY, targetZ - 1, ModBlocks.barricade);
|
||||
}
|
||||
|
||||
private void tryFillContainer(int x, int y, int z) {
|
||||
@ -606,16 +601,6 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.List;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachineITER;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerPlasmaHeater;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -29,7 +28,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase implements IFluidContainer, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider {
|
||||
public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000;
|
||||
@ -40,9 +39,9 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
public TileEntityMachinePlasmaHeater() {
|
||||
super(5);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 16000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 16000, 1);
|
||||
plasma = new FluidTank(Fluids.PLASMA_DT, 64000, 2);
|
||||
tanks[0] = new FluidTank(Fluids.DEUTERIUM, 16_000);
|
||||
tanks[1] = new FluidTank(Fluids.TRITIUM, 16_000);
|
||||
plasma = new FluidTank(Fluids.PLASMA_DT, 64_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,12 +122,12 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
/// END Loading plasma into the ITER ///
|
||||
|
||||
/// START Notif packets ///
|
||||
for(int i = 0; i < tanks.length; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
plasma.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
plasma.writeToNBT(data, "t2");
|
||||
this.networkPack(data, 50);
|
||||
/// END Notif packets ///
|
||||
}
|
||||
@ -154,6 +153,9 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
super.networkUnpack(nbt);
|
||||
|
||||
this.power = nbt.getLong("power");
|
||||
tanks[0].readFromNBT(nbt, "t0");
|
||||
tanks[1].readFromNBT(nbt, "t1");
|
||||
plasma.readFromNBT(nbt, "t2");
|
||||
}
|
||||
|
||||
private void updateType() {
|
||||
@ -212,24 +214,6 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
plasma.writeToNBT(nbt, "plasma");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
|
||||
if(index == 2)
|
||||
plasma.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
|
||||
if(index == 2)
|
||||
plasma.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.container.ContainerRadiolysis;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -34,7 +33,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineRadiolysis extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidContainer, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineRadiolysis extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final int maxPower = 1000000;
|
||||
@ -48,9 +47,9 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
public TileEntityMachineRadiolysis() {
|
||||
super(15); //10 rtg slots, 2 fluid ID slots (io), 2 irradiation slots (io), battery slot
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 2000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 2000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.NONE, 2000, 2);
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 2_000);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 2_000);
|
||||
tanks[2] = new FluidTank(Fluids.NONE, 2_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -104,6 +103,9 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
|
||||
this.power = data.getLong("power");
|
||||
this.heat = data.getInteger("heat");
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
tanks[2].readFromNBT(data, "t2");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,10 +143,10 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("heat", heat);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
tanks[2].writeToNBT(data, "t2");
|
||||
this.networkPack(data, 50);
|
||||
|
||||
for(byte i = 0; i < 3; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,18 +251,6 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
/* Fluid Methods */
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return tanks;
|
||||
|
||||
@ -158,6 +158,8 @@ public class TileEntityMachineSolderingStation extends TileEntityMachineBase imp
|
||||
if(this.tank.getFill() < recipe.fluid.fill) return false;
|
||||
}
|
||||
|
||||
if(recipe.fluid == null && this.tank.getFill() > 0) return false;
|
||||
|
||||
if(slots[6] != null) {
|
||||
if(slots[6].getItem() != recipe.output.getItem()) return false;
|
||||
if(slots[6].getItemDamage() != recipe.output.getItemDamage()) return false;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerMachineTurbine;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -10,8 +9,7 @@ import com.hbm.inventory.fluid.trait.FT_Coolable;
|
||||
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
|
||||
import com.hbm.inventory.gui.GUIMachineTurbine;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
@ -21,9 +19,9 @@ import api.hbm.energymk2.IEnergyProviderMK2;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
@ -39,7 +37,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IEnergyProviderMK2, IFluidStandardTransceiver, IBufPacketReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -58,8 +56,8 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
|
||||
public TileEntityMachineTurbine() {
|
||||
slots = new ItemStack[7];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 64000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 128000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.STEAM, 64_000);
|
||||
tanks[1] = new FluidTank(Fluids.SPENTSTEAM, 128_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -272,23 +270,20 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
|
||||
|
||||
tanks[1].unloadTank(5, 6, slots);
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
this.sendStandard(25);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
@Override public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(power);
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
this.power = buf.readLong();
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -134,6 +134,9 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IC
|
||||
this.heat = data.getInteger("heat");
|
||||
this.pressure = data.getInteger("pressure");
|
||||
this.isOn = data.getBoolean("isOn");
|
||||
steam.readFromNBT(data, "t0");
|
||||
carbonDioxide.readFromNBT(data, "t1");
|
||||
water.readFromNBT(data, "t2");
|
||||
}
|
||||
|
||||
public int getGaugeScaled(int i, int type) {
|
||||
@ -229,11 +232,10 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IC
|
||||
data.setInteger("heat", heat);
|
||||
data.setInteger("pressure", pressure);
|
||||
data.setBoolean("isOn", isOn);
|
||||
steam.writeToNBT(data, "t0");
|
||||
carbonDioxide.writeToNBT(data, "t1");
|
||||
water.writeToNBT(data, "t2");
|
||||
this.networkPack(data, 150);
|
||||
|
||||
steam.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
carbonDioxide.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
water.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.entity.missile.EntitySoyuz;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerSoyuzLauncher;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -37,7 +36,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements ISidedInventory, IEnergyReceiverMK2, IFluidContainer, IFluidStandardReceiver, IGUIProvider {
|
||||
public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements ISidedInventory, IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000;
|
||||
@ -56,8 +55,8 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
public TileEntitySoyuzLauncher() {
|
||||
super(27);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.KEROSENE, 128000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.OXYGEN, 128000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.KEROSENE, 128_000);
|
||||
tanks[1] = new FluidTank(Fluids.OXYGEN, 128_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,9 +79,6 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
|
||||
tanks[0].loadTank(4, 5, slots);
|
||||
tanks[1].loadTank(6, 7, slots);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 8, power, maxPower);
|
||||
|
||||
@ -104,6 +100,8 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
data.setByte("mode", mode);
|
||||
data.setBoolean("starting", starting);
|
||||
data.setByte("type", this.getType());
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
networkPack(data, 250);
|
||||
}
|
||||
|
||||
@ -172,24 +170,25 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
public AudioWrapper createAudioLoop() {
|
||||
return MainRegistry.proxy.getLoopedSound("hbm:block.soyuzReady", xCoord, yCoord, zCoord, 2.0F, 100F, 1.0F);
|
||||
}
|
||||
|
||||
public void onChunkUnload() {
|
||||
|
||||
if(audio != null) {
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(audio != null) {
|
||||
audio.stopSound();
|
||||
audio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
super.networkUnpack(data);
|
||||
@ -198,6 +197,8 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
mode = data.getByte("mode");
|
||||
starting = data.getBoolean("starting");
|
||||
rocketType = data.getByte("type");
|
||||
tanks[0].readFromNBT(data, "t0");
|
||||
tanks[1].readFromNBT(data, "t1");
|
||||
}
|
||||
|
||||
public void startCountdown() {
|
||||
@ -399,18 +400,6 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
|
||||
@ -5,15 +5,14 @@ import java.util.List;
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.hazard.HazardRegistry;
|
||||
import com.hbm.hazard.HazardSystem;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerStorageDrum;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIStorageDrum;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemWasteLong;
|
||||
import com.hbm.items.special.ItemWasteShort;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
@ -23,6 +22,7 @@ import com.hbm.util.ContaminationUtil.HazardType;
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -34,7 +34,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityStorageDrum extends TileEntityMachineBase implements IFluidContainer, IFluidStandardSender, IGUIProvider {
|
||||
public class TileEntityStorageDrum extends TileEntityMachineBase implements IFluidStandardSender, IBufPacketReceiver, IGUIProvider {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
private static final int[] slots_arr = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
|
||||
@ -43,8 +43,8 @@ public class TileEntityStorageDrum extends TileEntityMachineBase implements IFlu
|
||||
public TileEntityStorageDrum() {
|
||||
super(24);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.WASTEFLUID, 16000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.WASTEGAS, 16000, 1);
|
||||
tanks[0] = new FluidTank(Fluids.WASTEFLUID, 16000);
|
||||
tanks[1] = new FluidTank(Fluids.WASTEGAS, 16000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -145,15 +145,24 @@ public class TileEntityStorageDrum extends TileEntityMachineBase implements IFlu
|
||||
|
||||
this.sendFluidToAll(tanks[0], this);
|
||||
this.sendFluidToAll(tanks[1], this);
|
||||
|
||||
tanks[0].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
tanks[1].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
this.sendStandard(25);
|
||||
|
||||
if(rad > 0) {
|
||||
radiate(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void serialize(ByteBuf buf) {
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override public void deserialize(ByteBuf buf) {
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
private void radiate(World world, int x, int y, int z, float rads) {
|
||||
|
||||
@ -233,18 +242,6 @@ public class TileEntityStorageDrum extends TileEntityMachineBase implements IFlu
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slots_arr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -4,10 +4,8 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMachineGasFlare;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Flammable;
|
||||
@ -43,7 +41,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineGasFlare extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidContainer, IFluidStandardReceiver, IControlReceiver, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineGasFlare extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidStandardReceiver, IControlReceiver, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -55,7 +53,7 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
|
||||
|
||||
public TileEntityMachineGasFlare() {
|
||||
super(6);
|
||||
tank = new FluidTank(Fluids.GAS, 64000, 0);
|
||||
tank = new FluidTank(Fluids.GAS, 64000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -112,7 +110,6 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
|
||||
|
||||
tank.setType(3, slots);
|
||||
tank.loadTank(1, 2, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
int maxVent = 50;
|
||||
int maxBurn = 10;
|
||||
@ -186,6 +183,7 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
|
||||
data.setLong("power", this.power);
|
||||
data.setBoolean("isOn", isOn);
|
||||
data.setBoolean("doesBurn", doesBurn);
|
||||
tank.writeToNBT(data, "t");
|
||||
this.networkPack(data, 50);
|
||||
|
||||
} else {
|
||||
@ -250,6 +248,7 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
|
||||
this.power = nbt.getLong("power");
|
||||
this.isOn = nbt.getBoolean("isOn");
|
||||
this.doesBurn = nbt.getBoolean("doesBurn");
|
||||
tank.readFromNBT(nbt, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -278,16 +277,6 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
|
||||
this.power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
|
||||
@ -3,11 +3,9 @@ package com.hbm.tileentity.machine.oil;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerLiquefactor;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUILiquefactor;
|
||||
@ -35,7 +33,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidContainer, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -49,7 +47,7 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
|
||||
public TileEntityMachineLiquefactor() {
|
||||
super(4);
|
||||
tank = new FluidTank(Fluids.NONE, 24000, 0);
|
||||
tank = new FluidTank(Fluids.NONE, 24_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -62,7 +60,6 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
this.power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
tank.updateTank(this);
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
@ -85,6 +82,7 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
data.setInteger("progress", this.progress);
|
||||
data.setInteger("usage", this.usage);
|
||||
data.setInteger("processTime", this.processTime);
|
||||
tank.writeToNBT(data, "t");
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
@ -124,22 +122,14 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(this.power < usage)
|
||||
return false;
|
||||
|
||||
if(slots[0] == null)
|
||||
return false;
|
||||
if(this.power < usage) return false;
|
||||
if(slots[0] == null) return false;
|
||||
|
||||
FluidStack out = LiquefactionRecipes.getOutput(slots[0]);
|
||||
|
||||
if(out == null)
|
||||
return false;
|
||||
|
||||
if(out.type != tank.getTankType() && tank.getFill() > 0)
|
||||
return false;
|
||||
|
||||
if(out.fill + tank.getFill() > tank.getMaxFill())
|
||||
return false;
|
||||
if(out == null) return false;
|
||||
if(out.type != tank.getTankType() && tank.getFill() > 0) return false;
|
||||
if(out.fill + tank.getFill() > tank.getMaxFill()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -171,6 +161,7 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.usage = nbt.getInteger("usage");
|
||||
this.processTime = nbt.getInteger("processTime");
|
||||
tank.readFromNBT(nbt, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -200,16 +191,6 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
|
||||
@ -3,10 +3,8 @@ package com.hbm.tileentity.machine.oil;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerSolidifier;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUISolidifier;
|
||||
@ -35,7 +33,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidContainer, IFluidStandardReceiver, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IUpgradeInfoProvider, IInfoProviderEC {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -49,7 +47,7 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
|
||||
public TileEntityMachineSolidifier() {
|
||||
super(5);
|
||||
tank = new FluidTank(Fluids.NONE, 24000, 0);
|
||||
tank = new FluidTank(Fluids.NONE, 24_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -63,7 +61,6 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
if(!worldObj.isRemote) {
|
||||
this.power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
tank.setType(4, slots);
|
||||
tank.updateTank(this);
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
@ -84,6 +81,7 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
data.setInteger("progress", this.progress);
|
||||
data.setInteger("usage", this.usage);
|
||||
data.setInteger("processTime", this.processTime);
|
||||
tank.writeToNBT(data, "t");
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
@ -180,6 +178,7 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.usage = nbt.getInteger("usage");
|
||||
this.processTime = nbt.getInteger("processTime");
|
||||
tank.readFromNBT(nbt, "t");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -208,16 +207,6 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -104,10 +104,6 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
this.overLevel = Math.min(UpgradeManager.getLevel(UpgradeType.OVERDRIVE), 3) + 1;
|
||||
int abLevel = Math.min(UpgradeManager.getLevel(UpgradeType.AFTERBURN), 3);
|
||||
|
||||
for(int i = 0; i < tanks.length; i++) {
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
int toBurn = Math.min(tanks[1].getFill(), abLevel * 10);
|
||||
|
||||
if(toBurn > 0) {
|
||||
@ -161,6 +157,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("indicator", this.indicator);
|
||||
for(int i = 0; i < tanks.length; i++) tanks[i].writeToNBT(data, "t" + i);
|
||||
this.networkPack(data, 25);
|
||||
}
|
||||
|
||||
@ -169,6 +166,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
|
||||
this.power = nbt.getLong("power");
|
||||
this.indicator = nbt.getInteger("indicator");
|
||||
for(int i = 0; i < tanks.length; i++) tanks[i].readFromNBT(nbt, "t" + i);
|
||||
}
|
||||
|
||||
public boolean canPump() {
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerRBMKGeneric;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -34,7 +33,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IFluidContainer, IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
@ -44,8 +43,8 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
public TileEntityRBMKBoiler() {
|
||||
super(0);
|
||||
|
||||
feed = new FluidTank(Fluids.WATER, 10000, 0);
|
||||
steam = new FluidTank(Fluids.STEAM, 1000000, 1);
|
||||
feed = new FluidTank(Fluids.WATER, 10000);
|
||||
steam = new FluidTank(Fluids.STEAM, 1000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,8 +56,6 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
feed.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
steam.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
this.consumption = 0;
|
||||
this.output = 0;
|
||||
@ -149,24 +146,6 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
|
||||
if(index == 0)
|
||||
feed.setFill(fill);
|
||||
else if(index == 1)
|
||||
steam.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
|
||||
if(index == 0)
|
||||
feed.setTankType(type);
|
||||
else if(index == 1)
|
||||
steam.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -27,7 +27,7 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidSt
|
||||
public TileEntityRBMKCooler() {
|
||||
super();
|
||||
|
||||
this.tank = new FluidTank(Fluids.CRYOGEL, 8000, 0);
|
||||
this.tank = new FluidTank(Fluids.CRYOGEL, 8_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -4,9 +4,7 @@ import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerRBMKHeater;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
||||
@ -30,15 +28,15 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidContainer, IFluidStandardTransceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidStandardTransceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
|
||||
public TileEntityRBMKHeater() {
|
||||
super(1);
|
||||
this.feed = new FluidTank(Fluids.COOLANT, 16_000, 0);
|
||||
this.steam = new FluidTank(Fluids.COOLANT_HOT, 16_000, 1);
|
||||
this.feed = new FluidTank(Fluids.COOLANT, 16_000);
|
||||
this.steam = new FluidTank(Fluids.COOLANT_HOT, 16_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,9 +51,6 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
|
||||
feed.setType(0, slots);
|
||||
|
||||
feed.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
steam.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
if(feed.getTankType().hasTrait(FT_Heatable.class)) {
|
||||
FT_Heatable trait = feed.getTankType().getTrait(FT_Heatable.class);
|
||||
HeatingStep step = trait.getFirstStep();
|
||||
@ -114,24 +109,6 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
|
||||
if(index == 0)
|
||||
feed.setFill(fill);
|
||||
else if(index == 1)
|
||||
steam.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
|
||||
if(index == 0)
|
||||
feed.setTankType(type);
|
||||
else if(index == 1)
|
||||
steam.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -24,7 +24,7 @@ public class TileEntityConverterHeRf extends TileEntityLoadedBase implements IEn
|
||||
public final long maxPower = 5_000_000;
|
||||
public static long heInput = 5;
|
||||
public static long rfOutput = 1;
|
||||
public static double inputDecay = 0.05;
|
||||
public static double inputDecay = 0.0;
|
||||
public EnergyStorage storage = new EnergyStorage(1_000_000, 1_000_000, 1_000_000);
|
||||
|
||||
@Override
|
||||
@ -93,13 +93,13 @@ public class TileEntityConverterHeRf extends TileEntityLoadedBase implements IEn
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
heInput = IConfigurableMachine.grab(obj, "L:HE_Used", heInput);
|
||||
rfOutput = IConfigurableMachine.grab(obj, "L:RF_Created", rfOutput);
|
||||
inputDecay = IConfigurableMachine.grab(obj, "D:inputDecay", inputDecay);
|
||||
inputDecay = IConfigurableMachine.grab(obj, "D:inputDecay2", inputDecay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:HE_Used").value(heInput);
|
||||
writer.name("L:RF_Created").value(rfOutput);
|
||||
writer.name("D:inputDecay").value(inputDecay);
|
||||
writer.name("D:inputDecay2").value(inputDecay);
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,9 +17,9 @@ public class TileEntityConverterRfHe extends TileEntityLoadedBase implements IEn
|
||||
|
||||
public long power;
|
||||
public final long maxPower = 5_000_000;
|
||||
public static long rfInput = 1;
|
||||
public static long rfInput = 2;
|
||||
public static long heOutput = 5;
|
||||
public static double inputDecay = 0.05;
|
||||
public static double inputDecay = 0.0;
|
||||
|
||||
public EnergyStorage storage = new EnergyStorage(1_000_000, 1_000_000, 1_000_000);
|
||||
|
||||
@ -73,15 +73,15 @@ public class TileEntityConverterRfHe extends TileEntityLoadedBase implements IEn
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
rfInput = IConfigurableMachine.grab(obj, "L:RF_Used", rfInput);
|
||||
heOutput = IConfigurableMachine.grab(obj, "L:HE_Created", heOutput);
|
||||
inputDecay = IConfigurableMachine.grab(obj, "D:inputDecay", inputDecay);
|
||||
rfInput = IConfigurableMachine.grab(obj, "L:RF_Used2", rfInput);
|
||||
heOutput = IConfigurableMachine.grab(obj, "L:HE_Created2", heOutput);
|
||||
inputDecay = IConfigurableMachine.grab(obj, "D:inputDecay2", inputDecay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("L:RF_Used").value(rfInput);
|
||||
writer.name("L:HE_Created").value(heOutput);
|
||||
writer.name("D:inputDecay").value(inputDecay);
|
||||
writer.name("L:RF_Used2").value(rfInput);
|
||||
writer.name("L:HE_Created2").value(heOutput);
|
||||
writer.name("D:inputDecay2").value(inputDecay);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.entity.projectile.EntityBulletBaseNT;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
@ -31,13 +30,13 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFluidContainer, IFluidStandardReceiver {
|
||||
public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFluidStandardReceiver {
|
||||
|
||||
public FluidTank tank;
|
||||
|
||||
public TileEntityTurretFritz() {
|
||||
super();
|
||||
this.tank = new FluidTank(Fluids.DIESEL, 16000, 0);
|
||||
this.tank = new FluidTank(Fluids.DIESEL, 16000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +141,6 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl
|
||||
if(!worldObj.isRemote) {
|
||||
tank.setType(9, 9, slots);
|
||||
tank.loadTank(0, 1, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
for(int i = 1; i < 10; i++) {
|
||||
|
||||
@ -155,6 +153,19 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NBTTagCompound writePacket() {
|
||||
NBTTagCompound data = super.writePacket();
|
||||
tank.writeToNBT(data, "t");
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
super.networkUnpack(nbt);
|
||||
tank.readFromNBT(nbt, "t");
|
||||
}
|
||||
|
||||
@Override //TODO: clean this shit up
|
||||
protected void updateConnections() {
|
||||
@ -197,16 +208,6 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl
|
||||
return new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 751 B |
Binary file not shown.
|
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 738 B |
Loading…
x
Reference in New Issue
Block a user