1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-11 10:53:03 +00:00

Started work on upgrading to 1.16.1. Not in a compilable state yet

This commit is contained in:
Alex Evelyn
2020-07-07 13:27:13 -04:00
parent cb66ef7e30
commit 605e1f6b9b
513 changed files with 48117 additions and 534 deletions

View File

@@ -14,12 +14,12 @@ import dan200.computercraft.shared.computer.core.ClientComputer;
import dan200.computercraft.shared.computer.core.ComputerFamily;
import dan200.computercraft.shared.turtle.blocks.TileTurtle;
import dan200.computercraft.shared.turtle.inventory.ContainerTurtle;
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;
public class GuiTurtle extends AbstractContainerScreen<ContainerTurtle>
public class GuiTurtle extends HandledScreen<ContainerTurtle>
{
private static final Identifier BACKGROUND_NORMAL = new Identifier( "computercraft", "textures/gui/turtle_normal.png" );
private static final Identifier BACKGROUND_ADVANCED = new Identifier( "computercraft", "textures/gui/turtle_advanced.png" );
@@ -40,8 +40,8 @@ public class GuiTurtle extends AbstractContainerScreen<ContainerTurtle>
m_family = turtle.getFamily();
m_computer = turtle.getClientComputer();
containerWidth = 254;
containerHeight = 217;
backgroundWidth = 254;
backgroundHeight = 217;
}
@Override
@@ -59,7 +59,7 @@ public class GuiTurtle extends AbstractContainerScreen<ContainerTurtle>
ComputerCraft.terminalHeight_turtle,
2, 2, 2, 2
);
terminalWrapper = new WidgetWrapper( terminal, 2 + 8 + left, 2 + 8 + top, termPxWidth, termPxHeight );
terminalWrapper = new WidgetWrapper( terminal, 2 + 8 + x, 2 + 8 + y, termPxWidth, termPxHeight );
children.add( terminalWrapper );
setFocused( terminalWrapper );
@@ -90,8 +90,8 @@ public class GuiTurtle extends AbstractContainerScreen<ContainerTurtle>
GlStateManager.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
int slotX = slot % 4;
int slotY = slot / 4;
minecraft.getTextureManager().bindTexture( advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL );
blit( left + m_container.m_turtleInvStartX - 2 + slotX * 18, top + m_container.m_playerInvStartY - 2 + slotY * 18, 0, 217, 24, 24 );
minecraft.getTextureManager().bindTextureInner( advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL );
blit( x + m_container.m_turtleInvStartX - 2 + slotX * 18, y + m_container.m_playerInvStartY - 2 + slotY * 18, 0, 217, 24, 24 );
}
}
@@ -104,8 +104,8 @@ public class GuiTurtle extends AbstractContainerScreen<ContainerTurtle>
// Draw border/inventory
GlStateManager.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
minecraft.getTextureManager().bindTexture( advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL );
blit( left, top, 0, 0, containerWidth, containerHeight );
minecraft.getTextureManager().bindTextureInner( advanced ? BACKGROUND_ADVANCED : BACKGROUND_NORMAL );
blit( x, y, 0, 0, backgroundWidth, backgroundHeight );
drawSelectionSlot( advanced );
}