Skip to content

Commit

Permalink
Undead: Allow Vehicle breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo56958 committed Jan 12, 2025
1 parent 040ee82 commit 05b6ad0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import de.flo56958.minetinker.utils.ConfigurationManager;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -101,7 +98,9 @@ public void onAttack(@NotNull EntityDamageByEntityEvent event) {

if (!(damager instanceof Player player)) return;
if (event.getEntity() instanceof Player) return;
if (event.getEntity() instanceof ArmorStand) return;
if (event.getEntity() instanceof Hanging) return; // item frames, paintings, etc.
if (event.getEntity() instanceof Vehicle && !(event.getEntity() instanceof LivingEntity)) return; // boats, minecarts, etc.
if (!player.hasPermission(getUsePermission())) return;

final ItemStack helmet = player.getInventory().getHelmet();
Expand Down

0 comments on commit 05b6ad0

Please sign in to comment.