The Ring of Magnetism now has a limit of 200 entities it can pull. Closes #1384

This commit is contained in:
Vasco Lavos committed 2015-09-19 22:58:14 +01:00
1 parent 3f063134c1
commit 8dafb55237
1 file changed
+5
@@ -99,13 +99,18 @@ public class ItemMagnetRing extends ItemBauble {
double z = player.posZ;
List<EntityItem> items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range));
int pulled = 0;
for(EntityItem item : items)
if(canPullItem(item)) {
if(pulled > 200)
break;
MathHelper.setEntityMotionFromVector(item, new Vector3(x, y, z), 0.45F);
if(player.worldObj.isRemote) {
boolean red = player.worldObj.rand.nextBoolean();
Botania.proxy.sparkleFX(player.worldObj, item.posX, item.posY, item.posZ, red ? 1F : 0F, 0F, red ? 0F : 1F, 1F, 3);
}
pulled++;
}
}
} else setCooldown(stack, cooldown - 1);