mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-23 00:31:20 +01:00
Merge pull request #54 from samerbam/master
Disable Magnetic while shifting.
This commit is contained in:
commit
94b07b3d18
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user