Merge pull request #54 from samerbam/master

Disable Magnetic while shifting.
This commit is contained in:
Will FP 2021-08-25 18:10:34 +01:00 committed by GitHub
commit 94b07b3d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,9 @@ public class Magnetic extends EcoEnchant implements TimedRunnable {
if (this.getDisabledWorlds().contains(player.getWorld())) {
return;
}
if(player.isSneaking()) {
return;
}
for (Entity e : player.getWorld().getNearbyEntities(player.getLocation(), distance, 2.0d, distance)) {
if (!(e instanceof Item || e instanceof ExperienceOrb)) {
@ -75,6 +78,7 @@ public class Magnetic extends EcoEnchant implements TimedRunnable {
continue;
}
Vector vector = player.getLocation().toVector().subtract(e.getLocation().toVector()).normalize().multiply(0.1 * level);
if (VectorUtils.isFinite(vector)) {