Use IItemHandler instead of IInventory internally (#2971)

* Use IItemHandler instead of IInventory internally
This commit is contained in:
fscan
2017-07-28 22:04:32 +02:00
committed by yueh
parent c077840988
commit 52d28fabe3
156 changed files with 2410 additions and 4604 deletions
@@ -13,20 +13,21 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.SlotItemHandler;
/**
* A proxy for a slot that will always return an itemstack with size 1, if there is an item in the slot.
* Used to prevent the default item count from rendering.
*/
class Size1Slot extends Slot
class Size1Slot extends SlotItemHandler
{
private final Slot delegate;
private final SlotItemHandler delegate;
public Size1Slot( Slot delegate )
public Size1Slot( SlotItemHandler delegate )
{
super( delegate.inventory, delegate.getSlotIndex(), delegate.xPos, delegate.yPos );
super( delegate.getItemHandler(), delegate.getSlotIndex(), delegate.xPos, delegate.yPos );
this.delegate = delegate;
}