This commit is contained in:
nossr50 2024-02-22 17:57:17 -08:00
commit 416c5383c9
3 changed files with 12 additions and 10 deletions

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) {
@ -365,7 +365,7 @@ public class EntityListener implements Listener {
if(attacker instanceof Projectile projectile) { if(attacker instanceof Projectile projectile) {
if(projectile.getShooter() instanceof Player attackingPlayer && !attackingPlayer.equals(defendingPlayer)) { if(projectile.getShooter() instanceof Player attackingPlayer && !attackingPlayer.equals(defendingPlayer)) {
//Check for party friendly fire and cancel the event //Check for party friendly fire and cancel the event
if (checkParties(event, defendingPlayer, attackingPlayer)) { if (mcMMO.p.getPartyConfig().isPartyEnabled() && checkParties(event, defendingPlayer, attackingPlayer)) {
return; return;
} }
} }
@ -383,7 +383,7 @@ public class EntityListener implements Listener {
} }
} }
} else if (attacker instanceof Player attackingPlayer){ } else if (attacker instanceof Player attackingPlayer){
if (checkParties(event, defendingPlayer, attackingPlayer)) if (mcMMO.p.getPartyConfig().isPartyEnabled() && checkParties(event, defendingPlayer, attackingPlayer))
return; return;
} }
} }

View File

@ -671,13 +671,14 @@ public class mcMMO extends JavaPlugin {
} }
// Automatically remove old members from parties // Automatically remove old members from parties
long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; if(partyConfig.isPartyEnabled()) {
long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
if (kickIntervalTicks == 0) { if (kickIntervalTicks == 0) {
getFoliaLib().getImpl().runLater(new PartyAutoKickTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. getFoliaLib().getImpl().runLater(new PartyAutoKickTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup.
} } else if (kickIntervalTicks > 0) {
else if (kickIntervalTicks > 0) { getFoliaLib().getImpl().runTimer(new PartyAutoKickTask(), kickIntervalTicks, kickIntervalTicks);
getFoliaLib().getImpl().runTimer(new PartyAutoKickTask(), kickIntervalTicks, kickIntervalTicks); }
} }
// Update power level tag scoreboards // Update power level tag scoreboards

View File

@ -741,7 +741,8 @@ public final class CombatUtils {
XPGainReason xpGainReason; XPGainReason xpGainReason;
if (target instanceof Player defender) { if (target instanceof Player defender) {
if (!ExperienceConfig.getInstance().getExperienceGainsPlayerVersusPlayerEnabled() || mcMMO.p.getPartyManager().inSameParty(mcMMOPlayer.getPlayer(), (Player) target)) { if (!ExperienceConfig.getInstance().getExperienceGainsPlayerVersusPlayerEnabled() ||
(mcMMO.p.getPartyConfig().isPartyEnabled() && mcMMO.p.getPartyManager().inSameParty(mcMMOPlayer.getPlayer(), (Player) target))) {
return; return;
} }