From 9e31e0c4044cd21336bf672f2c24188114028201 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 7 Nov 2016 20:07:37 +0100 Subject: [PATCH] Made the ranged collector show particles when picking items up --- .../mod/tile/TileEntityRangedCollector.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java index 9ac713bb9..1747cab9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java @@ -17,7 +17,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.world.WorldServer; import java.util.ArrayList; @@ -55,16 +57,17 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement ArrayList items = (ArrayList)this.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE)); if(!items.isEmpty()){ for(EntityItem item : items){ - if(!item.isDead && item.getEntityItem() != null){ + if(!item.isDead && !item.cannotPickup() && item.getEntityItem() != null){ ItemStack toAdd = item.getEntityItem().copy(); if(this.filter.check(toAdd, this.slots)){ ArrayList checkList = new ArrayList(); checkList.add(toAdd); if(WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, false, true)){ WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, true, true); + + ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.CLOUD, false, item.posX, item.posY+0.45F, item.posZ, 5, 0, 0, 0, 0.03D); + item.setDead(); - - } } }