Added new config options to allow friendly fire in parties.

This commit is contained in:
TfT_02 2013-02-05 14:35:51 +01:00
parent 433c99e239
commit 89eef2ce07
5 changed files with 13 additions and 3 deletions

View File

@ -17,6 +17,7 @@ Version 1.4.00-dev
+ Added '/ptp toggle' command, to disable party teleportation.
+ Added '/ptp accept' and '/ptp acceptall' commands
+ Added a automatic party kick when a party member has been offline for 7 days (default)
+ Added a config option to allow friendly fire in parties.
+ Added timeout on party teleport requests
+ Added XP bonus for Archery based on distance from shooter to target
+ Added ability to config Hylian Luck drops through treasures.yml

View File

@ -82,6 +82,7 @@ public class Config extends ConfigLoader {
/* PARTY SETTINGS */
public int getAutoPartyKickInterval() { return config.getInt("Party.AutoKick_Interval", 12); }
public int getAutoPartyKickTime() { return config.getInt("Party.Old_Party_Member_Cutoff", 7); }
public boolean getPartyFriendlyFire() { return config.getBoolean("Party.FriendlyFire_Enabled", false); }
public boolean getExpShareEnabled() { return config.getBoolean("Party.Sharing.ExpShare_enabled", true); }
public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1); }
public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05); }

View File

@ -27,6 +27,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
@ -111,7 +112,7 @@ public class EntityListener implements Listener {
return;
}
if (attacker instanceof Player && PartyManager.inSameParty(defendingPlayer, (Player) attacker)) {
if (attacker instanceof Player && PartyManager.inSameParty(defendingPlayer, (Player) attacker) && !Config.getInstance().getPartyFriendlyFire()) {
event.setCancelled(true);
return;
}

View File

@ -569,7 +569,11 @@ public final class CombatTools {
if (entity instanceof Player) {
Player defender = (Player) entity;
if (!defender.getWorld().getPVP() || defender == player || PartyManager.inSameParty(player, defender) || Users.getPlayer(defender).getProfile().getGodMode()) {
if (!defender.getWorld().getPVP() || defender == player || Users.getPlayer(defender).getProfile().getGodMode()) {
return false;
}
if (PartyManager.inSameParty(player, defender) && !Config.getInstance().getPartyFriendlyFire()) {
return false;
}
@ -582,7 +586,7 @@ public final class CombatTools {
}
}
else if (entity instanceof Tameable) {
if (Misc.isFriendlyPet(player, (Tameable) entity)) {
if (Misc.isFriendlyPet(player, (Tameable) entity) && !Config.getInstance().getPartyFriendlyFire()) {
return false;
}
}

View File

@ -66,6 +66,9 @@ Party:
AutoKick_Interval: 12
#Any user who hasn't connected in this many days will get kicked from their party
Old_Party_Member_Cutoff: 7
#Set this to true to allow party members to attack each other.
FriendlyFire_Enabled: false
#Settings for party share modes
Sharing:
ExpShare_enabled: true
ExpShare_bonus_base: 1.1