mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
more chemplannt rework stuff, new templates, battery block fixes
This commit is contained in:
parent
abb8c3aeba
commit
09e1b6b197
@ -44,6 +44,10 @@ public interface IEnergyConnector {
|
||||
*/
|
||||
public long getMaxPower();
|
||||
|
||||
public default long getTransferWeight() {
|
||||
return Math.max(getMaxPower() - getPower(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic implementation of subscribing to a nearby power grid
|
||||
* @param world
|
||||
|
||||
@ -109,7 +109,7 @@ public class PowerNet implements IPowerNet {
|
||||
long totalReq = 0;
|
||||
|
||||
for(IEnergyConnector con : this.subscribers) {
|
||||
long req = Math.max(con.getMaxPower() - con.getPower(), 0);
|
||||
long req = con.getTransferWeight();
|
||||
weight.add(req);
|
||||
totalReq += req;
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ public class MachineBattery extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineBattery(maxPower);
|
||||
return new TileEntityMachineBattery();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,296 +1,53 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplantNew;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChemplant extends BlockContainer implements IMultiblock {
|
||||
public class MachineChemplant extends BlockDummyable {
|
||||
|
||||
public MachineChemplant(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineChemplant();
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineChemplantNew();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_chemplant);
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 2, 1, 2, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, ModBlocks.guiID_machine_chemplant);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
if (i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.chemplantDimensionEast)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.chemplantDimensionEast, ModBlocks.dummy_block_chemplant);
|
||||
|
||||
//
|
||||
DummyBlockChemplant.safeBreak = true;
|
||||
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te = world.getTileEntity(x - 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z + 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 2, y, z, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te3 = world.getTileEntity(x + 2, y, z);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 2, y, z + 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te4 = world.getTileEntity(x + 2, y, z + 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockChemplant.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.chemplantDimensionSouth)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.chemplantDimensionSouth, ModBlocks.dummy_block_chemplant);
|
||||
|
||||
//
|
||||
DummyBlockChemplant.safeBreak = true;
|
||||
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te = world.getTileEntity(x, y, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z - 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x, y, z + 2, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te3 = world.getTileEntity(x, y, z + 2);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 2, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y, z + 2);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockChemplant.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.chemplantDimensionWest)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.chemplantDimensionWest, ModBlocks.dummy_block_chemplant);
|
||||
|
||||
//
|
||||
DummyBlockChemplant.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z - 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te2 = world.getTileEntity(x + 1, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 2, y, z, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te3 = world.getTileEntity(x - 2, y, z);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 2, y, z - 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te4 = world.getTileEntity(x - 2, y, z - 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockChemplant.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.chemplantDimensionNorth)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.chemplantDimensionNorth, ModBlocks.dummy_block_chemplant);
|
||||
|
||||
//
|
||||
DummyBlockChemplant.safeBreak = true;
|
||||
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te = world.getTileEntity(x, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z + 1, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te2 = world.getTileEntity(x + 1, y, z + 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x, y, z - 2, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te3 = world.getTileEntity(x, y, z - 2);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z - 2, ModBlocks.dummy_port_chemplant);
|
||||
TileEntity te4 = world.getTileEntity(x + 1, y, z - 2);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockChemplant.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
this.makeExtra(world, x + rot.offsetX * 2, y, z + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - rot.offsetX * 1, y, z - rot.offsetZ * 1);
|
||||
this.makeExtra(world, x + rot.offsetX * 2 + dir.offsetX, y, z + rot.offsetZ * 2 + dir.offsetZ);
|
||||
this.makeExtra(world, x - rot.offsetX * 1 + dir.offsetX, y, z - rot.offsetZ * 1 + dir.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.blocks.machine;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFENSU;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -327,8 +327,8 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_chemplant: {
|
||||
if(entity instanceof TileEntityMachineChemplant) {
|
||||
return new ContainerMachineChemplant(player.inventory, (TileEntityMachineChemplant) entity);
|
||||
if(entity instanceof TileEntityMachineChemplantNew) {
|
||||
return new ContainerMachineChemplant(player.inventory, (TileEntityMachineChemplantNew) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -1167,8 +1167,8 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_chemplant: {
|
||||
if(entity instanceof TileEntityMachineChemplant) {
|
||||
return new GUIMachineChemplant(player.inventory, (TileEntityMachineChemplant) entity);
|
||||
if(entity instanceof TileEntityMachineChemplantNew) {
|
||||
return new GUIMachineChemplant(player.inventory, (TileEntityMachineChemplantNew) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
//TODO: destroy this abomination and replace it with something more sensible
|
||||
public class ChemplantRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||
@ -94,7 +95,7 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if ((outputId.equals("chemistry")) && getClass() == ChemplantRecipeHandler.class) {
|
||||
/*if ((outputId.equals("chemistry")) && getClass() == ChemplantRecipeHandler.class) {
|
||||
Map<Object[], Object[]> recipes = MachineRecipes.instance().getChemistryRecipes();
|
||||
for (Map.Entry<Object[], Object[]> recipe : recipes.entrySet()) {
|
||||
this.arecipes.add(new SmeltingSet(
|
||||
@ -114,12 +115,12 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
Map<Object[], Object[]> recipes = MachineRecipes.instance().getChemistryRecipes();
|
||||
/*Map<Object[], Object[]> recipes = MachineRecipes.instance().getChemistryRecipes();
|
||||
for (Map.Entry<Object[], Object[]> recipe : recipes.entrySet()) {
|
||||
if (compareFluidStacks(result, (ItemStack)recipe.getValue()[0]) ||
|
||||
compareFluidStacks(result, (ItemStack)recipe.getValue()[1]) ||
|
||||
@ -141,7 +142,7 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler {
|
||||
(ItemStack)recipe.getValue()[4],
|
||||
(ItemStack)recipe.getValue()[5],
|
||||
(ItemStack)recipe.getKey()[6]));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -155,7 +156,7 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
Map<Object[], Object[]> recipes = MachineRecipes.instance().getChemistryRecipes();
|
||||
/*Map<Object[], Object[]> recipes = MachineRecipes.instance().getChemistryRecipes();
|
||||
for (Map.Entry<Object[], Object[]> recipe : recipes.entrySet()) {
|
||||
if (compareFluidStacks(ingredient, (ItemStack)recipe.getKey()[0]) ||
|
||||
compareFluidStacks(ingredient, (ItemStack)recipe.getKey()[1]) ||
|
||||
@ -178,7 +179,7 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler {
|
||||
(ItemStack)recipe.getValue()[4],
|
||||
(ItemStack)recipe.getValue()[5],
|
||||
(ItemStack)recipe.getKey()[6]));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
|
||||
|
||||
@ -93,6 +93,14 @@ public class RecipesCommon {
|
||||
* @return
|
||||
*/
|
||||
public abstract List<ItemStack> extractForNEI();
|
||||
|
||||
public ItemStack extractForCyclingDisplay(int cycle) {
|
||||
List<ItemStack> list = extractForNEI();
|
||||
|
||||
cycle *= 50;
|
||||
|
||||
return list.get((int)(System.currentTimeMillis() % (cycle * list.size()) / cycle));
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComparableStack extends AStack {
|
||||
|
||||
@ -1,24 +1,19 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplantNew;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineChemplant extends Container {
|
||||
|
||||
private TileEntityMachineChemplant nukeBoy;
|
||||
private TileEntityMachineChemplantNew nukeBoy;
|
||||
|
||||
private int progress;
|
||||
private int maxProgress;
|
||||
|
||||
public ContainerMachineChemplant(InventoryPlayer invPlayer, TileEntityMachineChemplant tedf) {
|
||||
progress = 0;
|
||||
public ContainerMachineChemplant(InventoryPlayer invPlayer, TileEntityMachineChemplantNew tedf) {
|
||||
nukeBoy = tedf;
|
||||
|
||||
// Battery
|
||||
@ -52,48 +47,38 @@ private TileEntityMachineChemplant nukeBoy;
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 19, 8, 72));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 20, 26, 72));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
SlotMachineOutput.checkAchievements(p_82846_1_, var5);
|
||||
|
||||
if(par2 <= 20) {
|
||||
if (!this.mergeItemStack(var5, 21, this.inventorySlots.size(), true))
|
||||
{
|
||||
if(!this.mergeItemStack(var5, 21, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 4, 5, false))
|
||||
} else if(!this.mergeItemStack(var5, 4, 5, false))
|
||||
if(!this.mergeItemStack(var5, 13, 19, false))
|
||||
return null;
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
@ -105,39 +90,4 @@ private TileEntityMachineChemplant nukeBoy;
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return nukeBoy.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.progress != this.nukeBoy.progress)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.nukeBoy.progress);
|
||||
}
|
||||
|
||||
if(this.maxProgress != this.nukeBoy.maxProgress)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 2, this.nukeBoy.maxProgress);
|
||||
}
|
||||
}
|
||||
|
||||
this.progress= this.nukeBoy.progress;
|
||||
this.maxProgress= this.nukeBoy.maxProgress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 1)
|
||||
{
|
||||
nukeBoy.progress = j;
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
nukeBoy.maxProgress = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ public class GUIMachineBattery extends GuiInfoContainer {
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 52, 52, battery.power, battery.maxPower);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 52, 52, battery.power, battery.getMaxPower());
|
||||
|
||||
long delta = battery.log[19] - battery.log[0];
|
||||
String deltaText = BobMathUtil.getShortNumber(Math.abs(delta)) + "HE/s";
|
||||
@ -46,7 +46,7 @@ public class GUIMachineBattery extends GuiInfoContainer {
|
||||
deltaText = EnumChatFormatting.YELLOW + "+" + deltaText;
|
||||
|
||||
String[] info = {
|
||||
BobMathUtil.getShortNumber(battery.power) + "/" + BobMathUtil.getShortNumber(battery.maxPower) + "HE",
|
||||
BobMathUtil.getShortNumber(battery.power) + "/" + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE",
|
||||
deltaText
|
||||
};
|
||||
|
||||
|
||||
@ -2,11 +2,10 @@ package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachineChemplant;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplantNew;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -17,9 +16,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
public class GUIMachineChemplant extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_chemplant.png");
|
||||
private TileEntityMachineChemplant chemplant;
|
||||
private TileEntityMachineChemplantNew chemplant;
|
||||
|
||||
public GUIMachineChemplant(InventoryPlayer invPlayer, TileEntityMachineChemplant tedf) {
|
||||
public GUIMachineChemplant(InventoryPlayer invPlayer, TileEntityMachineChemplantNew tedf) {
|
||||
super(new ContainerMachineChemplant(invPlayer, tedf));
|
||||
chemplant = tedf;
|
||||
|
||||
@ -68,10 +67,10 @@ public class GUIMachineChemplant extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = (int)chemplant.getPowerScaled(52);
|
||||
int i = (int) (chemplant.power * 52 / chemplant.maxPower);
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 70 - i, 176, 52 - i, 16, i);
|
||||
|
||||
int j = chemplant.getProgressScaled(90);
|
||||
int j = chemplant.progress * 90 / chemplant.maxProgress;
|
||||
drawTexturedModalRect(guiLeft + 43, guiTop + 89, 0, 222, j, 18);
|
||||
|
||||
this.drawInfoPanel(guiLeft + 105, guiTop + 40, 8, 8, 8);
|
||||
|
||||
@ -10,11 +10,12 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.AssemblerRecipes;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemCassette;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate.EnumChemistryTemplate;
|
||||
import com.hbm.items.machine.ItemStamp.StampType;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.ItemFolderPacket;
|
||||
@ -80,11 +81,9 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
||||
}
|
||||
}
|
||||
// Chemistry Templates
|
||||
for(int i = 0; i < ItemChemistryTemplate.EnumChemistryTemplate.values().length; i++) {
|
||||
EnumChemistryTemplate chem = EnumChemistryTemplate.getEnum(i);
|
||||
if(!chem.isDisabled()) {
|
||||
allStacks.add(new ItemStack(ModItems.chemistry_template, 1, i));
|
||||
}
|
||||
for(int i = 0; i < ChemplantRecipes.recipes.size(); i++) {
|
||||
ChemRecipe chem = ChemplantRecipes.recipes.get(i);
|
||||
allStacks.add(new ItemStack(ModItems.chemistry_template, 1, chem.getId()));
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
@ -1,18 +1,14 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
@ -1117,50 +1117,6 @@ public class MachineRecipes {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Map<Object[], Object[]> getChemistryRecipes() {
|
||||
|
||||
Map<Object[], Object[]> recipes = new HashMap<Object[], Object[]>();
|
||||
|
||||
for (int i = 0; i < ItemChemistryTemplate.EnumChemistryTemplate.values().length; ++i)
|
||||
{
|
||||
ItemStack[] inputs = new ItemStack[7];
|
||||
ItemStack[] outputs = new ItemStack[6];
|
||||
inputs[6] = new ItemStack(ModItems.chemistry_template, 1, i);
|
||||
|
||||
List<ItemStack> listIn = MachineRecipes.getChemInputFromTempate(inputs[6]);
|
||||
if(listIn != null)
|
||||
for(int j = 0; j < listIn.size(); j++)
|
||||
if(listIn.get(j) != null)
|
||||
inputs[j + 2] = listIn.get(j).copy();
|
||||
|
||||
FluidStack[] fluidIn = MachineRecipes.getFluidInputFromTempate(inputs[6]);
|
||||
for(int j = 0; j < fluidIn.length; j++)
|
||||
if(fluidIn[j] != null)
|
||||
inputs[j] = ItemFluidIcon.addQuantity(new ItemStack(ModItems.fluid_icon, 1, fluidIn[j].type.getID()), fluidIn[j].fill);
|
||||
|
||||
ItemStack[] listOut = MachineRecipes.getChemOutputFromTempate(inputs[6]);
|
||||
for(int j = 0; j < listOut.length; j++)
|
||||
if(listOut[j] != null)
|
||||
outputs[j + 2] = listOut[j].copy();
|
||||
|
||||
FluidStack[] fluidOut = MachineRecipes.getFluidOutputFromTempate(inputs[6]);
|
||||
for(int j = 0; j < fluidOut.length; j++)
|
||||
if(fluidOut[j] != null)
|
||||
outputs[j] = ItemFluidIcon.addQuantity(new ItemStack(ModItems.fluid_icon, 1, fluidOut[j].type.getID()), fluidOut[j].fill);
|
||||
|
||||
for(int j = 0; j < inputs.length; j++)
|
||||
if(inputs[j] == null)
|
||||
inputs[j] = new ItemStack(ModItems.nothing);
|
||||
|
||||
for(int j = 0; j < outputs.length; j++)
|
||||
if(outputs[j] == null)
|
||||
outputs[j] = new ItemStack(ModItems.nothing);
|
||||
|
||||
recipes.put(inputs, outputs);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public Map<Object, Object> getBoilerRecipes() {
|
||||
|
||||
@ -1186,805 +1142,6 @@ public class MachineRecipes {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static List<ItemStack> getChemInputFromTempate(ItemStack stack) {
|
||||
|
||||
if(stack == null || !(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return null;
|
||||
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return list;
|
||||
|
||||
switch(chem) {
|
||||
case CC_OIL:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 8));
|
||||
list.add(new ItemStack(ModItems.oil_tar, 4));
|
||||
break;
|
||||
case CC_I:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 6));
|
||||
list.add(new ItemStack(ModItems.oil_tar, 4));
|
||||
break;
|
||||
case CC_HEATING:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 6));
|
||||
list.add(new ItemStack(ModItems.oil_tar, 4));
|
||||
break;
|
||||
case CC_HEAVY:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 8));
|
||||
list.add(new ItemStack(ModItems.oil_tar, 4));
|
||||
break;
|
||||
case CC_NAPHTHA:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 8));
|
||||
list.add(new ItemStack(ModItems.oil_tar, 4));
|
||||
break;
|
||||
case ASPHALT:
|
||||
list.add(new ItemStack(Blocks.gravel, 2));
|
||||
list.add(new ItemStack(Blocks.sand, 6));
|
||||
break;
|
||||
case CONCRETE:
|
||||
list.add(new ItemStack(Blocks.gravel, 8));
|
||||
list.add(new ItemStack(Blocks.sand, 8));
|
||||
break;
|
||||
case CONCRETE_ASBESTOS:
|
||||
list.add(new ItemStack(Blocks.gravel, 2));
|
||||
list.add(new ItemStack(Blocks.sand, 2));
|
||||
list.add(new ItemStack(ModItems.ingot_asbestos, 4));
|
||||
break;
|
||||
case COOLANT:
|
||||
list.add(new ItemStack(ModItems.niter, 1));
|
||||
break;
|
||||
case CRYOGEL:
|
||||
list.add(new ItemStack(ModItems.powder_ice, 1));
|
||||
break;
|
||||
case DESH:
|
||||
list.add(new ItemStack(ModItems.powder_desh_mix, 1));
|
||||
break;
|
||||
case CIRCUIT_4:
|
||||
list.add(new ItemStack(ModItems.circuit_red_copper, 1));
|
||||
list.add(new ItemStack(ModItems.wire_gold, 4));
|
||||
list.add(new ItemStack(ModItems.powder_lapis, 1));
|
||||
list.add(new ItemStack(ModItems.ingot_polymer, 1));
|
||||
break;
|
||||
case CIRCUIT_5:
|
||||
list.add(new ItemStack(ModItems.circuit_gold, 1));
|
||||
list.add(new ItemStack(ModItems.wire_schrabidium, 4));
|
||||
list.add(new ItemStack(ModItems.powder_diamond, 1));
|
||||
list.add(new ItemStack(ModItems.ingot_desh, 1));
|
||||
break;
|
||||
case POLYMER:
|
||||
list.add(new ItemStack(ModItems.powder_coal, 2));
|
||||
list.add(new ItemStack(ModItems.fluorite, 1));
|
||||
break;
|
||||
case DEUTERIUM:
|
||||
list.add(new ItemStack(ModItems.sulfur, 1));
|
||||
break;
|
||||
case BP_BIOGAS:
|
||||
list.add(new ItemStack(ModItems.biomass, 16));
|
||||
break;
|
||||
case YELLOWCAKE:
|
||||
list.add(new ItemStack(ModItems.billet_uranium, 2));
|
||||
list.add(new ItemStack(ModItems.sulfur, 2));
|
||||
break;
|
||||
case UF6:
|
||||
list.add(new ItemStack(ModItems.powder_yellowcake, 1));
|
||||
list.add(new ItemStack(ModItems.fluorite, 4));
|
||||
break;
|
||||
case PUF6:
|
||||
list.add(new ItemStack(ModItems.powder_plutonium, 1));
|
||||
list.add(new ItemStack(ModItems.fluorite, 3));
|
||||
break;
|
||||
case SAS3:
|
||||
list.add(new ItemStack(ModItems.powder_schrabidium, 1));
|
||||
list.add(new ItemStack(ModItems.sulfur, 2));
|
||||
break;
|
||||
case NITAN:
|
||||
list.add(new ItemStack(ModItems.powder_nitan_mix, 2));
|
||||
break;
|
||||
case OIL_SAND:
|
||||
list.add(new ItemStack(ModBlocks.ore_oil_sand, 16));
|
||||
break;
|
||||
case DYN_SCHRAB:
|
||||
list.add(new ItemStack(ModItems.dynosphere_desh_charged, 3));
|
||||
list.add(new ItemStack(ModItems.ingot_uranium, 1));
|
||||
list.add(new ItemStack(ModItems.catalyst_clay, 8));
|
||||
break;
|
||||
case DYN_EUPH:
|
||||
list.add(new ItemStack(ModItems.dynosphere_schrabidium_charged, 1));
|
||||
list.add(new ItemStack(ModItems.ingot_plutonium, 1));
|
||||
list.add(new ItemStack(ModItems.catalyst_clay, 16));
|
||||
list.add(new ItemStack(ModItems.ingot_euphemium, 1));
|
||||
break;
|
||||
case DYN_DNT:
|
||||
list.add(new ItemStack(ModItems.dynosphere_euphemium_charged, 2));
|
||||
list.add(new ItemStack(ModItems.powder_spark_mix, 1));
|
||||
list.add(new ItemStack(ModItems.ingot_starmetal, 1));
|
||||
list.add(new ItemStack(ModItems.catalyst_clay, 32));
|
||||
break;
|
||||
case CORDITE:
|
||||
list.add(new ItemStack(ModItems.niter, 2));
|
||||
list.add(new ItemStack(Blocks.planks, 1));
|
||||
list.add(new ItemStack(Items.sugar, 1));
|
||||
break;
|
||||
case KEVLAR:
|
||||
list.add(new ItemStack(ModItems.niter, 2));
|
||||
list.add(new ItemStack(Items.brick, 1));
|
||||
list.add(new ItemStack(ModItems.powder_coal, 1));
|
||||
break;
|
||||
case SOLID_FUEL:
|
||||
list.add(new ItemStack(ModItems.solid_fuel, 2));
|
||||
list.add(new ItemStack(ModItems.niter, 1));
|
||||
list.add(new ItemStack(Items.redstone, 1));
|
||||
break;
|
||||
case SATURN:
|
||||
list.add(new ItemStack(ModItems.powder_dura_steel, 1));
|
||||
list.add(new ItemStack(ModItems.powder_fire, 1));
|
||||
break;
|
||||
case BALEFIRE:
|
||||
list.add(new ItemStack(ModItems.egg_balefire_shard, 1));
|
||||
break;
|
||||
case SCHRABIDIC:
|
||||
list.add(new ItemStack(ModItems.pellet_charged, 1));
|
||||
break;
|
||||
case SCHRABIDATE:
|
||||
list.add(new ItemStack(ModItems.powder_iron, 1));
|
||||
break;
|
||||
case COLTAN_CLEANING:
|
||||
list.add(new ItemStack(ModItems.powder_coltan_ore, 2));
|
||||
list.add(new ItemStack(ModItems.powder_coal, 1));
|
||||
break;
|
||||
case COLTAN_PAIN:
|
||||
list.add(new ItemStack(ModItems.powder_coltan, 1));
|
||||
list.add(new ItemStack(ModItems.fluorite, 1));
|
||||
break;
|
||||
case VIT_LIQUID:
|
||||
case VIT_GAS:
|
||||
list.add(new ItemStack(ModBlocks.sand_lead, 1));
|
||||
break;
|
||||
case TEL:
|
||||
list.add(new ItemStack(ModItems.oil_tar, 1));
|
||||
list.add(new ItemStack(ModItems.powder_lead, 1));
|
||||
break;
|
||||
case GASOLINE:
|
||||
list.add(new ItemStack(ModItems.antiknock, 1));
|
||||
break;
|
||||
case FRACKSOL:
|
||||
list.add(new ItemStack(ModItems.sulfur, 1));
|
||||
break;
|
||||
case HELIUM3:
|
||||
list.add(new ItemStack(ModBlocks.moon_turf, 8));
|
||||
break;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
list.add(new ItemStack(ModItems.powder_paleogenite, 1));
|
||||
list.add(new ItemStack(ModItems.fluorite, 8));
|
||||
list.add(new ItemStack(ModItems.nugget_bismuth, 4));
|
||||
break;
|
||||
case ETHANOL:
|
||||
list.add(new ItemStack(Items.sugar, 6));
|
||||
break;
|
||||
case METH:
|
||||
list.add(new ItemStack(Items.wheat, 1));
|
||||
list.add(new ItemStack(Items.dye, 2, 3));
|
||||
break;
|
||||
case DUCRETE:
|
||||
list.add(new ItemStack(Blocks.sand, 8));
|
||||
list.add(new ItemStack(ModItems.billet_u238, 2));
|
||||
list.add(new ItemStack(Items.clay_ball, 4));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(list.isEmpty())
|
||||
return null;
|
||||
else
|
||||
return list;
|
||||
}
|
||||
|
||||
public static FluidStack[] getFluidInputFromTempate(ItemStack stack) {
|
||||
|
||||
if(stack == null || !(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return null;
|
||||
|
||||
FluidStack[] input = new FluidStack[2];
|
||||
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return input;
|
||||
|
||||
switch(chem) {
|
||||
case FP_HEAVYOIL:
|
||||
input[0] = new FluidStack(1000, Fluids.HEAVYOIL);
|
||||
break;
|
||||
case FP_SMEAR:
|
||||
input[0] = new FluidStack(1000, Fluids.SMEAR);
|
||||
break;
|
||||
case FP_NAPHTHA:
|
||||
input[0] = new FluidStack(1000, Fluids.NAPHTHA);
|
||||
break;
|
||||
case FP_LIGHTOIL:
|
||||
input[0] = new FluidStack(1000, Fluids.LIGHTOIL);
|
||||
break;
|
||||
case FR_REOIL:
|
||||
input[0] = new FluidStack(1000, Fluids.SMEAR);
|
||||
break;
|
||||
case FR_PETROIL:
|
||||
input[0] = new FluidStack(800, Fluids.RECLAIMED);
|
||||
input[1] = new FluidStack(200, Fluids.LUBRICANT);
|
||||
break;
|
||||
case FC_BITUMEN:
|
||||
input[0] = new FluidStack(1200, Fluids.BITUMEN);
|
||||
input[1] = new FluidStack(2400, Fluids.STEAM);
|
||||
break;
|
||||
case FC_I_NAPHTHA:
|
||||
input[0] = new FluidStack(1400, Fluids.SMEAR);
|
||||
input[1] = new FluidStack(800, Fluids.WATER);
|
||||
break;
|
||||
case FC_GAS_PETROLEUM:
|
||||
input[0] = new FluidStack(1800, Fluids.GAS);
|
||||
input[1] = new FluidStack(1200, Fluids.WATER);
|
||||
break;
|
||||
case FC_DIESEL_KEROSENE:
|
||||
input[0] = new FluidStack(1200, Fluids.DIESEL);
|
||||
input[1] = new FluidStack(2000, Fluids.STEAM);
|
||||
break;
|
||||
case FC_KEROSENE_PETROLEUM:
|
||||
input[0] = new FluidStack(1400, Fluids.KEROSENE);
|
||||
input[1] = new FluidStack(2000, Fluids.STEAM);
|
||||
break;
|
||||
case CC_I:
|
||||
input[0] = new FluidStack(1800, Fluids.WATER);
|
||||
break;
|
||||
case CC_OIL:
|
||||
input[0] = new FluidStack(1400, Fluids.STEAM);
|
||||
break;
|
||||
case CC_HEATING:
|
||||
input[0] = new FluidStack(2000, Fluids.STEAM);
|
||||
break;
|
||||
case CC_HEAVY:
|
||||
input[0] = new FluidStack(1400, Fluids.WATER);
|
||||
break;
|
||||
case CC_NAPHTHA:
|
||||
input[0] = new FluidStack(2400, Fluids.STEAM);
|
||||
break;
|
||||
case ASPHALT:
|
||||
input[0] = new FluidStack(1000, Fluids.BITUMEN);
|
||||
break;
|
||||
case CONCRETE:
|
||||
input[0] = new FluidStack(2000, Fluids.WATER);
|
||||
break;
|
||||
case CONCRETE_ASBESTOS:
|
||||
input[0] = new FluidStack(2000, Fluids.WATER);
|
||||
break;
|
||||
case COOLANT:
|
||||
input[0] = new FluidStack(1800, Fluids.WATER);
|
||||
break;
|
||||
case CRYOGEL:
|
||||
input[0] = new FluidStack(1800, Fluids.COOLANT);
|
||||
break;
|
||||
case DESH:
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
input[0] = new FluidStack(200, Fluids.LIGHTOIL);
|
||||
} else {
|
||||
input[0] = new FluidStack(200, Fluids.MERCURY);
|
||||
input[1] = new FluidStack(200, Fluids.LIGHTOIL);
|
||||
}
|
||||
break;
|
||||
case PEROXIDE:
|
||||
input[0] = new FluidStack(1000, Fluids.WATER);
|
||||
break;
|
||||
case CIRCUIT_4:
|
||||
input[0] = new FluidStack(400, Fluids.ACID);
|
||||
input[1] = new FluidStack(200, Fluids.PETROLEUM);
|
||||
break;
|
||||
case CIRCUIT_5:
|
||||
input[0] = new FluidStack(800, Fluids.ACID);
|
||||
input[1] = new FluidStack(200, Fluids.MERCURY);
|
||||
break;
|
||||
case SF_OIL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_OIL * 2, Fluids.OIL);
|
||||
break;
|
||||
case SF_HEAVYOIL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_HEAVY * 2, Fluids.HEAVYOIL);
|
||||
break;
|
||||
case SF_SMEAR:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_SMEAR * 2, Fluids.SMEAR);
|
||||
break;
|
||||
case SF_HEATINGOIL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_HEATING * 2, Fluids.HEATINGOIL);
|
||||
break;
|
||||
case SF_RECLAIMED:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_RECLAIMED * 2, Fluids.RECLAIMED);
|
||||
break;
|
||||
case SF_PETROIL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_PETROIL * 2, Fluids.PETROIL);
|
||||
break;
|
||||
case SF_LUBRICANT:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_LUBE * 2, Fluids.LUBRICANT);
|
||||
break;
|
||||
case SF_NAPHTHA:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_NAPH * 2, Fluids.NAPHTHA);
|
||||
break;
|
||||
case SF_DIESEL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_DIESEL * 2, Fluids.DIESEL);
|
||||
break;
|
||||
case SF_LIGHTOIL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_LIGHT * 2, Fluids.LIGHTOIL);
|
||||
break;
|
||||
case SF_KEROSENE:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_KEROSENE * 2, Fluids.KEROSENE);
|
||||
break;
|
||||
case SF_GAS:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_GAS * 2, Fluids.GAS);
|
||||
break;
|
||||
case SF_PETROLEUM:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_PETROLEUM * 2, Fluids.PETROLEUM);
|
||||
break;
|
||||
case SF_BIOGAS:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_BIOGAS * 2, Fluids.BIOGAS);
|
||||
break;
|
||||
case SF_BIOFUEL:
|
||||
input[0] = new FluidStack(SolidificationRecipes.SF_BIOFUEL * 2, Fluids.BIOFUEL);
|
||||
break;
|
||||
case POLYMER:
|
||||
input[0] = new FluidStack(600, Fluids.PETROLEUM);
|
||||
break;
|
||||
case DEUTERIUM:
|
||||
input[0] = new FluidStack(4000, Fluids.WATER);
|
||||
break;
|
||||
case STEAM:
|
||||
input[0] = new FluidStack(1000, Fluids.WATER);
|
||||
break;
|
||||
case LPG:
|
||||
input[0] = new FluidStack(2000, Fluids.PETROLEUM);
|
||||
break;
|
||||
case BP_BIOFUEL:
|
||||
input[0] = new FluidStack(2000, Fluids.BIOGAS);
|
||||
break;
|
||||
case YELLOWCAKE:
|
||||
input[0] = new FluidStack(500, Fluids.ACID);
|
||||
break;
|
||||
case UF6:
|
||||
input[0] = new FluidStack(1000, Fluids.WATER);
|
||||
break;
|
||||
case PUF6:
|
||||
input[0] = new FluidStack(1000, Fluids.WATER);
|
||||
break;
|
||||
case SAS3:
|
||||
input[0] = new FluidStack(2000, Fluids.ACID);
|
||||
break;
|
||||
case NITAN:
|
||||
input[0] = new FluidStack(600, Fluids.KEROSENE);
|
||||
input[1] = new FluidStack(200, Fluids.MERCURY);
|
||||
break;
|
||||
case OIL_SAND:
|
||||
input[0] = new FluidStack(400, Fluids.BITUMEN);
|
||||
break;
|
||||
case CORDITE:
|
||||
input[0] = new FluidStack(200, Fluids.HEATINGOIL);
|
||||
break;
|
||||
case KEVLAR:
|
||||
input[0] = new FluidStack(100, Fluids.PETROLEUM);
|
||||
break;
|
||||
case SOLID_FUEL:
|
||||
input[0] = new FluidStack(200, Fluids.PETROLEUM);
|
||||
break;
|
||||
case ELECTROLYSIS:
|
||||
input[0] = new FluidStack(8000, Fluids.WATER);
|
||||
break;
|
||||
case XENON:
|
||||
input[0] = new FluidStack(0, Fluids.NONE);
|
||||
break;
|
||||
case XENON_OXY:
|
||||
input[0] = new FluidStack(250, Fluids.OXYGEN);
|
||||
break;
|
||||
case SATURN:
|
||||
input[0] = new FluidStack(100, Fluids.ACID);
|
||||
input[1] = new FluidStack(50, Fluids.MERCURY);
|
||||
break;
|
||||
case BALEFIRE:
|
||||
input[0] = new FluidStack(6000, Fluids.KEROSENE);
|
||||
break;
|
||||
case SCHRABIDIC:
|
||||
input[0] = new FluidStack(8000, Fluids.SAS3);
|
||||
input[1] = new FluidStack(6000, Fluids.ACID);
|
||||
break;
|
||||
case SCHRABIDATE:
|
||||
input[0] = new FluidStack(250, Fluids.SCHRABIDIC);
|
||||
break;
|
||||
case COLTAN_CLEANING:
|
||||
input[0] = new FluidStack(250, Fluids.ACID);
|
||||
input[1] = new FluidStack(500, Fluids.HYDROGEN);
|
||||
break;
|
||||
case COLTAN_PAIN:
|
||||
input[0] = new FluidStack(1000, Fluids.GAS);
|
||||
input[1] = new FluidStack(500, Fluids.OXYGEN);
|
||||
break;
|
||||
case COLTAN_CRYSTAL:
|
||||
input[0] = new FluidStack(1000, Fluids.PAIN);
|
||||
input[1] = new FluidStack(500, Fluids.ACID);
|
||||
break;
|
||||
case VIT_LIQUID:
|
||||
input[0] = new FluidStack(1000, Fluids.WASTEFLUID);
|
||||
break;
|
||||
case VIT_GAS:
|
||||
input[0] = new FluidStack(1000, Fluids.WASTEGAS);
|
||||
break;
|
||||
case TEL:
|
||||
input[0] = new FluidStack(100, Fluids.PETROLEUM);
|
||||
input[1] = new FluidStack(1000, Fluids.STEAM);
|
||||
break;
|
||||
case GASOLINE:
|
||||
input[0] = new FluidStack(10000, Fluids.PETROIL);
|
||||
break;
|
||||
case FRACKSOL:
|
||||
input[0] = new FluidStack(100, Fluids.PETROLEUM);
|
||||
input[1] = new FluidStack(1000, Fluids.WATER);
|
||||
break;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
input[0] = new FluidStack(1000, Fluids.ACID);
|
||||
break;
|
||||
case METH:
|
||||
input[0] = new FluidStack(400, Fluids.LUBRICANT);
|
||||
input[1] = new FluidStack(400, Fluids.ACID);
|
||||
break;
|
||||
case CO2:
|
||||
input[0] = new FluidStack(1000, Fluids.GAS);
|
||||
break;
|
||||
case HEAVY_ELECTROLYSIS:
|
||||
input[0] = new FluidStack(8000, Fluids.HEAVYWATER);
|
||||
break;
|
||||
case DUCRETE:
|
||||
input[0] = new FluidStack(2000, Fluids.WATER);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public static ItemStack[] getChemOutputFromTempate(ItemStack stack) {
|
||||
|
||||
if(stack == null || !(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return null;
|
||||
|
||||
ItemStack[] output = new ItemStack[4];
|
||||
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return output;
|
||||
|
||||
switch(chem) {
|
||||
case ASPHALT:
|
||||
output[0] = new ItemStack(ModBlocks.asphalt, 4);
|
||||
output[1] = new ItemStack(ModBlocks.asphalt, 4);
|
||||
output[2] = new ItemStack(ModBlocks.asphalt, 4);
|
||||
output[3] = new ItemStack(ModBlocks.asphalt, 4);
|
||||
break;
|
||||
case CONCRETE:
|
||||
output[0] = new ItemStack(ModBlocks.concrete_smooth, 4);
|
||||
output[1] = new ItemStack(ModBlocks.concrete_smooth, 4);
|
||||
output[2] = new ItemStack(ModBlocks.concrete_smooth, 4);
|
||||
output[3] = new ItemStack(ModBlocks.concrete_smooth, 4);
|
||||
break;
|
||||
case CONCRETE_ASBESTOS:
|
||||
output[0] = new ItemStack(ModBlocks.concrete_asbestos, 4);
|
||||
output[1] = new ItemStack(ModBlocks.concrete_asbestos, 4);
|
||||
output[2] = new ItemStack(ModBlocks.concrete_asbestos, 4);
|
||||
output[3] = new ItemStack(ModBlocks.concrete_asbestos, 4);
|
||||
break;
|
||||
case DESH:
|
||||
output[0] = new ItemStack(ModItems.ingot_desh, 1);
|
||||
break;
|
||||
case CIRCUIT_4:
|
||||
output[0] = new ItemStack(ModItems.circuit_gold, 1);
|
||||
break;
|
||||
case CIRCUIT_5:
|
||||
output[0] = new ItemStack(ModItems.circuit_schrabidium, 1);
|
||||
break;
|
||||
case SF_OIL:
|
||||
output[0] = DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE);
|
||||
output[1] = DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE);
|
||||
break;
|
||||
case SF_HEAVYOIL:
|
||||
output[0] = DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE);
|
||||
output[1] = DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE);
|
||||
break;
|
||||
case SF_SMEAR:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_HEATINGOIL:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_RECLAIMED:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_PETROIL:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_LUBRICANT:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_NAPHTHA:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_DIESEL:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_LIGHTOIL:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_KEROSENE:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_GAS:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_PETROLEUM:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_BIOGAS:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case SF_BIOFUEL:
|
||||
output[0] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
output[1] = new ItemStack(ModItems.solid_fuel, 1);
|
||||
break;
|
||||
case POLYMER:
|
||||
output[0] = new ItemStack(ModItems.ingot_polymer, 1);
|
||||
break;
|
||||
case YELLOWCAKE:
|
||||
output[0] = new ItemStack(ModItems.powder_yellowcake, 1);
|
||||
break;
|
||||
case UF6:
|
||||
output[0] = new ItemStack(ModItems.sulfur, 2);
|
||||
break;
|
||||
case DYN_SCHRAB:
|
||||
output[0] = new ItemStack(ModItems.ingot_schrabidium, 1);
|
||||
output[1] = new ItemStack(ModItems.powder_desh, 12);
|
||||
output[2] = new ItemStack(ModItems.powder_desh_mix, 12);
|
||||
break;
|
||||
case DYN_EUPH:
|
||||
output[0] = new ItemStack(ModItems.nugget_euphemium, 12);
|
||||
output[1] = new ItemStack(ModItems.powder_schrabidium, 4);
|
||||
output[2] = new ItemStack(ModItems.powder_power, 4);
|
||||
break;
|
||||
case DYN_DNT:
|
||||
output[0] = new ItemStack(ModItems.ingot_dineutronium, 1);
|
||||
output[1] = new ItemStack(ModItems.powder_euphemium, 8);
|
||||
output[2] = new ItemStack(ModItems.powder_nitan_mix, 8);
|
||||
break;
|
||||
case CORDITE:
|
||||
output[0] = new ItemStack(ModItems.cordite, 4);
|
||||
break;
|
||||
case KEVLAR:
|
||||
output[0] = new ItemStack(ModItems.plate_kevlar, 4);
|
||||
break;
|
||||
case SOLID_FUEL:
|
||||
output[0] = new ItemStack(ModItems.rocket_fuel, 4);
|
||||
break;
|
||||
case SATURN:
|
||||
output[0] = new ItemStack(ModItems.ingot_saturnite, 2);
|
||||
break;
|
||||
case BALEFIRE:
|
||||
output[0] = new ItemStack(ModItems.powder_balefire, 1);
|
||||
break;
|
||||
case SCHRABIDATE:
|
||||
output[0] = new ItemStack(ModItems.powder_schrabidate, 1);
|
||||
break;
|
||||
case COLTAN_CLEANING:
|
||||
output[0] = new ItemStack(ModItems.powder_coltan, 1);
|
||||
output[1] = new ItemStack(ModItems.powder_niobium, 1);
|
||||
output[2] = new ItemStack(ModItems.dust, 1);
|
||||
break;
|
||||
case COLTAN_CRYSTAL:
|
||||
output[0] = new ItemStack(ModItems.gem_tantalium, 1);
|
||||
output[1] = new ItemStack(ModItems.dust, 3);
|
||||
break;
|
||||
case VIT_LIQUID:
|
||||
case VIT_GAS:
|
||||
output[0] = new ItemStack(ModItems.nuclear_waste_vitrified, 1);
|
||||
break;
|
||||
case TEL:
|
||||
output[0] = new ItemStack(ModItems.antiknock, 1);
|
||||
break;
|
||||
case METH:
|
||||
output[0] = new ItemStack(ModItems.chocolate, 2);
|
||||
output[1] = new ItemStack(ModItems.chocolate, 2);
|
||||
break;
|
||||
case DUCRETE:
|
||||
output[0] = new ItemStack(ModBlocks.ducrete_smooth, 2);
|
||||
output[1] = new ItemStack(ModBlocks.ducrete_smooth, 2);
|
||||
output[2] = new ItemStack(ModBlocks.ducrete_smooth, 2);
|
||||
output[3] = new ItemStack(ModBlocks.ducrete_smooth, 2);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
public static FluidStack[] getFluidOutputFromTempate(ItemStack stack) {
|
||||
|
||||
if(stack == null || !(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return null;
|
||||
|
||||
FluidStack[] output = new FluidStack[2];
|
||||
|
||||
ItemChemistryTemplate.EnumChemistryTemplate chem = ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(chem.isDisabled())
|
||||
return output;
|
||||
|
||||
switch(chem) {
|
||||
case FP_HEAVYOIL:
|
||||
output[0] = new FluidStack(RefineryRecipes.heavy_frac_bitu * 10, Fluids.BITUMEN);
|
||||
output[1] = new FluidStack(RefineryRecipes.heavy_frac_smear * 10, Fluids.SMEAR);
|
||||
break;
|
||||
case FP_SMEAR:
|
||||
output[0] = new FluidStack(RefineryRecipes.smear_frac_heat * 10, Fluids.HEATINGOIL);
|
||||
output[1] = new FluidStack(RefineryRecipes.smear_frac_lube * 10, Fluids.LUBRICANT);
|
||||
break;
|
||||
case FP_NAPHTHA:
|
||||
output[0] = new FluidStack(RefineryRecipes.napht_frac_heat * 10, Fluids.HEATINGOIL);
|
||||
output[1] = new FluidStack(RefineryRecipes.napht_frac_diesel * 10, Fluids.DIESEL);
|
||||
break;
|
||||
case FP_LIGHTOIL:
|
||||
output[0] = new FluidStack(RefineryRecipes.light_frac_diesel * 10, Fluids.DIESEL);
|
||||
output[1] = new FluidStack(RefineryRecipes.light_frac_kero * 10, Fluids.KEROSENE);
|
||||
break;
|
||||
case FR_REOIL:
|
||||
output[0] = new FluidStack(800, Fluids.RECLAIMED);
|
||||
break;
|
||||
case FR_PETROIL:
|
||||
output[0] = new FluidStack(1000, Fluids.PETROIL);
|
||||
break;
|
||||
case FC_BITUMEN:
|
||||
output[0] = new FluidStack(1000, Fluids.OIL);
|
||||
output[1] = new FluidStack(200, Fluids.PETROLEUM);
|
||||
break;
|
||||
case FC_I_NAPHTHA:
|
||||
output[0] = new FluidStack(800, Fluids.NAPHTHA);
|
||||
break;
|
||||
case FC_GAS_PETROLEUM:
|
||||
output[0] = new FluidStack(800, Fluids.PETROLEUM);
|
||||
break;
|
||||
case FC_DIESEL_KEROSENE:
|
||||
output[0] = new FluidStack(400, Fluids.KEROSENE);
|
||||
break;
|
||||
case FC_KEROSENE_PETROLEUM:
|
||||
output[0] = new FluidStack(800, Fluids.PETROLEUM);
|
||||
break;
|
||||
case CC_OIL:
|
||||
output[0] = new FluidStack(2000, Fluids.OIL);
|
||||
break;
|
||||
case CC_I:
|
||||
output[0] = new FluidStack(1600, Fluids.SMEAR);
|
||||
break;
|
||||
case CC_HEATING:
|
||||
output[0] = new FluidStack(1800, Fluids.HEATINGOIL);
|
||||
break;
|
||||
case CC_HEAVY:
|
||||
output[0] = new FluidStack(1800, Fluids.HEAVYOIL);
|
||||
break;
|
||||
case CC_NAPHTHA:
|
||||
output[0] = new FluidStack(2000, Fluids.NAPHTHA);
|
||||
break;
|
||||
case COOLANT:
|
||||
output[0] = new FluidStack(2000, Fluids.COOLANT);
|
||||
break;
|
||||
case CRYOGEL:
|
||||
output[0] = new FluidStack(2000, Fluids.CRYOGEL);
|
||||
break;
|
||||
case PEROXIDE:
|
||||
output[0] = new FluidStack(800, Fluids.ACID);
|
||||
break;
|
||||
case DEUTERIUM:
|
||||
output[0] = new FluidStack(500, Fluids.DEUTERIUM);
|
||||
break;
|
||||
case STEAM:
|
||||
output[0] = new FluidStack(1000, Fluids.STEAM);
|
||||
break;
|
||||
case BP_BIOGAS:
|
||||
output[0] = new FluidStack(4000, Fluids.BIOGAS);
|
||||
break;
|
||||
case BP_BIOFUEL:
|
||||
output[0] = new FluidStack(1000, Fluids.BIOFUEL);
|
||||
break;
|
||||
case LPG:
|
||||
output[0] = new FluidStack(1000, Fluids.LPG);
|
||||
break;
|
||||
case UF6:
|
||||
output[0] = new FluidStack(1200, Fluids.UF6);
|
||||
break;
|
||||
case PUF6:
|
||||
output[0] = new FluidStack(900, Fluids.PUF6);
|
||||
break;
|
||||
case SAS3:
|
||||
output[0] = new FluidStack(1000, Fluids.SAS3);
|
||||
break;
|
||||
case NITAN:
|
||||
output[0] = new FluidStack(1000, Fluids.NITAN);
|
||||
break;
|
||||
case OIL_SAND:
|
||||
output[0] = new FluidStack(1000, Fluids.BITUMEN);
|
||||
break;
|
||||
case DYN_SCHRAB:
|
||||
output[0] = new FluidStack(50, Fluids.WATZ);
|
||||
break;
|
||||
case DYN_EUPH:
|
||||
output[0] = new FluidStack(100, Fluids.WATZ);
|
||||
break;
|
||||
case DYN_DNT:
|
||||
output[0] = new FluidStack(150, Fluids.WATZ);
|
||||
break;
|
||||
case ELECTROLYSIS:
|
||||
output[0] = new FluidStack(400, Fluids.HYDROGEN);
|
||||
output[1] = new FluidStack(400, Fluids.OXYGEN);
|
||||
break;
|
||||
case XENON:
|
||||
output[0] = new FluidStack(50, Fluids.XENON);
|
||||
break;
|
||||
case XENON_OXY:
|
||||
output[0] = new FluidStack(50, Fluids.XENON);
|
||||
break;
|
||||
case BALEFIRE:
|
||||
output[0] = new FluidStack(8000, Fluids.BALEFIRE);
|
||||
break;
|
||||
case SCHRABIDIC:
|
||||
output[0] = new FluidStack(16000, Fluids.SCHRABIDIC);
|
||||
break;
|
||||
case COLTAN_CLEANING:
|
||||
output[0] = new FluidStack(500, Fluids.WATER);
|
||||
break;
|
||||
case COLTAN_PAIN:
|
||||
output[0] = new FluidStack(1000, Fluids.PAIN);
|
||||
break;
|
||||
case COLTAN_CRYSTAL:
|
||||
output[0] = new FluidStack(250, Fluids.WATER);
|
||||
break;
|
||||
case GASOLINE:
|
||||
output[0] = new FluidStack(12000, Fluids.GASOLINE);
|
||||
break;
|
||||
case FRACKSOL:
|
||||
output[0] = new FluidStack(1000, Fluids.FRACKSOL);
|
||||
break;
|
||||
case HELIUM3:
|
||||
output[0] = new FluidStack(1000, Fluids.HELIUM3);
|
||||
break;
|
||||
case OSMIRIDIUM_DEATH:
|
||||
output[0] = new FluidStack(1000, Fluids.DEATH);
|
||||
break;
|
||||
case ETHANOL:
|
||||
output[0] = new FluidStack(1000, Fluids.ETHANOL);
|
||||
break;
|
||||
case CO2:
|
||||
output[0] = new FluidStack(1000, Fluids.CARBONDIOXIDE);
|
||||
break;
|
||||
case HEAVY_ELECTROLYSIS:
|
||||
output[0] = new FluidStack(400, Fluids.DEUTERIUM);
|
||||
output[1] = new FluidStack(400, Fluids.OXYGEN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
public Map<Object, Object> getFluidContainers() {
|
||||
Map<Object, Object> map = new HashMap<Object, Object>();
|
||||
|
||||
|
||||
@ -2,8 +2,9 @@ package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemChemistryTemplate.EnumChemistryTemplate;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -20,19 +21,19 @@ public class ItemChemistryIcon extends Item {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public ItemChemistryIcon()
|
||||
{
|
||||
public ItemChemistryIcon() {
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
String s = ("" + StatCollector.translateToLocal(ModItems.chemistry_template.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal("chem." + EnumChemistryTemplate.getEnum(stack.getItemDamage()).name())).trim();
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
|
||||
if (s1 != null)
|
||||
{
|
||||
ChemRecipe chem = ChemplantRecipes.recipes.get(stack.getItemDamage() % ChemplantRecipes.recipes.size());
|
||||
|
||||
String s = ("" + StatCollector.translateToLocal(ModItems.chemistry_template.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal("chem." + chem.name)).trim();
|
||||
|
||||
if(s1 != null) {
|
||||
s = s + " " + s1;
|
||||
}
|
||||
|
||||
@ -41,28 +42,23 @@ public class ItemChemistryIcon extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
for (int i = 0; i < EnumChemistryTemplate.values().length; ++i)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list) {
|
||||
for(int i = 0; i < ChemplantRecipes.recipes.size(); i++) {
|
||||
list.add(new ItemStack(item, 1, ChemplantRecipes.recipes.get(i).getId()));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister reg)
|
||||
{
|
||||
this.icons = new IIcon[EnumChemistryTemplate.values().length];
|
||||
public void registerIcons(IIconRegister reg) {
|
||||
this.icons = new IIcon[ChemplantRecipes.recipes.size()];
|
||||
|
||||
for (int i = 0; i < icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = reg.registerIcon("hbm:chem_icon_" + EnumChemistryTemplate.getEnum(i).name());
|
||||
for(int i = 0; i < icons.length; ++i) {
|
||||
this.icons[i] = reg.registerIcon("hbm:chem_icon_" + ChemplantRecipes.recipes.get(i).name);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int i)
|
||||
{
|
||||
public IIcon getIconFromDamage(int i) {
|
||||
int j = MathHelper.clamp_int(i, 0, icons.length - 1);
|
||||
return this.icons[j];
|
||||
}
|
||||
|
||||
@ -4,7 +4,10 @@ import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes;
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
@ -20,135 +23,20 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemChemistryTemplate extends Item {
|
||||
|
||||
@Spaghetti("this system is so utterly and horribly fucking retarded i can not believe i haven't been shot for this yet")
|
||||
public enum EnumChemistryTemplate {
|
||||
|
||||
//FP - Fuel Processing
|
||||
//FR - Fuel Reprocessing
|
||||
//FC - Fuel Cracking
|
||||
//CC - Coal Cracking
|
||||
//SF - Solid Fuel Production
|
||||
//BP - Biofuel Production
|
||||
|
||||
FP_HEAVYOIL, //0
|
||||
FP_SMEAR,
|
||||
FP_NAPHTHA,
|
||||
FP_LIGHTOIL,
|
||||
FR_REOIL,
|
||||
FR_PETROIL,
|
||||
FC_BITUMEN(true),
|
||||
FC_I_NAPHTHA(true),
|
||||
FC_GAS_PETROLEUM(true),
|
||||
FC_DIESEL_KEROSENE(true),
|
||||
FC_KEROSENE_PETROLEUM(true), //10
|
||||
CC_OIL(true),
|
||||
CC_I(true),
|
||||
CC_HEATING(true),
|
||||
CC_HEAVY(true),
|
||||
CC_NAPHTHA(true),
|
||||
SF_OIL(true),
|
||||
SF_HEAVYOIL(true),
|
||||
SF_SMEAR(true),
|
||||
SF_HEATINGOIL(true),
|
||||
SF_RECLAIMED(true), //20
|
||||
SF_PETROIL(true),
|
||||
SF_LUBRICANT(true),
|
||||
SF_NAPHTHA(true),
|
||||
SF_DIESEL(true),
|
||||
SF_LIGHTOIL(true),
|
||||
SF_KEROSENE(true),
|
||||
SF_GAS(true),
|
||||
SF_PETROLEUM(true),
|
||||
SF_BIOGAS(true),
|
||||
SF_BIOFUEL(true), //30
|
||||
BP_BIOGAS,
|
||||
BP_BIOFUEL,
|
||||
LPG,
|
||||
OIL_SAND,
|
||||
ASPHALT,
|
||||
COOLANT,
|
||||
CRYOGEL,
|
||||
DESH,
|
||||
NITAN,
|
||||
PEROXIDE, //40
|
||||
CIRCUIT_4,
|
||||
CIRCUIT_5,
|
||||
POLYMER,
|
||||
DEUTERIUM,
|
||||
STEAM,
|
||||
YELLOWCAKE,
|
||||
UF6,
|
||||
PUF6,
|
||||
SAS3,
|
||||
DYN_SCHRAB, //50
|
||||
DYN_EUPH,
|
||||
DYN_DNT,
|
||||
CORDITE,
|
||||
KEVLAR,
|
||||
CONCRETE,
|
||||
CONCRETE_ASBESTOS,
|
||||
SOLID_FUEL,
|
||||
ELECTROLYSIS,
|
||||
XENON,
|
||||
XENON_OXY, //60
|
||||
SATURN,
|
||||
BALEFIRE,
|
||||
SCHRABIDIC,
|
||||
SCHRABIDATE,
|
||||
COLTAN_CLEANING,
|
||||
COLTAN_PAIN,
|
||||
COLTAN_CRYSTAL,
|
||||
VIT_LIQUID,
|
||||
VIT_GAS,
|
||||
TEL, //70
|
||||
GASOLINE,
|
||||
FRACKSOL,
|
||||
HELIUM3,
|
||||
OSMIRIDIUM_DEATH,
|
||||
ETHANOL,
|
||||
METH,
|
||||
CO2,
|
||||
HEAVY_ELECTROLYSIS,
|
||||
DUCRETE;
|
||||
|
||||
private boolean disabled = false;
|
||||
|
||||
private EnumChemistryTemplate() { }
|
||||
|
||||
/** Alternate ctor for disabling recipes to prevent recipe shifting armageddon */
|
||||
private EnumChemistryTemplate(boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public static EnumChemistryTemplate getEnum(int i) {
|
||||
if(i < EnumChemistryTemplate.values().length)
|
||||
return EnumChemistryTemplate.values()[i];
|
||||
else
|
||||
return FP_HEAVYOIL;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.toString();
|
||||
}
|
||||
|
||||
public boolean isDisabled() {
|
||||
return this.disabled;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemChemistryTemplate() {
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(stack.getItemDamage());
|
||||
|
||||
if(enum1.isDisabled()) {
|
||||
ChemRecipe recipe = ChemplantRecipes.indexMapping.get(stack.getItemDamage());
|
||||
|
||||
if(recipe == null) {
|
||||
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
||||
} else {
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal("chem." + enum1.name())).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal("chem." + recipe.name)).trim();
|
||||
|
||||
if(s1 != null) {
|
||||
s = s + " " + s1;
|
||||
@ -161,105 +49,8 @@ public class ItemChemistryTemplate extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list) {
|
||||
for(int i = 0; i < EnumChemistryTemplate.values().length; ++i) {
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(i);
|
||||
|
||||
if(!enum1.isDisabled()) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getProcessTime(ItemStack stack) {
|
||||
|
||||
if(!(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return 100;
|
||||
|
||||
int i = stack.getItemDamage();
|
||||
EnumChemistryTemplate enum1 = EnumChemistryTemplate.getEnum(i);
|
||||
|
||||
switch(enum1) {
|
||||
case FP_HEAVYOIL: return 50;
|
||||
case FP_SMEAR: return 50;
|
||||
case FP_NAPHTHA: return 50;
|
||||
case FP_LIGHTOIL: return 50;
|
||||
case FR_REOIL: return 30;
|
||||
case FR_PETROIL: return 30;
|
||||
case OIL_SAND: return 200;
|
||||
case FC_BITUMEN: return 100;
|
||||
case FC_I_NAPHTHA: return 150;
|
||||
case FC_GAS_PETROLEUM: return 100;
|
||||
case FC_DIESEL_KEROSENE: return 150;
|
||||
case FC_KEROSENE_PETROLEUM: return 150;
|
||||
case CC_OIL: return 150;
|
||||
case CC_I: return 200;
|
||||
case CC_HEATING: return 250;
|
||||
case CC_HEAVY: return 200;
|
||||
case CC_NAPHTHA: return 300;
|
||||
case ASPHALT: return 100;
|
||||
case COOLANT: return 50;
|
||||
case CRYOGEL: return 50;
|
||||
case DESH: return 300;
|
||||
case NITAN: return 50;
|
||||
case PEROXIDE: return 50;
|
||||
case CIRCUIT_4: return 200;
|
||||
case CIRCUIT_5: return 250;
|
||||
case SF_OIL: return 20;
|
||||
case SF_HEAVYOIL: return 20;
|
||||
case SF_SMEAR: return 20;
|
||||
case SF_HEATINGOIL: return 20;
|
||||
case SF_RECLAIMED: return 20;
|
||||
case SF_PETROIL: return 20;
|
||||
case SF_LUBRICANT: return 20;
|
||||
case SF_NAPHTHA: return 20;
|
||||
case SF_DIESEL: return 20;
|
||||
case SF_LIGHTOIL: return 20;
|
||||
case SF_KEROSENE: return 20;
|
||||
case SF_GAS: return 20;
|
||||
case SF_PETROLEUM: return 20;
|
||||
case SF_BIOGAS: return 20;
|
||||
case SF_BIOFUEL: return 20;
|
||||
case POLYMER: return 100;
|
||||
case DEUTERIUM: return 200;
|
||||
case STEAM: return 20;
|
||||
case BP_BIOGAS: return 200;
|
||||
case BP_BIOFUEL: return 100;
|
||||
case LPG: return 100;
|
||||
case YELLOWCAKE: return 250;
|
||||
case UF6: return 100;
|
||||
case PUF6: return 150;
|
||||
case SAS3: return 200;
|
||||
case DYN_SCHRAB: return 1 * 60 * 20;
|
||||
case DYN_EUPH: return 3 * 60 * 20;
|
||||
case DYN_DNT: return 5 * 60 * 20;
|
||||
case CORDITE: return 40;
|
||||
case KEVLAR: return 40;
|
||||
case CONCRETE: return 100;
|
||||
case CONCRETE_ASBESTOS: return 100;
|
||||
case SOLID_FUEL: return 200;
|
||||
case ELECTROLYSIS: return 150;
|
||||
case XENON: return 300;
|
||||
case XENON_OXY: return 20;
|
||||
case SATURN: return 60;
|
||||
case BALEFIRE: return 100;
|
||||
case SCHRABIDIC: return 100;
|
||||
case SCHRABIDATE: return 150;
|
||||
case COLTAN_CLEANING: return 60;
|
||||
case COLTAN_PAIN: return 120;
|
||||
case COLTAN_CRYSTAL: return 80;
|
||||
case VIT_LIQUID: return 100;
|
||||
case VIT_GAS: return 100;
|
||||
case TEL: return 40;
|
||||
case GASOLINE: return 40;
|
||||
case FRACKSOL: return 20;
|
||||
case HELIUM3: return 200;
|
||||
case OSMIRIDIUM_DEATH: return 240;
|
||||
case ETHANOL: return 50;
|
||||
case METH: return 30;
|
||||
case CO2: return 60;
|
||||
case HEAVY_ELECTROLYSIS: return 150;
|
||||
case DUCRETE: return 150;
|
||||
default: return 100;
|
||||
for(int i = 0; i < ChemplantRecipes.recipes.size(); i++) {
|
||||
list.add(new ItemStack(item, 1, ChemplantRecipes.recipes.get(i).getId()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,40 +60,45 @@ public class ItemChemistryTemplate extends Item {
|
||||
if(!(stack.getItem() instanceof ItemChemistryTemplate))
|
||||
return;
|
||||
|
||||
if(EnumChemistryTemplate.getEnum(stack.getItemDamage()).isDisabled()) {
|
||||
ChemRecipe recipe = ChemplantRecipes.indexMapping.get(stack.getItemDamage());
|
||||
|
||||
if(recipe == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ItemStack> stacks = MachineRecipes.getChemInputFromTempate(stack);
|
||||
FluidStack[] inF = MachineRecipes.getFluidInputFromTempate(stack);
|
||||
ItemStack[] out = MachineRecipes.getChemOutputFromTempate(stack);
|
||||
FluidStack[] outF = MachineRecipes.getFluidOutputFromTempate(stack);
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("info.templatefolder", I18nUtil.resolveKey(ModItems.template_folder.getUnlocalizedName() + ".name")));
|
||||
list.add("");
|
||||
|
||||
try {
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_out_p"));
|
||||
for(int i = 0; i < 4; i++)
|
||||
if(out[i] != null)
|
||||
list.add(out[i].stackSize + "x " + out[i].getDisplayName());
|
||||
for(int i = 0; i < 4; i++) {
|
||||
if(recipe.outputs.length > i && recipe.outputs[i] != null) {
|
||||
list.add(recipe.outputs[i].stackSize + "x " + recipe.outputs[i].getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(outF[i] != null)
|
||||
list.add(outF[i].fill + "mB " + I18n.format(outF[i].type.getUnlocalizedName()));
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(recipe.outputFluids.length > i && recipe.outputFluids[i] != null) {
|
||||
list.add(recipe.outputFluids[i].fill + "mB " + I18n.format(recipe.outputFluids[i].type.getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_in_p"));
|
||||
|
||||
if(stacks != null)
|
||||
for(int i = 0; i < stacks.size(); i++)
|
||||
list.add(stacks.get(i).stackSize + "x " + stacks.get(i).getDisplayName());
|
||||
for(int i = 0; i < recipe.inputs.length; i++) {
|
||||
if(recipe.inputs.length > i && recipe.inputs[i] != null) {
|
||||
list.add(recipe.inputs[i].stacksize + "x " + recipe.inputs[i].extractForCyclingDisplay(20).getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
if(inF[i] != null)
|
||||
list.add(inF[i].fill + "mB " + I18n.format(inF[i].type.getUnlocalizedName()));
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(recipe.inputFluids.length > i && recipe.inputFluids[i] != null) {
|
||||
list.add(recipe.inputFluids[i].fill + "mB " + I18n.format(recipe.inputFluids[i].type.getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("info.template_time"));
|
||||
list.add(Math.floor((float) (getProcessTime(stack)) / 20 * 100) / 100 + " " + I18nUtil.resolveKey("info.template_seconds"));
|
||||
list.add(Math.floor((float) (recipe.getDuration()) / 20 * 100) / 100 + " " + I18nUtil.resolveKey("info.template_seconds"));
|
||||
} catch(Exception e) {
|
||||
list.add("###INVALID###");
|
||||
list.add("0x334077-0x6A298F-0xDF3795-0x334077");
|
||||
|
||||
@ -168,7 +168,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningDrill.class, new RenderMiningDrill());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningLaser.class, new RenderLaserMiner());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssembler.class, new RenderAssembler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineChemplant.class, new RenderChemplant());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineChemplantNew.class, new RenderChemplant());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFluidTank.class, new RenderFluidTank());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineBAT9000.class, new RenderBAT9000());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineOrbus.class, new RenderOrbus());
|
||||
|
||||
@ -944,6 +944,7 @@ public class MainRegistry {
|
||||
TileEntityNukeFurnace.registerFuels();
|
||||
BreederRecipes.registerRecipes();
|
||||
AssemblerRecipes.loadRecipes();
|
||||
ChemplantRecipes.register();
|
||||
CyclotronRecipes.register();
|
||||
HadronRecipes.register();
|
||||
MagicRecipes.register();
|
||||
|
||||
@ -2,10 +2,11 @@ package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.HmfController;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplantNew;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -22,25 +23,23 @@ public class RenderChemplant extends TileEntitySpecialRenderer {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 2:
|
||||
switch(tileEntity.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 5:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0.5D, 0.0D, -0.5D);
|
||||
break;
|
||||
case 2:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F);
|
||||
break;
|
||||
case 4:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0.5D, 0.0D, -0.5D);
|
||||
GL11.glRotatef(0, 0F, 1F, 0F);
|
||||
break;
|
||||
case 3:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0.5D, 0.0D, -0.5D);
|
||||
break;
|
||||
case 5:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0.5D, 0.0D, -0.5D);
|
||||
break;
|
||||
}
|
||||
|
||||
GL11.glTranslated(-0.5D, 0.0D, 0.5D);
|
||||
|
||||
bindTexture(ResourceManager.chemplant_body_tex);
|
||||
|
||||
ResourceManager.chemplant_body.renderAll();
|
||||
@ -52,29 +51,28 @@ public class RenderChemplant extends TileEntitySpecialRenderer {
|
||||
|
||||
public void renderExtras(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
TileEntityMachineChemplant chem = (TileEntityMachineChemplant) tileEntity;
|
||||
switch(chem.getBlockMetadata()) {
|
||||
case 2:
|
||||
GL11.glTranslated(-1, 0, 0);
|
||||
TileEntityMachineChemplantNew chem = (TileEntityMachineChemplantNew) tileEntity;
|
||||
switch(tileEntity.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 5:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
break;
|
||||
case 4:
|
||||
case 2:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F);
|
||||
break;
|
||||
case 3:
|
||||
GL11.glTranslated(0, 0, -1);
|
||||
case 4:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F);
|
||||
break;
|
||||
case 5:
|
||||
GL11.glTranslated(-1, 0, -1);
|
||||
case 3:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
break;
|
||||
}
|
||||
|
||||
GL11.glTranslated(-0.5D, 0.0D, 0.5D);
|
||||
|
||||
bindTexture(ResourceManager.chemplant_spinner_tex);
|
||||
|
||||
int rotation = (int) (System.currentTimeMillis() % (360 * 5)) / 5;
|
||||
|
||||
@ -4,7 +4,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFENSU;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
||||
@ -4,9 +4,9 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFENSU;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.RBMKColumn;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
||||
@ -79,7 +79,6 @@ public class TileMappings {
|
||||
put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
|
||||
put(TileEntityFluidDuctSimple.class, "tileentity_universal_duct_simple");
|
||||
put(TileEntityFluidDuct.class, "tileentity_universal_duct");
|
||||
put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
|
||||
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
||||
put(TileEntityTurretHeavy.class, "tileentity_turret_heavy");
|
||||
put(TileEntityTurretRocket.class, "tileentity_turret_rocket");
|
||||
@ -245,6 +244,7 @@ public class TileMappings {
|
||||
put(TileEntityMachineLiquefactor.class, "tileentity_liquefactor");
|
||||
put(TileEntityMachineSolidifier.class, "tileentity_solidifier");
|
||||
|
||||
put(TileEntityMachineChemplantNew.class, "tileentity_chemical_plant");
|
||||
put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");
|
||||
|
||||
@ -5,11 +5,8 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockHazard;
|
||||
import com.hbm.blocks.generic.BlockHazardFalling;
|
||||
import com.hbm.blocks.machine.MachineSILEX;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.machine.ItemFELCrystal;
|
||||
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
|
||||
@ -20,16 +17,12 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockTNT;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -61,6 +54,7 @@ public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser
|
||||
return "container.machineFEL";
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
@Override
|
||||
@Spaghetti ("What the fuck were you thinking")
|
||||
public void updateEntity() {
|
||||
@ -83,7 +77,6 @@ public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser
|
||||
} else { this.mode = EnumWavelengths.NULL; }
|
||||
|
||||
int range = 24;
|
||||
int length = 3;
|
||||
boolean silexSpacing = false;
|
||||
if(this.isOn && power >= powerReq * Math.pow(3, mode.ordinal()) && this.mode != EnumWavelengths.NULL) {
|
||||
|
||||
@ -101,7 +94,7 @@ public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser
|
||||
switch(this.mode) {
|
||||
case VISIBLE: entity.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 60 * 65536, 0));
|
||||
case IR:
|
||||
case UV: entity.setFire(65535); break;
|
||||
case UV: entity.setFire(10); break;
|
||||
case GAMMA: HbmLivingProps.incrementRadiation(entity, 25); break;
|
||||
case DRX: HbmLivingProps.incrementDigamma(entity, 0.1F); break;
|
||||
}
|
||||
@ -110,8 +103,6 @@ public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser
|
||||
power -= powerReq * ((mode.ordinal() == 0) ? 0 : Math.pow(3, mode.ordinal()));
|
||||
for(int i = 3; i < range; i++) {
|
||||
|
||||
length = i;
|
||||
|
||||
int x = xCoord + dir.offsetX * i;
|
||||
int y = yCoord + 1;
|
||||
int z = zCoord + dir.offsetZ * i;
|
||||
|
||||
@ -44,6 +44,7 @@ import net.minecraft.tileentity.TileEntityHopper;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@Deprecated //shut up and die please
|
||||
public class TileEntityMachineChemplant extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidSource {
|
||||
|
||||
private ItemStack slots[];
|
||||
@ -300,7 +301,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
FluidStack[] inputs = MachineRecipes.getFluidInputFromTempate(slots[4]);
|
||||
/*FluidStack[] inputs = MachineRecipes.getFluidInputFromTempate(slots[4]);
|
||||
FluidStack[] outputs = MachineRecipes.getFluidOutputFromTempate(slots[4]);
|
||||
|
||||
if((MachineRecipes.getChemInputFromTempate(slots[4]) != null || !Library.isArrayEmpty(inputs)) &&
|
||||
@ -436,7 +437,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacket(xCoord + 1.625, yCoord + 3, zCoord + 0.375, 1),
|
||||
new TargetPoint(worldObj.provider.dimensionId, xCoord + 1.625, yCoord + 3, zCoord + 0.375, 50));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEChemplantPacket(xCoord, yCoord, zCoord, isProgressing), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new LoopedSoundPacket(xCoord, yCoord, zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
@ -540,7 +541,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
|
||||
private void setContainers() {
|
||||
|
||||
if(slots[4] == null || (slots[4] != null && !(slots[4].getItem() instanceof ItemChemistryTemplate))) {
|
||||
/*if(slots[4] == null || (slots[4] != null && !(slots[4].getItem() instanceof ItemChemistryTemplate))) {
|
||||
} else {
|
||||
FluidStack[] inputs = MachineRecipes.getFluidInputFromTempate(slots[4]);
|
||||
FluidStack[] outputs = MachineRecipes.getFluidOutputFromTempate(slots[4]);
|
||||
@ -549,7 +550,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
tanks[1].setTankType(inputs[1] == null ? Fluids.NONE : inputs[1].type);
|
||||
tanks[2].setTankType(outputs[0] == null ? Fluids.NONE : outputs[0].type);
|
||||
tanks[3].setTankType(outputs[1] == null ? Fluids.NONE : outputs[1].type);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public boolean hasFluidsStored(FluidStack[] fluids) {
|
||||
@ -724,7 +725,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
//Loads assembler's input queue from chests
|
||||
public boolean tryFillAssembler(IInventory inventory, int slot) {
|
||||
|
||||
FluidStack[] inputs = MachineRecipes.getFluidInputFromTempate(slots[4]);
|
||||
/*FluidStack[] inputs = MachineRecipes.getFluidInputFromTempate(slots[4]);
|
||||
FluidStack[] outputs = MachineRecipes.getFluidOutputFromTempate(slots[4]);
|
||||
|
||||
if(!((MachineRecipes.getChemInputFromTempate(slots[4]) != null || !Library.isArrayEmpty(inputs)) &&
|
||||
@ -754,7 +755,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
if(!flag)
|
||||
return false;
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
for(int i = 13; i < 17; i++) {
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@ public class TileEntityMachineChemplantNew extends TileEntityMachineBase impleme
|
||||
public static final long maxPower = 100000;
|
||||
public int progress;
|
||||
public int maxProgress = 100;
|
||||
public boolean isProgressing;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
@ -67,6 +68,7 @@ public class TileEntityMachineChemplantNew extends TileEntityMachineBase impleme
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.isProgressing = false;
|
||||
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
if(!tanks[0].loadTank(17, 19, slots)) tanks[0].unloadTank(17, 19, slots);
|
||||
@ -99,6 +101,7 @@ public class TileEntityMachineChemplantNew extends TileEntityMachineBase impleme
|
||||
if(!canProcess()) {
|
||||
this.progress = 0;
|
||||
} else {
|
||||
isProgressing = true;
|
||||
process();
|
||||
}
|
||||
|
||||
@ -106,10 +109,13 @@ public class TileEntityMachineChemplantNew extends TileEntityMachineBase impleme
|
||||
data.setLong("power", this.power);
|
||||
data.setInteger("progress", this.progress);
|
||||
data.setInteger("maxProgress", this.maxProgress);
|
||||
data.setBoolean("isProgressing", isProgressing);
|
||||
|
||||
for(int i = 0; i < tanks.length; i++) {
|
||||
tanks[i].writeToNBT(data, "t" + i);
|
||||
}
|
||||
|
||||
this.networkPack(data, 150);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,6 +124,7 @@ public class TileEntityMachineChemplantNew extends TileEntityMachineBase impleme
|
||||
this.power = nbt.getLong("power");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.maxProgress = nbt.getInteger("maxProgress");
|
||||
this.isProgressing = nbt.getBoolean("isProgressing");
|
||||
|
||||
for(int i = 0; i < tanks.length; i++) {
|
||||
tanks[i].readFromNBT(nbt, "t" + i);
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -11,14 +7,10 @@ import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.GasCentrifugeRecipes;
|
||||
import com.hbm.inventory.recipes.GasCentrifugeRecipes.PseudoFluidType;
|
||||
import com.hbm.inventory.recipes.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIdentifier;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
@ -27,12 +19,8 @@ import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -330,23 +318,26 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
|
||||
FluidType newType = ItemFluidIdentifier.getType(slots[in]);
|
||||
|
||||
if(tank.getTankType() != newType) {
|
||||
tank.setTankType(newType);
|
||||
tank.setFill(0);
|
||||
|
||||
boolean success = false;
|
||||
|
||||
if(newType == Fluids.UF6) {
|
||||
inputTank.setTankType(PseudoFluidType.NUF6);
|
||||
outputTank.setTankType(PseudoFluidType.NUF6.getOutputFluid());
|
||||
return;
|
||||
}
|
||||
if(newType == Fluids.PUF6) {
|
||||
success = true;
|
||||
} else if(newType == Fluids.PUF6) {
|
||||
inputTank.setTankType(PseudoFluidType.PF6);
|
||||
outputTank.setTankType(PseudoFluidType.PF6.getOutputFluid());
|
||||
return;
|
||||
}
|
||||
if(newType == Fluids.WATZ) {
|
||||
success = true;
|
||||
} else if(newType == Fluids.WATZ) {
|
||||
inputTank.setTankType(PseudoFluidType.MUD);
|
||||
outputTank.setTankType(PseudoFluidType.MUD.getOutputFluid());
|
||||
return;
|
||||
success = true;
|
||||
}
|
||||
|
||||
if(success) {
|
||||
tank.setTankType(newType);
|
||||
tank.setFill(0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
@ -18,12 +18,15 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
|
||||
public long[] log = new long[20];
|
||||
public long power = 0;
|
||||
public long maxPower = 1000000;
|
||||
|
||||
//0: input only
|
||||
//1: buffer
|
||||
//2: output only
|
||||
//3: nothing
|
||||
public static final int mode_input = 0;
|
||||
public static final int mode_buffer = 1;
|
||||
public static final int mode_output = 2;
|
||||
public static final int mode_none = 3;
|
||||
public short redLow = 0;
|
||||
public short redHigh = 2;
|
||||
|
||||
@ -40,12 +43,6 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
slots = new ItemStack[2];
|
||||
}
|
||||
|
||||
public TileEntityMachineBattery(long maxPower) {
|
||||
super(2);
|
||||
slots = new ItemStack[2];
|
||||
this.maxPower = maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.battery";
|
||||
@ -146,7 +143,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
}
|
||||
|
||||
public long getPowerRemainingScaled(long i) {
|
||||
return (power * i) / maxPower;
|
||||
return (power * i) / this.getMaxPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,20 +151,17 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
|
||||
if(worldObj.getBlock(xCoord, yCoord, zCoord) instanceof MachineBattery && !worldObj.isRemote) {
|
||||
|
||||
this.maxPower = ((MachineBattery)worldObj.getBlock(xCoord, yCoord, zCoord)).maxPower;
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
power = Library.chargeItemsFromTE(slots, 1, power, maxPower);
|
||||
|
||||
long prevPower = this.power;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
this.transmitPower();
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, getMaxPower());
|
||||
power = Library.chargeItemsFromTE(slots, 1, power, getMaxPower());
|
||||
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setLong("power", (power + prevPower) / 2);
|
||||
nbt.setLong("maxPower", maxPower);
|
||||
nbt.setShort("redLow", redLow);
|
||||
nbt.setShort("redHigh", redHigh);
|
||||
this.networkPack(nbt, 20);
|
||||
@ -200,7 +194,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
}
|
||||
|
||||
//then we add energy
|
||||
if(mode == 1 || mode == 2) {
|
||||
if(mode == mode_buffer || mode == mode_output) {
|
||||
if(te instanceof IEnergyConnector) {
|
||||
IEnergyConnector con = (IEnergyConnector) te;
|
||||
long oldPower = this.power;
|
||||
@ -214,7 +208,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
IEnergyConductor con = (IEnergyConductor) te;
|
||||
|
||||
if(con.getPowerNet() != null) {
|
||||
if(mode == 2 || mode == 3) {
|
||||
if(mode == mode_output || mode == mode_none) {
|
||||
if(con.getPowerNet().isSubscribed(this)) {
|
||||
con.getPowerNet().unsubscribe(this);
|
||||
}
|
||||
@ -230,7 +224,6 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
|
||||
this.power = nbt.getLong("power");
|
||||
this.maxPower = nbt.getLong("maxPower");
|
||||
this.redLow = nbt.getShort("redLow");
|
||||
this.redHigh = nbt.getShort("redHigh");
|
||||
}
|
||||
@ -249,13 +242,16 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
}
|
||||
}
|
||||
|
||||
private long bufferedMax;
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
|
||||
if(!worldObj.isRemote && getRelevantMode() >= 2)
|
||||
return this.getPower();
|
||||
if(bufferedMax == 0) {
|
||||
bufferedMax = ((MachineBattery)worldObj.getBlock(xCoord, yCoord, zCoord)).maxPower;
|
||||
}
|
||||
|
||||
return maxPower;
|
||||
return bufferedMax;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -264,6 +260,12 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
@Override
|
||||
public long transferPower(long power) {
|
||||
|
||||
int mode =this.getRelevantMode();
|
||||
|
||||
if(mode == mode_output || mode == mode_none) {
|
||||
return power;
|
||||
}
|
||||
|
||||
this.power += power;
|
||||
|
||||
if(this.power > this.getMaxPower()) {
|
||||
@ -276,6 +278,18 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTransferWeight() {
|
||||
|
||||
int mode =this.getRelevantMode();
|
||||
|
||||
if(mode == mode_output || mode == mode_none) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Math.max(getMaxPower() - getPower(), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return true;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
@ -20,18 +19,15 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
this.maxPower = Long.MAX_VALUE;
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.transmitPower();
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
power = Library.chargeItemsFromTE(slots, 1, power, maxPower);
|
||||
power = Library.chargeTEFromItems(slots, 0, power, getMaxPower());
|
||||
power = Library.chargeItemsFromTE(slots, 1, power, getMaxPower());
|
||||
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setLong("power", power);
|
||||
nbt.setLong("maxPower", maxPower);
|
||||
nbt.setShort("redLow", redLow);
|
||||
nbt.setShort("redHigh", redHigh);
|
||||
this.networkPack(nbt, 250);
|
||||
@ -94,11 +90,16 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
||||
@Override
|
||||
public long getPowerRemainingScaled(long i) {
|
||||
|
||||
double powerScaled = (double)power / (double)maxPower;
|
||||
double powerScaled = (double)power / (double)getMaxPower();
|
||||
|
||||
return (long)(i * powerScaled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return (float) Math.pow(Math.log(power * 0.75 + 1) * 0.05F, 5);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Loading…
x
Reference in New Issue
Block a user