mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-29 04:18:07 +01:00
title prefix/suffix/seperator
This commit is contained in:
parent
11e374c0f3
commit
7b049fe670
@ -68,6 +68,9 @@ public class JobsConfiguration {
|
||||
protected int maxJobs;
|
||||
protected boolean payNearSpawner;
|
||||
protected boolean modifyChat;
|
||||
public String modifyChatPrefix;
|
||||
public String modifyChatSuffix;
|
||||
public String modifyChatSeparator;
|
||||
protected int economyBatchDelay;
|
||||
protected boolean saveOnDisconnect;
|
||||
public boolean LocalOfflinePlayersData;
|
||||
@ -138,7 +141,7 @@ public class JobsConfiguration {
|
||||
public boolean isUseBreederFinder() {
|
||||
return this.useBreederFinder;
|
||||
}
|
||||
|
||||
|
||||
public void setTntFinder(boolean state) {
|
||||
this.useTnTFinder = state;
|
||||
}
|
||||
@ -146,7 +149,7 @@ public class JobsConfiguration {
|
||||
public boolean isUseTntFinder() {
|
||||
return this.useTnTFinder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get how often in minutes to save job information
|
||||
* @return how often in minutes to save job information
|
||||
@ -267,6 +270,18 @@ public class JobsConfiguration {
|
||||
return modifyChat;
|
||||
}
|
||||
|
||||
public String getModifyChatPrefix() {
|
||||
return modifyChatPrefix;
|
||||
}
|
||||
|
||||
public String getModifyChatSuffix() {
|
||||
return modifyChatSuffix;
|
||||
}
|
||||
|
||||
public String getModifyChatSeparator() {
|
||||
return modifyChatSeparator;
|
||||
}
|
||||
|
||||
public synchronized int getEconomyBatchDelay() {
|
||||
return economyBatchDelay;
|
||||
}
|
||||
@ -453,6 +468,10 @@ public class JobsConfiguration {
|
||||
"Modifys chat to add chat titles. If you're using a chat manager, you may add the tag {jobs} to your chat format and disable this.");
|
||||
modifyChat = getBoolean("modify-chat", true, config, writer);
|
||||
|
||||
modifyChatPrefix = getString("modify-chat-prefix", "&c[", config, writer, true);
|
||||
modifyChatSuffix = getString("modify-chat-suffix", "&c]", config, writer, true);
|
||||
modifyChatSeparator = getString("modify-chat-seperator", " ", config, writer, true);
|
||||
|
||||
writer.addComment("UseCustomNames", "Do you want to use custom item/block/mob/enchant/color names",
|
||||
"With this set to true names like Stone:1 will be translated to Granite", "Name list is in ItemList.yml file");
|
||||
UseCustomNames = getBoolean("UseCustomNames", true, config, writer);
|
||||
@ -1124,6 +1143,12 @@ public class JobsConfiguration {
|
||||
return config.getString(path);
|
||||
}
|
||||
|
||||
private String getString(String path, String boo, YamlConfiguration config, CommentedYamlConfiguration writer, boolean colorize) {
|
||||
config.addDefault(path, boo);
|
||||
copySetting(config, writer, path);
|
||||
return org.bukkit.ChatColor.translateAlternateColorCodes('&', config.getString(path));
|
||||
}
|
||||
|
||||
private Double getDouble(String path, Double boo, YamlConfiguration config, CommentedYamlConfiguration writer) {
|
||||
config.addDefault(path, boo);
|
||||
copySetting(config, writer, path);
|
||||
|
@ -444,7 +444,7 @@ public class JobsPlayer {
|
||||
if (method.equals(DisplayMethod.NONE))
|
||||
continue;
|
||||
if (gotTitle) {
|
||||
builder.append(" ");
|
||||
builder.append(ConfigManager.getJobsConfiguration().getModifyChatSeparator());
|
||||
gotTitle = false;
|
||||
}
|
||||
Title title = ConfigManager.getJobsConfiguration().getTitleForLevel(prog.getLevel(), prog.getJob().getName());
|
||||
@ -513,6 +513,8 @@ public class JobsPlayer {
|
||||
}
|
||||
|
||||
honorific = builder.toString().trim();
|
||||
honorific = ConfigManager.getJobsConfiguration().getModifyChatPrefix() + honorific + ConfigManager.getJobsConfiguration().getModifyChatSuffix();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -406,7 +406,7 @@ public class JobsListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
||||
|
||||
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() + " " : "";
|
||||
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
||||
|
||||
if (honorific.equalsIgnoreCase(" "))
|
||||
honorific = "";
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: Jobs
|
||||
description: Jobs Plugin for the BukkitAPI
|
||||
main: com.gamingmesh.jobs.JobsPlugin
|
||||
version: 2.59.1
|
||||
version: 2.60.0
|
||||
author: phrstbrn
|
||||
softdepend: [Vault, CoreProtect, MythicMobs, McMMO]
|
||||
commands:
|
||||
|
Loading…
Reference in New Issue
Block a user