From 6cc9ba9cd8f7652d44747691004266f6c1269ccb Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 17 Dec 2021 22:28:03 -0800 Subject: [PATCH] gas cent! yay --- .../nei/GasCentrifugeRecipeHandler.java | 33 +++-- .../container/ContainerMachineGasCent.java | 45 +++---- .../hbm/inventory/gui/GUIMachineGasCent.java | 42 ++++-- .../recipes/GasCentrifugeRecipes.java | 67 ++++++++- .../hbm/inventory/recipes/MachineRecipes.java | 127 +----------------- .../hbm/inventory/recipes/SILEXRecipes.java | 4 +- .../machine/TileEntityMachineGasCent.java | 39 ++++-- .../hbm/textures/gui/centrifuge_gas.png | Bin 2590 -> 2811 bytes 8 files changed, 162 insertions(+), 195 deletions(-) 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 688d9cc1940199eef2e8d994555744fb5fef4720..83754faa0f05214099c3b0f9110ef5c084cfb632 100644 GIT binary patch literal 2811 zcmd5;i96Km7k_6AjjeFIxcyR=5LvPg*}mMti0q;;*0N53b zvoE9O5>vK>!Wh{Gm1R^i;Wypx@-N)?Iq!3p&pGEk=RME+Ja4kSt);NQJ^=uLuoVvL z2mpdBA^@6)%R(NwIe*n69WBiOrFZ`VS3w1so-hTVDqZl44=)$1w6}3K=i0%RY)VQB z27~GB?A+Pe0UHW!&G#D~-D_`ou)aE_udlDArFHDsv9Pc(u&TDrS(;+>(w{bTch+@2 zsUeX_9v&VR78Y16*3{J0#l;0IYVYi7NO98O6|3DDdd>weeP)&{M<%?+g;Z4_NyT|+}dP#*-U!a&tIP#y#BN6)?) ztgkJec-`ae?X9V)>E`AJiW9)S_-SVU5^MC`;_I49a#MW?9*;kJ_H1BapqiSRj*bqv zeYvitNJB#d+)Q41HxUvN0x~joc2*M;6G2KgxN;j@y#+25fr~{Twj9Kjf$&NYQV;xF z0iFh2>AKuoEmzSJ4gx%XUBIWBoro6ZC zI;4Liu3q_u02+NmRv`OsT*{{l2M;SVb{*iTbI#5YG;{r96oVcs+@Acz4#I2ZW4b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