Gui/Container over haul to get Bus Guis working.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package appeng.container.slot;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -12,8 +13,15 @@ public class AppEngSlot extends Slot
|
||||
NotAvailable, Valid, Invalid
|
||||
};
|
||||
|
||||
public boolean isDraggable = true;
|
||||
public boolean isPlayerSide = false;
|
||||
|
||||
public Slot setNotDraggable()
|
||||
{
|
||||
isDraggable = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Slot setPlayerSide()
|
||||
{
|
||||
isPlayerSide = true;
|
||||
@@ -24,6 +32,17 @@ public class AppEngSlot extends Slot
|
||||
public hasCalculatedValidness isValid;
|
||||
public int defX, defY;
|
||||
|
||||
@Override
|
||||
public boolean func_111238_b()
|
||||
{
|
||||
return isEnabled();
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getTooltip()
|
||||
{
|
||||
return null;
|
||||
@@ -48,6 +67,9 @@ public class AppEngSlot extends Slot
|
||||
@Override
|
||||
public ItemStack getStack()
|
||||
{
|
||||
if ( !isEnabled() )
|
||||
return null;
|
||||
|
||||
if ( isDisplay )
|
||||
{
|
||||
isDisplay = false;
|
||||
@@ -56,6 +78,34 @@ public class AppEngSlot extends Slot
|
||||
return super.getStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack(ItemStack par1ItemStack)
|
||||
{
|
||||
if ( isEnabled() )
|
||||
super.putStack( par1ItemStack );
|
||||
}
|
||||
|
||||
public void clearStack()
|
||||
{
|
||||
super.putStack( null );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
if ( isEnabled() )
|
||||
return super.canTakeStack( par1EntityPlayer );
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack)
|
||||
{
|
||||
if ( isEnabled() )
|
||||
return super.isItemValid( par1ItemStack );
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack getDisplayStack()
|
||||
{
|
||||
return super.getStack();
|
||||
|
||||
Reference in New Issue
Block a user