This commit is contained in:
Shadows_of_Fire 2018-02-11 19:44:15 -05:00
parent c2209f0596
commit 3a56a962b2

View file

@ -10,6 +10,9 @@
package de.ellpeck.actuallyadditions.mod.tile; package de.ellpeck.actuallyadditions.mod.tile;
import java.util.ArrayList;
import java.util.List;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
@ -21,8 +24,6 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import java.util.ArrayList;
public class TileEntityRangedCollector extends TileEntityInventoryBase implements IButtonReactor{ public class TileEntityRangedCollector extends TileEntityInventoryBase implements IButtonReactor{
public static final int RANGE = 6; public static final int RANGE = 6;
@ -53,7 +54,7 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement
@Override @Override
public void activateOnPulse(){ public void activateOnPulse(){
ArrayList<EntityItem> items = (ArrayList<EntityItem>)this.world.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)); List<EntityItem> items = this.world.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.cannotPickup() && StackUtil.isValid(item.getItem())){ if(!item.isDead && !item.cannotPickup() && StackUtil.isValid(item.getItem())){