mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Fix Item transfers related to Hoppers.
This commit is contained in:
1 parent
668bf47337
commit
f12a4b5c1e
6 files changed
+29
-12
No files matched your search
@@ -40,16 +40,16 @@ public class VanillaHopperItemHandler extends InvWrapper
|
||||
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
|
||||
{
|
||||
if (stack.func_190926_b())
|
||||
return null;
|
||||
// if (simulate || !hopper.mayTransfer())
|
||||
// return super.insertItem(slot, stack, simulate);
|
||||
return ItemStack.field_190927_a;
|
||||
if (simulate || !hopper.mayTransfer())
|
||||
return super.insertItem(slot, stack, simulate);
|
||||
|
||||
int curStackSize = stack.func_190916_E();
|
||||
ItemStack itemStack = super.insertItem(slot, stack, false);
|
||||
// if (itemStack == null || curStackSize != itemStack.func_190916_E())
|
||||
// {
|
||||
// hopper.setTransferCooldown(8);
|
||||
// }
|
||||
if (itemStack.func_190926_b() || curStackSize != itemStack.func_190916_E())
|
||||
{
|
||||
hopper.setTransferCooldown(8);
|
||||
}
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public class VanillaInventoryCodeHooks
|
||||
for (int i = 0; i < hopper.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack stackInSlot = hopper.getStackInSlot(i);
|
||||
if (stackInSlot.func_190926_b())
|
||||
if (!stackInSlot.func_190926_b())
|
||||
{
|
||||
ItemStack insert = stackInSlot.copy();
|
||||
insert.func_190920_e(1);
|
||||
|
||||
@@ -93,7 +93,7 @@ public class InvWrapper implements IItemHandlerModifiable
|
||||
if (!simulate)
|
||||
{
|
||||
ItemStack copy = stack.copy();
|
||||
copy.func_190918_g(stackInSlot.func_190916_E());
|
||||
copy.func_190917_f(stackInSlot.func_190916_E());
|
||||
getInv().setInventorySlotContents(slot, copy);
|
||||
getInv().markDirty();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user