🚧 Add replace wilderness faction

This commit is contained in:
Maxlego08 2022-03-16 18:30:14 +01:00
parent 4d64d9bac0
commit b7e01db442
3 changed files with 43 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import fr.maxlego08.zkoth.api.event.events.KothStartEvent;
import fr.maxlego08.zkoth.api.event.events.KothStopEvent;
import fr.maxlego08.zkoth.api.event.events.KothWinEvent;
import fr.maxlego08.zkoth.save.Config;
import fr.maxlego08.zkoth.save.ReplaceConfig;
import fr.maxlego08.zkoth.zcore.ZPlugin;
import fr.maxlego08.zkoth.zcore.enums.Message;
import fr.maxlego08.zkoth.zcore.utils.Cuboid;
@ -386,6 +387,13 @@ public class ZKoth extends ZUtils implements Koth {
: this.factionListener.getFactionTag(this.currentPlayer);
message = message.replace("%faction%", faction);
if (Config.replaceNoFaction != null && Config.enableReplaceNoFaction) {
ReplaceConfig config = Config.replaceNoFaction;
message = message.replace(config.getFrom(), config.getTo());
}
return message;
}

View File

@ -28,6 +28,9 @@ public class Config implements Saveable {
public static ProgressBar progressBarPoints = new ProgressBar(10, '|', "§b", "§7");
public static ProgressBar progressBarTimer = new ProgressBar(10, '|', "§b", "§7");
public static ProgressBar progressBarClassic = new ProgressBar(10, '|', "§b", "§7");
public static ReplaceConfig replaceNoFaction = new ReplaceConfig("§2Wilderness", "§3NoFaction");
public static boolean enableReplaceNoFaction = false;
static {

View File

@ -0,0 +1,32 @@
package fr.maxlego08.zkoth.save;
public class ReplaceConfig {
private final String from;
private final String to;
/**
* @param from
* @param to
*/
public ReplaceConfig(String from, String to) {
super();
this.from = from;
this.to = to;
}
/**
* @return the from
*/
public String getFrom() {
return from;
}
/**
* @return the to
*/
public String getTo() {
return to;
}
}