Skip to content

Commit

Permalink
Remove useless logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Feb 12, 2024
1 parent d7d0613 commit e25ae05
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class IllegalDamageAndPotionCheck implements Listener {

// Player get damage
// Entity gets damage
@EventHandler(ignoreCancelled = true)
public void onDamage(EntityDamageByEntityEvent event) {
// Player => Entity
Expand All @@ -40,18 +40,6 @@ public void onDamage(EntityDamageByEntityEvent event) {
}
}

// Arrow shoot by player
@EventHandler(ignoreCancelled = true)
public void onBow(EntityDamageByEntityEvent event) {
if (!(event.getDamager() instanceof Arrow)) {
return;
}
if (((Arrow) event.getDamager()).getShooter() instanceof Player damager && event.getDamage() > 40) {
event.setCancelled(true);
Utils.sendMessage(damager, ConfigCache.IllegalDamageMessage);
}
}

@EventHandler
public void onLeave(PlayerQuitEvent event) {
Player player = event.getPlayer();
Expand Down

0 comments on commit e25ae05

Please sign in to comment.