mh yes plas ma

This commit is contained in:
Bob 2026-03-19 23:56:55 +01:00
parent 6c68778fd0
commit 399f51097d
12 changed files with 7078 additions and 6877 deletions

View File

@ -3,12 +3,14 @@ package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachinePlasmaForge; import com.hbm.inventory.container.ContainerMachinePlasmaForge;
import com.hbm.inventory.recipes.AssemblyMachineRecipes; import com.hbm.inventory.recipes.PlasmaForgeRecipe;
import com.hbm.inventory.recipes.PlasmaForgeRecipes; import com.hbm.inventory.recipes.PlasmaForgeRecipes;
import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.inventory.recipes.loader.GenericRecipe;
import com.hbm.items.machine.ItemBlueprints; import com.hbm.items.machine.ItemBlueprints;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.render.util.GaugeUtil;
import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge; import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge;
import com.hbm.util.BobMathUtil;
import com.hbm.util.i18n.I18nUtil; import com.hbm.util.i18n.I18nUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -22,11 +24,11 @@ import net.minecraft.util.ResourceLocation;
public class GUIMachinePlasmaForge extends GuiInfoContainer { public class GUIMachinePlasmaForge extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_fusion_plasmaforge.png"); private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_fusion_plasmaforge.png");
private TileEntityFusionPlasmaForge assembler; private TileEntityFusionPlasmaForge forge;
public GUIMachinePlasmaForge(InventoryPlayer invPlayer, TileEntityFusionPlasmaForge tedf) { public GUIMachinePlasmaForge(InventoryPlayer invPlayer, TileEntityFusionPlasmaForge tedf) {
super(new ContainerMachinePlasmaForge(invPlayer, tedf)); super(new ContainerMachinePlasmaForge(invPlayer, tedf));
assembler = tedf; forge = tedf;
this.xSize = 176; this.xSize = 176;
this.ySize = 244; this.ySize = 244;
@ -36,30 +38,38 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
public void drawScreen(int mouseX, int mouseY, float f) { public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f); super.drawScreen(mouseX, mouseY, f);
assembler.inputTank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 18, 16, 52); forge.inputTank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 18, 16, 52);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 62, assembler.power, assembler.maxPower); this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 62, forge.power, forge.maxPower);
if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 80 < mouseY && guiTop + 80 + 18 >= mouseY) { if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 80 < mouseY && guiTop + 80 + 18 >= mouseY) {
if(this.assembler.plasmaModule.recipe != null && PlasmaForgeRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.plasmaModule.recipe)) { if(this.forge.plasmaModule.recipe != null && PlasmaForgeRecipes.INSTANCE.recipeNameMap.containsKey(this.forge.plasmaModule.recipe)) {
GenericRecipe recipe = (GenericRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(this.assembler.plasmaModule.recipe); GenericRecipe recipe = (GenericRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(this.forge.plasmaModule.recipe);
this.func_146283_a(recipe.print(), mouseX, mouseY); this.func_146283_a(recipe.print(), mouseX, mouseY);
} else { } else {
this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY);
} }
} }
PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(forge.plasmaModule.recipe);
if(recipe != null) {
drawCustomInfoStat(mouseX, mouseY, guiLeft + 25, guiTop + 115, 18, 18, mouseX, mouseY, EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(forge.plasmaEnergySync) + "KyU / " + BobMathUtil.getShortNumber(recipe.ignitionTemp) + "KyU");
} else {
drawCustomInfoStat(mouseX, mouseY, guiLeft + 25, guiTop + 115, 18, 18, mouseX, mouseY, "0TU / 0TU");
}
} }
@Override @Override
protected void mouseClicked(int x, int y, int button) { protected void mouseClicked(int x, int y, int button) {
super.mouseClicked(x, y, button); super.mouseClicked(x, y, button);
if(this.checkClick(x, y, 7, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(PlasmaForgeRecipes.INSTANCE, assembler, assembler.plasmaModule.recipe, 0, ItemBlueprints.grabPool(assembler.slots[1]), this); if(this.checkClick(x, y, 7, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(PlasmaForgeRecipes.INSTANCE, forge, forge.plasmaModule.recipe, 0, ItemBlueprints.grabPool(forge.slots[1]), this);
} }
@Override @Override
protected void drawGuiContainerForegroundLayer(int i, int j) { protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.assembler.hasCustomInventoryName() ? this.assembler.getInventoryName() : I18n.format(this.assembler.getInventoryName()); String name = this.forge.hasCustomInventoryName() ? this.forge.getInventoryName() : I18n.format(this.forge.getInventoryName());
this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
@ -71,35 +81,43 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture); Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int p = (int) (assembler.power * 61 / assembler.maxPower); int p = (int) (forge.power * 61 / forge.maxPower);
drawTexturedModalRect(guiLeft + 152, guiTop + 79 - p, 176, 61 - p, 16, p); drawTexturedModalRect(guiLeft + 152, guiTop + 80 - p, 176, 62 - p, 16, p);
if(assembler.plasmaModule.progress > 0) { if(forge.plasmaModule.progress > 0) {
int j = (int) Math.ceil(70 * assembler.plasmaModule.progress); int j = (int) Math.ceil(70 * forge.plasmaModule.progress);
drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16); drawTexturedModalRect(guiLeft + 62, guiTop + 81, 176, 62, j, 16);
} }
GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.plasmaModule.recipe); PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(forge.plasmaModule.recipe);
/// LEFT LED /// LEFT LED
if(assembler.didProcess) { if(forge.didProcess) {
drawTexturedModalRect(guiLeft + 51, guiTop + 76, 195, 0, 3, 6); drawTexturedModalRect(guiLeft + 51, guiTop + 76, 195, 0, 3, 6);
} else if(recipe != null) { } else if(recipe != null) {
drawTexturedModalRect(guiLeft + 51, guiTop + 76, 192, 0, 3, 6); drawTexturedModalRect(guiLeft + 51, guiTop + 76, 192, 0, 3, 6);
} }
/// RIGHT LED /// RIGHT LED
if(assembler.didProcess) { if(forge.didProcess) {
drawTexturedModalRect(guiLeft + 56, guiTop + 76, 195, 0, 3, 6); drawTexturedModalRect(guiLeft + 56, guiTop + 76, 195, 0, 3, 6);
} else if(recipe != null && assembler.power >= recipe.power) { } else if(recipe != null && forge.power >= recipe.power) {
drawTexturedModalRect(guiLeft + 56, guiTop + 76, 192, 0, 3, 6); drawTexturedModalRect(guiLeft + 56, guiTop + 76, 192, 0, 3, 6);
} }
this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 8, 80); double inputGauge = recipe == null ? 0 : Math.min(((double) forge.plasmaEnergySync / (double) recipe.ignitionTemp), 1.5) / 1.5D;
double boosterGauge = 0;
// input energy
GaugeUtil.drawSmoothGauge(guiLeft + 34, guiTop + 124, this.zLevel, inputGauge, 5, 2, 1, 0xA00000);
// output genergy
GaugeUtil.drawSmoothGauge(guiLeft + 70, guiTop + 124, this.zLevel, boosterGauge, 5, 2, 1, 0xA00000);
this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 8, 81);
if(recipe != null && recipe.inputItem != null) { if(recipe != null && recipe.inputItem != null) {
for(int i = 0; i < recipe.inputItem.length; i++) { for(int i = 0; i < recipe.inputItem.length; i++) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(assembler.plasmaModule.inputSlots[i]); Slot slot = (Slot) this.inventorySlots.inventorySlots.get(forge.plasmaModule.inputSlots[i]);
if(!slot.getHasStack()) this.renderItem(recipe.inputItem[i].extractForCyclingDisplay(20), slot.xDisplayPosition, slot.yDisplayPosition, 10F); if(!slot.getHasStack()) this.renderItem(recipe.inputItem[i].extractForCyclingDisplay(20), slot.xDisplayPosition, slot.yDisplayPosition, 10F);
} }
@ -109,7 +127,7 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
this.zLevel = 300F; this.zLevel = 300F;
for(int i = 0; i < recipe.inputItem.length; i++) { for(int i = 0; i < recipe.inputItem.length; i++) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(assembler.plasmaModule.inputSlots[i]); Slot slot = (Slot) this.inventorySlots.inventorySlots.get(forge.plasmaModule.inputSlots[i]);
if(!slot.getHasStack()) drawTexturedModalRect(guiLeft + slot.xDisplayPosition, guiTop + slot.yDisplayPosition, slot.xDisplayPosition, slot.yDisplayPosition, 16, 16); if(!slot.getHasStack()) drawTexturedModalRect(guiLeft + slot.xDisplayPosition, guiTop + slot.yDisplayPosition, slot.xDisplayPosition, slot.yDisplayPosition, 16, 16);
} }
this.zLevel = 0F; this.zLevel = 0F;
@ -117,6 +135,6 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
} }
assembler.inputTank.renderTank(guiLeft + 80, guiTop + 70, this.zLevel, 16, 52); forge.inputTank.renderTank(guiLeft + 80, guiTop + 70, this.zLevel, 16, 52);
} }
} }

View File

@ -0,0 +1,33 @@
package com.hbm.inventory.recipes;
import java.util.ArrayList;
import java.util.List;
import com.hbm.inventory.recipes.loader.GenericRecipe;
import com.hbm.util.BobMathUtil;
import com.hbm.util.i18n.I18nUtil;
import net.minecraft.util.EnumChatFormatting;
public class PlasmaForgeRecipe extends GenericRecipe {
// minimum plasma energy to perform the recipe
public long ignitionTemp;
public PlasmaForgeRecipe(String name) { super(name); }
public PlasmaForgeRecipe setInputEnergy(long ignitionTemp) { this.ignitionTemp = ignitionTemp; return this; }
public List<String> print() {
List<String> list = new ArrayList();
list.add(EnumChatFormatting.YELLOW + this.getLocalizedName());
duration(list);
power(list);
list.add(EnumChatFormatting.LIGHT_PURPLE + I18nUtil.resolveKey("gui.recipe.fusionIn") + ": " + BobMathUtil.getShortNumber(ignitionTemp) + "TU/t");
input(list);
output(list);
return list;
}
}

View File

@ -2,10 +2,14 @@ package com.hbm.inventory.recipes;
import static com.hbm.inventory.OreDictManager.*; import static com.hbm.inventory.OreDictManager.*;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.BlockICFLaserComponent.EnumICFPart; import com.hbm.blocks.machine.BlockICFLaserComponent.EnumICFPart;
import com.hbm.inventory.FluidStack; import com.hbm.inventory.FluidStack;
@ -24,7 +28,7 @@ import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class PlasmaForgeRecipes extends GenericRecipes<GenericRecipe> { public class PlasmaForgeRecipes extends GenericRecipes<PlasmaForgeRecipe> {
public static final PlasmaForgeRecipes INSTANCE = new PlasmaForgeRecipes(); public static final PlasmaForgeRecipes INSTANCE = new PlasmaForgeRecipes();
@ -34,68 +38,68 @@ public class PlasmaForgeRecipes extends GenericRecipes<GenericRecipe> {
@Override public int outputFluidLimit() { return 0; } @Override public int outputFluidLimit() { return 0; }
@Override public String getFileName() { return "hbmPlasmaForge.json"; } @Override public String getFileName() { return "hbmPlasmaForge.json"; }
@Override public GenericRecipe instantiateRecipe(String name) { return new GenericRecipe(name); } @Override public PlasmaForgeRecipe instantiateRecipe(String name) { return new PlasmaForgeRecipe(name); }
@Override @Override
public void registerDefaults() { public void registerDefaults() {
// Plates // Plates
this.register(new GenericRecipe("plsm.plateeuphemium").setup(600, 100).outputItems(new ItemStack(ModItems.plate_euphemium, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.plateeuphemium").setInputEnergy(1_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModItems.plate_euphemium, 1))
.inputItems(new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 3), new OreDictStack(BI.dust(), 1), new OreDictStack(VOLCANIC.gem(), 1), new OreDictStack(OSMIRIDIUM.ingot()))); .inputItems(new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 3), new OreDictStack(BI.dust(), 1), new OreDictStack(VOLCANIC.gem(), 1), new OreDictStack(OSMIRIDIUM.ingot())));
this.register(new GenericRecipe("plsm.platednt").setup(600, 100).outputItems(new ItemStack(ModItems.plate_dineutronium, 4)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.platednt").setInputEnergy(1_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModItems.plate_dineutronium, 4))
.inputItems(new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1))); .inputItems(new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1)));
// ICF // ICF
this.register(new GenericRecipe("plsm.icfcell").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.CELL.ordinal())) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfcell").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.CELL.ordinal()))
.inputItems(new ComparableStack(ModItems.ingot_cft, 2), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new ComparableStack(ModBlocks.glass_quartz, 16)) .inputItems(new ComparableStack(ModItems.ingot_cft, 2), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new ComparableStack(ModBlocks.glass_quartz, 16))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 2, EnumExpensiveType.BRONZE_TUBES), new ComparableStack(ModItems.ingot_cft, 8), new ComparableStack(ModBlocks.glass_quartz, 16)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 2, EnumExpensiveType.BRONZE_TUBES), new ComparableStack(ModItems.ingot_cft, 8), new ComparableStack(ModBlocks.glass_quartz, 16))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfemitter").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.EMITTER.ordinal())) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfemitter").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.EMITTER.ordinal()))
.inputItems(new OreDictStack(W.plateWelded(), 4), new OreDictStack(MAGTUNG.wireDense(), 16)) .inputItems(new OreDictStack(W.plateWelded(), 4), new OreDictStack(MAGTUNG.wireDense(), 16))
.inputItemsEx(new OreDictStack(W.plateWelded(), 8), new OreDictStack(MAGTUNG.wireDense(), 16)) .inputItemsEx(new OreDictStack(W.plateWelded(), 8), new OreDictStack(MAGTUNG.wireDense(), 16))
.inputFluids(new FluidStack(Fluids.XENON, 16_000)) .inputFluids(new FluidStack(Fluids.XENON, 16_000))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfcapacitor").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.CAPACITOR.ordinal())) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfcapacitor").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.CAPACITOR.ordinal()))
.inputItems(new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 1), new OreDictStack(ND.wireDense(), 16), new OreDictStack(SBD.wireDense(), 2)) .inputItems(new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 1), new OreDictStack(ND.wireDense(), 16), new OreDictStack(SBD.wireDense(), 2))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 3, EnumExpensiveType.FERRO_PLATING), new OreDictStack(ND.wireDense(), 16), new OreDictStack(SBD.wireDense(), 2)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 3, EnumExpensiveType.FERRO_PLATING), new OreDictStack(ND.wireDense(), 16), new OreDictStack(SBD.wireDense(), 2))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfturbo").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.TURBO.ordinal())) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfturbo").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.TURBO.ordinal()))
.inputItems(new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 2), new OreDictStack(DNT.wireDense(), 4), new OreDictStack(SBD.wireDense(), 4)) .inputItems(new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 2), new OreDictStack(DNT.wireDense(), 4), new OreDictStack(SBD.wireDense(), 4))
.inputItemsEx(new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 8), new OreDictStack(DNT.wireDense(), 8), new OreDictStack(SBD.wireDense(), 4)) .inputItemsEx(new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 8), new OreDictStack(DNT.wireDense(), 8), new OreDictStack(SBD.wireDense(), 4))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfcasing").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.CASING.ordinal())) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfcasing").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.CASING.ordinal()))
.inputItems(new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new OreDictStack(BIGMT.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16)) .inputItems(new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new OreDictStack(BIGMT.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(BIGMT.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(BIGMT.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfport").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.PORT.ordinal())) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfport").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_laser_component, 1, EnumICFPart.PORT.ordinal()))
.inputItems(new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new OreDictStack(ND.wireDense(), 16)) .inputItems(new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new OreDictStack(ND.wireDense(), 16))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new OreDictStack(ND.wireDense(), 16)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new OreDictStack(ND.wireDense(), 16))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfcontroller").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_controller, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfcontroller").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_controller, 1))
.inputItems(new ComparableStack(ModItems.ingot_cft, 16), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.BISMOID)) .inputItems(new ComparableStack(ModItems.ingot_cft, 16), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 4), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.BISMOID))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.BRONZE_TUBES), new ComparableStack(ModItems.ingot_cft, 16), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new ComparableStack(ModItems.circuit, 32, EnumCircuitType.BISMOID), new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.COMPUTER)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.BRONZE_TUBES), new ComparableStack(ModItems.ingot_cft, 16), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new ComparableStack(ModItems.circuit, 32, EnumCircuitType.BISMOID), new ComparableStack(ModItems.item_expensive, 4, EnumExpensiveType.COMPUTER))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfscaffold").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_component, 1, 0)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfscaffold").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_component, 1, 0))
.inputItems(new OreDictStack(STEEL.plateWelded(), 4), new OreDictStack(TI.plateWelded(), 2)) .inputItems(new OreDictStack(STEEL.plateWelded(), 4), new OreDictStack(TI.plateWelded(), 2))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 8, EnumExpensiveType.STEEL_PLATING)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 8, EnumExpensiveType.STEEL_PLATING))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfvessel").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_component, 1, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfvessel").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_component, 1, 1))
.inputItems(new ComparableStack(ModItems.ingot_cft, 1), new OreDictStack(CMB.plateCast(), 1), new OreDictStack(W.plateWelded(), 2)) .inputItems(new ComparableStack(ModItems.ingot_cft, 1), new OreDictStack(CMB.plateCast(), 1), new OreDictStack(W.plateWelded(), 2))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfstructural").setup(200, 100).outputItems(new ItemStack(ModBlocks.icf_component, 1, 3)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfstructural").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.icf_component, 1, 3))
.inputItems(new OreDictStack(STEEL.plateWelded(), 2), new OreDictStack(CU.plateWelded(), 2), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 1)) .inputItems(new OreDictStack(STEEL.plateWelded(), 2), new OreDictStack(CU.plateWelded(), 2), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 1))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 1, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(STEEL.plateWelded(), 8)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 1, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(STEEL.plateWelded(), 8))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfcore").setup(1_200, 100).outputItems(new ItemStack(ModBlocks.struct_icf_core, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfcore").setInputEnergy(1_000_000).setup(1_200, 10_000_000).outputItems(new ItemStack(ModBlocks.struct_icf_core, 1))
.inputItems(new OreDictStack(CMB.plateWelded(), 16), new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 16), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 16), new OreDictStack(SBD.wireDense(), 32), new ComparableStack(ModItems.circuit, 32, EnumCircuitType.BISMOID), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.QUANTUM)) .inputItems(new OreDictStack(CMB.plateWelded(), 16), new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 16), new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 16), new OreDictStack(SBD.wireDense(), 32), new ComparableStack(ModItems.circuit, 32, EnumCircuitType.BISMOID), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.QUANTUM))
.inputItemsEx(new ComparableStack(ModItems.item_expensive, 16, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(CMB.plateWelded(), 16), new OreDictStack(SBD.wireDense(), 32), new ComparableStack(ModItems.circuit, 32, EnumCircuitType.QUANTUM), new ComparableStack(ModItems.item_expensive, 16, EnumExpensiveType.COMPUTER)) .inputItemsEx(new ComparableStack(ModItems.item_expensive, 16, EnumExpensiveType.BRONZE_TUBES), new OreDictStack(CMB.plateWelded(), 16), new OreDictStack(SBD.wireDense(), 32), new ComparableStack(ModItems.circuit, 32, EnumCircuitType.QUANTUM), new ComparableStack(ModItems.item_expensive, 16, EnumExpensiveType.COMPUTER))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
this.register(new GenericRecipe("plsm.icfpress").setup(200, 100).outputItems(new ItemStack(ModBlocks.machine_icf_press, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.icfpress").setInputEnergy(1_000_000).setup(200, 10_000_000).outputItems(new ItemStack(ModBlocks.machine_icf_press, 1))
.inputItems(new OreDictStack(GOLD.plateCast(), 8), new ComparableStack(ModItems.motor, 4), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID)) .inputItems(new OreDictStack(GOLD.plateCast(), 8), new ComparableStack(ModItems.motor, 4), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID))
.setPools528(GenericRecipes.POOL_PREFIX_528 + "chlorophyte")); .setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
// weapons // weapons
this.register(new GenericRecipe("plsm.schrabhammer").setup(6_000, 100).outputItems(new ItemStack(ModItems.schrabidium_hammer, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.schrabhammer").setInputEnergy(25_000_000).setup(6_000, 10_000_000).outputItems(new ItemStack(ModItems.schrabidium_hammer, 1))
.inputItems( .inputItems(
new OreDictStack(SA326.block(), 35), new OreDictStack(SA326.block(), 35),
new ComparableStack(ModItems.billet_yharonite, 64), new ComparableStack(ModItems.billet_yharonite, 64),
@ -110,7 +114,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<GenericRecipe> {
new ComparableStack(ModItems.fragment_meteorite, 64), new ComparableStack(ModItems.fragment_meteorite, 64),
new ComparableStack(ModItems.fragment_meteorite, 64))); new ComparableStack(ModItems.fragment_meteorite, 64)));
this.register(new GenericRecipe("ass.fensusan").setup(1_200, 100).outputItems(new ItemStack(ModBlocks.machine_battery_redd, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("ass.fensusan").setInputEnergy(50_000_000).setup(1_200, 50_000_000).outputItems(new ItemStack(ModBlocks.machine_battery_redd, 1))
.inputItems(new ComparableStack(ModItems.ingot_electronium, 64), .inputItems(new ComparableStack(ModItems.ingot_electronium, 64),
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_QUANTUM), new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_QUANTUM),
new OreDictStack(OSMIRIDIUM.plateWelded(), 64), new OreDictStack(OSMIRIDIUM.plateWelded(), 64),
@ -136,7 +140,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<GenericRecipe> {
new ComparableStack(ModItems.ingot_cft, 64), new ComparableStack(ModItems.ingot_cft, 64),
new ComparableStack(ModItems.ingot_cft, 64))); new ComparableStack(ModItems.ingot_cft, 64)));
this.register(new GenericRecipe("plsm.gerald").setup(6_000, 100).outputItems(new ItemStack(ModItems.sat_gerald, 1)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.gerald").setInputEnergy(25_000_000).setup(6_000, 50_000_000).outputItems(new ItemStack(ModItems.sat_gerald, 1))
.inputItems(new OreDictStack(SBD.plateCast(), 64), .inputItems(new OreDictStack(SBD.plateCast(), 64),
new OreDictStack(SBD.plateCast(), 64), new OreDictStack(SBD.plateCast(), 64),
new OreDictStack(BSCCO.wireDense(), 64), new OreDictStack(BSCCO.wireDense(), 64),
@ -159,21 +163,32 @@ public class PlasmaForgeRecipes extends GenericRecipes<GenericRecipe> {
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE), new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
new ComparableStack(ModItems.circuit, 64, EnumCircuitType.CONTROLLER_QUANTUM), new ComparableStack(ModItems.circuit, 64, EnumCircuitType.CONTROLLER_QUANTUM),
new ComparableStack(ModItems.item_expensive, 64, EnumExpensiveType.COMPUTER), new ComparableStack(ModItems.item_expensive, 64, EnumExpensiveType.COMPUTER),
new ComparableStack(ModItems.coin_ufo, 1)).setPools(GenericRecipes.POOL_PREFIX_DISCOVER + "gerald")); new ComparableStack(ModItems.coin_ufo, 1)).setPools(PlasmaForgeRecipes.POOL_PREFIX_DISCOVER + "gerald"));
// really, really boring fucking temp recipes // really, really boring fucking temp recipes
this.register(new GenericRecipe("plsm.dfccore").setup(1_200, 100_000_000).outputItems(new ItemStack(ModBlocks.dfc_core)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 12_000)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.dfccore").setInputEnergy(50_000_000).setup(1_200, 100_000_000).outputItems(new ItemStack(ModBlocks.dfc_core)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 12_000))
.inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(DNT.wireDense(), 16), new ComparableStack(ModItems.circuit, 12, EnumCircuitType.CONTROLLER_QUANTUM), new ComparableStack(ModItems.singularity_spark), new ComparableStack(ModItems.powder_chlorophyte, 64))); .inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(DNT.wireDense(), 16), new ComparableStack(ModItems.circuit, 12, EnumCircuitType.CONTROLLER_QUANTUM), new ComparableStack(ModItems.singularity_spark), new ComparableStack(ModItems.powder_chlorophyte, 64)));
this.register(new GenericRecipe("plsm.dfcemitter").setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_emitter)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.dfcemitter").setInputEnergy(50_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_emitter)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000))
.inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(STAR.wireDense(), 16), new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_QUANTUM))); .inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(STAR.wireDense(), 16), new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_QUANTUM)));
this.register(new GenericRecipe("plsm.dfcreceiver").setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_receiver)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.dfcreceiver").setInputEnergy(50_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_receiver)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000))
.inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(STAR.plateCast(), 16), new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_QUANTUM))); .inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(STAR.plateCast(), 16), new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_QUANTUM)));
this.register(new GenericRecipe("plsm.dfcinjector").setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_injector)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.dfcinjector").setInputEnergy(50_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_injector)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000))
.inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(BIGMT.plateCast(), 16), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.CONTROLLER_ADVANCED))); .inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(BIGMT.plateCast(), 16), new ComparableStack(ModItems.circuit, 4, EnumCircuitType.CONTROLLER_ADVANCED)));
this.register(new GenericRecipe("plsm.dfcstabilizer").setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_stabilizer)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)) this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.dfcstabilizer").setInputEnergy(50_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModBlocks.dfc_stabilizer)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000))
.inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(SBD.wireDense(), 16), new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_QUANTUM))); .inputItems(new OreDictStack(OSMIRIDIUM.plateWelded(), 16), new OreDictStack(SBD.wireDense(), 16), new ComparableStack(ModItems.circuit, 8, EnumCircuitType.CONTROLLER_QUANTUM)));
} }
@Override
public void readExtraData(JsonElement element, PlasmaForgeRecipe recipe) {
JsonObject obj = (JsonObject) element;
recipe.ignitionTemp = obj.get("ignitionTemp").getAsLong();
}
@Override
public void writeExtraData(PlasmaForgeRecipe recipe, JsonWriter writer) throws IOException {
writer.name("ignitionTemp").value(recipe.ignitionTemp);
}
public static HashMap getRecipes() { public static HashMap getRecipes() {
HashMap<Object, Object> recipes = new HashMap<Object, Object>(); HashMap<Object, Object> recipes = new HashMap<Object, Object>();

View File

@ -6,6 +6,9 @@ import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
import com.hbm.render.item.ItemRenderBase; import com.hbm.render.item.ItemRenderBase;
import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge;
import com.hbm.util.BobMathUtil;
import com.hbm.util.Clock;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -30,6 +33,8 @@ public class RenderFusionPlasmaForge extends TileEntitySpecialRenderer implement
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break; case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
} }
TileEntityFusionPlasmaForge forge = (TileEntityFusionPlasmaForge) tile;
GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.fusion_plasma_forge_tex); bindTexture(ResourceManager.fusion_plasma_forge_tex);
ResourceManager.fusion_plasma_forge.renderPart("Body"); ResourceManager.fusion_plasma_forge.renderPart("Body");
@ -85,11 +90,64 @@ public class RenderFusionPlasmaForge extends TileEntitySpecialRenderer implement
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D); if(forge.plasmaEnergySync <= 0) {
GL11.glColor3f(0F, 0F, 0F); GL11.glColor3f(0F, 0F, 0F);
ResourceManager.fusion_plasma_forge.renderPart("Plasma"); GL11.glDisable(GL11.GL_TEXTURE_2D);
ResourceManager.fusion_plasma_forge.renderPart("Plasma");
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(1F, 1F, 1F);
} else {
RenderArcFurnace.fullbright(true);
long time = Clock.get_ms() + forge.timeOffset;
float alpha = 0.5F + (float) (Math.sin(time / 500D) * 0.25F);
double mainOsc = BobMathUtil.sps(time / 750D) % 1D;
double glowOsc = Math.sin(time / 1000D) % 1D;
double glowExtra = time / 10000D % 1D;
GL11.glColor3f(forge.plasmaRed * alpha, forge.plasmaGreen * alpha, forge.plasmaBlue * alpha);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
bindTexture(ResourceManager.fusion_plasma_tex);
GL11.glTranslated(0, mainOsc, 0);
ResourceManager.fusion_plasma_forge.renderPart("Plasma");
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDepthMask(false);
GL11.glColor3f(forge.plasmaRed * 2, forge.plasmaGreen * 2, forge.plasmaBlue * 2);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
bindTexture(ResourceManager.fusion_plasma_glow_tex);
GL11.glTranslated(0, glowOsc + glowExtra, 0);
ResourceManager.fusion_plasma_forge.renderPart("Plasma");
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
glowOsc = Math.sin(time / 600D + 2) % 1D;
glowExtra = time / 5000D % 1D;
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
bindTexture(ResourceManager.fusion_plasma_glow_tex);
GL11.glTranslated(0, glowOsc + glowExtra, 0);
ResourceManager.fusion_plasma_forge.renderPart("Plasma");
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
RenderArcFurnace.fullbright(false);
}
GL11.glColor3f(1F, 1F, 1F); GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_FLAT); GL11.glShadeModel(GL11.GL_FLAT);

View File

@ -12,5 +12,5 @@ public interface IFusionPowerReceiver {
* fusionPower is the per-port output adjusted for the amount of connected receivers (i.e. when boilers share output energy) * fusionPower is the per-port output adjusted for the amount of connected receivers (i.e. when boilers share output energy)
* neutronPower is a fixed value provided by the recipe * neutronPower is a fixed value provided by the recipe
*/ */
public void receiveFusionPower(long fusionPower, double neutronPower); public void receiveFusionPower(long fusionPower, double neutronPower, float r, float g, float b);
} }

View File

@ -87,7 +87,7 @@ public class TileEntityFusionBoiler extends TileEntityLoadedBase implements IFlu
@Override public boolean receivesFusionPower() { return true; } @Override public boolean receivesFusionPower() { return true; }
@Override @Override
public void receiveFusionPower(long fusionPower, double neutronPower) { public void receiveFusionPower(long fusionPower, double neutronPower, float r, float g, float b) {
this.plasmaEnergy = fusionPower; this.plasmaEnergy = fusionPower;
int waterCycles = Math.min(tanks[0].getFill(), tanks[1].getMaxFill() - tanks[1].getFill()); int waterCycles = Math.min(tanks[0].getFill(), tanks[1].getMaxFill() - tanks[1].getFill());

View File

@ -267,7 +267,7 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
} }
@Override public boolean receivesFusionPower() { return false; } @Override public boolean receivesFusionPower() { return false; }
@Override public void receiveFusionPower(long fusionPower, double neutronPower) { this.neutronEnergy = neutronPower; doProgress(); } @Override public void receiveFusionPower(long fusionPower, double neutronPower, float r, float g, float b) { this.neutronEnergy = neutronPower; doProgress(); }
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; } @Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; }
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; } @Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; }

View File

@ -62,7 +62,7 @@ public class TileEntityFusionCoupler extends TileEntityLoadedBase implements IFu
@Override public boolean receivesFusionPower() { return true; } @Override public boolean receivesFusionPower() { return true; }
@Override @Override
public void receiveFusionPower(long fusionPower, double neutronPower) { public void receiveFusionPower(long fusionPower, double neutronPower, float r, float g, float b) {
// more copy pasted crap code ! ! ! // more copy pasted crap code ! ! !
if(klystronNode != null && klystronNode.net != null) { if(klystronNode != null && klystronNode.net != null) {

View File

@ -159,7 +159,7 @@ public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnerg
} }
@Override public boolean receivesFusionPower() { return true; } @Override public boolean receivesFusionPower() { return true; }
@Override public void receiveFusionPower(long fusionPower, double neutronPower) { this.plasmaEnergy = fusionPower; } @Override public void receiveFusionPower(long fusionPower, double neutronPower, float r, float g, float b) { this.plasmaEnergy = fusionPower; }
@Override @Override
public void serialize(ByteBuf buf) { public void serialize(ByteBuf buf) {

View File

@ -1,18 +1,25 @@
package com.hbm.tileentity.machine.fusion; package com.hbm.tileentity.machine.fusion;
import java.util.Map.Entry;
import com.hbm.interfaces.IControlReceiver; import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerMachinePlasmaForge; import com.hbm.inventory.container.ContainerMachinePlasmaForge;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.gui.GUIMachinePlasmaForge; import com.hbm.inventory.gui.GUIMachinePlasmaForge;
import com.hbm.inventory.recipes.PlasmaForgeRecipe;
import com.hbm.inventory.recipes.PlasmaForgeRecipes; import com.hbm.inventory.recipes.PlasmaForgeRecipes;
import com.hbm.inventory.recipes.loader.GenericRecipe;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.module.machine.ModuleMachinePlasma; import com.hbm.module.machine.ModuleMachinePlasma;
import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.uninos.GenNode;
import com.hbm.uninos.INetworkProvider;
import com.hbm.uninos.UniNodespace;
import com.hbm.uninos.networkproviders.PlasmaNetworkProvider;
import com.hbm.util.BobMathUtil; import com.hbm.util.BobMathUtil;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.util.fauxpointtwelve.DirPos; import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.energymk2.IEnergyReceiverMK2;
@ -28,7 +35,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider { public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IFusionPowerReceiver, IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider {
public FluidTank inputTank; public FluidTank inputTank;
@ -36,6 +43,16 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
public long maxPower = 10_000_000; public long maxPower = 10_000_000;
public boolean didProcess; public boolean didProcess;
public float plasmaRed;
public float plasmaGreen;
public float plasmaBlue;
public long plasmaEnergy;
public long plasmaEnergySync;
protected GenNode receiverNode;
protected GenNode providerNode;
public int timeOffset = -1;
public ModuleMachinePlasma plasmaModule; public ModuleMachinePlasma plasmaModule;
public TileEntityFusionPlasmaForge() { public TileEntityFusionPlasmaForge() {
@ -51,6 +68,14 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
return "container.machinePlasmaForge"; return "container.machinePlasmaForge";
} }
@Override public boolean receivesFusionPower() { return true; }
@Override public void receiveFusionPower(long fusionPower, double neutronPower, float r, float g, float b) {
this.plasmaEnergy = fusionPower;
this.plasmaRed = r;
this.plasmaGreen = g;
this.plasmaBlue = b;
}
@Override @Override
public void updateEntity() { public void updateEntity() {
@ -58,7 +83,17 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
GenericRecipe recipe = PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(plasmaModule.recipe); this.plasmaEnergySync = this.plasmaEnergy;
this.plasmaEnergy = 0;
ForgeDirection rot = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getRotation(ForgeDirection.UP);
if(receiverNode == null || receiverNode.expired) receiverNode = this.createNode(PlasmaNetworkProvider.THE_PROVIDER, rot);
if(providerNode == null || providerNode.expired) providerNode = this.createNode(PlasmaNetworkProvider.THE_PROVIDER, rot.getOpposite());
if(receiverNode != null && receiverNode.hasValidNet()) receiverNode.net.addReceiver(this);
if(providerNode != null && providerNode.hasValidNet()) providerNode.net.addProvider(this); // technically unused, but good to have when we do something else with the plasma nets
PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(plasmaModule.recipe);
if(recipe != null) this.maxPower = recipe.power * 100; if(recipe != null) this.maxPower = recipe.power * 100;
this.maxPower = BobMathUtil.max(this.power, this.maxPower, 100_000); this.maxPower = BobMathUtil.max(this.power, this.maxPower, 100_000);
@ -72,14 +107,44 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
double speed = 1D; double speed = 1D;
double pow = 1D; double pow = 1D;
this.plasmaModule.update(speed, pow, true, slots[1]); boolean ignition = recipe != null ? recipe.ignitionTemp <= this.plasmaEnergySync : true;
this.plasmaModule.update(speed, pow, ignition, slots[1]);
this.didProcess = this.plasmaModule.didProcess; this.didProcess = this.plasmaModule.didProcess;
if(this.plasmaModule.markDirty) this.markDirty(); if(this.plasmaModule.markDirty) this.markDirty();
if(providerNode != null && providerNode.hasValidNet()) {
for(Object o : providerNode.net.receiverEntries.entrySet()) {
Entry<Object, Long> entry = (Entry<Object, Long>) o;
if(entry.getKey() instanceof IFusionPowerReceiver) {
long powerReceived = (long) Math.ceil(this.plasmaEnergySync * 0.75);
((IFusionPowerReceiver) entry.getKey()).receiveFusionPower(powerReceived, 0, plasmaRed, plasmaGreen, plasmaBlue);
}
}
}
this.networkPackNT(100); this.networkPackNT(100);
} else {
if(timeOffset == -1) this.timeOffset = worldObj.rand.nextInt(30_000);
} }
} }
public GenNode createNode(INetworkProvider provider, ForgeDirection dir) {
GenNode node = UniNodespace.getNode(worldObj, xCoord + dir.offsetX * 5, yCoord + 2, zCoord + dir.offsetZ * 5, provider);
if(node != null) return node;
node = new GenNode(provider,
new BlockPos(xCoord + dir.offsetX * 5, yCoord + 2, zCoord + dir.offsetZ * 5))
.setConnections(new DirPos(xCoord + dir.offsetX * 6, yCoord + 2, zCoord + dir.offsetZ * 6, dir));
UniNodespace.createNode(worldObj, node);
return node;
}
public DirPos[] getConPos() { public DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10); ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP); ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
@ -102,6 +167,10 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
public void serialize(ByteBuf buf) { public void serialize(ByteBuf buf) {
super.serialize(buf); super.serialize(buf);
this.inputTank.serialize(buf); this.inputTank.serialize(buf);
buf.writeFloat(plasmaRed);
buf.writeFloat(plasmaGreen);
buf.writeFloat(plasmaBlue);
buf.writeLong(plasmaEnergySync);
buf.writeLong(power); buf.writeLong(power);
buf.writeLong(maxPower); buf.writeLong(maxPower);
buf.writeBoolean(didProcess); buf.writeBoolean(didProcess);
@ -111,8 +180,11 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
@Override @Override
public void deserialize(ByteBuf buf) { public void deserialize(ByteBuf buf) {
super.deserialize(buf); super.deserialize(buf);
boolean wasProcessing = this.didProcess;
this.inputTank.deserialize(buf); this.inputTank.deserialize(buf);
this.plasmaRed = buf.readFloat();
this.plasmaGreen = buf.readFloat();
this.plasmaBlue = buf.readFloat();
this.plasmaEnergySync = buf.readLong();
this.power = buf.readLong(); this.power = buf.readLong();
this.maxPower = buf.readLong(); this.maxPower = buf.readLong();
this.didProcess = buf.readBoolean(); this.didProcess = buf.readBoolean();

View File

@ -169,6 +169,9 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
boolean ignition = recipe != null ? recipe.ignitionTemp <= this.klystronEnergy : true; boolean ignition = recipe != null ? recipe.ignitionTemp <= this.klystronEnergy : true;
float r = 0F;
float g = 0F;
float b = 0F;
this.plasmaEnergy = 0; this.plasmaEnergy = 0;
this.fuelConsumption = 0; this.fuelConsumption = 0;
this.fusionModule.preUpdate(factor, collectors * 0.5D); this.fusionModule.preUpdate(factor, collectors * 0.5D);
@ -178,6 +181,9 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
if(didProcess && recipe != null) { if(didProcess && recipe != null) {
this.plasmaEnergy = (long) Math.ceil(recipe.outputTemp * factor); this.plasmaEnergy = (long) Math.ceil(recipe.outputTemp * factor);
this.fuelConsumption = factor; this.fuelConsumption = factor;
r = recipe.r;
g = recipe.g;
b = recipe.b;
} }
double outputIntensity = this.getOuputIntensity(receiverCount); double outputIntensity = this.getOuputIntensity(receiverCount);
@ -192,7 +198,7 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
if(entry.getKey() instanceof IFusionPowerReceiver) { if(entry.getKey() instanceof IFusionPowerReceiver) {
long powerReceived = (long) Math.ceil(this.plasmaEnergy * outputIntensity); long powerReceived = (long) Math.ceil(this.plasmaEnergy * outputIntensity);
((IFusionPowerReceiver) entry.getKey()).receiveFusionPower(powerReceived, outputFlux); ((IFusionPowerReceiver) entry.getKey()).receiveFusionPower(powerReceived, outputFlux, r, g, b);
} }
} }
} }

File diff suppressed because it is too large Load Diff