mirror of
https://github.com/Maxlego08/zKoth.git
synced 2025-02-17 01:52:25 +01:00
🚧 Add replace wilderness faction
This commit is contained in:
parent
4d64d9bac0
commit
b7e01db442
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
32
src/fr/maxlego08/zkoth/save/ReplaceConfig.java
Normal file
32
src/fr/maxlego08/zkoth/save/ReplaceConfig.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user