diff --git a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java index 7634b4a92..3c1247c62 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java @@ -21,6 +21,7 @@ import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import vazkii.botania.api.internal.IManaBurst; +import vazkii.botania.common.item.ModItems; public class LensInfluence extends Lens { @@ -32,11 +33,24 @@ public class LensInfluence extends Lens { movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); movables.addAll(entity.worldObj.getEntitiesWithinAABB(EntityFallingBlock.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); + movables.addAll(entity.worldObj.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range))); for(Entity movable : movables) { - movable.motionX = entity.motionX; - movable.motionY = entity.motionY; - movable.motionZ = entity.motionZ; + if(movable == burst) + continue; + + if(movable instanceof IManaBurst) { + IManaBurst otherBurst = (IManaBurst) movable; + ItemStack lens = otherBurst.getSourceLens(); + if(lens != null && lens.getItem() == ModItems.lens && lens.getItemDamage() == ItemLens.INFLUENCE) + continue; + + ((IManaBurst) movable).setMotion(entity.motionX, entity.motionY, entity.motionZ); + } else { + movable.motionX = entity.motionX; + movable.motionY = entity.motionY; + movable.motionZ = entity.motionZ; + } } } }