Merge remote-tracking branch 'origin/1.6.x' into 1.6.x

This commit is contained in:
droppinganvil 2020-04-08 12:59:51 -05:00
commit 861f88a916
9 changed files with 32 additions and 7 deletions

@ -1,6 +1,7 @@
# SaberFactions
![Downloads](https://img.shields.io/github/downloads/driftay/saber-factions/total.svg) [![CodeFactor](https://www.codefactor.io/repository/github/driftay/saber-factions/badge)](https://www.codefactor.io/repository/github/driftay/saber-factions) [![License](https://img.shields.io/badge/license-GNU%20General%20Public%20License%20v3.0-brightgreen)](https://github.com/SaberLLC/Saber-Factions/blob/1.6.x/LICENSE) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SaberLLC/Saber-Factions)
![Downloads](https://img.shields.io/github/downloads/driftay/saber-factions/total.svg) [![CodeFactor](https://www.codefactor.io/repository/github/driftay/saber-factions/badge)](https://www.codefactor.io/repository/github/driftay/saber-factions) [![License](https://img.shields.io/badge/license-GNU%20General%20Public%20License%20v3.0-brightgreen)](https://github.com/SaberLLC/Saber-Factions/blob/1.6.x/LICENSE) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SaberLLC/Saber-Factions) [![](https://jitpack.io/v/SaberLLC/Saber-Factions.svg)](https://jitpack.io/#SaberLLC/Saber-Factions)
SaberFactions is an exotic, performance optimized, and feature rich factions plugin that focuses on not only making the player experience as great as possibly but maintaining this aspect with the cost of NOTHING! We strive to continue development for SaberFactions as the factions community is strongly growing and seeking new players every day.
@ -32,7 +33,7 @@ Some of our features include the following
<dependency>
<groupId>com.github.SaberLLC</groupId>
<artifactId>Saber-Factions</artifactId>
<version>2.2.7-STABLE</version>
<version>2.3.3-STABLE</version>
</dependency>
```
## Moving Forward

@ -140,7 +140,6 @@ public class Econ {
public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount, boolean notify) {
if (!shouldBeUsed()) {
invoker.msg(TL.ECON_OFF);
return false;
}

@ -2,6 +2,7 @@ package com.massivecraft.factions.tag;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.util.timer.TimerManager;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
@ -12,7 +13,7 @@ public enum GeneralTag implements Tag {
/**
* @author FactionsUUID Team
*/
GRACE_TIMER("{grace-time}", () -> String.valueOf(TimerManager.getRemaining(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining(), true))),
MAX_WARPS("{max-warps}", () -> String.valueOf(FactionsPlugin.getInstance().getConfig().getInt("max-warps", 5))),
MAX_ALLIES("{max-allies}", () -> getRelation("ally")),
MAX_ENEMIES("{max-enemies}", () -> getRelation("enemy")),

@ -1,5 +1,12 @@
package com.massivecraft.factions.util.timer;
import com.massivecraft.factions.util.Config;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
/**
* Factions - Developed by Driftay.
* All rights reserved 2020.
@ -8,6 +15,7 @@ package com.massivecraft.factions.util.timer;
public abstract class GlobalTimer extends Timer {
private TimerRunnable runnable;
public GlobalTimer(String name, long defaultCooldown) {
super(name, defaultCooldown);
}

@ -1,8 +1,6 @@
package com.massivecraft.factions.util.timer;
import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.util.Config;
import com.massivecraft.factions.util.timer.type.GraceTimer;
/**
* Factions - Developed by Driftay.

@ -1,7 +1,6 @@
package com.massivecraft.factions.util.timer;
import com.massivecraft.factions.FactionsPlugin;
import com.massivecraft.factions.util.Config;
import java.util.UUID;

@ -3,6 +3,7 @@ package com.massivecraft.factions.util.timer.type;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.util.Config;
import com.massivecraft.factions.util.timer.GlobalTimer;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
@ -40,4 +41,17 @@ public class GraceTimer extends GlobalTimer implements Listener {
}
}
}
@Override
public void load(Config config) {
setPaused(config.getBoolean(this.name + ".paused"));
setRemaining(config.getLong(this.name + ".time"), false);
}
@Override
public void save(Config config) {
config.set(this.name + ".paused", isPaused());
config.set(this.name + ".time", getRemaining());
}
}

@ -3,6 +3,7 @@ package com.massivecraft.factions.zcore.util;
import com.massivecraft.factions.*;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.util.timer.TimerManager;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -82,6 +83,7 @@ public enum TagReplacer {
/**
* General variables, require no faction or player
*/
GRACE_TIMER(TagType.GENERAL, "{grace-time}"),
MAX_WARPS(TagType.GENERAL, "{max-warps}"),
MAX_ALLIES(TagType.GENERAL, "{max-allies}"),
MAX_ALTS(TagType.GENERAL, "{max-alts}"),
@ -125,6 +127,8 @@ public enum TagReplacer {
*/
protected String getValue() {
switch (this) {
case GRACE_TIMER:
return String.valueOf(TimerManager.getRemaining(FactionsPlugin.getInstance().getTimerManager().graceTimer.getRemaining(), true));
case TOTAL_ONLINE:
return String.valueOf(Bukkit.getOnlinePlayers().size());
case FACTIONLESS:

@ -1560,6 +1560,7 @@ Wild:
# - {action-access-color} : Access color
# General variables. Can be used anywhere.
# - {grace-time} : Time of Grace Period
# - {total-online} : Total # of players on the server
# - {max-warps} : Max # of warps a faction can set
# - {max-allies} : Max # of allies a faction can have