Skip to content

Commit

Permalink
implement #4830
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryLoenwind committed Dec 26, 2018
1 parent 9d4649d commit efb7f07
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Expand Up @@ -35,7 +35,7 @@
import static crazypants.enderio.base.integration.botania.BotaniaUtil.hasSolegnoliaAround;

@EventBusSubscriber(modid = EnderIO.MODID)
public class MagnetController {
public final class MagnetController {

private MagnetController() {
}
Expand Down Expand Up @@ -142,7 +142,7 @@ private static List<Entity> selectEntitiesWithinAABB(World world, AxisAlignedBB
isValidTarget = true;
}
}
isValidTarget = isValidTarget && !MagnetUtil.isReserved(entity);
isValidTarget = isValidTarget && !MagnetUtil.isReserved(entity, false);
if (isValidTarget) {
if (arraylist == null) {
arraylist = new ArrayList<Entity>(ItemConfig.magnetMaxItems.get() > 0 ? ItemConfig.magnetMaxItems.get() : 20);
Expand Down
Expand Up @@ -8,7 +8,6 @@

import com.enderio.core.api.common.util.ITankAccess;
import com.enderio.core.client.render.BoundingBox;
import info.loenwind.autosave.util.NBTAction;
import com.enderio.core.common.fluid.FluidWrapper;
import com.enderio.core.common.fluid.SmartTank;
import com.enderio.core.common.fluid.SmartTankFluidHandler;
Expand All @@ -34,6 +33,7 @@
import crazypants.enderio.util.Prep;
import info.loenwind.autosave.annotations.Storable;
import info.loenwind.autosave.annotations.Store;
import info.loenwind.autosave.util.NBTAction;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
Expand Down Expand Up @@ -258,7 +258,7 @@ private void hooverXP() {
if (!needsMending()) {
return;
}
} else if (MagnetUtil.shouldAttract(getPos(), entity)) {
} else if (MagnetUtil.shouldAttract(getPos(), entity, true)) {
double d = 1 - (Math.max(0.1, totalDistance) / maxDist);
double speed = 0.01 + (d * 0.02);

Expand Down
Expand Up @@ -7,7 +7,6 @@
import javax.annotation.Nullable;

import com.enderio.core.client.render.BoundingBox;
import info.loenwind.autosave.util.NBTAction;
import com.enderio.core.common.inventory.Callback;
import com.enderio.core.common.inventory.EnderInventory;
import com.enderio.core.common.inventory.EnderInventory.Type;
Expand All @@ -34,6 +33,7 @@
import crazypants.enderio.util.Prep;
import info.loenwind.autosave.annotations.Storable;
import info.loenwind.autosave.annotations.Store;
import info.loenwind.autosave.util.NBTAction;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
Expand Down Expand Up @@ -142,7 +142,7 @@ private List<EntityItem> selectEntitiesWithinAABB(World worldIn, AxisAlignedBB b
for (int chunkY = minChunkYClamped; chunkY <= maxChunkYClamped; ++chunkY) {
for (Entity entity : entityLists[chunkY]) {
if (!entity.isDead && (entity instanceof EntityItem) && entity.getEntityBoundingBox().intersects(bb)
&& (filter == null || filter.doesItemPassFilter(null, ((EntityItem) entity).getItem())) && MagnetUtil.shouldAttract(getPos(), entity)) {
&& (filter == null || filter.doesItemPassFilter(null, ((EntityItem) entity).getItem())) && MagnetUtil.shouldAttract(getPos(), entity, false)) {
result.add((EntityItem) entity);
if (maxItems > 0 && maxItems <= result.size()) {
return result;
Expand Down
Expand Up @@ -83,7 +83,7 @@ public void doUpdate() {

@Override
public boolean apply(@Nullable EntityXPOrb entity) {
return MagnetUtil.shouldAttract(getPos(), entity);
return MagnetUtil.shouldAttract(getPos(), entity, true);
}

private static final double speed = VacuumConfig.vacuumXPVelocity.get();
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -15,7 +15,7 @@ version_appendix=alpha
# dependencies versions
waila_version=1.8.13-B26_1.11
jei_version=4.8.5.147
endercore_version=1.12.2-0.5.43
endercore_version=1.12.2-0.5.44
top_version=1.12-1.4.19-11
forestry_version=5.8.0.242
chisel_version=0.1.1.26
Expand Down

0 comments on commit efb7f07

Please sign in to comment.