This commit is contained in:
Bob 2025-11-17 22:19:49 +01:00
parent 2e00964514
commit c33d717631
11 changed files with 131 additions and 13 deletions

View File

@ -63,3 +63,4 @@
* Fixed assembly and chemical factories not properly saving their recipe fluid buffers
* Fixed light blue and light gray dyes not working when dyeing cables
* Fixed bismuth armor not having a valid repair material
* Fixed compressors needing at least one mB of fluid more to process a recipe than necessary

View File

@ -50,7 +50,11 @@ public class GUIFusionKlystron extends GuiInfoContainer {
super.drawScreen(mouseX, mouseY, interp);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 52, klystron.power, klystron.getMaxPower());
drawCustomInfoStat(mouseX, mouseY, guiLeft + 43, guiTop + 71, 18, 18, mouseX, mouseY, BobMathUtil.getShortNumber(klystron.output) + "KyU / " + BobMathUtil.getShortNumber(klystron.outputTarget) + "KyU");
klystron.compair.renderTankInfo(this, mouseX, mouseY, guiLeft + 76, guiTop + 71, 18, 18);
drawCustomInfoStat(mouseX, mouseY, guiLeft + 115, guiTop + 71, 18, 18, mouseX, mouseY, BobMathUtil.getShortNumber(klystron.output) + "HE / " + BobMathUtil.getShortNumber(klystron.outputTarget) + "HE");
}
@Override
@ -83,12 +87,12 @@ public class GUIFusionKlystron extends GuiInfoContainer {
// power LED
if(powerGauge >= 0.5 && klystron.output > 0) drawTexturedModalRect(guiLeft + 160, guiTop + 71, 210, 8, 8, 8);
else if(powerGauge < 0.5 && klystron.output > 0) drawTexturedModalRect(guiLeft + 160, guiTop + 71, 210, 0, 8, 8);
else if(powerGauge > 0) drawTexturedModalRect(guiLeft + 160, guiTop + 71, 210, 0, 8, 8);
// cooling LED
if(airGauge >= 0.5 && klystron.output > 0) drawTexturedModalRect(guiLeft + 170, guiTop + 71, 210, 8, 8, 8);
else if(airGauge < 0.5 && klystron.output > 0) drawTexturedModalRect(guiLeft + 170, guiTop + 71, 210, 0, 8, 8);
else if(airGauge > 0) drawTexturedModalRect(guiLeft + 170, guiTop + 71, 210, 0, 8, 8);
// action LED
if(klystron.output >= klystron.outputTarget) drawTexturedModalRect(guiLeft + 180, guiTop + 71, 210, 8, 8, 8);
if(klystron.output >= klystron.outputTarget && klystron.output > 0) drawTexturedModalRect(guiLeft + 180, guiTop + 71, 210, 8, 8, 8);
else if(klystron.output > 0) drawTexturedModalRect(guiLeft + 180, guiTop + 71, 210, 0, 8, 8);
// output energy

View File

@ -40,10 +40,25 @@ public class GUIFusionTorus extends GuiInfoContainer {
torus.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 52);
torus.coolantTanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 188, guiTop + 46, 16, 52);
torus.coolantTanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 206, guiTop + 46, 16, 52);
FusionRecipe recipe = (FusionRecipe) FusionRecipes.INSTANCE.recipeNameMap.get(this.torus.fusionModule.recipe);
if(recipe != null) {
drawCustomInfoStat(mouseX, mouseY, guiLeft + 43, guiTop + 115, 18, 18, mouseX, mouseY, BobMathUtil.getShortNumber(torus.klystronEnergy) + "KyU / " + BobMathUtil.getShortNumber(recipe.ignitionTemp) + "KyU");
drawCustomInfoStat(mouseX, mouseY, guiLeft + 79, guiTop + 115, 18, 18, mouseX, mouseY, BobMathUtil.getShortNumber(torus.plasmaEnergy) + "TU / " + BobMathUtil.getShortNumber(recipe.outputTemp) + "TU");
String[] lines = new String[recipe.inputFluid.length];
for(int i = 0; i < lines.length; i++) {
int consumption = (int) Math.ceil(recipe.inputFluid[i].fill * torus.fuelConsumption);
lines[i] = consumption + "mB/t " + recipe.inputFluid[i].type.getLocalizedName();
}
drawCustomInfoStat(mouseX, mouseY, guiLeft + 115, guiTop + 115, 18, 18, mouseX, mouseY, lines);
} else {
drawCustomInfoStat(mouseX, mouseY, guiLeft + 43, guiTop + 115, 18, 18, mouseX, mouseY, "0KyU / 0KyU");
drawCustomInfoStat(mouseX, mouseY, guiLeft + 79, guiTop + 115, 18, 18, mouseX, mouseY, "0TU / 0TU");
}
if(guiLeft + 43 <= mouseX && guiLeft + 43 + 18 > mouseX && guiTop + 80 < mouseY && guiTop + 80 + 18 >= mouseY) {
if(this.torus.fusionModule.recipe != null && FusionRecipes.INSTANCE.recipeNameMap.containsKey(this.torus.fusionModule.recipe)) {
FusionRecipe recipe = (FusionRecipe) FusionRecipes.INSTANCE.recipeNameMap.get(this.torus.fusionModule.recipe);
if(recipe != null) {
this.func_146283_a(recipe.print(), mouseX, mouseY);
} else {
this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY);
@ -112,10 +127,8 @@ public class GUIFusionTorus extends GuiInfoContainer {
drawTexturedModalRect(guiLeft + 92, guiTop + 76, 246, 0, 3, 6);
}
double demoGauge = BobMathUtil.sps((Minecraft.getMinecraft().theWorld.getTotalWorldTime() + interp) * 0.25) / 2 + 0.5D;
double inputGauge = recipe == null ? 0 : Math.min(((double) torus.klystronEnergy / (double) recipe.ignitionTemp), 1.5) / 1.5D;
double outputGauge = recipe == null ? 0 : Math.min(((double) torus.plasmaEnergy / (double) recipe.outputTemp), 1.5) / 1.5D;
double outputGauge = recipe == null ? 0 : Math.min(((double) torus.plasmaEnergy / (double) recipe.outputTemp), 1);
// input energy
GaugeUtil.drawSmoothGauge(guiLeft + 52, guiTop + 124, this.zLevel, inputGauge, 5, 2, 1, 0xA00000);

View File

@ -42,6 +42,8 @@ public class ModuleMachineFusion extends ModuleMachineBase {
@Override
protected boolean hasInput(GenericRecipe recipe) {
if(processSpeed <= 0) return false;
if(recipe.inputFluid != null) {
for(int i = 0; i < Math.min(recipe.inputFluid.length, inputTanks.length); i++) {
if(inputTanks[i].getFill() > 0 && inputTanks[i].getFill() < (int) Math.ceil(recipe.inputFluid[i].fill * processSpeed)) return false;

View File

@ -161,7 +161,7 @@ public abstract class TileEntityMachineCompressorBase extends TileEntityMachineB
return tanks[0].getFill() >= 1000 && tanks[1].getFill() + 1000 <= tanks[1].getMaxFill();
}
return tanks[0].getFill() > recipe.inputAmount && tanks[1].getFill() + recipe.output.fill <= tanks[1].getMaxFill();
return tanks[0].getFill() >= recipe.inputAmount && tanks[1].getFill() + recipe.output.fill <= tanks[1].getMaxFill();
}
public void process() {

View File

@ -1,12 +1,52 @@
package com.hbm.tileentity.machine.fusion;
import com.hbm.uninos.GenNode;
import com.hbm.uninos.UniNodespace;
import com.hbm.uninos.networkproviders.PlasmaNetworkProvider;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.util.fauxpointtwelve.DirPos;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityFusionBreeder extends TileEntity {
protected GenNode plasmaNode;
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(plasmaNode == null || plasmaNode.expired) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getOpposite();
plasmaNode = UniNodespace.getNode(worldObj, xCoord + dir.offsetX * 2, yCoord + 2, zCoord + dir.offsetZ * 2, PlasmaNetworkProvider.THE_PROVIDER);
if(plasmaNode == null) {
plasmaNode = new GenNode(PlasmaNetworkProvider.THE_PROVIDER,
new BlockPos(xCoord + dir.offsetX * 2, yCoord + 2, zCoord + dir.offsetZ * 2))
.setConnections(new DirPos(xCoord + dir.offsetX * 3, yCoord + 2, zCoord + dir.offsetZ * 3, dir));
UniNodespace.createNode(worldObj, plasmaNode);
}
}
if(plasmaNode != null && plasmaNode.hasValidNet()) plasmaNode.net.addReceiver(this);
}
}
@Override
public void invalidate() {
super.invalidate();
if(!worldObj.isRemote) {
if(this.plasmaNode != null) UniNodespace.destroyNode(worldObj, plasmaNode);
}
}
AxisAlignedBB bb = null;
@Override

View File

@ -1,12 +1,52 @@
package com.hbm.tileentity.machine.fusion;
import com.hbm.uninos.GenNode;
import com.hbm.uninos.UniNodespace;
import com.hbm.uninos.networkproviders.PlasmaNetworkProvider;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.util.fauxpointtwelve.DirPos;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityFusionCollector extends TileEntity {
protected GenNode plasmaNode;
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(plasmaNode == null || plasmaNode.expired) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getOpposite();
plasmaNode = UniNodespace.getNode(worldObj, xCoord + dir.offsetX * 2, yCoord + 2, zCoord + dir.offsetZ * 2, PlasmaNetworkProvider.THE_PROVIDER);
if(plasmaNode == null) {
plasmaNode = new GenNode(PlasmaNetworkProvider.THE_PROVIDER,
new BlockPos(xCoord + dir.offsetX * 2, yCoord + 2, zCoord + dir.offsetZ * 2))
.setConnections(new DirPos(xCoord + dir.offsetX * 3, yCoord + 2, zCoord + dir.offsetZ * 3, dir));
UniNodespace.createNode(worldObj, plasmaNode);
}
}
if(plasmaNode != null && plasmaNode.hasValidNet()) plasmaNode.net.addReceiver(this);
}
}
@Override
public void invalidate() {
super.invalidate();
if(!worldObj.isRemote) {
if(this.plasmaNode != null) UniNodespace.destroyNode(worldObj, plasmaNode);
}
}
AxisAlignedBB bb = null;
@Override

View File

@ -89,6 +89,8 @@ public class TileEntityFusionKlystron extends TileEntityMachineBase implements I
this.compair.setFill(this.compair.getFill() - airReq);
}
if(output < outputTarget / 50) output = 0;
if(klystronNode == null || klystronNode.expired) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getOpposite();
klystronNode = UniNodespace.getNode(worldObj, xCoord + dir.offsetX * 4, yCoord + 2, zCoord + dir.offsetZ * 4, KlystronNetworkProvider.THE_PROVIDER);

View File

@ -1,5 +1,7 @@
package com.hbm.tileentity.machine.fusion;
import java.util.Map.Entry;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerFusionTorus;
import com.hbm.inventory.fluid.Fluids;
@ -120,10 +122,23 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
this.power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
int collectors = 0;
for(int i = 0; i < 4; i++) {
connections[i] = false;
if(klystronNodes[i] != null && klystronNodes[i].hasValidNet() && !klystronNodes[i].net.providerEntries.isEmpty()) connections[i] = true;
if(!connections[i] && plasmaNodes[i] != null && plasmaNodes[i].hasValidNet() && !plasmaNodes[i].net.receiverEntries.isEmpty()) connections[i] = true;
if(plasmaNodes[i] != null && plasmaNodes[i].hasValidNet() && !plasmaNodes[i].net.receiverEntries.isEmpty()) {
for(Object o : plasmaNodes[i].net.receiverEntries.entrySet()) {
Entry<Object, Long> entry = (Entry<Object, Long>) o;
if(entry.getKey() instanceof TileEntityFusionCollector) {
collectors++;
}
break;
}
}
}
FusionRecipe recipe = (FusionRecipe) this.fusionModule.getRecipe();
@ -132,14 +147,15 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
double fuel0Factor = recipe != null && recipe.inputFluid.length > 0 ? getSpeedScaled(tanks[0].getMaxFill(), tanks[0].getFill()) : 1D;
double fuel1Factor = recipe != null && recipe.inputFluid.length > 1 ? getSpeedScaled(tanks[1].getMaxFill(), tanks[1].getFill()) : 1D;
double fuel2Factor = recipe != null && recipe.inputFluid.length > 2 ? getSpeedScaled(tanks[2].getMaxFill(), tanks[2].getFill()) : 1D;
double klystronFactor = recipe != null ? getSpeedScaled(recipe.ignitionTemp, this.klystronEnergy) : 1D;
double factor = BobMathUtil.min(powerFactor, fuel0Factor, fuel1Factor, fuel2Factor, klystronFactor);
double factor = BobMathUtil.min(powerFactor, fuel0Factor, fuel1Factor, fuel2Factor);
boolean ignition = recipe != null ? recipe.ignitionTemp <= this.klystronEnergy : true;
this.plasmaEnergy = 0;
this.fuelConsumption = 0;
this.fusionModule.preUpdate(factor, 0.5D);
this.fusionModule.update(1D, 1D, this.isCool(), slots[1]);
this.fusionModule.preUpdate(factor, collectors * 0.5D);
this.fusionModule.update(1D, 1D, this.isCool() && ignition, slots[1]);
this.didProcess = this.fusionModule.didProcess;
if(this.fusionModule.markDirty) this.markDirty();
if(didProcess && recipe != null) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB