mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
fix item duplication when cant inject (#334)
Co-authored-by: UltraProdigy <187078471+UltraProdigy@users.noreply.github.com>
This commit is contained in:
1 parent
a48914c55c
commit
446920485a
2 files changed
+5
-17
No files matched your search
+4
-13
@@ -13,7 +13,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
|
||||
@@ -210,19 +209,11 @@ public class WirelessMagnetCardFilterInventory extends BaseWirelessInventory imp
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean doInject(IAEItemStack is, EntityItem itemToGet, World world) {
|
||||
public boolean doInject(IAEItemStack is, EntityItem itemToGet) {
|
||||
IAEItemStack ais = (IAEItemStack) injectItems(is);
|
||||
if (ais != null) {
|
||||
player.onItemPickup(itemToGet, ais.getItemStack().stackSize);
|
||||
player.inventory.addItemStackToInventory(ais.getItemStack());
|
||||
world.playSoundAtEntity(
|
||||
player,
|
||||
"random.pop",
|
||||
0.15F,
|
||||
((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
if (ais == null) return true;
|
||||
itemToGet.getEntityItem().stackSize = (int) ais.getStackSize();
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isItemFiltered(ItemStack inputItemStack) {
|
||||
|
||||
@@ -70,10 +70,7 @@ public class CommonProxy {
|
||||
.getFilter(wirelessTerm, result.getLeft(), gridNode, player);
|
||||
|
||||
if (inv.isPassFilter(stack)) {
|
||||
if (inv.doInject(
|
||||
AEApi.instance().storage().createItemStack(stack),
|
||||
itemEntity,
|
||||
world)) {
|
||||
if (inv.doInject(AEApi.instance().storage().createItemStack(stack), itemEntity)) {
|
||||
itemEntity.setDead();
|
||||
e.setCanceled(true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user