mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-26 12:16:24 +01:00
Using PEX 1.15 and only as superpermsmanager to allow for use of the parent permission. Also changed the handling of money on faction leave as last player.
This commit is contained in:
parent
98260c75de
commit
88fe43d600
Binary file not shown.
25
plugin.yml
25
plugin.yml
@ -12,6 +12,10 @@ permissions:
|
||||
factions.lock: true
|
||||
factions.reload: true
|
||||
factions.save: true
|
||||
factions.*:
|
||||
description: This is just an alias for factions.kit.admin
|
||||
children:
|
||||
factions.kit.admin: true
|
||||
factions.kit.mod:
|
||||
description: All faction permissions but configuration and persistance.
|
||||
children:
|
||||
@ -20,7 +24,7 @@ permissions:
|
||||
factions.setpermanent: true
|
||||
factions.setpeaceful: true
|
||||
factions.sethome.any: true
|
||||
factions.money.withdraw.any: true
|
||||
factions.money.*: true
|
||||
factions.kit.halfmod:
|
||||
description: Zones, bypassing, and kicking
|
||||
children:
|
||||
@ -55,13 +59,7 @@ permissions:
|
||||
factions.list: true
|
||||
factions.map: true
|
||||
factions.mod: true
|
||||
factions.money.balance: true
|
||||
factions.money.balance.any: true
|
||||
factions.money.deposit: true
|
||||
factions.money.withdraw: true
|
||||
factions.money.f2f: true
|
||||
factions.money.f2p: true
|
||||
factions.money.p2f: true
|
||||
factions.money.kit.standard: true
|
||||
factions.noboom: true
|
||||
factions.open: true
|
||||
factions.owner: true
|
||||
@ -140,12 +138,21 @@ permissions:
|
||||
description: transfer money from faction to player
|
||||
factions.money.p2f:
|
||||
description: transfer money from player to faction
|
||||
factions.money.*:
|
||||
factions.money.kit.standard:
|
||||
children:
|
||||
factions.money.balance: true
|
||||
factions.money.balance.any: true
|
||||
factions.money.deposit: true
|
||||
factions.money.withdraw: true
|
||||
factions.money.f2f: true
|
||||
factions.money.f2p: true
|
||||
factions.money.p2f: true
|
||||
factions.money.*:
|
||||
children:
|
||||
factions.money.kit.standard: true
|
||||
factions.money.balance.any: true
|
||||
factions.money.deposit: true
|
||||
factions.money.withdraw: true
|
||||
factions.money.withdraw.any: true
|
||||
factions.money.f2f: true
|
||||
factions.money.f2p: true
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.massivecraft.factions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -593,42 +595,29 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
|
||||
{
|
||||
double cost = Conf.econCostLeave;
|
||||
if ( ! Econ.modifyMoney(this, -cost, "to leave your faction.", "for leaving your faction.")) return;
|
||||
/*
|
||||
// pay up
|
||||
if (cost > 0.0) {
|
||||
String costString = Econ.moneyString(cost);
|
||||
if ( ! Econ.deductMoney(this.getName(), cost)) {
|
||||
msg("<b>It costs <h>%s<b> to leave your faction, which you can't currently afford.", costString);
|
||||
return;
|
||||
}
|
||||
msg("<i>You have paid <h>%s<i> to leave your faction.", costString);
|
||||
}
|
||||
// wait... we pay you to leave?
|
||||
else if (cost < 0.0)
|
||||
{
|
||||
String costString = Econ.moneyString(-cost);
|
||||
Econ.addMoney(this.getName(), -cost);
|
||||
msg("<i>You have been paid <h>%s<i> for leaving your faction.", costString);
|
||||
}*/
|
||||
}
|
||||
|
||||
if (myFaction.isNormal())
|
||||
{
|
||||
//myFaction.msg("%s<i> left your faction.", this.getNameAndRelevant(myFaction));
|
||||
for (FPlayer fplayer : myFaction.getFPlayersWhereOnline(true))
|
||||
{
|
||||
fplayer.msg("%s<i> left your faction.", this.describeTo(fplayer, true));
|
||||
}
|
||||
}
|
||||
|
||||
this.resetFactionData();
|
||||
|
||||
if (myFaction.isNormal() && !perm && myFaction.getFPlayers().isEmpty())
|
||||
// Am I the last one in the faction?
|
||||
ArrayList<FPlayer> fplayers = myFaction.getFPlayers();
|
||||
if (fplayers.size() == 1 && fplayers.get(0) == this)
|
||||
{
|
||||
// Transfer all money
|
||||
if (Econ.shouldBeUsed())
|
||||
Econ.transferMoney(this, myFaction, this, myFaction.getAccount().balance());
|
||||
}
|
||||
|
||||
if (myFaction.isNormal())
|
||||
{
|
||||
for (FPlayer fplayer : myFaction.getFPlayersWhereOnline(true))
|
||||
{
|
||||
fplayer.msg("%s<i> left %s<i>.", this.describeTo(fplayer, true), myFaction.describeTo(fplayer));
|
||||
}
|
||||
}
|
||||
|
||||
this.resetFactionData();
|
||||
|
||||
if (myFaction.isNormal() && !perm && myFaction.getFPlayers().isEmpty())
|
||||
{
|
||||
// Remove this faction
|
||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ public class PermUtil {
|
||||
pex = PermissionsEx.getPermissionManager();
|
||||
p.log("Will use this plugin for permissions: " + Bukkit.getServer().getPluginManager().getPlugin("PermissionsEx").getDescription().getFullName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( Bukkit.getServer().getPluginManager().isPluginEnabled("Permissions"))
|
||||
{
|
||||
@ -89,7 +89,9 @@ public class PermUtil {
|
||||
|
||||
if (pex != null)
|
||||
{
|
||||
return pex.has((Player)me, perm);
|
||||
//return pex.has((Player)me, perm);
|
||||
// Since pex supports superperms we should use those instead.
|
||||
return ((Player)me).hasPermission(perm);
|
||||
}
|
||||
|
||||
if (perm2or3 != null)
|
||||
|
Loading…
Reference in New Issue
Block a user