Java Code Examples for org.bukkit.Material#COOKED_PORKCHOP
The following examples show how to use
org.bukkit.Material#COOKED_PORKCHOP .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BukkitCompat.java From StackMob-3 with GNU General Public License v3.0 | 4 votes |
@Override public boolean checkFood(Entity entity, ItemStack food) { Material type = food.getType(); switch (entity.getType()) { case COW: case SHEEP: case MUSHROOM_COW: return type == Material.WHEAT; case PIG: return (type == Material.CARROT || type == Material.BEETROOT || type == Material.POTATO); case CHICKEN: return type == Material.WHEAT_SEEDS || type == Material.MELON_SEEDS || type == Material.BEETROOT_SEEDS || type == Material.PUMPKIN_SEEDS; case HORSE: return (type == Material.GOLDEN_APPLE || type == Material.GOLDEN_CARROT) && ((Horse)entity).isTamed(); case WOLF: return (type == Material.BEEF || type == Material.CHICKEN || type == Material.COD || type == Material.MUTTON || type == Material.PORKCHOP || type == Material.RABBIT || type == Material.SALMON || type == Material.COOKED_BEEF || type == Material.COOKED_CHICKEN || type == Material.COOKED_COD || type == Material.COOKED_MUTTON || type == Material.COOKED_PORKCHOP || type == Material.COOKED_RABBIT || type == Material.COOKED_SALMON) && ((Wolf) entity).isTamed(); case OCELOT: return (type == Material.SALMON || type == Material.COD || type == Material.PUFFERFISH || type == Material.TROPICAL_FISH) && ((Ocelot) entity).isTamed(); case RABBIT: return type == Material.CARROT || type == Material.GOLDEN_CARROT || type == Material.DANDELION; case LLAMA: return type == Material.HAY_BLOCK; case TURTLE: return type == Material.SEAGRASS; } return false; }
Example 2
Source File: BukkitCompat.java From StackMob-3 with GNU General Public License v3.0 | 4 votes |
@Override public boolean checkFood(Entity entity, ItemStack food) { Material type = food.getType(); switch (entity.getType()) { case COW: case SHEEP: case MUSHROOM_COW: return type == Material.WHEAT; case PIG: return (type == Material.CARROT || type == Material.BEETROOT || type == Material.POTATO); case CHICKEN: return type == Material.WHEAT_SEEDS || type == Material.MELON_SEEDS || type == Material.BEETROOT_SEEDS || type == Material.PUMPKIN_SEEDS; case HORSE: return (type == Material.GOLDEN_APPLE || type == Material.GOLDEN_CARROT) && ((Horse)entity).isTamed(); case WOLF: return (type == Material.BEEF || type == Material.CHICKEN || type == Material.COD || type == Material.MUTTON || type == Material.PORKCHOP || type == Material.RABBIT || type == Material.SALMON || type == Material.COOKED_BEEF || type == Material.COOKED_CHICKEN || type == Material.COOKED_COD || type == Material.COOKED_MUTTON || type == Material.COOKED_PORKCHOP || type == Material.COOKED_RABBIT || type == Material.COOKED_SALMON) && ((Wolf) entity).isTamed(); case OCELOT: return (type == Material.SALMON || type == Material.COD || type == Material.PUFFERFISH || type == Material.TROPICAL_FISH); case RABBIT: return type == Material.CARROT || type == Material.GOLDEN_CARROT || type == Material.DANDELION; case LLAMA: return type == Material.HAY_BLOCK; case TURTLE: return type == Material.SEAGRASS; case PANDA: return type == Material.BAMBOO; case FOX: return type == Material.SWEET_BERRIES; case CAT: return (type == Material.COD || type == Material.SALMON) && ((Cat) entity).isTamed(); } return false; }
Example 3
Source File: GUIManager.java From Statz with GNU General Public License v3.0 | 4 votes |
private Material getIconMaterialForSpecificStatistic(Query query, PlayerStat stat) { if (stat == PlayerStat.BLOCKS_BROKEN || stat == PlayerStat.BLOCKS_PLACED) { Material material = Material.getMaterial(query.getValue("block").toString()); if (material != null && material.isItem()) { return material; } } if (stat == PlayerStat.VILLAGER_TRADES) { return Material.getMaterial(query.getValue("trade").toString()); } if (stat == PlayerStat.KILLS_MOBS) { return Material.getMaterial(query.getValue("weapon").toString()); } if (stat == PlayerStat.ITEMS_PICKED_UP || stat == PlayerStat.ITEMS_DROPPED || stat == PlayerStat.ITEMS_CRAFTED || stat == PlayerStat.TOOLS_BROKEN) { return Material.getMaterial(query.getValue("item").toString()); } if (stat == PlayerStat.ITEMS_CAUGHT) { return Material.getMaterial(query.getValue("caught").toString()); } if (stat == PlayerStat.FOOD_EATEN) { return Material.getMaterial(query.getValue("foodEaten").toString()); } if (stat == PlayerStat.DISTANCE_TRAVELLED) { String movementType = query.getValue("moveType").toString(); switch (movementType) { case "SWIM": return Material.TROPICAL_FISH; case "FLY": return Material.BLAZE_POWDER; case "BOAT": return Material.OAK_BOAT; case "MINECART": case "HORSE IN MINECART": return Material.MINECART; case "PIG IN MINECART": case "PIG": return Material.COOKED_PORKCHOP; case "HORSE": return Material.DIAMOND_HORSE_ARMOR; case "FLY WITH ELYTRA": return Material.ELYTRA; case "WALK": return Material.GOLDEN_BOOTS; } } return plugin.getStatisticDescriptionConfig().getIconMaterial(stat); }