mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Made the ranged collector show particles when picking items up
This commit is contained in:
parent
14255ea801
commit
9e31e0c404
1 changed files with 6 additions and 3 deletions
|
@ -17,7 +17,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumParticleTypes;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.WorldServer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -55,16 +57,17 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement
|
||||||
ArrayList<EntityItem> items = (ArrayList<EntityItem>)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));
|
ArrayList<EntityItem> items = (ArrayList<EntityItem>)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()){
|
if(!items.isEmpty()){
|
||||||
for(EntityItem item : items){
|
for(EntityItem item : items){
|
||||||
if(!item.isDead && item.getEntityItem() != null){
|
if(!item.isDead && !item.cannotPickup() && item.getEntityItem() != null){
|
||||||
ItemStack toAdd = item.getEntityItem().copy();
|
ItemStack toAdd = item.getEntityItem().copy();
|
||||||
if(this.filter.check(toAdd, this.slots)){
|
if(this.filter.check(toAdd, this.slots)){
|
||||||
ArrayList<ItemStack> checkList = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> checkList = new ArrayList<ItemStack>();
|
||||||
checkList.add(toAdd);
|
checkList.add(toAdd);
|
||||||
if(WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, false, true)){
|
if(WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, false, true)){
|
||||||
WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, true, 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();
|
item.setDead();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue