Fixed Issue with Interface and Gui, and Derpy Automation( Hoppers )

This commit is contained in:
AlgorithmX2 2014-01-30 19:23:12 -06:00
parent d10033fb50
commit 79a8da50a8
4 changed files with 26 additions and 3 deletions

View file

@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import appeng.tile.inventory.AppEngInternalInventory;
public class AppEngSlot extends Slot
{
@ -51,7 +52,11 @@ public class AppEngSlot extends Slot
@Override
public void onSlotChanged()
{
super.onSlotChanged();
if ( inventory instanceof AppEngInternalInventory )
((AppEngInternalInventory) inventory).onInventoryChanged( getSlotIndex() );
else
super.onSlotChanged();
isValid = hasCalculatedValidness.NotAvailable;
}

View file

@ -319,6 +319,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
public void onInventoryChanged()
{
for (int slot = 0; slot < storage.getSizeInventory(); slot++)
onChangeInventory( storage, slot, InvOperation.onInventoryChanged, null, null );
}
@Override
@ -360,8 +362,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
public boolean hasWorkToDo()
{
return requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null || requireWork[4] != null || requireWork[5] != null
|| requireWork[6] != null || requireWork[7] != null;
return requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null || requireWork[4] != null
|| requireWork[5] != null || requireWork[6] != null || requireWork[7] != null;
}
private boolean updateStorage()

View file

@ -137,6 +137,15 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
}
}
// for guis...
public void onInventoryChanged(int slotIndex)
{
if ( te != null && eventsEnabled() )
{
te.onChangeInventory( this, slotIndex, InvOperation.onInventoryChanged, null, null );
}
}
@Override
public int getInventoryStackLimit()
{
@ -242,4 +251,5 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
{
return new InvIterator( this );
}
}

View file

@ -124,6 +124,12 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IS
return duality.getInternalInventory();
}
@Override
public void onInventoryChanged()
{
duality.onInventoryChanged();
}
@Override
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added)
{