mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO
This commit is contained in:
commit
416c5383c9
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -671,14 +671,15 @@ public class mcMMO extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Automatically remove old members from parties
|
// Automatically remove old members from parties
|
||||||
|
if(partyConfig.isPartyEnabled()) {
|
||||||
long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR;
|
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
|
||||||
getFoliaLib().getImpl().runTimer(new PowerLevelUpdatingTask(), 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
|
getFoliaLib().getImpl().runTimer(new PowerLevelUpdatingTask(), 2 * Misc.TICK_CONVERSION_FACTOR, 2 * Misc.TICK_CONVERSION_FACTOR);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user