Use IItemHandler instead of IInventory internally (#2971)
* Use IItemHandler instead of IInventory internally
This commit is contained in:
@@ -21,10 +21,11 @@ package appeng.tile.networking;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.GridFlags;
|
||||
@@ -40,15 +41,11 @@ import appeng.block.networking.BlockController;
|
||||
import appeng.block.networking.BlockController.ControllerBlockState;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.grid.AENetworkPowerTile;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.inv.InvOperation;
|
||||
|
||||
|
||||
public class TileController extends AENetworkPowerTile
|
||||
{
|
||||
private static final IInventory NULL_INVENTORY = new AppEngInternalInventory( null, 0 );
|
||||
private static final int[] ACCESSIBLE_SLOTS_BY_SIDE = {};
|
||||
|
||||
private boolean isValid = false;
|
||||
|
||||
public TileController()
|
||||
@@ -194,21 +191,14 @@ public class TileController extends AENetworkPowerTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInternalInventory()
|
||||
public IItemHandler getInternalInventory()
|
||||
{
|
||||
return NULL_INVENTORY;
|
||||
return EmptyHandler.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
||||
public void onChangeInventory( final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removed, final ItemStack added )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsBySide( final EnumFacing whichSide )
|
||||
{
|
||||
return ACCESSIBLE_SLOTS_BY_SIDE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,11 +216,4 @@ public class TileController extends AENetworkPowerTile
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user