More warning fixes and cleanup.

This commit is contained in:
Sebastian Hartte
2020-06-14 18:13:42 +02:00
parent 20e9eb66b2
commit cbbb9d1ade
22 changed files with 81 additions and 90 deletions
+38 -47
View File
@@ -39,14 +39,14 @@ import appeng.core.sync.packets.PacketSwapSlots;
import appeng.fluids.client.render.FluidStackSizeRenderer; import appeng.fluids.client.render.FluidStackSizeRenderer;
import appeng.fluids.container.slots.IMEFluidSlot; import appeng.fluids.container.slots.IMEFluidSlot;
import appeng.helpers.InventoryAction; import appeng.helpers.InventoryAction;
import com.google.common.base.Joiner; import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.gui.widget.Widget; import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -69,8 +69,6 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@@ -99,14 +97,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
super.init(); super.init();
final List<Slot> slots = this.getInventorySlots(); final List<Slot> slots = this.getInventorySlots();
final Iterator<Slot> i = slots.iterator(); slots.removeIf(slot -> slot instanceof SlotME);
while( i.hasNext() )
{
if( i.next() instanceof SlotME )
{
i.remove();
}
}
for( final InternalSlotME me : this.meSlots ) for( final InternalSlotME me : this.meSlots )
{ {
@@ -160,9 +151,9 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
final int right = left + slot.getWidth(); final int right = left + slot.getWidth();
final int bottom = top + slot.getHeight(); final int bottom = top + slot.getHeight();
slot.drawContent( this.minecraft, mouseX, mouseY, partialTicks ); slot.drawContent( getMinecraft(), mouseX, mouseY, partialTicks );
if( this.isPointInRegion( left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY ) && slot.canClick( this.minecraft.player ) ) if( this.isPointInRegion( left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY ) && slot.canClick( getPlayer() ) )
{ {
RenderSystem.colorMask( true, true, true, false ); RenderSystem.colorMask( true, true, true, false );
this.fillGradient( left, top, right, bottom, -2130706433, -2130706433 ); this.fillGradient( left, top, right, bottom, -2130706433, -2130706433 );
@@ -261,7 +252,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
GuiUtils.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1, GuiUtils.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1,
18, 18,
18, 18,
0 /* FIXME: Check, this used this.zLevel before */); getBlitOffset());
} }
else else
{ {
@@ -270,7 +261,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
GuiUtils.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1, GuiUtils.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1,
18, 18,
18, 18,
0 /* FIXME: Check, this used this.zLevel before */); getBlitOffset());
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F ); RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
} }
} }
@@ -279,7 +270,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
for( final GuiCustomSlot slot : this.guiSlots ) for( final GuiCustomSlot slot : this.guiSlots )
{ {
slot.drawBackground( ox, oy ); slot.drawBackground( ox, oy, getBlitOffset() );
} }
} }
@@ -303,9 +294,9 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
for( GuiCustomSlot slot : this.guiSlots ) for( GuiCustomSlot slot : this.guiSlots )
{ {
if( this.isPointInRegion( slot.xPos(), slot.yPos(), slot.getWidth(), slot.getHeight(), xCoord, yCoord ) && slot.canClick( this.minecraft.player ) ) if( this.isPointInRegion( slot.xPos(), slot.yPos(), slot.getWidth(), slot.getHeight(), xCoord, yCoord ) && slot.canClick( getPlayer() ) )
{ {
slot.slotClicked( this.minecraft.player.inventory.getItemStack(), btn ); slot.slotClicked( getPlayer().inventory.getItemStack(), btn );
} }
} }
@@ -321,7 +312,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double dragX, double dragY) { public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double dragX, double dragY) {
final Slot slot = this.getSlot( (int) mouseX, (int) mouseY ); final Slot slot = this.getSlot( (int) mouseX, (int) mouseY );
final ItemStack itemstack = this.minecraft.player.inventory.getItemStack(); final ItemStack itemstack = getPlayer().inventory.getItemStack();
if( this.getScrollBar() != null ) if( this.getScrollBar() != null )
{ {
@@ -353,7 +344,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
@Override @Override
protected void handleMouseClick( final Slot slot, final int slotIdx, final int mouseButton, final ClickType clickType ) protected void handleMouseClick( final Slot slot, final int slotIdx, final int mouseButton, final ClickType clickType )
{ {
final PlayerEntity player = Minecraft.getInstance().player; final PlayerEntity player = getPlayer();
if( slot instanceof SlotFake ) if( slot instanceof SlotFake )
{ {
@@ -386,7 +377,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
return; // prevent weird double clicks.. return; // prevent weird double clicks..
} }
InventoryAction action = null; InventoryAction action;
if( hasShiftDown() ) if( hasShiftDown() )
{ {
action = InventoryAction.CRAFT_SHIFT; action = InventoryAction.CRAFT_SHIFT;
@@ -508,7 +499,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
if( action != null ) if( action != null )
{ {
( (AEBaseContainer) this.container ).setTargetStack( stack ); this.container.setTargetStack( stack );
final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 ); final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
NetworkHandler.instance().sendToServer( p ); NetworkHandler.instance().sendToServer( p );
} }
@@ -542,7 +533,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
for( final Slot inventorySlot : slots ) for( final Slot inventorySlot : slots )
{ {
if( inventorySlot != null && inventorySlot.canTakeStack( if( inventorySlot != null && inventorySlot.canTakeStack(
this.minecraft.player ) && inventorySlot.getHasStack() && inventorySlot.isSameInventory( slot ) && Container.canAddItemToSlot( getPlayer() ) && inventorySlot.getHasStack() && inventorySlot.isSameInventory( slot ) && Container.canAddItemToSlot(
inventorySlot, this.dbl_whichItem, true ) ) inventorySlot, this.dbl_whichItem, true ) )
{ {
this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, 0, ClickType.QUICK_MOVE ); this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, 0, ClickType.QUICK_MOVE );
@@ -560,16 +551,21 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
protected boolean func_195363_d(int keyCode, int scanCode) { protected boolean func_195363_d(int keyCode, int scanCode) {
return checkHotbarKeys(InputMappings.getInputByCode(keyCode, scanCode)); return checkHotbarKeys(InputMappings.getInputByCode(keyCode, scanCode));
} }
protected ClientPlayerEntity getPlayer() {
// Our UIs are usually not opened when not in-game, so this should not be a problem
return Preconditions.checkNotNull(getMinecraft().player);
}
protected boolean checkHotbarKeys( final InputMappings.Input input ) protected boolean checkHotbarKeys( final InputMappings.Input input )
{ {
final Slot theSlot = this.getSlotUnderMouse(); final Slot theSlot = this.getSlotUnderMouse();
if( this.minecraft.player.inventory.getItemStack().isEmpty() && theSlot != null ) if( getPlayer().inventory.getItemStack().isEmpty() && theSlot != null )
{ {
for( int j = 0; j < 9; ++j ) for( int j = 0; j < 9; ++j )
{ {
if( this.minecraft.gameSettings.keyBindsHotbar[j].isActiveAndMatches(input) ) if( getMinecraft().gameSettings.keyBindsHotbar[j].isActiveAndMatches(input) )
{ {
final List<Slot> slots = this.getInventorySlots(); final List<Slot> slots = this.getInventorySlots();
for( final Slot s : slots ) for( final Slot s : slots )
@@ -673,7 +669,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
public void bindTexture( final String base, final String file ) public void bindTexture( final String base, final String file )
{ {
final ResourceLocation loc = new ResourceLocation( base, "textures/" + file ); final ResourceLocation loc = new ResourceLocation( base, "textures/" + file );
this.minecraft.getTextureManager().bindTexture( loc ); getMinecraft().getTextureManager().bindTexture( loc );
} }
protected void drawItem( final int x, final int y, final ItemStack is ) protected void drawItem( final int x, final int y, final ItemStack is )
@@ -695,16 +691,12 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
private boolean hasCustomInventoryName() private boolean hasCustomInventoryName()
{ {
if( this.container instanceof AEBaseContainer ) return this.container.getCustomName() != null;
{
return ( (AEBaseContainer) this.container ).getCustomName() != null;
}
return false;
} }
private String getInventoryName() private String getInventoryName()
{ {
return ( (AEBaseContainer) this.container ).getCustomName(); return this.container.getCustomName();
} }
/** /**
@@ -746,9 +738,9 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
RenderSystem.disableBlend(); RenderSystem.disableBlend();
final Fluid fluid = fs.getFluid(); final Fluid fluid = fs.getFluid();
FluidAttributes fluidAttributes = fluid.getAttributes(); FluidAttributes fluidAttributes = fluid.getAttributes();
minecraft.getTextureManager().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE ); bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
ResourceLocation fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack()); ResourceLocation fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
final TextureAtlasSprite sprite = minecraft.getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture); final TextureAtlasSprite sprite = getMinecraft().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture);
// Set color for dynamic fluids // Set color for dynamic fluids
// Convert int color to RGB // Convert int color to RGB
@@ -783,7 +775,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
try try
{ {
final int uv_y = (int) Math.floor( aes.getIcon() / 16 ); final int uv_y = aes.getIcon() / 16;
final int uv_x = aes.getIcon() - uv_y * 16; final int uv_x = aes.getIcon() - uv_y * 16;
RenderSystem.enableBlend(); RenderSystem.enableBlend();
@@ -803,24 +795,23 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
final float f1 = 0.00390625F; final float f1 = 0.00390625F;
final float f = 0.00390625F; final float f = 0.00390625F;
final float par6 = 16; final float par6 = 16;
int zLevel = 0; // FIXME This was previously a field (see FIXMEs above) vb.pos( par1 + 0, par2 + par6, getBlitOffset() )
vb.pos( par1 + 0, par2 + par6, zLevel )
.tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 ) .tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 )
.color( 1.0f, 1.0f, 1.0f, .color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ) aes.getOpacityOfIcon() )
.endVertex(); .endVertex();
final float par5 = 16; final float par5 = 16;
vb.pos( par1 + par5, par2 + par6, zLevel ) vb.pos( par1 + par5, par2 + par6, getBlitOffset() )
.tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 ) .tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 )
.color( 1.0f, 1.0f, 1.0f, .color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ) aes.getOpacityOfIcon() )
.endVertex(); .endVertex();
vb.pos( par1 + par5, par2 + 0, zLevel ) vb.pos( par1 + par5, par2 + 0, getBlitOffset() )
.tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 ) .tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 )
.color( 1.0f, 1.0f, 1.0f, .color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ) aes.getOpacityOfIcon() )
.endVertex(); .endVertex();
vb.pos( par1 + 0, par2 + 0, zLevel ) vb.pos( par1 + 0, par2 + 0, getBlitOffset() )
.tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 ) .tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 )
.color( 1.0f, 1.0f, 1.0f, .color( 1.0f, 1.0f, 1.0f,
aes.getOpacityOfIcon() ) aes.getOpacityOfIcon() )
@@ -830,6 +821,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
} }
catch( final Exception err ) catch( final Exception err )
{ {
err.printStackTrace();
} }
} }
} }
@@ -844,7 +836,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
{ {
try try
{ {
isValid = ( (SlotRestrictedInput) s ).isValid( is, this.minecraft.world ); isValid = ( (SlotRestrictedInput) s ).isValid( is, getMinecraft().world );
} }
catch( final Exception err ) catch( final Exception err )
{ {
@@ -856,13 +848,12 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.Invalid ) if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.Invalid )
{ {
// FIXME: Test this, the fill function used below does not support setting Z setBlitOffset(100);
// FIXME this.zLevel = 100.0F;
this.itemRenderer.zLevel = 100.0F; this.itemRenderer.zLevel = 100.0F;
fill( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666 ); fill( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666 );
// FIXME this.zLevel = 0.0F; setBlitOffset(0);
this.itemRenderer.zLevel = 0.0F; this.itemRenderer.zLevel = 0.0F;
} }
} }
@@ -896,12 +887,12 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
public void bindTexture( final String file ) public void bindTexture( final String file )
{ {
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file ); final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
this.minecraft.getTextureManager().bindTexture( loc ); getMinecraft().getTextureManager().bindTexture( loc );
} }
public void bindTexture( final ResourceLocation loc ) public void bindTexture( final ResourceLocation loc )
{ {
this.minecraft.getTextureManager().bindTexture( loc ); getMinecraft().getTextureManager().bindTexture( loc );
} }
protected GuiScrollbar getScrollBar() protected GuiScrollbar getScrollBar()
@@ -67,53 +67,53 @@ public class GuiCellWorkbench extends GuiUpgradeable<ContainerCellWorkbench>
this.handleButtonVisibility(); this.handleButtonVisibility();
this.bindTexture( this.getBackground() ); this.bindTexture( this.getBackground() );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, getBlitOffset() );
if( this.drawUpgrades() ) if( this.drawUpgrades() )
{ {
if( this.container.availableUpgrades() <= 8 ) if( this.container.availableUpgrades() <= 8 )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + this.container.availableUpgrades() * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + this.container.availableUpgrades() * 18, getBlitOffset() );
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( this.container.availableUpgrades() ) * 18 ), 177, 151, 35, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( this.container.availableUpgrades() ) * 18 ), 177, 151, 35, 7, getBlitOffset() );
} }
else if( this.container.availableUpgrades() <= 16 ) else if( this.container.availableUpgrades() <= 16 )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18, getBlitOffset() );
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7, getBlitOffset() );
final int dx = this.container.availableUpgrades() - 8; final int dx = this.container.availableUpgrades() - 8;
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18, getBlitOffset() );
if( dx == 8 ) if( dx == 8 )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7, getBlitOffset() );
} }
else else
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7, getBlitOffset() );
} }
} }
else else
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 7 + 8 * 18, getBlitOffset() );
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY + ( 7 + ( 8 ) * 18 ), 177, 151, 35, 7, getBlitOffset() );
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + 8 * 18, getBlitOffset() );
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( 8 ) * 18 ), 186, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( 8 ) * 18 ), 186, 151, 35 - 8, 7, getBlitOffset() );
final int dx = this.container.availableUpgrades() - 16; final int dx = this.container.availableUpgrades() - 16;
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18, getBlitOffset() );
if( dx == 8 ) if( dx == 8 )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7, getBlitOffset() );
} }
else else
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7, getBlitOffset() );
} }
} }
} }
if( this.hasToolbox() ) if( this.hasToolbox() )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68, getBlitOffset() );
} }
} }
@@ -71,6 +71,6 @@ public class GuiChest extends AEBaseGui<ContainerChest>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/chest.png" ); this.bindTexture( "guis/chest.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -72,6 +72,6 @@ public class GuiCondenser extends AEBaseGui<ContainerCondenser>
{ {
this.bindTexture( "guis/condenser.png" ); this.bindTexture( "guis/condenser.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -95,7 +95,7 @@ public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount>
this.next.setMessage(hasShiftDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal()); this.next.setMessage(hasShiftDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal());
this.bindTexture( "guis/craft_amt.png" ); this.bindTexture( "guis/craft_amt.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
try try
{ {
@@ -362,7 +362,7 @@ public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm>
{ {
this.setScrollBar(); this.setScrollBar();
this.bindTexture( "guis/craftingreport.png" ); this.bindTexture( "guis/craftingreport.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
private void setScrollBar() private void setScrollBar()
@@ -320,7 +320,7 @@ public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/craftingcpu.png" ); this.bindTexture( "guis/craftingcpu.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
public void postUpdate( final List<IAEItemStack> list, final byte ref ) public void postUpdate( final List<IAEItemStack> list, final byte ref )
@@ -62,6 +62,6 @@ public class GuiDrive extends AEBaseGui<ContainerDrive>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/drive.png" ); this.bindTexture( "guis/drive.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -47,6 +47,6 @@ public class GuiGrinder extends AEBaseGui<ContainerGrinder>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/grinder.png" ); this.bindTexture( "guis/grinder.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -71,15 +71,15 @@ public class GuiInscriber extends AEBaseGui<ContainerInscriber>
this.pb.x = 135 + this.guiLeft; this.pb.x = 135 + this.guiLeft;
this.pb.y = 39 + this.guiTop; this.pb.y = 39 + this.guiTop;
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, getBlitOffset() );
if( this.drawUpgrades() ) if( this.drawUpgrades() )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.container.availableUpgrades() * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.container.availableUpgrades() * 18, getBlitOffset() );
} }
if( this.hasToolbox() ) if( this.hasToolbox() )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68, getBlitOffset() );
} }
} }
@@ -152,7 +152,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/interfaceterminal.png" ); this.bindTexture( "guis/interfaceterminal.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
int offset = 17; int offset = 17;
final int ex = this.getScrollBar().getCurrentScroll(); final int ex = this.getScrollBar().getCurrentScroll();
@@ -166,7 +166,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
RenderSystem.color4f( 1, 1, 1, 1 ); RenderSystem.color4f( 1, 1, 1, 1 );
final int width = inv.getInventory().getSlots() * 18; final int width = inv.getInventory().getSlots() * 18;
GuiUtils.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18, getBlitOffset() );
} }
offset += 18; offset += 18;
} }
@@ -188,7 +188,7 @@ public class GuiNetworkStatus extends AEBaseGui<ContainerNetworkStatus> implemen
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/networkstatus.png" ); this.bindTexture( "guis/networkstatus.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
public void postUpdate( final List<IAEItemStack> list ) public void postUpdate( final List<IAEItemStack> list )
@@ -71,6 +71,6 @@ public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/toolbox.png" ); this.bindTexture( "guis/toolbox.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -89,7 +89,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/priority.png" ); this.bindTexture( "guis/priority.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
this.priority.render(mouseX, mouseY, partialTicks); this.priority.render(mouseX, mouseY, partialTicks);
} }
@@ -47,6 +47,6 @@ public class GuiQNB extends AEBaseGui<ContainerQNB>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/chest.png" ); this.bindTexture( "guis/chest.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -68,7 +68,7 @@ public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/quartzknife.png" ); this.bindTexture( "guis/quartzknife.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
this.name.render(mouseX, mouseY, partialTicks); this.name.render(mouseX, mouseY, partialTicks);
} }
@@ -73,6 +73,6 @@ public class GuiSpatialIOPort extends AEBaseGui<ContainerSpatialIOPort>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/spatialio.png" ); this.bindTexture( "guis/spatialio.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -116,14 +116,14 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
this.handleButtonVisibility(); this.handleButtonVisibility();
this.bindTexture( this.getBackground() ); this.bindTexture( this.getBackground() );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize, getBlitOffset() );
if( this.drawUpgrades() ) if( this.drawUpgrades() )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18, getBlitOffset() );
} }
if( this.hasToolbox() ) if( this.hasToolbox() )
{ {
GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68, getBlitOffset() );
} }
} }
@@ -66,7 +66,7 @@ public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber>
RenderSystem.color3f( 1, 1, 1 ); RenderSystem.color3f( 1, 1, 1 );
final int l = -15; final int l = -15;
final int k = 25; final int k = 25;
GuiUtils.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2, getBlitOffset() );
} }
} }
@@ -76,6 +76,6 @@ public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber>
this.bindTexture( "guis/vibchamber.png" ); this.bindTexture( "guis/vibchamber.png" );
this.pb.x = 99 + this.guiLeft; this.pb.x = 99 + this.guiLeft;
this.pb.y = 36 + this.guiTop; this.pb.y = 36 + this.guiTop;
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -70,6 +70,6 @@ public class GuiWireless extends AEBaseGui<ContainerWireless>
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks)
{ {
this.bindTexture( "guis/wireless.png" ); this.bindTexture( "guis/wireless.png" );
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 /* FIXME this.zlevel was used */ ); GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset() );
} }
} }
@@ -37,7 +37,7 @@ public abstract class GuiCustomSlot extends AbstractGui implements ITooltip
public abstract void drawContent( final Minecraft mc, final int mouseX, final int mouseY, final float partialTicks ); public abstract void drawContent( final Minecraft mc, final int mouseX, final int mouseY, final float partialTicks );
public void drawBackground( int guileft, int guitop ) public void drawBackground( int guileft, int guitop, int currentZIndex )
{ {
} }
@@ -46,7 +46,7 @@ public class GuiOptionalFluidSlot extends GuiFluidSlot
} }
@Override @Override
public void drawBackground( int guileft, int guitop ) public void drawBackground( int guileft, int guitop, int currentZIndex )
{ {
RenderSystem.enableBlend(); RenderSystem.enableBlend();
if( this.isSlotEnabled() ) if( this.isSlotEnabled() )
@@ -58,6 +58,6 @@ public class GuiOptionalFluidSlot extends GuiFluidSlot
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 0.4F ); RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 0.4F );
} }
GuiUtils.drawTexturedModalRect( guileft + this.xPos() - 1, guitop + this.yPos() - 1, this.srcX - 1, this.srcY - 1, this.getWidth() + 2, GuiUtils.drawTexturedModalRect( guileft + this.xPos() - 1, guitop + this.yPos() - 1, this.srcX - 1, this.srcY - 1, this.getWidth() + 2,
this.getHeight() + 2, 0 /* FIXME ZINDEX */ ); this.getHeight() + 2, currentZIndex );
} }
} }