mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 06:52:58 +00:00
Fix patchouli integration components
This commit is contained in:
1 parent
26103c00ae
commit
f430df39f2
4 files changed
+41
-35
No files matched your search
@@ -8,9 +8,13 @@
|
||||
*/
|
||||
package vazkii.botania.client.patchouli.component;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.patchouli.api.IComponentRenderContext;
|
||||
@@ -42,11 +46,10 @@ public class ManaComponent implements ICustomComponent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(IComponentRenderContext context, float pticks, int mouseX, int mouseY) {
|
||||
FontRenderer font = context.getFont();
|
||||
|
||||
String manaUsage = I18n.format("botaniamisc.manaUsage");
|
||||
font.drawString(manaUsage, x + 102 / 2 - font.getStringWidth(manaUsage) / 2, y, 0x66000000);
|
||||
public void render(MatrixStack ms, IComponentRenderContext context, float pticks, int mouseX, int mouseY) {
|
||||
FontRenderer font = Minecraft.getInstance().fontRenderer;
|
||||
ITextComponent manaUsage = new TranslationTextComponent("botaniamisc.manaUsage").func_230530_a_(context.getFont());
|
||||
font.func_238422_b_(ms, manaUsage, x + 102 / 2 - font.func_238414_a_(manaUsage) / 2, y, 0x66000000);
|
||||
|
||||
int ratio = 10;
|
||||
if (context.isAreaHovered(mouseX, mouseY, x, y - 2, 102, 5 + 20)) {
|
||||
@@ -55,8 +58,8 @@ public class ManaComponent implements ICustomComponent {
|
||||
HUDHandler.renderManaBar(ms, x, y + 10, 0x0000FF, 0.75F,
|
||||
manaValues[(context.getTicksInBook() / 20) % manaValues.length], TilePool.MAX_MANA / ratio);
|
||||
|
||||
String ratioString = I18n.format("botaniamisc.ratio", ratio);
|
||||
font.drawString(ratioString, x + 102 / 2 - font.getStringWidth(ratioString) / 2, y + 15, 0x99000000);
|
||||
ITextComponent ratioString = new TranslationTextComponent("botaniamisc.ratio", ratio).func_230530_a_(context.getFont());
|
||||
font.func_238422_b_(ms, ratioString, x + 102 / 2 - font.func_238414_a_(ratioString) / 2, y + 15, 0x99000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user