Fix Item transfers related to Hoppers.

This commit is contained in:
LexManos 2016-11-18 14:42:22 -08:00
parent 668bf47337
commit f12a4b5c1e
6 changed files with 29 additions and 12 deletions

View File

@ -208,7 +208,7 @@
public SoundType func_185467_w()
{
return this.field_149762_H;
@@ -908,6 +934,1187 @@
@@ -908,6 +934,1176 @@
{
}
@ -1385,7 +1385,7 @@
public static void func_149671_p()
{
func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air"));
@@ -1201,14 +2408,7 @@
@@ -1201,14 +2397,7 @@
}
else
{

View File

@ -30,3 +30,16 @@
public static ItemStack func_174918_a(IInventory p_174918_0_, IInventory p_174918_1_, ItemStack p_174918_2_, @Nullable EnumFacing p_174918_3_)
{
if (p_174918_1_ instanceof ISidedInventory && p_174918_3_ != null)
@@ -509,9 +518,10 @@
int j = MathHelper.func_76128_c(p_145893_3_);
int k = MathHelper.func_76128_c(p_145893_5_);
BlockPos blockpos = new BlockPos(i, j, k);
- Block block = p_145893_0_.func_180495_p(blockpos).func_177230_c();
+ net.minecraft.block.state.IBlockState state = p_145893_0_.func_180495_p(blockpos);
+ Block block = state.func_177230_c();
- if (block.func_149716_u())
+ if (block.hasTileEntity(state))
{
TileEntity tileentity = p_145893_0_.func_175625_s(blockpos);

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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();
}

View File

@ -283,4 +283,8 @@ public net.minecraft.potion.PotionHelper$ItemPredicateInstance
public net.minecraft.potion.PotionHelper$MixPredicate
public net.minecraft.potion.PotionHelper func_185201_a(Lnet/minecraft/item/ItemPotion;Lnet/minecraft/potion/PotionHelper$ItemPredicateInstance;Lnet/minecraft/item/ItemPotion;)V # registerPotionItemConversion
public net.minecraft.potion.PotionHelper func_185202_a(Lnet/minecraft/potion/PotionHelper$ItemPredicateInstance;)V # registerPotionItem
public net.minecraft.potion.PotionHelper func_185204_a(Lnet/minecraft/potion/PotionType;Lcom/google/common/base/Predicate;Lnet/minecraft/potion/PotionType;)V # registerPotionTypeConversion
public net.minecraft.potion.PotionHelper func_185204_a(Lnet/minecraft/potion/PotionType;Lcom/google/common/base/Predicate;Lnet/minecraft/potion/PotionType;)V # registerPotionTypeConversion
# TileEntityHopper
public net.minecraft.tileentity.TileEntityHopper func_174914_o()Z # mayTransfer
public net.minecraft.tileentity.TileEntityHopper func_145896_c(I)V # setTransferCooldown