mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-14 03:24:43 +02:00
Fixed errors with block-based skill experience (#3506)
* Updated configs * [WIP] Replacing MaterialData with Blockdata * Fixed most block based experience gain * Fixed most block based experience gain & updated wooden_tools * Removed debug prints
This commit is contained in:

committed by
t00thpick1

parent
210b418e44
commit
ee324c77a9
@ -25,7 +25,7 @@ import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.ShapedRecipe;
|
||||
import org.bukkit.inventory.ShapelessRecipe;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@ -255,7 +255,7 @@ public class SkillUtils {
|
||||
return Material.COBBLESTONE;
|
||||
}
|
||||
else if (ItemUtils.isWoodTool(inHand)) {
|
||||
return Material.OAK_PLANKS;
|
||||
return Material.OAK_WOOD;
|
||||
}
|
||||
else if (ItemUtils.isLeatherArmor(inHand)) {
|
||||
return Material.LEATHER;
|
||||
@ -278,7 +278,7 @@ public class SkillUtils {
|
||||
item.setDurability((short) 0);
|
||||
|
||||
int quantity = 0;
|
||||
MaterialData repairData = repairMaterial != null ? new MaterialData(repairMaterial, repairMetadata) : null;
|
||||
BlockData repairData = repairMaterial != null ? repairMaterial.createBlockData() : null;
|
||||
List<Recipe> recipes = mcMMO.p.getServer().getRecipesFor(item);
|
||||
|
||||
if (recipes.isEmpty()) {
|
||||
@ -289,14 +289,14 @@ public class SkillUtils {
|
||||
|
||||
if (recipe instanceof ShapelessRecipe) {
|
||||
for (ItemStack ingredient : ((ShapelessRecipe) recipe).getIngredientList()) {
|
||||
if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getData().equals(repairData))) {
|
||||
if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getType().equals(repairData))) {
|
||||
quantity += ingredient.getAmount();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (recipe instanceof ShapedRecipe) {
|
||||
for (ItemStack ingredient : ((ShapedRecipe) recipe).getIngredientMap().values()) {
|
||||
if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getData().equals(repairData))) {
|
||||
if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getType().equals(repairData))) {
|
||||
quantity += ingredient.getAmount();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user