mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-12 18:31:32 +01:00
Misc simplifications
This commit is contained in:
parent
ba37c1b746
commit
2f37a7398c
@ -100,7 +100,7 @@ public class GuiManager {
|
||||
else
|
||||
Lore.add(Jobs.getLanguage().getMessage("command.browse.output.bonus", "[amount]", (int) (job.getBonus() * 100)));
|
||||
|
||||
Lore.addAll(Arrays.asList(job.getDescription().contains("/n") ? job.getDescription().split("/n") : job.getDescription().split("\n")));
|
||||
Lore.addAll(Arrays.asList(job.getDescription().split("/n|\\n")));
|
||||
|
||||
if (job.getMaxSlots() != null)
|
||||
Lore.add(Jobs.getLanguage().getMessage("command.info.gui.leftSlots") + ((job.getMaxSlots() - Jobs.getUsedSlots(job)) > 0 ? (job.getMaxSlots() - Jobs
|
||||
@ -306,13 +306,13 @@ public class GuiManager {
|
||||
}
|
||||
|
||||
if (!fromCommand) {
|
||||
ItemStack skull = Jobs.getGCManager().guiBackButton;
|
||||
ItemMeta skullMeta = skull.getItemMeta();
|
||||
ItemStack back = Jobs.getGCManager().guiBackButton;
|
||||
ItemMeta meta = back.getItemMeta();
|
||||
|
||||
skullMeta.setDisplayName(Jobs.getLanguage().getMessage("command.info.gui.back"));
|
||||
skull.setItemMeta(skullMeta);
|
||||
meta.setDisplayName(Jobs.getLanguage().getMessage("command.info.gui.back"));
|
||||
back.setItemMeta(meta);
|
||||
|
||||
gui.addButton(new CMIGuiButton(backButton, skull) {
|
||||
gui.addButton(new CMIGuiButton(backButton, back) {
|
||||
@Override
|
||||
public void click(GUIClickType type) {
|
||||
openJobsBrowseGUI(player);
|
||||
|
@ -24,8 +24,8 @@ import com.gamingmesh.jobs.container.TopList;
|
||||
|
||||
public class SignUtil {
|
||||
|
||||
private HashMap<String, HashMap<String, jobsSign>> SignsByType = new HashMap<>();
|
||||
private HashMap<String, jobsSign> SignsByLocation = new HashMap<>();
|
||||
private final HashMap<String, HashMap<String, jobsSign>> SignsByType = new HashMap<>();
|
||||
private final HashMap<String, jobsSign> SignsByLocation = new HashMap<>();
|
||||
|
||||
public HashMap<String, HashMap<String, jobsSign>> getSigns() {
|
||||
return SignsByType;
|
||||
@ -44,10 +44,7 @@ public class SignUtil {
|
||||
}
|
||||
|
||||
public jobsSign getSign(Location loc) {
|
||||
if (loc == null)
|
||||
return null;
|
||||
|
||||
return SignsByLocation.get(jobsSign.locToBlockString(loc));
|
||||
return loc == null ? null : SignsByLocation.get(jobsSign.locToBlockString(loc));
|
||||
}
|
||||
|
||||
public void addSign(jobsSign jSign) {
|
||||
@ -171,7 +168,6 @@ public class SignUtil {
|
||||
}
|
||||
|
||||
public boolean SignUpdate(Job job, SignTopType type) {
|
||||
|
||||
if (!Jobs.getGCManager().SignsEnabled)
|
||||
return true;
|
||||
|
||||
|
@ -431,7 +431,7 @@ public class ConfigManager {
|
||||
material = CMIMaterial.get(myKey + (subType));
|
||||
|
||||
if (material == CMIMaterial.NONE)
|
||||
material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase());
|
||||
material = CMIMaterial.get(myKey.replace(' ', '_').toUpperCase());
|
||||
|
||||
if (material == CMIMaterial.NONE) {
|
||||
// try integer method
|
||||
@ -852,7 +852,7 @@ public class ConfigManager {
|
||||
CMIMaterial material = CMIMaterial.get(item + (subType));
|
||||
|
||||
if (material == null)
|
||||
material = CMIMaterial.get(item.replace(" ", "_").toUpperCase());
|
||||
material = CMIMaterial.get(item.replace(' ', '_').toUpperCase());
|
||||
|
||||
if (material == null) {
|
||||
// try integer method
|
||||
@ -1123,7 +1123,7 @@ public class ConfigManager {
|
||||
try {
|
||||
ActionType actionType = ActionType.getByName(split[0]);
|
||||
String mats = split[1];
|
||||
String[] co = mats.contains(",") ? mats.split(",") : new String[0];
|
||||
String[] co = mats.split(",");
|
||||
|
||||
int amount = 1;
|
||||
if (split.length == 3) {
|
||||
|
@ -392,7 +392,7 @@ public class NameTranslatorManager {
|
||||
if (one == null || CMIEnchantment.getName(one) == null)
|
||||
continue;
|
||||
|
||||
String name = Util.firstToUpperCase(CMIEnchantment.getName(one)).replace("_", " ");
|
||||
String name = Util.firstToUpperCase(CMIEnchantment.getName(one)).replace('_', ' ');
|
||||
if (c.getC().isConfigurationSection("EnchantList"))
|
||||
for (String onek : c.getC().getConfigurationSection("EnchantList").getKeys(false)) {
|
||||
String old = c.getC().getString("EnchantList." + onek + ".MCName");
|
||||
|
Loading…
Reference in New Issue
Block a user