mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
The Influence lens can now move mana bursts. Have fun with this one :3
This commit is contained in:
1 parent
33d7e67af9
commit
e0aa502961
1 file changed
+17
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user