mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-04 05:25:28 +02:00
Quick and dirty 1.13 update. I.e. it now compiles for 1.13.
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.party.ItemWeightConfig;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.CoalType;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.FurnaceRecipe;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.Recipe;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.material.Coal;
|
||||
import org.bukkit.material.Dye;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.party.ItemWeightConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public final class ItemUtils {
|
||||
private ItemUtils() {}
|
||||
@@ -48,10 +43,10 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_SWORD:
|
||||
case GOLD_SWORD:
|
||||
case GOLDEN_SWORD:
|
||||
case IRON_SWORD:
|
||||
case STONE_SWORD:
|
||||
case WOOD_SWORD:
|
||||
case WOODEN_SWORD:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -70,10 +65,10 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_HOE:
|
||||
case GOLD_HOE:
|
||||
case GOLDEN_HOE:
|
||||
case IRON_HOE:
|
||||
case STONE_HOE:
|
||||
case WOOD_HOE:
|
||||
case WOODEN_HOE:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -91,11 +86,11 @@ public final class ItemUtils {
|
||||
Material type = item.getType();
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_SPADE:
|
||||
case GOLD_SPADE:
|
||||
case IRON_SPADE:
|
||||
case STONE_SPADE:
|
||||
case WOOD_SPADE:
|
||||
case DIAMOND_SHOVEL:
|
||||
case GOLDEN_SHOVEL:
|
||||
case IRON_SHOVEL:
|
||||
case STONE_SHOVEL:
|
||||
case WOODEN_SHOVEL:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -114,10 +109,10 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_AXE:
|
||||
case GOLD_AXE:
|
||||
case GOLDEN_AXE:
|
||||
case IRON_AXE:
|
||||
case STONE_AXE:
|
||||
case WOOD_AXE:
|
||||
case WOODEN_AXE:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -136,10 +131,10 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_PICKAXE:
|
||||
case GOLD_PICKAXE:
|
||||
case GOLDEN_PICKAXE:
|
||||
case IRON_PICKAXE:
|
||||
case STONE_PICKAXE:
|
||||
case WOOD_PICKAXE:
|
||||
case WOODEN_PICKAXE:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -172,7 +167,7 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_HELMET:
|
||||
case GOLD_HELMET:
|
||||
case GOLDEN_HELMET:
|
||||
case IRON_HELMET:
|
||||
case CHAINMAIL_HELMET:
|
||||
case LEATHER_HELMET:
|
||||
@@ -194,7 +189,7 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_CHESTPLATE:
|
||||
case GOLD_CHESTPLATE:
|
||||
case GOLDEN_CHESTPLATE:
|
||||
case IRON_CHESTPLATE:
|
||||
case CHAINMAIL_CHESTPLATE:
|
||||
case LEATHER_CHESTPLATE:
|
||||
@@ -216,7 +211,7 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_LEGGINGS:
|
||||
case GOLD_LEGGINGS:
|
||||
case GOLDEN_LEGGINGS:
|
||||
case IRON_LEGGINGS:
|
||||
case CHAINMAIL_LEGGINGS:
|
||||
case LEATHER_LEGGINGS:
|
||||
@@ -238,7 +233,7 @@ public final class ItemUtils {
|
||||
|
||||
switch (type) {
|
||||
case DIAMOND_BOOTS:
|
||||
case GOLD_BOOTS:
|
||||
case GOLDEN_BOOTS:
|
||||
case IRON_BOOTS:
|
||||
case CHAINMAIL_BOOTS:
|
||||
case LEATHER_BOOTS:
|
||||
@@ -296,10 +291,10 @@ public final class ItemUtils {
|
||||
*/
|
||||
public static boolean isGoldArmor(ItemStack item) {
|
||||
switch (item.getType()) {
|
||||
case GOLD_BOOTS:
|
||||
case GOLD_CHESTPLATE:
|
||||
case GOLD_HELMET:
|
||||
case GOLD_LEGGINGS:
|
||||
case GOLDEN_BOOTS:
|
||||
case GOLDEN_CHESTPLATE:
|
||||
case GOLDEN_HELMET:
|
||||
case GOLDEN_LEGGINGS:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -385,7 +380,7 @@ public final class ItemUtils {
|
||||
case STONE_AXE:
|
||||
case STONE_HOE:
|
||||
case STONE_PICKAXE:
|
||||
case STONE_SPADE:
|
||||
case STONE_SHOVEL:
|
||||
case STONE_SWORD:
|
||||
return true;
|
||||
|
||||
@@ -402,11 +397,11 @@ public final class ItemUtils {
|
||||
*/
|
||||
public static boolean isWoodTool(ItemStack item) {
|
||||
switch (item.getType()) {
|
||||
case WOOD_AXE:
|
||||
case WOOD_HOE:
|
||||
case WOOD_PICKAXE:
|
||||
case WOOD_SPADE:
|
||||
case WOOD_SWORD:
|
||||
case WOODEN_AXE:
|
||||
case WOODEN_HOE:
|
||||
case WOODEN_PICKAXE:
|
||||
case WOODEN_SHOVEL:
|
||||
case WOODEN_SWORD:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -423,7 +418,7 @@ public final class ItemUtils {
|
||||
public static boolean isStringTool(ItemStack item) {
|
||||
switch (item.getType()) {
|
||||
case BOW:
|
||||
case CARROT_STICK:
|
||||
case CARROT_ON_A_STICK:
|
||||
case FISHING_ROD:
|
||||
return true;
|
||||
|
||||
@@ -440,11 +435,11 @@ public final class ItemUtils {
|
||||
*/
|
||||
public static boolean isGoldTool(ItemStack item) {
|
||||
switch (item.getType()) {
|
||||
case GOLD_AXE:
|
||||
case GOLD_HOE:
|
||||
case GOLD_PICKAXE:
|
||||
case GOLD_SPADE:
|
||||
case GOLD_SWORD:
|
||||
case GOLDEN_AXE:
|
||||
case GOLDEN_HOE:
|
||||
case GOLDEN_PICKAXE:
|
||||
case GOLDEN_SHOVEL:
|
||||
case GOLDEN_SWORD:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -465,7 +460,7 @@ public final class ItemUtils {
|
||||
case IRON_AXE:
|
||||
case IRON_HOE:
|
||||
case IRON_PICKAXE:
|
||||
case IRON_SPADE:
|
||||
case IRON_SHOVEL:
|
||||
case IRON_SWORD:
|
||||
case SHEARS:
|
||||
return true;
|
||||
@@ -486,7 +481,7 @@ public final class ItemUtils {
|
||||
case DIAMOND_AXE:
|
||||
case DIAMOND_HOE:
|
||||
case DIAMOND_PICKAXE:
|
||||
case DIAMOND_SPADE:
|
||||
case DIAMOND_SHOVEL:
|
||||
case DIAMOND_SWORD:
|
||||
return true;
|
||||
|
||||
@@ -506,7 +501,7 @@ public final class ItemUtils {
|
||||
case ENCHANTED_BOOK:
|
||||
case SHEARS:
|
||||
case FISHING_ROD:
|
||||
case CARROT_STICK:
|
||||
case CARROT_ON_A_STICK:
|
||||
case FLINT_AND_STEEL:
|
||||
return true;
|
||||
|
||||
@@ -568,12 +563,10 @@ public final class ItemUtils {
|
||||
case REDSTONE:
|
||||
case GLOWSTONE_DUST: // Should we also have Glowstone here?
|
||||
case QUARTZ:
|
||||
case QUARTZ_ORE:
|
||||
case NETHER_QUARTZ_ORE:
|
||||
case LAPIS_LAZULI:
|
||||
return true;
|
||||
|
||||
case INK_SACK:
|
||||
return ((Dye) item.getData()).getColor() == DyeColor.BLUE;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -588,33 +581,30 @@ public final class ItemUtils {
|
||||
public static boolean isHerbalismDrop(ItemStack item) {
|
||||
switch (item.getType()) {
|
||||
case WHEAT:
|
||||
case SEEDS:
|
||||
case CARROT_ITEM:
|
||||
case WHEAT_SEEDS:
|
||||
case CARROT:
|
||||
case CHORUS_FRUIT:
|
||||
case CHORUS_FLOWER:
|
||||
case POTATO_ITEM:
|
||||
case POTATO:
|
||||
case BEETROOT:
|
||||
case BEETROOT_SEEDS:
|
||||
case NETHER_WARTS:
|
||||
case NETHER_WART:
|
||||
case BROWN_MUSHROOM:
|
||||
case RED_MUSHROOM:
|
||||
case RED_ROSE:
|
||||
case YELLOW_FLOWER:
|
||||
case ROSE_RED:
|
||||
case DANDELION_YELLOW:
|
||||
case CACTUS:
|
||||
case SUGAR_CANE:
|
||||
case MELON:
|
||||
case MELON_SEEDS:
|
||||
case PUMPKIN:
|
||||
case PUMPKIN_SEEDS:
|
||||
case WATER_LILY:
|
||||
case LILY_PAD:
|
||||
case VINE:
|
||||
case LONG_GRASS:
|
||||
case DOUBLE_PLANT:
|
||||
case TALL_GRASS:
|
||||
case COCOA_BEANS:
|
||||
return true;
|
||||
|
||||
case INK_SACK:
|
||||
return ((Dye) item.getData()).getColor() == DyeColor.BROWN;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -630,19 +620,34 @@ public final class ItemUtils {
|
||||
switch (item.getType()) {
|
||||
case STRING:
|
||||
case FEATHER:
|
||||
case RAW_CHICKEN:
|
||||
case CHICKEN:
|
||||
case COOKED_CHICKEN:
|
||||
case LEATHER:
|
||||
case RAW_BEEF:
|
||||
case BEEF:
|
||||
case COOKED_BEEF:
|
||||
case PORK:
|
||||
case GRILLED_PORK:
|
||||
case WOOL:
|
||||
case PORKCHOP:
|
||||
case COOKED_PORKCHOP:
|
||||
case WHITE_WOOL:
|
||||
case BLACK_WOOL:
|
||||
case BLUE_WOOL:
|
||||
case BROWN_WOOL:
|
||||
case CYAN_WOOL:
|
||||
case GRAY_WOOL:
|
||||
case GREEN_WOOL:
|
||||
case LIGHT_BLUE_WOOL:
|
||||
case LIGHT_GRAY_WOOL:
|
||||
case LIME_WOOL:
|
||||
case MAGENTA_WOOL:
|
||||
case ORANGE_WOOL:
|
||||
case PINK_WOOL:
|
||||
case PURPLE_WOOL:
|
||||
case RED_WOOL:
|
||||
case YELLOW_WOOL:
|
||||
case IRON_INGOT:
|
||||
case SNOW_BALL:
|
||||
case SNOWBALL:
|
||||
case BLAZE_ROD:
|
||||
case SPIDER_EYE:
|
||||
case SULPHUR:
|
||||
case GUNPOWDER:
|
||||
case ENDER_PEARL:
|
||||
case GHAST_TEAR:
|
||||
case MAGMA_CREAM:
|
||||
@@ -653,14 +658,10 @@ public final class ItemUtils {
|
||||
case ROTTEN_FLESH:
|
||||
case GOLD_NUGGET:
|
||||
case EGG:
|
||||
case ROSE_RED:
|
||||
case COAL:
|
||||
return true;
|
||||
|
||||
case COAL: // Not sure we should include this, as it will also trigger when mining
|
||||
return (((Coal) item.getData()).getType() == CoalType.COAL);
|
||||
|
||||
case RED_ROSE: // Not sure we should include this, as it will also trigger from herbalism
|
||||
return (item.getData().getData() == 0x0);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -674,11 +675,30 @@ public final class ItemUtils {
|
||||
*/
|
||||
public static boolean isWoodcuttingDrop(ItemStack item) {
|
||||
switch (item.getType()) {
|
||||
case LOG:
|
||||
case LOG_2:
|
||||
case LEAVES:
|
||||
case LEAVES_2:
|
||||
case SAPLING:
|
||||
case ACACIA_LOG:
|
||||
case BIRCH_LOG:
|
||||
case DARK_OAK_LOG:
|
||||
case JUNGLE_LOG:
|
||||
case OAK_LOG:
|
||||
case SPRUCE_LOG:
|
||||
case STRIPPED_ACACIA_LOG:
|
||||
case STRIPPED_BIRCH_LOG:
|
||||
case STRIPPED_DARK_OAK_LOG:
|
||||
case STRIPPED_JUNGLE_LOG:
|
||||
case STRIPPED_OAK_LOG:
|
||||
case STRIPPED_SPRUCE_LOG:
|
||||
case ACACIA_SAPLING:
|
||||
case SPRUCE_SAPLING:
|
||||
case BIRCH_SAPLING:
|
||||
case DARK_OAK_SAPLING:
|
||||
case JUNGLE_SAPLING:
|
||||
case OAK_SAPLING:
|
||||
case ACACIA_LEAVES:
|
||||
case BIRCH_LEAVES:
|
||||
case DARK_OAK_LEAVES:
|
||||
case JUNGLE_LEAVES:
|
||||
case OAK_LEAVES:
|
||||
case SPRUCE_LEAVES:
|
||||
case APPLE:
|
||||
return true;
|
||||
|
||||
|
Reference in New Issue
Block a user