Preventing mysterious Magnet from picking up player's own shot projectiles. Doesn't _really_ fix #96, but it's the best I can do without special-casing to hell and back again. |:

This commit is contained in:
MysteriousAges committed 2015-09-29 17:35:44 -07:00
1 parent af44fb9d89
commit 2503c94b83
1 file changed
+2 -1
@@ -168,7 +168,8 @@ public class ItemMysteriousMagnet extends Item implements IBauble {
List<EntityArrow> arrows = world.getEntitiesWithinAABB(EntityArrow.class, bounds);
for (EntityArrow arrow : arrows) {
if (arrow.canBePickedUp == 1 || world.rand.nextFloat() < 0.3f) {
if ((arrow.canBePickedUp == 1 || world.rand.nextFloat() < 0.3f)
&& arrow.shootingEntity != entity) {
EntityItem replacement = new EntityItem(world, arrow.posX, arrow.posY, arrow.posZ,
new ItemStack(Items.arrow));
world.spawnEntityInWorld(replacement);