Skip to content

Commit

Permalink
10.0.0.0
Browse files Browse the repository at this point in the history
- Fixed a bug that caused all fall damage to be cancelled instead of just fall damage from a player's flight being disabled.
  • Loading branch information
SirBlobman committed Jan 15, 2020
1 parent 04c4ac1 commit bfa20cf
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;

public class ListenerFlight implements Listener {
Expand Down Expand Up @@ -69,7 +68,12 @@ public void onDamage(EntityDamageEvent e) {

Entity entity = e.getEntity();
if(!(entity instanceof Player)) return;


Player player = (Player) entity;
UUID uuid = player.getUniqueId();
if(!this.preventFallDamage.contains(uuid)) return;

e.setCancelled(true);
this.preventFallDamage.remove(uuid);
}
}

0 comments on commit bfa20cf

Please sign in to comment.