Fixed bug where Nether Quartz wasn't included in Smelting or item

sharing
This commit is contained in:
GJ 2013-05-16 08:13:01 -04:00
parent 27ab2f5b12
commit b6c4d2b4ad
3 changed files with 157 additions and 199 deletions

View File

@ -28,7 +28,8 @@ Version 1.4.06-dev
+ Added multiplier to Archery XP based on bow force + Added multiplier to Archery XP based on bow force
+ Added information about /party itemshare and /party expshare to the party help page + Added information about /party itemshare and /party expshare to the party help page
+ Added option to use scoreboards for power level display instead of Spout. + Added option to use scoreboards for power level display instead of Spout.
+ Fixed bug where custom Spout titles were overwritten by mcMMO. = Fixed bug where custom Spout titles were overwritten by mcMMO.
= Fixed bug where Nether Quartz wasn't included in Smelting or item sharing
= Fixed bug where players were able to join the same party multiple times = Fixed bug where players were able to join the same party multiple times
= Fixed displaying partial names when trying to use /ptp = Fixed displaying partial names when trying to use /ptp
= Fixed wolves from Call of the Wild only having 8 health = Fixed wolves from Call of the Wild only having 8 health

View File

@ -1,10 +1,7 @@
package com.gmail.nossr50.util; package com.gmail.nossr50.util;
import java.util.List;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
@ -17,18 +14,14 @@ import com.gmail.nossr50.config.party.ItemWeightConfig;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
public class ItemUtils { public class ItemUtils {
private static Config configInstance = Config.getInstance();
private static boolean customToolsEnabled = configInstance.getToolModsEnabled();
private static boolean customArmorEnabled = configInstance.getArmorModsEnabled();
/** /**
* Checks if the item is a sword. * Checks if the item is a sword.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a sword, false otherwise * @return true if the item is a sword, false otherwise
*/ */
public static boolean isSword(ItemStack is) { public static boolean isSword(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_SWORD: case DIAMOND_SWORD:
case GOLD_SWORD: case GOLD_SWORD:
case IRON_SWORD: case IRON_SWORD:
@ -37,26 +30,18 @@ public class ItemUtils {
return true; return true;
default: default:
if (customToolsEnabled && CustomToolConfig.getInstance().customSwordIDs.contains(is.getTypeId())) { return (Config.getInstance().getToolModsEnabled() && CustomToolConfig.getInstance().customSwordIDs.contains(item.getTypeId())) || (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutSwords.contains(item));
return true;
}
else if (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutSwords.contains(is)) {
return true;
}
else {
return false;
}
} }
} }
/** /**
* Checks if the item is a hoe. * Checks if the item is a hoe.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a hoe, false otherwise * @return true if the item is a hoe, false otherwise
*/ */
public static boolean isHoe(ItemStack is) { public static boolean isHoe(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_HOE: case DIAMOND_HOE:
case GOLD_HOE: case GOLD_HOE:
case IRON_HOE: case IRON_HOE:
@ -65,26 +50,18 @@ public class ItemUtils {
return true; return true;
default: default:
if (customToolsEnabled && CustomToolConfig.getInstance().customHoeIDs.contains(is.getTypeId())) { return (Config.getInstance().getToolModsEnabled() && CustomToolConfig.getInstance().customHoeIDs.contains(item.getTypeId())) || (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutHoes.contains(item));
return true;
}
else if (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutHoes.contains(is)) {
return true;
}
else {
return false;
}
} }
} }
/** /**
* Checks if the item is a shovel. * Checks if the item is a shovel.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a shovel, false otherwise * @return true if the item is a shovel, false otherwise
*/ */
public static boolean isShovel(ItemStack is) { public static boolean isShovel(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_SPADE: case DIAMOND_SPADE:
case GOLD_SPADE: case GOLD_SPADE:
case IRON_SPADE: case IRON_SPADE:
@ -93,26 +70,18 @@ public class ItemUtils {
return true; return true;
default: default:
if (customToolsEnabled && CustomToolConfig.getInstance().customShovelIDs.contains(is.getTypeId())) { return (Config.getInstance().getToolModsEnabled() && CustomToolConfig.getInstance().customShovelIDs.contains(item.getTypeId())) || (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutShovels.contains(item));
return true;
}
else if (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutShovels.contains(is)) {
return true;
}
else {
return false;
}
} }
} }
/** /**
* Checks if the item is an axe. * Checks if the item is an axe.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is an axe, false otherwise * @return true if the item is an axe, false otherwise
*/ */
public static boolean isAxe(ItemStack is) { public static boolean isAxe(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_AXE: case DIAMOND_AXE:
case GOLD_AXE: case GOLD_AXE:
case IRON_AXE: case IRON_AXE:
@ -121,26 +90,18 @@ public class ItemUtils {
return true; return true;
default: default:
if (customToolsEnabled && CustomToolConfig.getInstance().customAxeIDs.contains(is.getTypeId())) { return (Config.getInstance().getToolModsEnabled() && CustomToolConfig.getInstance().customAxeIDs.contains(item.getTypeId())) || (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutAxes.contains(item));
return true;
}
else if (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutAxes.contains(is)) {
return true;
}
else {
return false;
}
} }
} }
/** /**
* Checks if the item is a pickaxe. * Checks if the item is a pickaxe.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a pickaxe, false otherwise * @return true if the item is a pickaxe, false otherwise
*/ */
public static boolean isPickaxe(ItemStack is) { public static boolean isPickaxe(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_PICKAXE: case DIAMOND_PICKAXE:
case GOLD_PICKAXE: case GOLD_PICKAXE:
case IRON_PICKAXE: case IRON_PICKAXE:
@ -149,138 +110,118 @@ public class ItemUtils {
return true; return true;
default: default:
if (customToolsEnabled && CustomToolConfig.getInstance().customPickaxeIDs.contains(is.getTypeId())) { return (Config.getInstance().getToolModsEnabled() && CustomToolConfig.getInstance().customPickaxeIDs.contains(item.getTypeId())) || (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutPickaxes.contains(item));
return true;
}
else if (mcMMO.isSpoutEnabled() && SpoutToolsAPI.spoutPickaxes.contains(is)) {
return true;
}
else {
return false;
}
} }
} }
/** /**
* Checks if the item is a helmet. * Checks if the item is a helmet.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a helmet, false otherwise * @return true if the item is a helmet, false otherwise
*/ */
public static boolean isHelmet(ItemStack is) { public static boolean isHelmet(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_HELMET: case DIAMOND_HELMET:
case GOLD_HELMET: case GOLD_HELMET:
case IRON_HELMET: case IRON_HELMET:
case CHAINMAIL_HELMET:
case LEATHER_HELMET: case LEATHER_HELMET:
return true; return true;
default: default:
if (customArmorEnabled && CustomArmorConfig.getInstance().customHelmetIDs.contains(is.getTypeId())) { return Config.getInstance().getArmorModsEnabled() && CustomArmorConfig.getInstance().customHelmetIDs.contains(item.getTypeId());
return true;
}
return false;
} }
} }
/** /**
* Checks if the item is a chestplate. * Checks if the item is a chestplate.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a chestplate, false otherwise * @return true if the item is a chestplate, false otherwise
*/ */
public static boolean isChestplate(ItemStack is) { public static boolean isChestplate(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_CHESTPLATE: case DIAMOND_CHESTPLATE:
case GOLD_CHESTPLATE: case GOLD_CHESTPLATE:
case IRON_CHESTPLATE: case IRON_CHESTPLATE:
case CHAINMAIL_CHESTPLATE:
case LEATHER_CHESTPLATE: case LEATHER_CHESTPLATE:
return true; return true;
default: default:
if (customArmorEnabled && CustomArmorConfig.getInstance().customChestplateIDs.contains(is.getTypeId())) { return Config.getInstance().getArmorModsEnabled() && CustomArmorConfig.getInstance().customChestplateIDs.contains(item.getTypeId());
return true;
}
return false;
} }
} }
/** /**
* Checks if the item is a pair of pants. * Checks if the item is a pair of pants.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a pair of pants, false otherwise * @return true if the item is a pair of pants, false otherwise
*/ */
public static boolean isLeggings(ItemStack is) { public static boolean isLeggings(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_LEGGINGS: case DIAMOND_LEGGINGS:
case GOLD_LEGGINGS: case GOLD_LEGGINGS:
case IRON_LEGGINGS: case IRON_LEGGINGS:
case CHAINMAIL_LEGGINGS:
case LEATHER_LEGGINGS: case LEATHER_LEGGINGS:
return true; return true;
default: default:
if (customArmorEnabled && CustomArmorConfig.getInstance().customLeggingIDs.contains(is.getTypeId())) { return Config.getInstance().getArmorModsEnabled() && CustomArmorConfig.getInstance().customLeggingIDs.contains(item.getTypeId());
return true;
}
return false;
} }
} }
/** /**
* Checks if the item is a pair of boots. * Checks if the item is a pair of boots.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a pair of boots, false otherwise * @return true if the item is a pair of boots, false otherwise
*/ */
public static boolean isBoots(ItemStack is) { public static boolean isBoots(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_BOOTS: case DIAMOND_BOOTS:
case GOLD_BOOTS: case GOLD_BOOTS:
case IRON_BOOTS: case IRON_BOOTS:
case CHAINMAIL_BOOTS:
case LEATHER_BOOTS: case LEATHER_BOOTS:
return true; return true;
default: default:
if (customArmorEnabled && CustomArmorConfig.getInstance().customBootIDs.contains(is.getTypeId())) { return Config.getInstance().getArmorModsEnabled() && CustomArmorConfig.getInstance().customBootIDs.contains(item.getTypeId());
return true;
}
return false;
} }
} }
/** /**
* Checks to see if an item is a wearable armor piece. * Checks to see if an item is a wearable armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is armor, false otherwise * @return true if the item is armor, false otherwise
*/ */
public static boolean isArmor(ItemStack is) { public static boolean isArmor(ItemStack item) {
return isHelmet(is) || isChestplate(is) || isLeggings(is) || isBoots(is); return isHelmet(item) || isChestplate(item) || isLeggings(item) || isBoots(item);
} }
/** /**
* Checks to see if an item is a wearable armor piece. * Checks to see if an item is a wearable *vanilla* armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is armor, false otherwise * @return true if the item is armor, false otherwise
*/ */
public static boolean isMinecraftArmor(ItemStack is) { public static boolean isMinecraftArmor(ItemStack item) {
return isLeatherArmor(is) || isGoldArmor(is) || isIronArmor(is) || isDiamondArmor(is); return isLeatherArmor(item) || isGoldArmor(item) || isIronArmor(item) || isDiamondArmor(item) || isChainmailArmor(item);
} }
/** /**
* Checks to see if an item is a leather armor piece. * Checks to see if an item is a leather armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is leather armor, false otherwise * @return true if the item is leather armor, false otherwise
*/ */
public static boolean isLeatherArmor(ItemStack is) { public static boolean isLeatherArmor(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case LEATHER_BOOTS: case LEATHER_BOOTS:
case LEATHER_CHESTPLATE: case LEATHER_CHESTPLATE:
case LEATHER_HELMET: case LEATHER_HELMET:
@ -295,11 +236,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a gold armor piece. * Checks to see if an item is a gold armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is gold armor, false otherwise * @return true if the item is gold armor, false otherwise
*/ */
public static boolean isGoldArmor(ItemStack is) { public static boolean isGoldArmor(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case GOLD_BOOTS: case GOLD_BOOTS:
case GOLD_CHESTPLATE: case GOLD_CHESTPLATE:
case GOLD_HELMET: case GOLD_HELMET:
@ -314,11 +255,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is an iron armor piece. * Checks to see if an item is an iron armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is iron armor, false otherwise * @return true if the item is iron armor, false otherwise
*/ */
public static boolean isIronArmor(ItemStack is) { public static boolean isIronArmor(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case IRON_BOOTS: case IRON_BOOTS:
case IRON_CHESTPLATE: case IRON_CHESTPLATE:
case IRON_HELMET: case IRON_HELMET:
@ -333,11 +274,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a diamond armor piece. * Checks to see if an item is a diamond armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is diamond armor, false otherwise * @return true if the item is diamond armor, false otherwise
*/ */
public static boolean isDiamondArmor(ItemStack is) { public static boolean isDiamondArmor(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_BOOTS: case DIAMOND_BOOTS:
case DIAMOND_CHESTPLATE: case DIAMOND_CHESTPLATE:
case DIAMOND_HELMET: case DIAMOND_HELMET:
@ -350,23 +291,42 @@ public class ItemUtils {
} }
/** /**
* Checks to see if an item is a tool. * Checks to see if an item is a chainmail armor piece.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is chainmail armor, false otherwise
*/
public static boolean isChainmailArmor(ItemStack item) {
switch (item.getType()) {
case CHAINMAIL_BOOTS:
case CHAINMAIL_CHESTPLATE:
case CHAINMAIL_HELMET:
case CHAINMAIL_LEGGINGS:
return true;
default:
return false;
}
}
/**
* Checks to see if an item is a *vanilla* tool.
*
* @param item Item to check
* @return true if the item is a tool, false otherwise * @return true if the item is a tool, false otherwise
*/ */
public static boolean isMinecraftTool(ItemStack is) { public static boolean isMinecraftTool(ItemStack item) {
return isStoneTool(is) || isWoodTool(is) || isGoldTool(is) || isIronTool(is) || isDiamondTool(is) || isStringTool(is); return isStoneTool(item) || isWoodTool(item) || isGoldTool(item) || isIronTool(item) || isDiamondTool(item) || isStringTool(item);
} }
/** /**
* Checks to see if an item is a stone tool. * Checks to see if an item is a stone tool.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a stone tool, false otherwise * @return true if the item is a stone tool, false otherwise
*/ */
public static boolean isStoneTool(ItemStack is) { public static boolean isStoneTool(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case STONE_AXE: case STONE_AXE:
case STONE_HOE: case STONE_HOE:
case STONE_PICKAXE: case STONE_PICKAXE:
@ -382,11 +342,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a wooden tool. * Checks to see if an item is a wooden tool.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a wooden tool, false otherwise * @return true if the item is a wooden tool, false otherwise
*/ */
public static boolean isWoodTool(ItemStack is) { public static boolean isWoodTool(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case WOOD_AXE: case WOOD_AXE:
case WOOD_HOE: case WOOD_HOE:
case WOOD_PICKAXE: case WOOD_PICKAXE:
@ -402,11 +362,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a string tool. * Checks to see if an item is a string tool.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a string tool, false otherwise * @return true if the item is a string tool, false otherwise
*/ */
public static boolean isStringTool(ItemStack is) { public static boolean isStringTool(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case BOW: case BOW:
case CARROT_STICK: case CARROT_STICK:
case FISHING_ROD: case FISHING_ROD:
@ -420,11 +380,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a gold tool. * Checks to see if an item is a gold tool.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a stone tool, false otherwise * @return true if the item is a stone tool, false otherwise
*/ */
public static boolean isGoldTool(ItemStack is) { public static boolean isGoldTool(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case GOLD_AXE: case GOLD_AXE:
case GOLD_HOE: case GOLD_HOE:
case GOLD_PICKAXE: case GOLD_PICKAXE:
@ -440,11 +400,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is an iron tool. * Checks to see if an item is an iron tool.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is an iron tool, false otherwise * @return true if the item is an iron tool, false otherwise
*/ */
public static boolean isIronTool(ItemStack is) { public static boolean isIronTool(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case BUCKET: case BUCKET:
case FLINT_AND_STEEL: case FLINT_AND_STEEL:
case IRON_AXE: case IRON_AXE:
@ -463,11 +423,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a diamond tool. * Checks to see if an item is a diamond tool.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a diamond tool, false otherwise * @return true if the item is a diamond tool, false otherwise
*/ */
public static boolean isDiamondTool(ItemStack is) { public static boolean isDiamondTool(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case DIAMOND_AXE: case DIAMOND_AXE:
case DIAMOND_HOE: case DIAMOND_HOE:
case DIAMOND_PICKAXE: case DIAMOND_PICKAXE:
@ -483,16 +443,25 @@ public class ItemUtils {
/** /**
* Checks to see if an item is enchantable. * Checks to see if an item is enchantable.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is enchantable, false otherwise * @return true if the item is enchantable, false otherwise
*/ */
public static boolean isEnchantable(ItemStack is) { public static boolean isEnchantable(ItemStack item) {
Material type = is.getType(); switch (item.getType()) {
return isArmor(is) || isSword(is) || isAxe(is) || isShovel(is) || isPickaxe(is) || type == Material.SHEARS || type == Material.FISHING_ROD || type == Material.CARROT_STICK || type == Material.FLINT_AND_STEEL || type == Material.BOW; case SHEARS:
case FISHING_ROD:
case CARROT_STICK:
case BOW:
case FLINT_AND_STEEL:
return true;
default:
return isArmor(item) || isSword(item) || isAxe(item) || isShovel(item) || isPickaxe(item);
}
} }
public static boolean isSmeltable(ItemStack itemStack) { public static boolean isSmeltable(ItemStack item) {
switch (itemStack.getType()) { switch (item.getType()) {
case COAL_ORE: case COAL_ORE:
case DIAMOND_ORE: case DIAMOND_ORE:
case GLOWING_REDSTONE_ORE: case GLOWING_REDSTONE_ORE:
@ -501,6 +470,7 @@ public class ItemUtils {
case LAPIS_ORE: case LAPIS_ORE:
case REDSTONE_ORE: case REDSTONE_ORE:
case EMERALD_ORE: case EMERALD_ORE:
case QUARTZ_ORE:
return true; return true;
default: default:
@ -508,22 +478,19 @@ public class ItemUtils {
} }
} }
public static boolean isSmelted(ItemStack itemStack) { public static boolean isSmelted(ItemStack item) {
switch (itemStack.getType()) { switch (item.getType()) {
case COAL: case COAL:
case DIAMOND: case DIAMOND:
case REDSTONE: case REDSTONE:
case GOLD_INGOT: case GOLD_INGOT:
case IRON_INGOT: case IRON_INGOT:
case EMERALD: case EMERALD:
case QUARTZ:
return true; return true;
case INK_SACK: case INK_SACK:
if (itemStack.getData().getData() == DyeColor.BLUE.getDyeData()) { return item.getData().getData() == DyeColor.BLUE.getDyeData();
return true;
}
return false;
default: default:
return false; return false;
@ -536,18 +503,18 @@ public class ItemUtils {
* @param item Item that will get shared * @param item Item that will get shared
* @return True if the item can be shared. * @return True if the item can be shared.
*/ */
public static boolean isShareable(ItemStack is) { public static boolean isShareable(ItemStack item) {
return isMiningDrop(is) || isWoodcuttingDrop(is) || isMobDrop(is) || isHerbalismDrop(is) || isMiscDrop(is); return isMiningDrop(item) || isWoodcuttingDrop(item) || isMobDrop(item) || isHerbalismDrop(item) || isMiscDrop(item);
} }
/** /**
* Checks to see if an item is a mining drop. * Checks to see if an item is a mining drop.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a mining drop, false otherwise * @return true if the item is a mining drop, false otherwise
*/ */
public static boolean isMiningDrop(ItemStack is) { public static boolean isMiningDrop(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case COAL: case COAL:
case COAL_ORE: case COAL_ORE:
case DIAMOND: case DIAMOND:
@ -557,17 +524,15 @@ public class ItemUtils {
case GOLD_ORE: case GOLD_ORE:
case IRON_ORE: case IRON_ORE:
case LAPIS_ORE: case LAPIS_ORE:
case REDSTONE_ORE: case REDSTONE_ORE: // Should we also have Glowing Redstone Ore here?
case REDSTONE: case REDSTONE:
case GLOWSTONE_DUST: case GLOWSTONE_DUST: // Should we also have Glowstone here?
case QUARTZ:
case QUARTZ_ORE:
return true; return true;
case INK_SACK: case INK_SACK:
if (is.getData().getData() == DyeColor.BLUE.getDyeData()) { return item.getData().getData() == DyeColor.BLUE.getDyeData();
return true;
}
return false;
default: default:
return false; return false;
@ -577,11 +542,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a herbalism drop. * Checks to see if an item is a herbalism drop.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a herbalism drop, false otherwise * @return true if the item is a herbalism drop, false otherwise
*/ */
public static boolean isHerbalismDrop(ItemStack is) { public static boolean isHerbalismDrop(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case WHEAT: case WHEAT:
case SEEDS: case SEEDS:
case CARROT_ITEM: case CARROT_ITEM:
@ -602,7 +567,7 @@ public class ItemUtils {
return true; return true;
case INK_SACK: case INK_SACK:
return is.getData().getData() == DyeColor.BROWN.getDyeData(); return item.getData().getData() == DyeColor.BROWN.getDyeData();
default: default:
return false; return false;
@ -612,11 +577,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a mob drop. * Checks to see if an item is a mob drop.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a mob drop, false otherwise * @return true if the item is a mob drop, false otherwise
*/ */
public static boolean isMobDrop(ItemStack is) { public static boolean isMobDrop(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case STRING: case STRING:
case FEATHER: case FEATHER:
case RAW_CHICKEN: case RAW_CHICKEN:
@ -627,7 +592,7 @@ public class ItemUtils {
case PORK: case PORK:
case GRILLED_PORK: case GRILLED_PORK:
case WOOL: case WOOL:
case RED_ROSE: case RED_ROSE: // Not sure we should include this, as it will also trigger from herbalism
case IRON_INGOT: case IRON_INGOT:
case SNOW_BALL: case SNOW_BALL:
case BLAZE_ROD: case BLAZE_ROD:
@ -640,7 +605,7 @@ public class ItemUtils {
case ARROW: case ARROW:
case SLIME_BALL: case SLIME_BALL:
case NETHER_STAR: case NETHER_STAR:
case COAL: case COAL: // Not sure we should include this, as it will also trigger when mining
case ROTTEN_FLESH: case ROTTEN_FLESH:
case GOLD_NUGGET: case GOLD_NUGGET:
case EGG: case EGG:
@ -654,11 +619,11 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a woodcutting drop. * Checks to see if an item is a woodcutting drop.
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a woodcutting drop, false otherwise * @return true if the item is a woodcutting drop, false otherwise
*/ */
public static boolean isWoodcuttingDrop(ItemStack is) { public static boolean isWoodcuttingDrop(ItemStack item) {
switch (is.getType()) { switch (item.getType()) {
case LOG: case LOG:
case LEAVES: case LEAVES:
case SAPLING: case SAPLING:
@ -673,38 +638,28 @@ public class ItemUtils {
/** /**
* Checks to see if an item is a miscellaneous drop. These items are read from the config file * Checks to see if an item is a miscellaneous drop. These items are read from the config file
* *
* @param is Item to check * @param item Item to check
* @return true if the item is a miscellaneous drop, false otherwise * @return true if the item is a miscellaneous drop, false otherwise
*/ */
public static boolean isMiscDrop(ItemStack is) { public static boolean isMiscDrop(ItemStack item) {
return ItemWeightConfig.getInstance().getMiscItems().contains(is.getType()); return ItemWeightConfig.getInstance().getMiscItems().contains(item.getType());
} }
public static boolean isMcMMOItem(ItemStack is) { public static boolean isMcMMOItem(ItemStack item) {
if (!is.hasItemMeta()) { if (!item.hasItemMeta()) {
return false; return false;
} }
ItemMeta itemMeta = is.getItemMeta(); ItemMeta itemMeta = item.getItemMeta();
if (itemMeta.hasLore()) { return itemMeta.hasLore() && itemMeta.getLore().contains("mcMMO Item");
List<String> itemLore = itemMeta.getLore();
if (itemLore.contains("mcMMO Item")) {
return true;
}
} }
public static boolean isChimaeraWing(ItemStack item) {
if (!isMcMMOItem(item)) {
return false; return false;
} }
public static boolean isChimaeraWing(ItemStack is) { ItemMeta itemMeta = item.getItemMeta();
if (!isMcMMOItem(is)) { return itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"));
return false;
}
ItemMeta itemMeta = is.getItemMeta();
if (itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"))) {
return true;
}
return false;
} }
} }

View File

@ -10,6 +10,8 @@
##### #####
Item_Weights: Item_Weights:
Default: 5 Default: 5
Quartz: 200
Quartz_Ore: 200
Emerald: 150 Emerald: 150
Emerald_Ore: 150 Emerald_Ore: 150
Diamond: 100 Diamond: 100