Only run EntityListener#checkParties on EntityCombustByEntityEvent if Parties are enabled

This commit is contained in:
Dieu 2024-02-21 19:20:34 +01:00
parent cdc187b211
commit 33c467e7ce

View File

@ -259,7 +259,7 @@ public class EntityListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityCombustByEntityEvent(EntityCombustByEntityEvent event) { public void onEntityCombustByEntityEvent(EntityCombustByEntityEvent event) {
//Prevent players from setting fire to each other if they are in the same party //Prevent players from setting fire to each other if they are in the same party
if(event.getEntity() instanceof Player defender) { if(mcMMO.p.getPartyConfig().isPartyEnabled() && event.getEntity() instanceof Player defender) {
if(event.getCombuster() instanceof Projectile projectile) { if(event.getCombuster() instanceof Projectile projectile) {
if(projectile.getShooter() instanceof Player attacker) { if(projectile.getShooter() instanceof Player attacker) {