mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-07 00:38:42 +01:00
parent
58bcb0d45a
commit
081b02c7df
@ -2624,6 +2624,11 @@ public enum CMIMaterial {
|
|||||||
return newName.replaceFirst(".+?_", "");
|
return newName.replaceFirst(".+?_", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newName.matches("(?i)^(WHITE|ORANGE|MAGENTA|YELLOW|LIME|PINK|GRAY|CYAN|PURPLE|BLUE|BROWN|GREEN|RED|BLACK|" +
|
||||||
|
"LIGHT_GRAY|LIGHT_BLUE|)$")) {
|
||||||
|
return "color";
|
||||||
|
}
|
||||||
|
|
||||||
return fullName;
|
return fullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,12 +389,12 @@ public class ConfigManager {
|
|||||||
meta = "";
|
meta = "";
|
||||||
int id = 0;
|
int id = 0;
|
||||||
|
|
||||||
if (myKey.contains("-")) {
|
if (myKey.contains("-") && !myKey.endsWith("-all")) {
|
||||||
// uses subType
|
// uses subType
|
||||||
subType = ":" + myKey.split("-")[1];
|
subType = ":" + myKey.split("-")[1];
|
||||||
meta = myKey.split("-")[1];
|
meta = myKey.split("-")[1];
|
||||||
myKey = myKey.split("-")[0];
|
myKey = myKey.split("-")[0];
|
||||||
} else if (myKey.contains(":")) { // when we uses tipped arrow effect types
|
} else if (myKey.contains(":") && !myKey.endsWith(":all")) { // when we uses tipped arrow effect types
|
||||||
String[] split = myKey.split(":");
|
String[] split = myKey.split(":");
|
||||||
meta = split.length > 1 ? split[1] : myKey;
|
meta = split.length > 1 ? split[1] : myKey;
|
||||||
myKey = split[0];
|
myKey = split[0];
|
||||||
@ -592,7 +592,7 @@ public class ConfigManager {
|
|||||||
|
|
||||||
type = enchant == null ? myKey : enchant.toString();
|
type = enchant == null ? myKey : enchant.toString();
|
||||||
} else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.COLLECT || actionType == ActionType.MMKILL
|
} else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.COLLECT || actionType == ActionType.MMKILL
|
||||||
|| actionType == ActionType.SHEAR || actionType == ActionType.BAKE || actionType == ActionType.BOSS) {
|
|| actionType == ActionType.BAKE || actionType == ActionType.BOSS) {
|
||||||
type = myKey;
|
type = myKey;
|
||||||
} else if (actionType == ActionType.EXPLORE) {
|
} else if (actionType == ActionType.EXPLORE) {
|
||||||
type = myKey;
|
type = myKey;
|
||||||
@ -615,6 +615,13 @@ public class ConfigManager {
|
|||||||
if (myKey.contains(":")) {
|
if (myKey.contains(":")) {
|
||||||
subType = myKey.split(":")[1];
|
subType = myKey.split(":")[1];
|
||||||
}
|
}
|
||||||
|
} else if (actionType == ActionType.SHEAR) {
|
||||||
|
if (myKey.startsWith("color") && (myKey.endsWith("-all") || myKey.endsWith(":all"))) {
|
||||||
|
subType = ":all";
|
||||||
|
type = myKey.split(":|-")[0];
|
||||||
|
} else {
|
||||||
|
type = myKey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
@ -624,7 +631,8 @@ public class ConfigManager {
|
|||||||
|
|
||||||
if (":ALL".equalsIgnoreCase(subType)) {
|
if (":ALL".equalsIgnoreCase(subType)) {
|
||||||
meta = "ALL";
|
meta = "ALL";
|
||||||
type = CMIMaterial.getGeneralMaterialName(type);
|
// case for ":all" identifier
|
||||||
|
type = (actionType == ActionType.SHEAR && myKey.startsWith("color")) ? "color" : CMIMaterial.getGeneralMaterialName(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actionType == ActionType.TNTBREAK)
|
if (actionType == ActionType.TNTBREAK)
|
||||||
|
@ -29,7 +29,7 @@ public class NameTranslatorManager {
|
|||||||
return Translate(materialName, info.getActionType(), info.getId(), info.getMeta(), info.getName());
|
return Translate(materialName, info.getActionType(), info.getId(), info.getMeta(), info.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String Translate(String materialName, ActionType action, Integer id, String meta, String mame) {
|
public String Translate(String materialName, ActionType action, Integer id, String meta, String name) {
|
||||||
// Translating name to user friendly
|
// Translating name to user friendly
|
||||||
if (Jobs.getGCManager().UseCustomNames)
|
if (Jobs.getGCManager().UseCustomNames)
|
||||||
switch (action) {
|
switch (action) {
|
||||||
@ -63,7 +63,7 @@ public class NameTranslatorManager {
|
|||||||
return nameLs.getName();
|
return nameLs.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mame != null && !mame.isEmpty()) {
|
if (name != null && !name.isEmpty()) {
|
||||||
mat = CMIMaterial.get(materialName.replace(" ", ""));
|
mat = CMIMaterial.get(materialName.replace(" ", ""));
|
||||||
nameLs = ListOfNames.get(mat);
|
nameLs = ListOfNames.get(mat);
|
||||||
|
|
||||||
@ -114,34 +114,35 @@ public class NameTranslatorManager {
|
|||||||
return one.getName();
|
return one.getName();
|
||||||
}
|
}
|
||||||
ids = one.getMinecraftName();
|
ids = one.getMinecraftName();
|
||||||
if (ids.equalsIgnoreCase(mame)) {
|
if (ids.equalsIgnoreCase(name)) {
|
||||||
return one.getName();
|
return one.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ENCHANT:
|
case ENCHANT:
|
||||||
String name = materialName;
|
String mName = materialName;
|
||||||
String level = "";
|
String level = "";
|
||||||
if (name.contains(":")) {
|
if (mName.contains(":")) {
|
||||||
name = materialName.split(":")[0];
|
mName = materialName.split(":")[0];
|
||||||
level = ":" + materialName.split(":")[1];
|
level = ":" + materialName.split(":")[1];
|
||||||
}
|
}
|
||||||
NameList nameInfo = ListOfEnchants.get(name.toLowerCase().replace("_", ""));
|
NameList nameInfo = ListOfEnchants.get(mName.toLowerCase().replace("_", ""));
|
||||||
if (nameInfo != null) {
|
if (nameInfo != null) {
|
||||||
return nameInfo.getMinecraftName() + level;
|
return nameInfo.getMinecraftName() + level;
|
||||||
}
|
}
|
||||||
return materialName;
|
|
||||||
case CUSTOMKILL:
|
|
||||||
case EXPLORE:
|
|
||||||
break;
|
break;
|
||||||
case SHEAR:
|
case SHEAR:
|
||||||
for (NameList one : ListOfColors) {
|
for (NameList one : ListOfColors) {
|
||||||
String ids = one.getMinecraftName();
|
String ids = one.getMinecraftName();
|
||||||
if (ids.equalsIgnoreCase(mame)) {
|
if (ids.equalsIgnoreCase(name)) {
|
||||||
return one.getName();
|
return one.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
String fallbackColorName = Arrays.stream(name.split("\\s|:|-"))
|
||||||
|
.map(word -> word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase())
|
||||||
|
.collect(Collectors.joining(" ")); // returns capitalized word (from this -> To This)
|
||||||
|
return fallbackColorName;
|
||||||
case MMKILL:
|
case MMKILL:
|
||||||
NameList got = ListOfMMEntities.get(materialName.toLowerCase());
|
NameList got = ListOfMMEntities.get(materialName.toLowerCase());
|
||||||
if (got != null && got.getName() != null)
|
if (got != null && got.getName() != null)
|
||||||
|
@ -350,6 +350,7 @@ Jobs:
|
|||||||
income: 5.0
|
income: 5.0
|
||||||
experience: 10.0
|
experience: 10.0
|
||||||
# Shear sheeps by its color
|
# Shear sheeps by its color
|
||||||
|
# You can use "color-all" to specify all known colors.
|
||||||
Shear:
|
Shear:
|
||||||
Black:
|
Black:
|
||||||
income: 2.0
|
income: 2.0
|
||||||
|
Loading…
Reference in New Issue
Block a user