package info.u_team.u_team_core.gui;

import com.mojang.blaze3d.systems.RenderSystem;

import info.u_team.u_team_core.container.*;
import info.u_team.u_team_core.gui.render.FluidInventoryRender;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.fluid.Fluids;
import net.minecraft.inventory.container.Container;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.*;
import net.minecraftforge.fluids.FluidStack;

@OnlyIn(Dist.CLIENT)
public abstract class FluidContainerScreen<T extends Container> extends ContainerScreen<T> {
	
	private static final FluidInventoryRender FLUID_RENDERER = new FluidInventoryRender();
	
	public FluidContainerScreen(T screenContainer, PlayerInventory inv, ITextComponent titleIn) {
		super(screenContainer, inv, titleIn);
	}
	
	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		if (container instanceof FluidContainer) {
			final FluidContainer fluidContainer = (FluidContainer) container;
			for (int index = 0; index < fluidContainer.fluidSlots.size(); index++) {
				// drawFluidSlot(fluidContainer.fluidSlots.get(index));
			}
		}
		
//		RenderSystem.enableBlend();
//		RenderSystem.enableAlphaTest();
		
		FLUID_RENDERER.drawFluid(8, 18, new FluidStack(Fluids.WATER, 10));
		
//		RenderSystem.disableAlphaTest();
//		RenderSystem.disableBlend();
	}
	
	protected void drawFluidSlot(FluidSlot slot) {
		final int x = slot.getX();
		final int y = slot.getY();
		final FluidStack stack = slot.getStack();
		
		RenderSystem.enableBlend();
		RenderSystem.enableAlphaTest();
		
		FLUID_RENDERER.drawFluid(x, y, stack);
		
		RenderSystem.disableAlphaTest();
		RenderSystem.disableBlend();
	}
	
}

@@ -35,57 +35,8 @@
 i;%0A%0A
-import com.mojang.blaze3d.systems.RenderSystem;%0A%0A
 impo
@@ -71,24 +71,24 @@
 ontainer.*;%0A
+
 import info.
@@ -718,23 +718,17 @@
 creen(T 
-screenC
+c
 ontainer
@@ -745,19 +745,31 @@
 ventory 
-inv
+playerInventory
 , ITextC
@@ -782,18 +782,16 @@
 nt title
-In
 ) %7B%0A%09%09su
@@ -798,15 +798,9 @@
 per(
-screenC
+c
 onta
@@ -809,20 +809,30 @@
 er, 
-inv
+playerInventory
 , title
-In
 );%0A%09
@@ -1186,553 +1186,273 @@
 %0A%09%09%0A
-//%09%09RenderSystem.enableBlend();%0A//%09%09RenderSystem.enableAlphaTest();%0A%09%09%0A%09%09FLUID_RENDERER.drawFluid(8, 18, new FluidStack(Fluids.WATER, 10));%0A%09%09%0A//%09%09RenderSystem.disableAlphaTest();%0A//%09%09RenderSystem.disableBlend();%0A%09%7D%0A%09%0A%09protected void drawFluidSlot(FluidSlot slot) %7B%0A%09%09final int x = slot.getX();%0A%09%09final int y = slot.getY();%0A%09%09final FluidStack stack = slot.getStack();%0A%09%09%0A%09%09RenderSystem.enableBlend();%0A%09%09RenderSystem.enableAlphaTest();%0A%09%09%0A%09%09FLUID_RENDERER.drawFluid(x, y, stack);%0A%09%09%0A%09%09RenderSystem.disableAlphaTest();%0A%09%09RenderSystem.disableBlend(
+%09%09FLUID_RENDERER.drawFluid(8, 18, new FluidStack(Fluids.WATER, 10));%0A%09%7D%0A%09%0A%09protected void drawFluidSlot(FluidSlot slot) %7B%0A%09%09final int x = slot.getX();%0A%09%09final int y = slot.getY();%0A%09%09final FluidStack stack = slot.getStack();%0A%09%09%0A%09%09FLUID_RENDERER.drawFluid(x, y, stack
 );%0A%09

Rename some variables + remove gl operations