Switch to new IItemHandler (#3669)

This commit is contained in:
fscan
2018-10-04 20:39:06 +02:00
committed by yueh
parent e21c59b326
commit d88f550eb0
14 changed files with 34 additions and 158 deletions
@@ -23,11 +23,12 @@ import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import appeng.util.helpers.ItemHandlerUtil;
public class WrapperRangeItemHandler implements IInternalItemHandler
public class WrapperRangeItemHandler implements IItemHandlerModifiable
{
private final IItemHandler compose;
private final int minSlot;
@@ -108,22 +109,12 @@ public class WrapperRangeItemHandler implements IInternalItemHandler
}
@Override
public boolean isItemValidForSlot( int slot, ItemStack stack )
public boolean isItemValid( int slot, ItemStack stack )
{
if( this.checkSlot( slot ) )
{
return ItemHandlerUtil.isItemValidForSlot( this.compose, slot + this.minSlot, stack );
return this.compose.isItemValid( slot + this.minSlot, stack );
}
return false;
}
@Override
public void markDirty( int slot )
{
if( this.checkSlot( slot ) )
{
ItemHandlerUtil.markDirty( this.compose, slot + this.minSlot );
}
}
}