Various Fixes (#3537)

* Updated ItemUtils, added isBlock check to smelt functions

+ added a check in ItemUtils.isSmeltable() and ItemUtils.isSmelted() to make sure the Item type was a block to prevent an error occuring mentioned in https://github.com/mcMMO-Dev/mcMMO/issues/3536

* Fixed Green Thumb replant issue

see https://github.com/mcMMO-Dev/mcMMO/issues/3535

HerbalismManager
= fixed names of netherwart
= fixed handleBlockState, and slightly altered it
StringUtils
= fixed name of netherwart

* Fixes to herbalism skill

Herbalism
= fixed material name for grass in green terra block conversion
= fixed material name for grass in shroom thumb block conversion
EntityListener
= fixed material name for melon in food level change
experience config
= updated name for melon and sugar cane

* Minor Name Updates

experience config
= removed Stone|*
= added Stone, Granite, Adesite, Diorite
MaterialTypes
= updated material reference for wood

* Small fishing change

PlayerListener
= made it so COD, TROPICAL_FISH, and PUFFERFISH are no longer overwritten, so players can now catch these
This commit is contained in:
Devon Palma
2018-08-05 08:15:12 -06:00
committed by t00thpick1
parent fa1bbd2031
commit 2f2a80e1ce
8 changed files with 36 additions and 33 deletions

View File

@ -511,7 +511,7 @@ public final class ItemUtils {
}
public static boolean isSmeltable(ItemStack item) {
return item != null && MaterialUtils.isOre(item.getType().createBlockData());
return item != null && item.getType().isBlock() && MaterialUtils.isOre(item.getType().createBlockData());
}
public static boolean isSmelted(ItemStack item) {
@ -520,7 +520,7 @@ public final class ItemUtils {
}
for (Recipe recipe : mcMMO.p.getServer().getRecipesFor(item)) {
if (recipe instanceof FurnaceRecipe && MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getType().createBlockData())) {
if (recipe instanceof FurnaceRecipe && ((FurnaceRecipe) recipe).getInput().getType().isBlock() && MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getType().createBlockData())) {
return true;
}
}

View File

@ -53,7 +53,7 @@ public class StringUtils {
case BEETROOTS:
case CARROTS:
case POTATOES:
case NETHER_WART_BLOCK: {
case NETHER_WART: {
if (data instanceof Ageable) {
Ageable ageData = (Ageable) data;
if (ageData.getAge() == ageData.getMaximumAge()) {