mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-26 14:25:20 +00:00
Prevent weird GUI behaviour at small X coordinates
https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/7377
This commit is contained in:
1 parent
11f1d366a1
commit
fbf087c758
3 files changed
+10
-8
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
aeversion=rv3
|
||||
aechannel=beta
|
||||
aebuild=40-GTNH
|
||||
aebuild=41-GTNH
|
||||
#KEEP V6 FOR MOD SUPPORT
|
||||
aegroup=appeng
|
||||
aebasename=appliedenergistics2
|
||||
|
||||
@@ -215,8 +215,9 @@ public enum GuiBridge implements IGuiHandler
|
||||
public Object getServerGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
final ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 );
|
||||
final GuiBridge ID = values()[ordinal >> 4];
|
||||
final GuiBridge ID = values()[ordinal >> 5];
|
||||
final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
|
||||
final boolean xIsSlotIndex = ( ( ordinal >> 4 ) & 1 ) == 1;
|
||||
if( ID.type.isItem() )
|
||||
{
|
||||
ItemStack it = null;
|
||||
@@ -224,7 +225,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
it = player.inventory.getCurrentItem();
|
||||
}
|
||||
else if( x >= 0 && x < player.inventory.mainInventory.length )
|
||||
else if( xIsSlotIndex && x >= 0 && x < player.inventory.mainInventory.length )
|
||||
{
|
||||
it = player.inventory.getStackInSlot( x );
|
||||
}
|
||||
@@ -397,8 +398,9 @@ public enum GuiBridge implements IGuiHandler
|
||||
public Object getClientGuiElement( final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
final ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 );
|
||||
final GuiBridge ID = values()[ordinal >> 4];
|
||||
final GuiBridge ID = values()[ordinal >> 5];
|
||||
final boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
|
||||
final boolean xIsSlotIndex = ( ( ordinal >> 4 ) & 1 ) == 1;
|
||||
if( ID.type.isItem() )
|
||||
{
|
||||
ItemStack it = null;
|
||||
@@ -406,7 +408,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
it = player.inventory.getCurrentItem();
|
||||
}
|
||||
else if( x >= 0 && x < player.inventory.mainInventory.length )
|
||||
else if (xIsSlotIndex && x >= 0 && x < player.inventory.mainInventory.length )
|
||||
{
|
||||
it = player.inventory.getStackInSlot( x );
|
||||
}
|
||||
|
||||
@@ -338,15 +338,15 @@ public class Platform
|
||||
{
|
||||
if( tile == null && type.getType() == GuiHostType.ITEM )
|
||||
{
|
||||
p.openGui( AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0 );
|
||||
p.openGui( AppEng.instance(), type.ordinal() << 5 | (1 << 4), p.getEntityWorld(), p.inventory.currentItem, 0, 0 );
|
||||
}
|
||||
else if( tile == null || type.getType() == GuiHostType.ITEM )
|
||||
{
|
||||
p.openGui( AppEng.instance(), type.ordinal() << 4 | ( 1 << 3 ), p.getEntityWorld(), x, y, z );
|
||||
p.openGui( AppEng.instance(), type.ordinal() << 5 | ( 1 << 3 ), p.getEntityWorld(), x, y, z );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.openGui( AppEng.instance(), type.ordinal() << 4 | ( side.ordinal() ), tile.getWorldObj(), x, y, z );
|
||||
p.openGui( AppEng.instance(), type.ordinal() << 5 | ( side.ordinal() ), tile.getWorldObj(), x, y, z );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user