Fix herbalism I think

This commit is contained in:
t00thpick1 2017-07-23 18:06:33 -04:00
parent 2c8d2998bb
commit 8cbb57df97
3 changed files with 22 additions and 14 deletions

View File

@ -195,21 +195,31 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
public int getXp(SkillType skill, MaterialData data)
{
String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + ".";
String explicitString = baseString + StringUtils.getFriendlyConfigMaterialDataString(data);
String noDataString = baseString + StringUtils.getPrettyItemString(data.getItemType());
String explicitString = baseString + StringUtils.getExplicitConfigMaterialDataString(data);
if (config.contains(explicitString))
return config.getInt(explicitString);
return config.getInt(noDataString, 0);
String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialDataString(data);
if (config.contains(friendlyString))
return config.getInt(friendlyString);
String wildcardString = baseString + StringUtils.getWildcardConfigMaterialDataString(data);
if (config.contains(wildcardString))
return config.getInt(wildcardString);
return 0;
}
public boolean isSkillBlock(SkillType skill, MaterialData data)
{
String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + ".";
String explicitString = baseString + StringUtils.getFriendlyConfigMaterialDataString(data);
String noDataString = baseString + StringUtils.getPrettyItemString(data.getItemType());
String explicitString = baseString + StringUtils.getExplicitConfigMaterialDataString(data);
if (config.contains(explicitString))
return true;
return config.contains(noDataString);
String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialDataString(data);
if (config.contains(friendlyString))
return true;
String wildcardString = baseString + StringUtils.getWildcardConfigMaterialDataString(data);
if (config.contains(wildcardString))
return true;
return false;
}
/* Acrobatics */

View File

@ -47,6 +47,10 @@ public class StringUtils {
public static String getPrettyTreeSpeciesString(TreeSpecies species) {
return createPrettyEnumString(species.toString());
}
public static String getWildcardConfigMaterialDataString(MaterialData data) {
return StringUtils.getPrettyItemString(data.getItemType()).replace(" ", "_") + "|*";
}
public static String getFriendlyConfigMaterialDataString(MaterialData data) {
switch (data.getItemType()) {

View File

@ -184,12 +184,6 @@ Experience:
Water_Lily: 100
White_Tulip: 150
Yellow_Flower: 100
Beetroot_Block_Ungrown: 0
Carrot_Ungrown: 0
Potato_Ungrown: 0
Crops_Ungrown: 0
Nether_Warts_Ungrown: 0
Cocoa_Ungrown: 0
Mining:
Coal_Ore: 100
Diamond_Ore: 750
@ -208,8 +202,8 @@ Experience:
Quartz_Ore: 100
Redstone_Ore: 150
Sandstone: 30
Stained_Clay: 50
Stone: 30
Stained_Clay|*: 50
Stone|*: 30
Red_Sandstone: 100
Prismarine: 70
Purpur_Block: 200