plenty more changes; RBMK rounding errors fixed

This commit is contained in:
Vaern 2022-06-05 20:32:47 -07:00
parent 671948754b
commit cfe90f281a
10 changed files with 195 additions and 114 deletions

View File

@ -1,18 +1,27 @@
package com.hbm.handler.nei;
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.hbm.handler.nei.AnvilRecipeHandler.RecipeSet;
import com.hbm.inventory.gui.GUIMachineGasCent;
import com.hbm.inventory.recipes.GasCentrifugeRecipes;
import com.hbm.inventory.recipes.MachineRecipes;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRectHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
@ -23,13 +32,17 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;
List<PositionedStack> output = new ArrayList();
boolean isHighSpeed;
int centNumber;
public SmeltingSet(ItemStack input, ItemStack[] results) {
public SmeltingSet(ItemStack input, ItemStack[] results, boolean isHighSpeed, int centNumber) {
input.stackSize = 1;
this.input = new PositionedStack(input, 25, 35 - 11);
this.input = new PositionedStack(input, 52 - 5, 35 - 11);
this.isHighSpeed = isHighSpeed;
this.centNumber = centNumber;
for(byte i = 0; i < results.length; i++) {
this.output.add(new PositionedStack(results[i], i % 2 == 0 ? 128 : 146, i < 2 ? 26 - 11 : 44 - 11 ));
this.output.add(new PositionedStack(results[i], i % 2 == 0 ? 134 - 5 : 152 - 5, i < 2 ? 26 - 11 : 44 - 11 ));
}
}
@ -68,12 +81,7 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
@Override
public String getGuiTexture() {
return GUIMachineGasCent.texture.toString();
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GUIMachineGasCent.class;
return RefStrings.MODID + ":textures/gui/nei/gui_nei_centrifuge_gas.png";
}
@Override
@ -91,7 +99,7 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
if((outputId.equals("gascentprocessing")) && getClass() == GasCentrifugeRecipeHandler.class) {
Map<Object, Object[]> recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes();
for(Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack[]) recipe.getValue()));
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack[]) recipe.getValue()[0], (boolean) recipe.getValue()[1], (int) recipe.getValue()[2]));
}
} else {
super.loadCraftingRecipes(outputId, results);
@ -102,9 +110,9 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(ItemStack result) {
Map<Object, Object[]> recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes();
for(Map.Entry<Object, Object[]> 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))
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack[]) recipe.getValue()));
if(NEIServerUtils.areStacksSameType(((ItemStack[]) recipe.getValue()[0])[0], result) || NEIServerUtils.areStacksSameType(((ItemStack[]) recipe.getValue()[0])[1], result)
|| NEIServerUtils.areStacksSameType(((ItemStack[]) recipe.getValue()[0])[2], result) || NEIServerUtils.areStacksSameType(((ItemStack[]) recipe.getValue()[0])[3], result))
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack[]) recipe.getValue()[0], (boolean) recipe.getValue()[1], (int) recipe.getValue()[2]));
}
}
@ -122,7 +130,7 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
Map<Object, Object[]> recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes();
for(Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
if(compareFluidStacks(ingredient, (ItemStack) recipe.getKey()))
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack[]) recipe.getValue()));
this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack[]) recipe.getValue()[0], (boolean) recipe.getValue()[1], (int) recipe.getValue()[2]));
}
}
@ -133,11 +141,42 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler {
@Override
public void drawExtras(int recipe) {
drawProgressBar(3, 51 - 45, 176, 0, 16, 34, 480, 7);
drawProgressBar(69, 26, 208, 0, 33, 12, 200, 0);
SmeltingSet set = (SmeltingSet) this.arecipes.get(recipe);
drawProgressBar(79 - 5, 28 - 11, 208, 0, 44, 37, set.isHighSpeed ? 150 - 70 : 150, 0);
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
String centrifuges = set.centNumber + " G. Cents";
fontRenderer.drawString(centrifuges, (50 - fontRenderer.getStringWidth(centrifuges) / 2), 21 - 11, 65280);
}
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
@Override
public void loadTransferRects() {
transferRects.add(new RecipeTransferRect(new Rectangle(69, 26, 32, 12), "gascentprocessing"));
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(79 - 5, 26 - 11, 44, 40), "gascentprocessing"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(70 - 5, 36 - 11, 36, 12), "gascentprocessing"));
guiGui.add(GUIMachineGasCent.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
@Override
public void drawBackground(int recipe) {
super.drawBackground(recipe);
SmeltingSet set = (SmeltingSet) this.arecipes.get(recipe);
if(set.isHighSpeed)
drawTexturedModalRect(30 - 5, 35 - 11, 192, 0, 16, 16);
}
}

View File

@ -21,25 +21,25 @@ public class ContainerMachineGasCent extends Container {
//Output
for(int i = 0; i < 2; i++) {
for(int j = 0; j < 2; j++) {
this.addSlotToContainer(new SlotMachineOutput(tedf, j + i * 2, 133 + j * 18, 26 + i * 18));
this.addSlotToContainer(new SlotMachineOutput(tedf, j + i * 2, 71 + j * 18, 53 + i * 18));
}
}
//Battery
this.addSlotToContainer(new Slot(tedf, 4, 8, 53));
this.addSlotToContainer(new Slot(tedf, 4, 182, 71));
//Fluid ID IO
this.addSlotToContainer(new Slot(tedf, 5, 30, 35));
this.addSlotToContainer(new Slot(tedf, 5, 91, 15));
//upgrade
this.addSlotToContainer(new Slot(tedf, 6, 82, 19));
this.addSlotToContainer(new Slot(tedf, 6, 69, 15));
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));
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 180));
}
}

View File

@ -9,8 +9,10 @@ import com.hbm.tileentity.machine.TileEntityMachineGasCent;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class GUIMachineGasCent extends GuiInfoContainer {
@ -22,31 +24,42 @@ public class GUIMachineGasCent extends GuiInfoContainer {
super(new ContainerMachineGasCent(invPlayer, tedf));
gasCent = tedf;
this.xSize = 176;
this.ySize = 168;
this.xSize = 206;
this.ySize = 204;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
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"});
String[] inTankInfo = new String[] {gasCent.inputTank.getTankType().getName(), gasCent.inputTank.getFill() + " / " + gasCent.inputTank.getMaxFill() + " mB"};
if(gasCent.inputTank.getTankType().getIfHighSpeed()) {
if(gasCent.getProcessingSpeed() > gasCent.processingSpeed - 70)
inTankInfo[0] = EnumChatFormatting.DARK_RED + inTankInfo[0];
else
inTankInfo[0] = EnumChatFormatting.GOLD + inTankInfo[0];
}
String[] outTankInfo = new String[] {gasCent.outputTank.getTankType().getName(), gasCent.outputTank.getFill() + " / " + gasCent.outputTank.getMaxFill() + " mB"};
if(gasCent.outputTank.getTankType().getIfHighSpeed())
outTankInfo[0] = EnumChatFormatting.GOLD + outTankInfo[0];
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 51 - 34, 16, 34, gasCent.power, gasCent.maxPower);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 15, guiTop + 15, 24, 55, mouseX, mouseY, inTankInfo);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 137, guiTop + 15, 25, 55, mouseX, mouseY, outTankInfo);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 182, guiTop + 69 - 52, 16, 52, gasCent.power, gasCent.maxPower);
String[] enrichmentText = I18nUtil.resolveKeyArray("desc.gui.gasCent.enrichment");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 16, 16, 16, guiLeft - 8, guiTop + 16 + 16, enrichmentText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 12, guiTop + 16, 16, 16, guiLeft - 8, guiTop + 16 + 16, enrichmentText);
String[] transferText = I18nUtil.resolveKeyArray("desc.gui.gasCent.output");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 32, 16, 16, guiLeft - 8, guiTop + 32 + 16, transferText);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 12, guiTop + 32, 16, 16, guiLeft - 8, guiTop + 32 + 16, transferText);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
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(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@ -56,44 +69,50 @@ public class GUIMachineGasCent extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int i = (int)gasCent.getPowerRemainingScaled(34);
drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 176, 34 - i, 16, i);
int i = (int)gasCent.getPowerRemainingScaled(52);
drawTexturedModalRect(guiLeft + 182, guiTop + 69 - i, 206, 52 - i, 16, i);
int j = (int)gasCent.getCentrifugeProgressScaled(33);
drawTexturedModalRect(guiLeft + 74, guiTop + 37, 208, 0, j, 12);
int j = (int)gasCent.getCentrifugeProgressScaled(36);
drawTexturedModalRect(guiLeft + 70, guiTop + 35, 206, 52, j, 13);
int a = gasCent.getTankScaled(31, 0);
switch (gasCent.inputTank.getTankType()) {
case PF6:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 200, 31 - a, 8, a);
break;
case MUD:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 63 - a, 8, a);
break;
case MUD_HEAVY:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 63 - a, 8, a);
break;
case NONE:
break;
default:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 31 - a, 8, a);
}
this.renderTank(guiLeft + 16, guiTop + 16, this.zLevel, 6, 52, gasCent.inputTank.getFill(), gasCent.inputTank.getMaxFill());
this.renderTank(guiLeft + 32, guiTop + 16, this.zLevel, 6, 52, gasCent.inputTank.getFill(), gasCent.inputTank.getMaxFill());
int b = gasCent.getTankScaled(31, 1);
switch (gasCent.outputTank.getTankType()) {
case PF6:
drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 200, 31 - b, 8, b);
break;
case MUD_HEAVY:
drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 192, 63 - b, 8, b);
break;
case NONE:
break;
default:
drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 192, 31 - b, 8, b);
}
this.renderTank(guiLeft + 138, guiTop + 16, this.zLevel, 6, 52, gasCent.outputTank.getFill(), gasCent.outputTank.getMaxFill());
this.renderTank(guiLeft + 154, guiTop + 16, this.zLevel, 6, 52, gasCent.outputTank.getFill(), gasCent.outputTank.getMaxFill());
this.drawInfoPanel(guiLeft - 16, guiTop + 16, 16, 16, 3);
this.drawInfoPanel(guiLeft - 16, guiTop + 32, 16, 16, 2);
this.drawInfoPanel(guiLeft - 12, guiTop + 16, 16, 16, 3);
this.drawInfoPanel(guiLeft - 12, guiTop + 32, 16, 16, 2);
}
public void renderTank(int x, int y, double z, int width, int height, int fluid, int maxFluid) {
GL11.glEnable(GL11.GL_BLEND);
y += height;
Minecraft.getMinecraft().getTextureManager().bindTexture(gasCent.tank.getTankType().getTexture());
int i = (fluid * height) / maxFluid;
double minX = x;
double maxX = x + width;
double minY = y - height;
double maxY = y - (height - i);
double minV = 1D;
double maxV = 1D - i / 16D;
double minU = 0D;
double maxU = width / 16D;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(minX, maxY, z, minU, maxV);
tessellator.addVertexWithUV(maxX, maxY, z, maxU, maxV);
tessellator.addVertexWithUV(maxX, minY, z, maxU, minV);
tessellator.addVertexWithUV(minX, minY, z, minU, minV);
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
}
}

View File

@ -9,37 +9,41 @@ import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.I18nUtil;
import com.hbm.util.Tuple.Pair;
import net.minecraft.item.ItemStack;
public class GasCentrifugeRecipes {
//TODO: Change "String name" to I18n instead of unlocalized BS
public static enum PseudoFluidType {
NONE (0, 0, null, "Empty", false, (ItemStack[])null),
NONE (0, 0, null, false, (ItemStack[])null),
HEUF6 (300, 0, NONE, "High Enriched UF6", true, new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 1)),
MEUF6 (200, 100, HEUF6, "Medium Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1)),
LEUF6 (300, 200, MEUF6, "Low Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1), new ItemStack(ModItems.fluorite, 1)),
NUF6 (400, 300, LEUF6, "Natural UF6", false, new ItemStack(ModItems.nugget_u238, 1)),
HEUF6 (300, 0, NONE, true, new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 1)),
MEUF6 (200, 100, HEUF6, false, new ItemStack(ModItems.nugget_u238, 1)),
LEUF6 (300, 200, MEUF6, false, new ItemStack(ModItems.nugget_u238, 1), new ItemStack(ModItems.fluorite, 1)),
NUF6 (400, 300, LEUF6, false, new ItemStack(ModItems.nugget_u238, 1)),
PF6 (300, 0, NONE, "Plutonium Hexafluoride", false, new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)),
PF6 (300, 0, NONE, false, new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)),
MUD_HEAVY (500, 0, NONE, "Heavy Mud Fraction", false, new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.dust, 1), new ItemStack(ModItems.nuclear_waste_tiny, 1)),
MUD (1000, 500, MUD_HEAVY, "Poisonous Mud", false, new ItemStack(ModItems.powder_lead, 1), new ItemStack(ModItems.dust, 1));
MUD_HEAVY (500, 0, NONE, false, new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.dust, 1), new ItemStack(ModItems.nuclear_waste_tiny, 1)),
MUD (1000, 500, MUD_HEAVY, false, new ItemStack(ModItems.powder_lead, 1), new ItemStack(ModItems.dust, 1));
//TODO for bob: consider more fluid types
//Schraranium Trisulfide for more schrab-containing, pre-SILEX processing using the crystals?
//Gaseous Nuclear Waste: because why not? Large inputs could output Xe-135 and maybe some other fun stuff...
//
int fluidConsumed;
int fluidProduced;
PseudoFluidType outputFluid;
String name;
boolean isHighSpeed;
ItemStack[] output;
PseudoFluidType(int fluidConsumed, int fluidProduced, PseudoFluidType outputFluid, String name, boolean isHighSpeed, ItemStack... output) {
PseudoFluidType(int fluidConsumed, int fluidProduced, PseudoFluidType outputFluid, boolean isHighSpeed, ItemStack... output) {
this.fluidConsumed = fluidConsumed;
this.fluidProduced = fluidProduced;
this.outputFluid = outputFluid;
this.name = name;
this.isHighSpeed = isHighSpeed;
this.output = output;
}
@ -57,7 +61,7 @@ public class GasCentrifugeRecipes {
}
public String getName() {
return this.name;
return I18nUtil.resolveKey("hbmpseudofluid.".concat(this.toString().toLowerCase()));
}
public boolean getIfHighSpeed() {
@ -71,7 +75,8 @@ public class GasCentrifugeRecipes {
};
/* Recipe NEI Handler */
private static Map<FluidStack, ItemStack[]> gasCent = new HashMap();
//Fluid input; ItemStack[] outputs, isHighSpeed, # of centrifuges
private static Map<FluidStack, Object[]> gasCent = new HashMap();
//Iterators are lots of fun
public static Map<Object, Object[]> getGasCentrifugeRecipes() {
@ -79,10 +84,10 @@ public class GasCentrifugeRecipes {
Iterator itr = gasCent.entrySet().iterator();
while(itr.hasNext()) {
Map.Entry entry = (Entry) itr.next();
Map.Entry<Object, Object[]> entry = (Entry) itr.next();
FluidStack input = (FluidStack) entry.getKey();
ItemStack[] out = new ItemStack[4];
ItemStack[] outputs = (ItemStack[]) entry.getValue();
ItemStack[] outputs = (ItemStack[]) entry.getValue()[0];
for(int j = 0; j < outputs.length; j++) {
out[j] = outputs[j].copy();
@ -91,18 +96,20 @@ public class GasCentrifugeRecipes {
if(out[j] == null)
out[j] = new ItemStack(ModItems.nothing);
recipes.put(ItemFluidIcon.make(input.type, input.fill), outputs);
recipes.put(ItemFluidIcon.make(input.type, input.fill), new Object[] { out, entry.getValue()[1], entry.getValue()[2] });
}
return recipes;
}
public static void register() {
gasCent.put(new FluidStack(1200, Fluids.UF6), new ItemStack[]
{new ItemStack(ModItems.nugget_u238, 11), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 4)});
gasCent.put(new FluidStack(900, Fluids.PUF6), new ItemStack[]
{new ItemStack(ModItems.nugget_pu238, 3), new ItemStack(ModItems.nugget_pu_mix, 6), new ItemStack(ModItems.fluorite, 3)});
gasCent.put(new FluidStack(1000, Fluids.WATZ), new ItemStack[]
{new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lead, 1), new ItemStack(ModItems.nuclear_waste_tiny, 1), new ItemStack(ModItems.dust, 2)});
gasCent.put(new FluidStack(1200, Fluids.UF6), new Object[] { new ItemStack[]
{new ItemStack(ModItems.nugget_u238, 11), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 4)}, true, 4 });
gasCent.put(new FluidStack(1200, Fluids.UF6), new Object[] { new ItemStack[]
{new ItemStack(ModItems.nugget_u238, 6), new ItemStack(ModItems.nugget_uranium_fuel, 2), new ItemStack(ModItems.fluorite, 4)}, false, 2 });
gasCent.put(new FluidStack(900, Fluids.PUF6), new Object[] { new ItemStack[]
{new ItemStack(ModItems.nugget_pu238, 3), new ItemStack(ModItems.nugget_pu_mix, 6), new ItemStack(ModItems.fluorite, 3)}, false, 1 });
gasCent.put(new FluidStack(1000, Fluids.WATZ), new Object[] { new ItemStack[]
{new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lead, 1), new ItemStack(ModItems.nuclear_waste_tiny, 1), new ItemStack(ModItems.dust, 2)}, false, 2 });
}
}

View File

@ -767,7 +767,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.upgrade_centrifuge, 1), new Object[] { "PHP", "PUP", "DTD", 'P', ModItems.centrifuge_element, 'H', Blocks.hopper, 'U', ModItems.upgrade_shredder, 'D', ANY_PLASTIC.ingot(), 'T', ModBlocks.machine_transformer });
addRecipeAuto(new ItemStack(ModItems.upgrade_crystallizer, 1), new Object[] { "PHP", "CUC", "DTD", 'P', new ItemStack(ModItems.fluid_barrel_full, 1, Fluids.ACID.getID()), 'H', ModItems.circuit_targeting_tier4, 'C', ModBlocks.barrel_steel, 'U', ModItems.upgrade_centrifuge, 'D', ModItems.motor, 'T', ModBlocks.machine_transformer });
addRecipeAuto(new ItemStack(ModItems.upgrade_screm, 1), new Object[] { "SUS", "SCS", "SUS", 'S', STEEL.plate(), 'U', ModItems.upgrade_template, 'C', ModItems.crystal_xen });
addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"GNG", "RUR", "GMG", 'R', RUBBER.ingot(), 'M', ModItems.motor, 'G', ModItems.coil_gold, 'N', TCALLOY.ingot(), 'U', ModItems.upgrade_template});
addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"GNG", "RUR", "GMG", 'R', RUBBER.ingot(), 'M', ModItems.motor, 'G', ModItems.coil_gold, 'N', TCALLOY.ingot(), 'U', ModItems.upgrade_template}); //TODO: gate this behind the upwards gate of the oil chain when it exists
addRecipeAuto(new ItemStack(ModItems.mech_key, 1), new Object[] { "MCM", "MKM", "MMM", 'M', ModItems.ingot_meteorite_forged, 'C', ModItems.coin_maskman, 'K', ModItems.key });
addRecipeAuto(new ItemStack(ModItems.spawn_ufo, 1), new Object[] { "MMM", "DCD", "MMM", 'M', ModItems.ingot_meteorite, 'D', DNT.ingot(), 'C', ModItems.coin_worm });

View File

@ -42,9 +42,7 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
public PseudoFluidTank inputTank;
public PseudoFluidTank outputTank;
private static final int[] slots_io = new int[] { 0, 2, 3, 4 };
private static final int[] slots_bottom = new int[] {2, 3, 4};
private static final int[] slots_side = new int[] { };
private static final int[] slots_io = new int[] { 0, 1, 2, 3 };
private static HashMap<FluidType, PseudoFluidType> fluidConversions = new HashMap();
@ -105,15 +103,6 @@ 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() + this.inputTank.getTankType().getFluidProduced() <= outputTank.getMaxFill()) {
@ -161,7 +150,7 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
TileEntityMachineGasCent cent = (TileEntityMachineGasCent) te;
if(cent.tank.getFill() == 0 && cent.tank.getTankType() == tank.getTankType()) {
if(cent.inputTank.getTankType() != outputTank.getTankType()) {
if(cent.inputTank.getTankType() != outputTank.getTankType() && outputTank.getTankType() != PseudoFluidType.NONE) {
cent.inputTank.setTankType(outputTank.getTankType());
cent.outputTank.setTankType(outputTank.getTankType().getOutputType());
}
@ -198,11 +187,11 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
updateConnections();
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
power = Library.chargeTEFromItems(slots, 4, power, maxPower);
setTankType(5);
tank.updateTank(this);
if(fluidConversions.containsValue(inputTank.getTankType())) {
tank.updateTank(this);
attemptConversion();
}
@ -235,8 +224,12 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
//*AT THE MOMENT*, there's not really any need for a dedicated method for this. Yet.
if(!attemptTransfer(te) && this.inputTank.getTankType() == PseudoFluidType.LEUF6) {
if(this.outputTank.getFill() >= 100 && InventoryUtil.tryAddItemToInventory(slots, 0, 3, new ItemStack(ModItems.nugget_uranium_fuel)) == null) {
this.outputTank.setFill(this.outputTank.getFill() - 100);
ItemStack[] converted = new ItemStack[] { new ItemStack(ModItems.nugget_uranium_fuel, 6), new ItemStack(ModItems.fluorite) };
if(this.outputTank.getFill() >= 600 && InventoryUtil.doesArrayHaveSpace(slots, 0, 3, converted)) {
this.outputTank.setFill(this.outputTank.getFill() - 600);
for(ItemStack stack : converted)
InventoryUtil.tryAddItemToInventory(slots, 0, 3, stack);
}
}
}

View File

@ -47,17 +47,32 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
double heatProvided = this.heat - heatCap;
if(heatProvided > 0) {
int waterUsed = (int)Math.floor(heatProvided / RBMKDials.getBoilerHeatConsumption(worldObj));
waterUsed = Math.min(waterUsed, feed.getFill());
feed.setFill(feed.getFill() - waterUsed);
int steamProduced = (int)Math.floor((waterUsed * 100) / getFactorFromSteam(steam.getTankType()));
steam.setFill(steam.getFill() + steamProduced);
double HEAT_PER_MB_WATER = RBMKDials.getBoilerHeatConsumption(worldObj);
double steamFactor = getFactorFromSteam(steam.getTankType());
int waterUsed;
int steamProduced;
if(steam.getFill() > steam.getMaxFill()) {
steam.setFill(steam.getMaxFill());
if(steam.getTankType() == Fluids.ULTRAHOTSTEAM) {
steamProduced = (int)Math.floor((heatProvided / HEAT_PER_MB_WATER) * 100D / steamFactor);
waterUsed = (int)Math.floor(steamProduced / 100D * steamFactor);
if(feed.getFill() < waterUsed) {
steamProduced = (int)Math.floor(feed.getFill() * 100D / steamFactor);
waterUsed = (int)Math.floor(steamProduced / 100D * steamFactor);
}
} else {
waterUsed = (int)Math.floor(heatProvided / HEAT_PER_MB_WATER);
waterUsed = Math.min(waterUsed, feed.getFill());
steamProduced = (int)Math.floor((waterUsed * 100D) / steamFactor);
}
this.heat -= waterUsed * RBMKDials.getBoilerHeatConsumption(worldObj);
feed.setFill(feed.getFill() - waterUsed);
steam.setFill(steam.getFill() + steamProduced);
if(steam.getFill() > steam.getMaxFill())
steam.setFill(steam.getMaxFill());
this.heat -= waterUsed * HEAT_PER_MB_WATER;
}
fillFluidInit(steam.getTankType());

View File

@ -758,6 +758,14 @@ hbmfluid.water=Water
hbmfluid.watz=Poisonous Mud
hbmfluid.xenon=Xenon Gas
hbmfluid.xpjuice=Experience Juice
hbmpseudofluid.none=Empty
hbmpseudofluid.heuf6=Highly Enriched UF6
hbmpseudofluid.meuf6=Medium Enriched UF6
hbmpseudofluid.leuf6=Low Enriched UF6
hbmpseudofluid.nuf6=Natural UF6
hbmpseudofluid.pf6=Plutonium Hexafluoride
hbmpseudofluid.mud_heavy=Heavy Sludge Fraction
hbmpseudofluid.mud=Poisonous Sludge Gas
info.coil=Coil Strength
info.templatefolder=Created with %s

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB