First Container opens (Sky Chest)

This commit is contained in:
Sebastian Hartte
2020-06-02 12:41:03 +02:00
parent 92fa237ce0
commit 2f50568237
7 changed files with 76 additions and 12 deletions
@@ -76,7 +76,7 @@ import java.util.concurrent.TimeUnit;
//TODO, pass generic up here for Container
public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScreen<T>
{
private final List<InternalSlotME> meSlots = new ArrayList<>();
// drag y
@@ -90,7 +90,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
private Slot bl_clicked;
protected final List<GuiCustomSlot> guiSlots = new ArrayList<>();
public AEBaseGui(AEBaseContainer container, PlayerInventory playerInventory, ITextComponent title) {
public AEBaseGui(T container, PlayerInventory playerInventory, ITextComponent title) {
super(container, playerInventory, title);
}
@@ -940,6 +940,11 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
this.minecraft.getTextureManager().bindTexture( loc );
}
public void bindTexture( final ResourceLocation loc )
{
this.minecraft.getTextureManager().bindTexture( loc );
}
protected GuiScrollbar getScrollBar()
{
return this.myScrollBar;
@@ -19,21 +19,25 @@
package appeng.client.gui.implementations;
import appeng.core.AppEng;
import net.minecraft.entity.player.PlayerInventory;
import appeng.client.gui.AEBaseGui;
import appeng.container.implementations.ContainerSkyChest;
import appeng.core.localization.GuiText;
import appeng.integration.Integrations;
import appeng.tile.storage.TileSkyChest;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
public class GuiSkyChest extends AEBaseGui
public class GuiSkyChest extends AEBaseGui<ContainerSkyChest>
{
public GuiSkyChest( final PlayerInventory PlayerInventory, final TileSkyChest te )
private static final ResourceLocation TEXTURE = new ResourceLocation(AppEng.MOD_ID, "textures/guis/skychest.png");
public GuiSkyChest( ContainerSkyChest container, PlayerInventory playerInv, ITextComponent title )
{
super( new ContainerSkyChest( PlayerInventory, te ) );
super( container, playerInv, title );
this.ySize = 195;
}
@@ -47,13 +51,14 @@ public class GuiSkyChest extends AEBaseGui
@Override
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.bindTexture( "guis/skychest.png" );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
bindTexture(TEXTURE);
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0 );
}
@Override
protected boolean enableSpaceClicking()
{
return !Integrations.invTweaks().isEnabled();
// FIXME return !Integrations.invTweaks().isEnabled();
return true;
}
}