diff --git a/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java b/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java index 1c4de7fc3..da94c5b43 100644 --- a/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java +++ b/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import com.hbm.inventory.gui.GUIMachineGasCent; +import com.hbm.inventory.recipes.GasCentrifugeRecipes; import com.hbm.inventory.recipes.MachineRecipes; import codechicken.nei.NEIServerUtils; @@ -25,15 +26,14 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { PositionedStack result1; PositionedStack result2; PositionedStack result3; - PositionedStack result4; + - public SmeltingSet(ItemStack input, ItemStack result1, ItemStack result2, ItemStack result3, ItemStack result4) { + public SmeltingSet(ItemStack input, ItemStack result1, ItemStack result2, ItemStack result3) { input.stackSize = 1; - this.input = new PositionedStack(input, 48, 24); - this.result1 = new PositionedStack(result1, 129, 6); - this.result2 = new PositionedStack(result2, 147, 6); - this.result3 = new PositionedStack(result3, 129, 42); - this.result4 = new PositionedStack(result4, 147, 42); + this.input = new PositionedStack(input, 25, 35 - 11); + this.result1 = new PositionedStack(result1, 128, 26 - 11); + this.result2 = new PositionedStack(result2, 128, 44 - 11); + this.result3 = new PositionedStack(result3, 146, 35 - 11); } @Override @@ -47,7 +47,6 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { stacks.add(fuels.get((cycleticks / 48) % fuels.size()).stack); stacks.add(result2); stacks.add(result3); - stacks.add(result4); return stacks; } @@ -96,9 +95,9 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { if ((outputId.equals("gascentprocessing")) && getClass() == GasCentrifugeRecipeHandler.class) { - Map recipes = MachineRecipes.instance().getGasCentrifugeRecipes(); + Map recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes(); for (Map.Entry recipe : recipes.entrySet()) { - this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2], (ItemStack)recipe.getValue()[3])); + this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2])); } } else { super.loadCraftingRecipes(outputId, results); @@ -107,10 +106,10 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(ItemStack result) { - Map recipes = MachineRecipes.instance().getGasCentrifugeRecipes(); + Map recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes(); for (Map.Entry recipe : recipes.entrySet()) { - if (NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[0], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[1], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[2], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[3], result)) - this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2], (ItemStack)recipe.getValue()[3])); + if (NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[0], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[1], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[2], result)) + this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2])); } } @@ -125,10 +124,10 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { @Override public void loadUsageRecipes(ItemStack ingredient) { - Map recipes = MachineRecipes.instance().getGasCentrifugeRecipes(); + Map recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes(); for (Map.Entry recipe : recipes.entrySet()) { if (compareFluidStacks(ingredient, (ItemStack)recipe.getKey())) - this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2], (ItemStack)recipe.getValue()[3])); + this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2])); } } @@ -139,11 +138,11 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { @Override public void drawExtras(int recipe) { drawProgressBar(3, 51 - 45, 176, 0, 16, 34, 480, 7); - drawProgressBar(93, 19, 192, -1, 6, 33, 200, 3); + drawProgressBar(69, 26, 208, 0, 33, 12, 200, 0); } @Override public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(56 * 2, 5 + 18, 54, 18), "gascentprocessing")); + transferRects.add(new RecipeTransferRect(new Rectangle(69, 26, 32, 12), "gascentprocessing")); } } diff --git a/src/main/java/com/hbm/inventory/container/ContainerMachineGasCent.java b/src/main/java/com/hbm/inventory/container/ContainerMachineGasCent.java index 15890b445..b63e18bdd 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerMachineGasCent.java +++ b/src/main/java/com/hbm/inventory/container/ContainerMachineGasCent.java @@ -12,25 +12,22 @@ import net.minecraft.item.ItemStack; public class ContainerMachineGasCent extends Container { - private TileEntityMachineGasCent diFurnace; + private TileEntityMachineGasCent gasCent; public ContainerMachineGasCent(InventoryPlayer invPlayer, TileEntityMachineGasCent tedf) { - diFurnace = tedf; + gasCent = tedf; //Battery this.addSlotToContainer(new Slot(tedf, 0, 8, 53)); //Fluid ID IO - this.addSlotToContainer(new Slot(tedf, 1, 35, 17)); - this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 35, 53)); - //Fluid IO - this.addSlotToContainer(new Slot(tedf, 3, 71, 17)); - this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 71, 53)); + this.addSlotToContainer(new Slot(tedf, 1, 30, 35)); //Output - this.addSlotToContainer(new SlotMachineOutput(tedf, 5, 134, 17)); - this.addSlotToContainer(new SlotMachineOutput(tedf, 6, 152, 17)); - this.addSlotToContainer(new SlotMachineOutput(tedf, 7, 134, 53)); - this.addSlotToContainer(new SlotMachineOutput(tedf, 8, 152, 53)); + this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 133, 26)); + this.addSlotToContainer(new SlotMachineOutput(tedf, 3, 133, 44)); + this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 151, 35)); + //upgrade + this.addSlotToContainer(new Slot(tedf, 5, 81, 18)); for(int i = 0; i < 3; i++) { @@ -52,35 +49,35 @@ public class ContainerMachineGasCent extends Container { } @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + public ItemStack transferStackInSlot(EntityPlayer player, int index) { ItemStack var3 = null; - Slot var4 = (Slot) this.inventorySlots.get(par2); + Slot slot = (Slot) this.inventorySlots.get(index); - if (var4 != null && var4.getHasStack()) + if (slot != null && slot.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); + ItemStack stack = slot.getStack(); + var3 = stack.copy(); - if (par2 <= 8) { - if (!this.mergeItemStack(var5, 9, this.inventorySlots.size(), true)) + if (index <= 5) { + if (!this.mergeItemStack(stack, 6, this.inventorySlots.size(), true)) { return null; } } - else if (!this.mergeItemStack(var5, 0, 2, false)) + else if (!this.mergeItemStack(stack, 0, 2, false)) { - if (!this.mergeItemStack(var5, 3, 4, false)) + if (!this.mergeItemStack(stack, 3, 4, false)) return null; } - if (var5.stackSize == 0) + if (stack.stackSize == 0) { - var4.putStack((ItemStack) null); + slot.putStack((ItemStack) null); } else { - var4.onSlotChanged(); + slot.onSlotChanged(); } } @@ -89,6 +86,6 @@ public class ContainerMachineGasCent extends Container { @Override public boolean canInteractWith(EntityPlayer player) { - return diFurnace.isUseableByPlayer(player); + return gasCent.isUseableByPlayer(player); } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineGasCent.java b/src/main/java/com/hbm/inventory/gui/GUIMachineGasCent.java index 536600987..d84324a2c 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineGasCent.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineGasCent.java @@ -15,11 +15,11 @@ import net.minecraft.util.ResourceLocation; public class GUIMachineGasCent extends GuiInfoContainer { public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/centrifuge_gas.png"); - private TileEntityMachineGasCent diFurnace; + private TileEntityMachineGasCent gasCent; public GUIMachineGasCent(InventoryPlayer invPlayer, TileEntityMachineGasCent tedf) { super(new ContainerMachineGasCent(invPlayer, tedf)); - diFurnace = tedf; + gasCent = tedf; this.xSize = 176; this.ySize = 168; @@ -28,17 +28,16 @@ public class GUIMachineGasCent extends GuiInfoContainer { @Override public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); - - diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 53, guiTop + 69 - 52, 16, 52); - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 98, guiTop + 30, 6, 32, mouseX, mouseY, new String[] {String.valueOf((int)((double)diFurnace.progress / (double)diFurnace.processingSpeed * 100D)) + "%"}); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 58, guiTop + 30, 8, 33, mouseX, mouseY, new String[] {gasCent.inputTank.getTankType().getName(), gasCent.inputTank.getFill() + " / " + gasCent.inputTank.getMaxFill() + " mB"}); + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 114, guiTop + 30, 8, 33, mouseX, mouseY, new String[] {gasCent.outputTank.getTankType().getName(), gasCent.outputTank.getFill() + " / " + gasCent.outputTank.getMaxFill() + " mB"}); - this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 51 - 34, 16, 34, diFurnace.power, diFurnace.maxPower); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 51 - 34, 16, 34, gasCent.power, gasCent.maxPower); } @Override protected void drawGuiContainerForegroundLayer(int i, int j) { - String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); + String name = this.gasCent.hasCustomInventoryName() ? this.gasCent.getInventoryName() : I18n.format(this.gasCent.getInventoryName()); this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); @@ -50,13 +49,32 @@ public class GUIMachineGasCent extends GuiInfoContainer { Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - int i = (int)diFurnace.getPowerRemainingScaled(34); + int i = (int)gasCent.getPowerRemainingScaled(34); drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 176, 34 - i, 16, i); - int j = (int)diFurnace.getCentrifugeProgressScaled(33); - drawTexturedModalRect(guiLeft + 98, guiTop + 63 - j, 192, 32 - j, 6, j); + int j = (int)gasCent.getCentrifugeProgressScaled(33); + drawTexturedModalRect(guiLeft + 74, guiTop + 37, 208, 0, j, 12); - Minecraft.getMinecraft().getTextureManager().bindTexture(diFurnace.tank.getSheet()); - diFurnace.tank.renderTank(this, guiLeft + 53, guiTop + 69, diFurnace.tank.getTankType().textureX() * FluidTank.x, diFurnace.tank.getTankType().textureY() * FluidTank.y, 16, 52); + int a = gasCent.getTankScaled(32, 0); + switch (gasCent.inputTank.getTankType()) { + case PF6: + drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 200, 31 - a, 8, a); + break; + case NONE: + break; + default: + drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 31 - a, 8, a); + } + + int b = gasCent.getTankScaled(32, 1); + switch (gasCent.outputTank.getTankType()) { + case PF6: + drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 200, 31 - b, 8, b); + break; + case NONE: + break; + default: + drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 192, 31 - b, 8, b); + } } } diff --git a/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java b/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java index 2c48e156a..10f9c4460 100644 --- a/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java @@ -1,31 +1,38 @@ package com.hbm.inventory.recipes; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemFluidIcon; import net.minecraft.item.ItemStack; public class GasCentrifugeRecipes { public static enum PseudoFluidType { - NONE (0, 0, "NONE", new ItemStack(ModItems.polaroid, 0)), + NONE (0, 0, "NONE", "Empty", new ItemStack(ModItems.polaroid, 0)), - NUF6 (400, 300, "LEUF6", new ItemStack(ModItems.nugget_u238, 1)), - LEUF6 (300, 200, "MEUF6", new ItemStack(ModItems.nugget_u238, 1)), - MEUF6 (200, 100, "HEUF6", new ItemStack(ModItems.nugget_u238, 1)), - HEUF6 (100, 0, "NONE", new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1)), + NUF6 (400, 300, "LEUF6", "Natural UF6", new ItemStack(ModItems.nugget_u238, 1)), + LEUF6 (300, 200, "MEUF6", "Low Enriched UF6", new ItemStack(ModItems.nugget_u238, 1), new ItemStack(ModItems.fluorite, 1)), + MEUF6 (200, 100, "HEUF6", "Medium Enriched UF6", new ItemStack(ModItems.nugget_u238, 1)), + HEUF6 (300, 0, "NONE", "High Enriched UF6", new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 1)), - PF6 (300, 0, "NONE", new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2)); + PF6 (300, 0, "NONE", "Plutonium Hexafluoride", new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)); int fluidConsumed; int fluidProduced; String outputFluid; + String name; ItemStack[] output; - PseudoFluidType(int fluidConsumed, int fluidProduced, String outputFluid, ItemStack... output) { + PseudoFluidType(int fluidConsumed, int fluidProduced, String outputFluid, String name, ItemStack... output) { this.fluidConsumed = fluidConsumed; this.fluidProduced = fluidProduced; this.outputFluid = outputFluid; + this.name = name; this.output = output; } @@ -41,10 +48,56 @@ public class GasCentrifugeRecipes { return this.valueOf(this.outputFluid); } + public String getName() { + return this.name; + } + public ItemStack[] getOutput() { return this.output; } }; + public static class GasCentRecipe { + ItemStack[] output; + int type; + int quantity; + + public GasCentRecipe(ItemStack[] output, int ordinal, int quantity) { + this.output = output; + this.type = ordinal; + this.quantity = quantity; + } + + public ItemStack[] getOutputs() { + return this.output; + } + + public int getOrdinal() { + return this.type; + } + + public int getQuantity() { + return this.quantity; + } + } + + static GasCentRecipe[] Recipes = new GasCentRecipe[] {new GasCentRecipe( new ItemStack[] {new ItemStack(ModItems.nugget_u238, 11), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 4)}, FluidType.UF6.ordinal(), 1200), new GasCentRecipe( new ItemStack[] {new ItemStack(ModItems.nugget_pu238, 3), new ItemStack(ModItems.nugget_pu_mix, 6), new ItemStack(ModItems.fluorite, 3)}, FluidType.PUF6.ordinal(), 900)}; + + public static Map getGasCentrifugeRecipes() { + Map recipes = new HashMap(); + + for(int i = 0; i < 2; i++) { + + ItemStack[] outputs = Recipes[i].getOutputs(); + + ItemStack input = new ItemStack(ModItems.fluid_icon, 1, Recipes[i].getOrdinal()); + ItemFluidIcon.addQuantity(input, Recipes[i].getQuantity()); + + recipes.put(input, outputs); + } + + return recipes; + } + } diff --git a/src/main/java/com/hbm/inventory/recipes/MachineRecipes.java b/src/main/java/com/hbm/inventory/recipes/MachineRecipes.java index d22262d91..b4402db62 100644 --- a/src/main/java/com/hbm/inventory/recipes/MachineRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/MachineRecipes.java @@ -152,87 +152,6 @@ public class MachineRecipes { return null; } - - //bro, i don't care - @SuppressWarnings("incomplete-switch") - public static List getGasCentOutput(FluidType fluid) { - - List list = new ArrayList(); - - switch(fluid) { - case UF6: - list.add(new GasCentOutput(3, new ItemStack(ModItems.nugget_u238), 1)); - list.add(new GasCentOutput(3, new ItemStack(ModItems.nugget_u238), 2)); - list.add(new GasCentOutput(2, new ItemStack(ModItems.nugget_u238), 3)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_u235), 4)); - return list; - case PUF6: - list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_pu238), 1)); - list.add(new GasCentOutput(2, new ItemStack(ModItems.nugget_pu238), 2)); - list.add(new GasCentOutput(6, new ItemStack(ModItems.nugget_pu_mix), 3)); - list.add(new GasCentOutput(6, new ItemStack(ModItems.nugget_pu_mix), 4)); - return list; - case WATZ: - list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_solinium), 1)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.nugget_uranium), 2)); - list.add(new GasCentOutput(5, new ItemStack(ModItems.powder_lead), 3)); - list.add(new GasCentOutput(10, new ItemStack(ModItems.dust), 4)); - return list; - case SAS3: - list.add(new GasCentOutput(4, new ItemStack(ModItems.nugget_schrabidium), 1)); - list.add(new GasCentOutput(4, new ItemStack(ModItems.nugget_schrabidium), 2)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.sulfur), 3)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.sulfur), 4)); - return list; - case NITAN: - list.add(new GasCentOutput(1, new ItemStack(ModItems.powder_nitan_mix), 1)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.powder_nitan_mix), 2)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.powder_nitan_mix), 3)); - list.add(new GasCentOutput(1, new ItemStack(ModItems.powder_nitan_mix), 4)); - return list; - } - - return null; - } - - public static class GasCentOutput { - public int weight; - public ItemStack output; - public int slot; - - public GasCentOutput(int w, ItemStack s, int i) { - weight = w; - output = s; - slot = i; - } - } - - @SuppressWarnings("incomplete-switch") - public static int getFluidConsumedGasCent(FluidType fluid) { - - new ArrayList(); - - switch(fluid) { - case LAVA: - return 1000; - case UF6: - return 100; - case PUF6: - return 100; - case WATZ: - return 1000; - case SAS3: - return 100; - case COOLANT: - return 2000; - case CRYOGEL: - return 1000; - case NITAN: - return 500; - } - - return 100; - } //return: FluidType, amount produced, amount required, heat required (°C * 100) @SuppressWarnings("incomplete-switch") @@ -540,43 +459,6 @@ public class MachineRecipes { return fuels; } - public Map getGasCentrifugeRecipes() { - Map recipes = new HashMap(); - - for(int i = 0; i < FluidType.values().length; i++) { - - if(getGasCentOutput(FluidType.getEnum(i)) != null) { - - List outputs = getGasCentOutput(FluidType.getEnum(i)); - - int totalWeight = 0; - - for(GasCentOutput o : outputs) { - totalWeight += o.weight; - } - - ItemStack input = new ItemStack(ModItems.fluid_icon, 1, i); - ItemFluidIcon.addQuantity(input, getFluidConsumedGasCent(FluidType.getEnum(i)) * totalWeight); - - ItemStack[] out = new ItemStack[4]; - - for(int j = 0; j < outputs.size(); j++) { - - out[j] = outputs.get(j).output.copy(); - out[j].stackSize *= outputs.get(j).weight; - } - - for(int j = 0; j < 4; j++) - if(out[j] == null) - out[j] = new ItemStack(ModItems.nothing); - - recipes.put(input, out); - } - } - - return recipes; - } - public ArrayList getCentrifugeFuels() { ArrayList fuels = new ArrayList(); fuels.add(new ItemStack(Items.coal)); @@ -1378,12 +1260,12 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.biomass, 16)); break; case YELLOWCAKE: - list.add(new ItemStack(ModItems.powder_uranium, 1)); + 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, 1)); + list.add(new ItemStack(ModItems.fluorite, 4)); break; case PUF6: list.add(new ItemStack(ModItems.powder_plutonium, 1)); @@ -1854,6 +1736,9 @@ public class MachineRecipes { 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); @@ -2005,7 +1890,7 @@ public class MachineRecipes { output[0] = new FluidStack(1000, FluidType.LPG); break; case UF6: - output[0] = new FluidStack(900, FluidType.UF6); + output[0] = new FluidStack(1200, FluidType.UF6); break; case PUF6: output[0] = new FluidStack(900, FluidType.PUF6); diff --git a/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java b/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java index e2078e0f3..6294058f1 100644 --- a/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java @@ -28,9 +28,9 @@ public class SILEXRecipes { itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, FluidType.UF6.ordinal()), new ComparableStack(ModItems.ingot_uranium)); dictTranslation.put("dustUranium", "ingotUranium"); - recipes.put("ingotUranium", new SILEXRecipe(900, 100) + recipes.put("ingotUranium", new SILEXRecipe(1200, 100) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 1)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 8)) + .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 11)) ); recipes.put(new ComparableStack(ModItems.ingot_pu_mix), new SILEXRecipe(900, 100) diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java index e3ab38340..fd8a40ad7 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineGasCent.java @@ -12,7 +12,6 @@ import com.hbm.inventory.FluidTank; import com.hbm.inventory.recipes.GasCentrifugeRecipes; import com.hbm.inventory.recipes.GasCentrifugeRecipes.PseudoFluidType; import com.hbm.inventory.recipes.MachineRecipes; -import com.hbm.inventory.recipes.MachineRecipes.GasCentOutput; import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.packet.AuxElectricityPacket; @@ -48,16 +47,15 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I public PseudoFluidTank inputTank; public PseudoFluidTank outputTank; - private static final int[] slots_top = new int[] {3}; - private static final int[] slots_bottom = new int[] {5, 6, 7, 8}; - private static final int[] slots_side = new int[] {0, 3}; + private static final int[] slots_top = new int[] {0}; + private static final int[] slots_bottom = new int[] {2, 3, 4}; + private static final int[] slots_side = new int[] { }; private String customName; - //TODO add inter-TE communications (outputting pseudofluids to other gascents, setting pseudofluidtype for other gascents, etc.) - //Check the TileEntityPileBase for how to do this, tis pretty easy + //TODO Add Machine Upgrades that speed up gas cent, required for enrichment past HEUF6; add dynamic output size like silex (?); fix puf6 public TileEntityMachineGasCent() { - super(9); //6 slots + super(6); tank = new FluidTank(FluidType.UF6, 4000, 0); inputTank = new PseudoFluidTank(PseudoFluidType.NUF6, 8000); outputTank = new PseudoFluidTank(PseudoFluidType.LEUF6, 8000); @@ -122,7 +120,7 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I @Override public boolean canExtractItem(int i, ItemStack itemStack, int j) { - return j != 0 || i != 1; + return (i != 0 && i != 1) || j == 1; } public int getCentrifugeProgressScaled(int i) { @@ -133,6 +131,15 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I return (power * i) / maxPower; } + public int getTankScaled(int i, int id) { + if(id == 0) { + return (this.inputTank.getFill() * i) / inputTank.getMaxFill(); + } else if(id == 1) { + return (this.outputTank.getFill() * i) / outputTank.getMaxFill(); + } + return i; + } + private boolean canEnrich() { if(power > 0 && this.inputTank.getFill() >= inputTank.getTankType().getFluidConsumed() && this.outputTank.getFill() <= outputTank.getMaxFill()) { @@ -226,6 +233,10 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I public void networkUnpack(NBTTagCompound data) { this.power = data.getLong("power"); this.progress = data.getInteger("progress"); + this.inputTank.setTankType(PseudoFluidType.valueOf(data.getString("inputType"))); + this.outputTank.setTankType(PseudoFluidType.valueOf(data.getString("outputType"))); + this.inputTank.setFill(data.getInteger("inputFill")); + this.outputTank.setFill(data.getInteger("outputFill")); } @Override @@ -273,12 +284,12 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I TileEntity te = worldObj.getTileEntity(this.xCoord - dir.offsetX, this.yCoord, this.zCoord - dir.offsetZ); if(attemptTransfer(te) && this.inputTank.getTankType() == PseudoFluidType.LEUF6) { - if(this.outputTank.getFill() >= 100 && (slots[3] == null || slots[3].getItem() == ModItems.nugget_uranium_fuel)) { + if(this.outputTank.getFill() >= 100 && (slots[4] == null || slots[4].getItem() == ModItems.nugget_uranium_fuel) && slots[4].stackSize + 1 <= slots[4].getMaxStackSize()) { this.outputTank.setFill(this.outputTank.getFill() - 100); - if(slots[3] == null) { - slots[3] = new ItemStack(ModItems.nugget_uranium_fuel, 1); + if(slots[4] == null) { + slots[4] = new ItemStack(ModItems.nugget_uranium_fuel, 1); } else { - slots[3].stackSize += 1; + slots[4].stackSize += 1; } } } @@ -287,6 +298,10 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I NBTTagCompound data = new NBTTagCompound(); data.setLong("power", power); data.setInteger("progress", progress); + data.setInteger("inputFill", inputTank.getFill()); + data.setInteger("outputFill", outputTank.getFill()); + data.setString("inputType", inputTank.getTankType().toString()); + data.setString("outputType", outputTank.getTankType().toString()); this.networkPack(data, 50); PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); diff --git a/src/main/resources/assets/hbm/textures/gui/centrifuge_gas.png b/src/main/resources/assets/hbm/textures/gui/centrifuge_gas.png index 688d9cc19..83754faa0 100644 Binary files a/src/main/resources/assets/hbm/textures/gui/centrifuge_gas.png and b/src/main/resources/assets/hbm/textures/gui/centrifuge_gas.png differ