From eea9b83a9cf6f5c8c8a82befd6209627edfb99b6 Mon Sep 17 00:00:00 2001 From: ProfessorProspector Date: Sun, 8 Jan 2017 14:07:34 -0800 Subject: [PATCH] Generator gui! --- .../techreborn/client/gui/GuiGenerator.java | 66 +++----- .../java/techreborn/client/gui/TRBuilder.java | 31 ++++ .../compat/jei/TechRebornJeiPlugin.java | 145 +++++++++--------- .../centrifuge/CentrifugeRecipeWrapper.java | 9 +- .../tiles/generator/TileGenerator.java | 12 +- .../assets/techreborn/textures/gui/jei.png | Bin 1911 -> 1898 bytes 6 files changed, 131 insertions(+), 132 deletions(-) diff --git a/src/main/java/techreborn/client/gui/GuiGenerator.java b/src/main/java/techreborn/client/gui/GuiGenerator.java index 0aa225825..3d62cad3f 100644 --- a/src/main/java/techreborn/client/gui/GuiGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiGenerator.java @@ -1,63 +1,35 @@ package techreborn.client.gui; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.translation.I18n; - -import reborncore.common.powerSystem.PowerSystem; - import techreborn.tiles.generator.TileGenerator; -public class GuiGenerator extends GuiContainer { +public class GuiGenerator extends GuiBase { - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/generator.png"); + TileGenerator tile; - TileGenerator generator; - - public GuiGenerator(final EntityPlayer player, final TileGenerator generator) { - super(generator.createContainer(player)); - this.xSize = 176; - this.ySize = 167; - this.generator = generator; + public GuiGenerator(final EntityPlayer player, final TileGenerator tile) { + super(player, tile, tile.createContainer(player)); + this.tile = tile; } @Override - public void initGui() { - final int k = (this.width - this.xSize) / 2; - final int l = (this.height - this.ySize) / 2; - super.initGui(); + protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) { + super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY); + final Layer layer = Layer.BACKGROUND; + + this.drawSlot(8, 72, layer); + + this.drawSlot(80, 54, layer); + + this.builder.drawJEIButton(this, 150, 4, mouseX, mouseY, layer); } @Override - protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) { - this.mc.getTextureManager().bindTexture(GuiGenerator.texture); - final int k = (this.width - this.xSize) / 2; - final int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) { + super.drawGuiContainerForegroundLayer(mouseX, mouseY); + final Layer layer = Layer.FOREGROUND; - int j = 0; - - j = this.generator.getEnergyScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16); - } - - if (this.generator.burnTime != 0) { - j = this.generator.getScaledBurnTime(13); - this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1); - } - } - - @Override - protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { - final String name = I18n.translateToLocal("tile.techreborn.generator.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, - 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.generator.getEnergy()), 25, - this.ySize - 150, 4210752); + this.builder.drawBurnBar(this, this.tile.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer); + this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer); } } diff --git a/src/main/java/techreborn/client/gui/TRBuilder.java b/src/main/java/techreborn/client/gui/TRBuilder.java index e933cdd53..535c88f59 100644 --- a/src/main/java/techreborn/client/gui/TRBuilder.java +++ b/src/main/java/techreborn/client/gui/TRBuilder.java @@ -155,6 +155,37 @@ public class TRBuilder extends GuiBuilder { gui.drawTexturedModalRect(x - 4, y - 4, 202, 44, 24, 24); } + public void drawBurnBar(GuiBase gui, int progress, int maxProgress, int x, int y, int mouseX, int mouseY, GuiBase.Layer layer) { + if (layer == GuiBase.Layer.BACKGROUND) { + x += gui.getGuiLeft(); + y += gui.getGuiTop(); + } + if (layer == GuiBase.Layer.FOREGROUND) { + mouseX -= gui.getGuiLeft(); + mouseY -= gui.getGuiTop(); + } + + gui.mc.getTextureManager().bindTexture(GUI_SHEET); + gui.drawTexturedModalRect(x, y, 171, 84, 13, 13); + int j = 13 - (int) ((double) progress / (double) maxProgress * 13); + if (j > 0) { + gui.drawTexturedModalRect(x, y + j, 171, 70 + j, 13, 13 - j); + + } + if (isInRect(x, y, 12, 12, mouseX, mouseY)) { + int percentage = percentage(maxProgress, progress); + List list = new ArrayList<>(); + list.add(getPercentageColour(percentage) + "" + percentage + "%"); + net.minecraftforge.fml.client.config.GuiUtils.drawHoveringText(list, mouseX, mouseY, gui.width, gui.height, -1, gui.mc.fontRendererObj); + GlStateManager.disableLighting(); + GlStateManager.color(1, 1, 1, 1); + } + } + + public int getScaledBurnTime(int scale, int burnTime, int totalBurnTime) { + return (int) (((float) burnTime / (float) totalBurnTime) * scale); + } + public TextFormatting getPercentageColour(int percentage) { if (percentage <= 10) { return TextFormatting.RED; diff --git a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java index eca891470..e313d597b 100644 --- a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java +++ b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java @@ -1,13 +1,16 @@ package techreborn.compat.jei; -import javax.annotation.Nonnull; - +import mezz.jei.api.BlankModPlugin; +import mezz.jei.api.IGuiHelper; +import mezz.jei.api.IJeiHelpers; +import mezz.jei.api.IModRegistry; +import mezz.jei.api.recipe.VanillaRecipeCategoryUid; +import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry; +import mezz.jei.config.Config; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.text.translation.I18n; - import reborncore.api.recipe.RecipeHandler; - import techreborn.Core; import techreborn.api.generator.EFluidGenerator; import techreborn.api.generator.GeneratorRecipeHelper; @@ -58,17 +61,10 @@ import techreborn.items.ItemParts; import techreborn.parts.TechRebornParts; import techreborn.parts.powerCables.EnumCableType; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; -import mezz.jei.api.BlankModPlugin; -import mezz.jei.api.IGuiHelper; -import mezz.jei.api.IJeiHelpers; -import mezz.jei.api.IModRegistry; -import mezz.jei.api.recipe.VanillaRecipeCategoryUid; -import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry; -import mezz.jei.config.Config; - @mezz.jei.api.JEIPlugin public class TechRebornJeiPlugin extends BlankModPlugin { private static void addDebugRecipes(final IModRegistry registry) { @@ -78,13 +74,13 @@ public class TechRebornJeiPlugin extends BlankModPlugin { for (int i = 0; i < 10; i++) { final int time = (int) Math.round(200 + Math.random() * 100); final AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock, - dirtBlock, time, 120); + dirtBlock, time, 120); debugRecipes.add(assemblingMachineRecipe); } for (int i = 0; i < 10; i++) { final int time = (int) Math.round(200 + Math.random() * 100); final ImplosionCompressorRecipe recipe = new ImplosionCompressorRecipe(diamondBlock, diamondBlock, dirtBlock, - dirtBlock, time, 120); + dirtBlock, time, 120); debugRecipes.add(recipe); } registry.addRecipes(debugRecipes); @@ -92,9 +88,9 @@ public class TechRebornJeiPlugin extends BlankModPlugin { @Override public void register( - @Nonnull - final - IModRegistry registry) { + @Nonnull + final + IModRegistry registry) { final IJeiHelpers jeiHelpers = registry.getJeiHelpers(); final IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); @@ -158,26 +154,26 @@ public class TechRebornJeiPlugin extends BlankModPlugin { } registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper), - new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper), - new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper), - new FusionReactorRecipeCategory(guiHelper), new IndustrialGrinderRecipeCategory(guiHelper), - new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper), - new RollingMachineRecipeCategory(guiHelper), new VacuumFreezerRecipeCategory(guiHelper), - new GrinderRecipeCategory(guiHelper), new ExtractorRecipeCategory(guiHelper), - new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper)); + new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper), + new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper), + new FusionReactorRecipeCategory(guiHelper), new IndustrialGrinderRecipeCategory(guiHelper), + new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper), + new RollingMachineRecipeCategory(guiHelper), new VacuumFreezerRecipeCategory(guiHelper), + new GrinderRecipeCategory(guiHelper), new ExtractorRecipeCategory(guiHelper), + new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper)); for (final EFluidGenerator type : EFluidGenerator.values()) registry.addRecipeCategories(new FluidGeneratorRecipeCategory(type, guiHelper)); registry.addRecipeHandlers(new AlloySmelterRecipeHandler(jeiHelpers), - new AssemblingMachineRecipeHandler(jeiHelpers), new BlastFurnaceRecipeHandler(jeiHelpers), - new CentrifugeRecipeHandler(jeiHelpers), new ChemicalReactorRecipeHandler(jeiHelpers), - new FusionReactorRecipeHandler(), new IndustrialGrinderRecipeHandler(jeiHelpers), - new ImplosionCompressorRecipeHandler(jeiHelpers), new IndustrialElectrolyzerRecipeHandler(jeiHelpers), - new RollingMachineRecipeHandler(), new VacuumFreezerRecipeHandler(jeiHelpers), - new GrinderRecipeHandler(jeiHelpers), new ExtractorRecipeHandler(jeiHelpers), - new CompressorRecipeHandler(jeiHelpers), new ScrapboxRecipeHandler(jeiHelpers), - new FluidGeneratorRecipeHandler(jeiHelpers)); + new AssemblingMachineRecipeHandler(jeiHelpers), new BlastFurnaceRecipeHandler(jeiHelpers), + new CentrifugeRecipeHandler(jeiHelpers), new ChemicalReactorRecipeHandler(jeiHelpers), + new FusionReactorRecipeHandler(), new IndustrialGrinderRecipeHandler(jeiHelpers), + new ImplosionCompressorRecipeHandler(jeiHelpers), new IndustrialElectrolyzerRecipeHandler(jeiHelpers), + new RollingMachineRecipeHandler(), new VacuumFreezerRecipeHandler(jeiHelpers), + new GrinderRecipeHandler(jeiHelpers), new ExtractorRecipeHandler(jeiHelpers), + new CompressorRecipeHandler(jeiHelpers), new ScrapboxRecipeHandler(jeiHelpers), + new FluidGeneratorRecipeHandler(jeiHelpers)); registry.addRecipes(RecipeHandler.recipeList); registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes); @@ -188,7 +184,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin { registry.addRecipes(RollingMachineRecipeMaker.getRecipes(jeiHelpers)); } catch (final RuntimeException e) { Core.logHelper - .error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations."); + .error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations."); e.printStackTrace(); } @@ -197,115 +193,116 @@ public class TechRebornJeiPlugin extends BlankModPlugin { } registry.addDescription(ItemParts.getPartByName("rubberSap"), - I18n.translateToLocal("techreborn.desc.rubberSap")); + I18n.translateToLocal("techreborn.desc.rubberSap")); if (!ConfigTechReborn.ScrapboxDispenser) { registry.addDescription(new ItemStack(ModItems.SCRAP_BOX), - I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser")); + I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser")); } else { registry.addDescription(new ItemStack(ModItems.SCRAP_BOX), - I18n.translateToLocal("techreborn.desc.scrapBox")); + I18n.translateToLocal("techreborn.desc.scrapBox")); } registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER, - VanillaRecipeCategoryUid.FUEL); + VanillaRecipeCategoryUid.FUEL); registry.addRecipeClickArea(GuiAlloySmelter.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER); registry.addRecipeClickArea(GuiAssemblingMachine.class, 85, 34, 24, 20, RecipeCategoryUids.ASSEMBLING_MACHINE); registry.addRecipeClickArea(GuiBlastFurnace.class, 63, 36, 24, 15, RecipeCategoryUids.BLAST_FURNACE); registry.addRecipeClickArea(GuiCentrifuge.class, 150, 4, 20, 12, RecipeCategoryUids.CENTRIFUGE); + registry.addRecipeClickArea(GuiGenerator.class, 150, 4, 20, 12, VanillaRecipeCategoryUid.FUEL); registry.addRecipeClickArea(GuiChemicalReactor.class, 73, 39, 32, 12, RecipeCategoryUids.CHEMICAL_REACTOR); registry.addRecipeClickArea(GuiFusionReactor.class, 111, 34, 27, 19, RecipeCategoryUids.FUSION_REACTOR); registry.addRecipeClickArea(GuiIndustrialGrinder.class, 50, 35, 25, 16, RecipeCategoryUids.INDUSTRIAL_GRINDER); registry.addRecipeClickArea(GuiImplosionCompressor.class, 60, 37, 24, 15, - RecipeCategoryUids.IMPLOSION_COMPRESSOR); + RecipeCategoryUids.IMPLOSION_COMPRESSOR); registry.addRecipeClickArea(GuiIndustrialElectrolyzer.class, 72, 37, 33, 14, - RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER); + RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER); registry.addRecipeClickArea(GuiRollingMachine.class, 89, 32, 26, 25, RecipeCategoryUids.ROLLING_MACHINE); registry.addRecipeClickArea(GuiVacuumFreezer.class, 78, 36, 24, 16, RecipeCategoryUids.VACUUM_FREEZER); registry.addRecipeClickArea(GuiGrinder.class, 78, 36, 24, 16, RecipeCategoryUids.GRINDER); registry.addRecipeClickArea(GuiExtractor.class, 78, 36, 24, 16, RecipeCategoryUids.EXTRACTOR); registry.addRecipeClickArea(GuiCompressor.class, 78, 36, 24, 16, RecipeCategoryUids.COMPRESSOR); registry.addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING, - VanillaRecipeCategoryUid.FUEL); + VanillaRecipeCategoryUid.FUEL); registry.addRecipeClickArea(GuiElectricFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING); registry.addRecipeClickArea(GuiSemifluidGenerator.class, 79, 34, 18, 18, - EFluidGenerator.SEMIFLUID.getRecipeID()); + EFluidGenerator.SEMIFLUID.getRecipeID()); registry.addRecipeClickArea(GuiDieselGenerator.class, 79, 34, 18, 18, - EFluidGenerator.DIESEL.getRecipeID()); + EFluidGenerator.DIESEL.getRecipeID()); registry.addRecipeClickArea(GuiGasTurbine.class, 79, 34, 18, 18, - EFluidGenerator.GAS.getRecipeID()); + EFluidGenerator.GAS.getRecipeID()); registry.addRecipeClickArea(GuiThermalGenerator.class, 79, 34, 18, 18, - EFluidGenerator.THERMAL.getRecipeID()); + EFluidGenerator.THERMAL.getRecipeID()); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.COMPRESSOR), RecipeCategoryUids.COMPRESSOR); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.IRON_ALLOY_FURNACE), RecipeCategoryUids.ALLOY_SMELTER); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALLOY_SMELTER), RecipeCategoryUids.ALLOY_SMELTER); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ASSEMBLY_MACHINE), - RecipeCategoryUids.ASSEMBLING_MACHINE); + RecipeCategoryUids.ASSEMBLING_MACHINE); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.INDUSTRIAL_BLAST_FURNACE), RecipeCategoryUids.BLAST_FURNACE); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), RecipeCategoryUids.CENTRIFUGE); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.CHEMICAL_REACTOR), - RecipeCategoryUids.CHEMICAL_REACTOR); + RecipeCategoryUids.CHEMICAL_REACTOR); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.EXTRACTOR), RecipeCategoryUids.EXTRACTOR); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.FUSION_CONTROL_COMPUTER), - RecipeCategoryUids.FUSION_REACTOR); + RecipeCategoryUids.FUSION_REACTOR); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.GRINDER), RecipeCategoryUids.GRINDER); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.IMPLOSION_COMPRESSOR), - RecipeCategoryUids.IMPLOSION_COMPRESSOR); + RecipeCategoryUids.IMPLOSION_COMPRESSOR); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), - RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER); + RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.INDUSTRIAL_GRINDER), - RecipeCategoryUids.INDUSTRIAL_GRINDER); + RecipeCategoryUids.INDUSTRIAL_GRINDER); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ROLLING_MACHINE), - RecipeCategoryUids.ROLLING_MACHINE); + RecipeCategoryUids.ROLLING_MACHINE); registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.SCRAP_BOX), RecipeCategoryUids.SCRAPBOX); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.SEMIFLUID_GENERATOR), - EFluidGenerator.SEMIFLUID.getRecipeID()); + EFluidGenerator.SEMIFLUID.getRecipeID()); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.GAS_TURBINE), - EFluidGenerator.GAS.getRecipeID()); + EFluidGenerator.GAS.getRecipeID()); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.DIESEL_GENERATOR), - EFluidGenerator.DIESEL.getRecipeID()); + EFluidGenerator.DIESEL.getRecipeID()); registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.THERMAL_GENERATOR), - EFluidGenerator.THERMAL.getRecipeID()); + EFluidGenerator.THERMAL.getRecipeID()); final IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry(); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("fusionreactor", RecipeCategoryUids.FUSION_REACTOR, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("fusionreactor", RecipeCategoryUids.FUSION_REACTOR, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("industrialelectrolyzer", RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 36, - 2, 0, 36)); + new BuiltContainerTransferInfo("industrialelectrolyzer", RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 36, + 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("industrialgrinder", RecipeCategoryUids.GRINDER, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("industrialgrinder", RecipeCategoryUids.GRINDER, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("implosioncompressor", RecipeCategoryUids.IMPLOSION_COMPRESSOR, 36, 2, 0, - 36)); + new BuiltContainerTransferInfo("implosioncompressor", RecipeCategoryUids.IMPLOSION_COMPRESSOR, 36, 2, 0, + 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("vacuumfreezer", RecipeCategoryUids.VACUUM_FREEZER, 36, 1, 0, 36)); + new BuiltContainerTransferInfo("vacuumfreezer", RecipeCategoryUids.VACUUM_FREEZER, 36, 1, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("blastfurnace", RecipeCategoryUids.BLAST_FURNACE, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("blastfurnace", RecipeCategoryUids.BLAST_FURNACE, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("rollingmachine", RecipeCategoryUids.ROLLING_MACHINE, 36, 9, 0, 36)); + new BuiltContainerTransferInfo("rollingmachine", RecipeCategoryUids.ROLLING_MACHINE, 36, 9, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("alloyfurnace", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("alloyfurnace", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("alloyfurnace", VanillaRecipeCategoryUid.FUEL, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("alloyfurnace", VanillaRecipeCategoryUid.FUEL, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("alloysmelter", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("alloysmelter", RecipeCategoryUids.ALLOY_SMELTER, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("assemblingmachine", RecipeCategoryUids.ASSEMBLING_MACHINE, 36, 2, 0, - 36)); + new BuiltContainerTransferInfo("assemblingmachine", RecipeCategoryUids.ASSEMBLING_MACHINE, 36, 2, 0, + 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("chemicalreactor", RecipeCategoryUids.CHEMICAL_REACTOR, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("chemicalreactor", RecipeCategoryUids.CHEMICAL_REACTOR, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("centrifuge", RecipeCategoryUids.CENTRIFUGE, 36, 2, 0, 36)); + new BuiltContainerTransferInfo("centrifuge", RecipeCategoryUids.CENTRIFUGE, 36, 2, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("grinder", RecipeCategoryUids.GRINDER, 36, 1, 0, 36)); + new BuiltContainerTransferInfo("grinder", RecipeCategoryUids.GRINDER, 36, 1, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("extractor", RecipeCategoryUids.EXTRACTOR, 36, 1, 0, 36)); + new BuiltContainerTransferInfo("extractor", RecipeCategoryUids.EXTRACTOR, 36, 1, 0, 36)); recipeTransferRegistry.addRecipeTransferHandler( - new BuiltContainerTransferInfo("compressor", RecipeCategoryUids.COMPRESSOR, 36, 1, 0, 36)); + new BuiltContainerTransferInfo("compressor", RecipeCategoryUids.COMPRESSOR, 36, 1, 0, 36)); if (CompatManager.isQuantumStorageLoaded) { registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.QUANTUM_CHEST)); diff --git a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java index 933c73e62..37023d652 100644 --- a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java @@ -5,6 +5,7 @@ import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; import mezz.jei.api.gui.IDrawableStatic; import net.minecraft.client.Minecraft; +import reborncore.common.powerSystem.PowerSystem; import techreborn.api.recipe.machines.CentrifugeRecipe; import techreborn.client.gui.TRBuilder; import techreborn.compat.jei.BaseRecipeWrapper; @@ -35,12 +36,12 @@ public class CentrifugeRecipeWrapper extends BaseRecipeWrapper progressRight.draw(minecraft, 25, 26); int x = -10; - int y1 = 3; - int y2 = 52; + int y1 = 1; + int y2 = 54; int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT; - minecraft.fontRendererObj.drawString("Time: " + baseRecipe.tickTime / 20 + " secs", (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth("Time: " + baseRecipe.tickTime / 20 + " secs") / 2) - 40, y1, 0x444444); - minecraft.fontRendererObj.drawString("EU: " + baseRecipe.euPerTick + " EU/t", (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth("EU: " + baseRecipe.euPerTick + " EU/t") / 2) - 40, y2, 0x444444); + minecraft.fontRendererObj.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2) - 40, y1, 0x444444); + minecraft.fontRendererObj.drawString(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime), (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth(PowerSystem.getLocaliszedPowerFormatted(baseRecipe.euPerTick * baseRecipe.tickTime)) / 2) - 40, y2, 0x444444); } } diff --git a/src/main/java/techreborn/tiles/generator/TileGenerator.java b/src/main/java/techreborn/tiles/generator/TileGenerator.java index 42823722b..23b4a5ce5 100644 --- a/src/main/java/techreborn/tiles/generator/TileGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileGenerator.java @@ -7,14 +7,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.ForgeModContainer; - import reborncore.api.power.EnumPowerTier; import reborncore.api.tile.IInventoryProvider; import reborncore.common.IWrenchable; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; - import techreborn.client.container.IContainerProvider; import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.ContainerBuilder; @@ -109,7 +107,7 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IIn @Override public double getMaxPower() { - return 100; + return 10000; } @Override @@ -169,9 +167,9 @@ public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IIn @Override public BuiltContainer createContainer(final EntityPlayer player) { - return new ContainerBuilder("generator").player(player.inventory).inventory(8, 84).hotbar(8, 142).addInventory() - .tile(this).fuelSlot(0, 80, 53).energySlot(1, 80, 17).syncEnergyValue() - .syncIntegerValue(this::getBurnTime, this::setBurnTime) - .syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(); + return new ContainerBuilder("generator").player(player.inventory).inventory().hotbar().addInventory() + .tile(this).fuelSlot(0, 80, 54).energySlot(1, 8, 72).syncEnergyValue() + .syncIntegerValue(this::getBurnTime, this::setBurnTime) + .syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(); } } diff --git a/src/main/resources/assets/techreborn/textures/gui/jei.png b/src/main/resources/assets/techreborn/textures/gui/jei.png index cc2b9bfcfb08db83c2907d1da95a5c98175b8556..58e5de28f7c513cadbc1fe6277e165e98841982c 100644 GIT binary patch delta 26 icmey)_lj?V%0@#27Op}D2BAX6&v&Z&HfOW&FarR7k_gWL delta 37 tcmaFG_nmKo3KwH>kh>GZx^prwH!2#la1}8y2o*8LrA9yA9LK`L3;^*J3%dXS