Skip to content

Commit

Permalink
shift nei mana pool (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastors authored Jun 2, 2024
1 parent ff36cef commit 67b44ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ dependencies {

compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.27-GTNH:dev')
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import java.util.Collection;
import java.util.List;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
Expand Down Expand Up @@ -49,6 +52,7 @@ else if (recipe.isConjuration())
otherStacks.add(new PositionedStack(new ItemStack(ModBlocks.conjurationCatalyst), 10, 37));

output = new PositionedStack(recipe.getOutput(), 101, 37);
// This value is where the mana bar is stored initially
mana = recipe.getManaToConsume();
}

Expand Down Expand Up @@ -94,9 +98,16 @@ public void drawBackground(int recipe) {
super.drawBackground(recipe);
GL11.glEnable(GL11.GL_BLEND);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
// Mana infusion is the mana pool, super weird.
GuiDraw.changeTexture(LibResources.GUI_MANA_INFUSION_OVERLAY);
GuiDraw.drawTexturedModalRect(45, 20, 38, 35, 92, 50);
HUDHandler.renderManaBar(32, 80, 0x0000FF, 0.75F, ((CachedManaPoolRecipe) arecipes.get(recipe)).mana, TilePool.MAX_MANA / 10);
// Below is where the mana bar actually drawn.
int tempMana = ((CachedManaPoolRecipe) arecipes.get(recipe)).mana;
HUDHandler.renderManaBar(32, 80, 0x0000FF, 0.75F, GuiScreen.isShiftKeyDown() ? tempMana : tempMana * 10, TilePool.MAX_MANA / 10);
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
String size = GuiScreen.isShiftKeyDown() ? "1x " : "10x ";
String localized = StatCollector.translateToLocal("botaniamisc.neiratio");
font.drawString(size + localized, 84 - font.getStringWidth(size + localized) / 2, 71, 0x000000);
RenderTilePool.forceMana = true;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/botania/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ botaniamisc.clickToSee=Click to read
botaniamisc.shiftToRemove=Shift-click to remove
botaniamisc.clickToAdd=Add Bookmark
botaniamisc.ratio=%sx Zoom (hover to zoom out)
botaniamisc.neiratio=Zoom (shift to zoom out)
botaniamisc.bottleTooltip=It has an acquired taste
botaniamisc.coarseDirt0=Coarse Dirt, grass
botaniamisc.coarseDirt1=won't grow on it
Expand Down

0 comments on commit 67b44ca

Please sign in to comment.