package info.u_team.u_team_test.screen;

import info.u_team.u_team_core.gui.UContainerScreen;
import info.u_team.u_team_core.gui.elements.EnergyStorageWidget;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.container.BasicEnergyCreatorContainer;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.*;
import net.minecraftforge.energy.CapabilityEnergy;

@OnlyIn(Dist.CLIENT)
public class BasicEnergyCreatorScreen extends UContainerScreen<BasicEnergyCreatorContainer> {
	
	public BasicEnergyCreatorScreen(BasicEnergyCreatorContainer container, PlayerInventory playerInventory, ITextComponent title) {
		super(container, playerInventory, title, new ResourceLocation(TestMod.MODID, "textures/gui/energy_creator.png"));
		xSize = 176;
		ySize = 173;
	}
	
	@Override
	protected void init() {
		super.init();
		addButton(new EnergyStorageWidget(guiLeft + 9, guiTop + 20, 54, container.getTileEntity().getCapability(CapabilityEnergy.ENERGY)));
	}
	
	@Override
	public void render(int mouseX, int mouseY, float partialTicks) {
		renderBackground();
		super.render(mouseX, mouseY, partialTicks);
		buttons.forEach(button -> button.renderToolTip(mouseX, mouseY));
		renderHoveredToolTip(mouseX, mouseY);
	}
	
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		font.drawString(title.getFormattedText(), 8, 6, 4210752);
		font.drawString(playerInventory.getDisplayName().getFormattedText(), 8.0F, ySize - 94, 4210752);
	}
	
}

@@ -34,16 +34,63 @@
 creen;%0A%0A
+import com.mojang.blaze3d.matrix.MatrixStack;%0A%0A
 import i
@@ -976,44 +976,69 @@
 oid 
-init() %7B%0A%09%09super.init();%0A%09%09addButton
+func_231160_c_() %7B%0A%09%09super.func_231160_c_();%0A%09%09func_230480_a_
 (new
@@ -1185,23 +1185,56 @@
 ic void 
-render(
+func_230430_a_(MatrixStack matrixStack, 
 int mous
@@ -1277,43 +1277,73 @@
 %7B%0A%09%09
-renderBackground();%0A%09%09super.render(
+func_230446_a_(matrixStack);%0A%09%09super.func_230430_a_(matrixStack, 
 mous
@@ -1371,16 +1371,18 @@
 cks);%0A%09%09
+//
 buttons.
@@ -1441,32 +1441,57 @@
 Y));
-%0A%09%09renderHoveredToolTip(
+ TODO nessessary??%0A%09%09func_230459_a_(matrixStack, 
 mous
@@ -1500,32 +1500,34 @@
 , mouseY);%0A%09%7D%0A%09%0A
+//
 %09@Override%0A%09prot
@@ -1513,32 +1513,34 @@
 %0A%09%0A//%09@Override%0A
+//
 %09protected void 
@@ -1597,16 +1597,18 @@
 useY) %7B%0A
+//
 %09%09font.d
@@ -1659,16 +1659,18 @@
 10752);%0A
+//
 %09%09font.d
@@ -1760,15 +1760,17 @@
 10752);%0A
+//
 %09%7D%0A%09%0A%7D%0A

Fix basic energy creator screen