From ee324c77a9f94b3a1e97a92ebf0b9af5038e7609 Mon Sep 17 00:00:00 2001 From: Shane Robertson Date: Thu, 26 Jul 2018 18:53:29 -0500 Subject: [PATCH] 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 --- .../config/experience/ExperienceConfig.java | 19 ++-- .../config/mods/CustomBlockConfig.java | 32 +++---- .../config/mods/CustomEntityConfig.java | 4 +- .../config/treasure/TreasureConfig.java | 95 ++++++++++++------- .../datatypes/skills/MaterialType.java | 2 +- .../nossr50/listeners/BlockListener.java | 1 - .../nossr50/skills/excavation/Excavation.java | 4 +- .../skills/fishing/FishingManager.java | 2 +- .../skills/herbalism/HerbalismManager.java | 25 +++-- .../gmail/nossr50/skills/mining/Mining.java | 7 +- .../nossr50/skills/mining/MiningManager.java | 3 +- .../nossr50/skills/repair/RepairManager.java | 4 +- .../skills/salvage/SalvageManager.java | 6 +- .../nossr50/skills/smelting/Smelting.java | 4 +- .../skills/unarmed/UnarmedManager.java | 4 +- .../skills/woodcutting/Woodcutting.java | 2 +- .../woodcutting/WoodcuttingManager.java | 1 + .../com/gmail/nossr50/util/BlockUtils.java | 11 ++- .../com/gmail/nossr50/util/ItemUtils.java | 16 +--- .../com/gmail/nossr50/util/MaterialUtils.java | 6 +- .../com/gmail/nossr50/util/ModManager.java | 22 ++--- .../com/gmail/nossr50/util/StringUtils.java | 31 ++++-- .../gmail/nossr50/util/skills/SkillUtils.java | 10 +- src/main/resources/config.yml | 2 +- src/main/resources/experience.yml | 36 ++++--- src/main/resources/repair.vanilla.yml | 10 +- src/main/resources/salvage.vanilla.yml | 10 +- src/main/resources/treasures.yml | 5 +- .../java/mcMMO/PotionConfigGenerator.java | 2 +- 29 files changed, 211 insertions(+), 165 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index 98c590d5d..6e75db8dc 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -8,7 +8,7 @@ import org.bukkit.Material; import org.bukkit.TreeSpecies; import org.bukkit.entity.EntityType; import org.bukkit.material.LongGrass; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import org.bukkit.material.Tree; import com.gmail.nossr50.mcMMO; @@ -193,31 +193,32 @@ public class ExperienceConfig extends AutoUpdateConfigLoader { public boolean hasCombatXP(EntityType entity) {return config.contains("Experience.Combat.Multiplier." + StringUtils.getPrettyEntityTypeString(entity).replace(" ", "_")); } /* Materials */ - public int getXp(SkillType skill, MaterialData data) + public int getXp(SkillType skill, BlockData data) { + System.out.print(">>YUP>"+skill.toString()); String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; - String explicitString = baseString + StringUtils.getExplicitConfigMaterialDataString(data); + String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) return config.getInt(explicitString); - String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialDataString(data); + String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); if (config.contains(friendlyString)) return config.getInt(friendlyString); - String wildcardString = baseString + StringUtils.getWildcardConfigMaterialDataString(data); + String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); if (config.contains(wildcardString)) return config.getInt(wildcardString); return 0; } - public boolean isSkillBlock(SkillType skill, MaterialData data) + public boolean isSkillBlock(SkillType skill, BlockData data) { String baseString = "Experience." + StringUtils.getCapitalized(skill.toString()) + "."; - String explicitString = baseString + StringUtils.getExplicitConfigMaterialDataString(data); + String explicitString = baseString + StringUtils.getExplicitConfigBlockDataString(data); if (config.contains(explicitString)) return true; - String friendlyString = baseString + StringUtils.getFriendlyConfigMaterialDataString(data); + String friendlyString = baseString + StringUtils.getFriendlyConfigBlockDataString(data); if (config.contains(friendlyString)) return true; - String wildcardString = baseString + StringUtils.getWildcardConfigMaterialDataString(data); + String wildcardString = baseString + StringUtils.getWildcardConfigBlockDataString(data); if (config.contains(wildcardString)) return true; return false; diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java index 9a754a929..df11ac212 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomBlockConfig.java @@ -7,7 +7,7 @@ import java.util.Set; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.datatypes.mods.CustomBlock; @@ -15,15 +15,15 @@ import com.gmail.nossr50.datatypes.mods.CustomBlock; public class CustomBlockConfig extends ConfigLoader { private boolean needsUpdate = false; - public List customExcavationBlocks = new ArrayList(); - public List customHerbalismBlocks = new ArrayList(); - public List customMiningBlocks = new ArrayList(); - public List customOres = new ArrayList(); - public List customLogs = new ArrayList(); - public List customLeaves = new ArrayList(); - public List customAbilityBlocks = new ArrayList(); + public List customExcavationBlocks = new ArrayList(); + public List customHerbalismBlocks = new ArrayList(); + public List customMiningBlocks = new ArrayList(); + public List customOres = new ArrayList(); + public List customLogs = new ArrayList(); + public List customLeaves = new ArrayList(); + public List customAbilityBlocks = new ArrayList(); - public HashMap customBlockMap = new HashMap(); + public HashMap customBlockMap = new HashMap(); protected CustomBlockConfig(String fileName) { super("mods", fileName); @@ -44,7 +44,7 @@ public class CustomBlockConfig extends ConfigLoader { } } - private void loadBlocks(String skillType, List blockList) { + private void loadBlocks(String skillType, List blockList) { if (needsUpdate) { return; } @@ -73,10 +73,10 @@ public class CustomBlockConfig extends ConfigLoader { } byte blockData = (blockInfo.length == 2) ? Byte.valueOf(blockInfo[1]) : 0; - MaterialData blockMaterialData = new MaterialData(blockMaterial, blockData); + BlockData blockBlockData = blockMaterial.createBlockData(); if (blockList != null) { - blockList.add(blockMaterialData); + blockList.add(blockBlockData); } if (skillType.equals("Ability_Blocks")) { @@ -87,20 +87,20 @@ public class CustomBlockConfig extends ConfigLoader { int smeltingXp = 0; if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) { - customOres.add(blockMaterialData); + customOres.add(blockBlockData); smeltingXp = config.getInt(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10); } else if (skillType.equals("Woodcutting")) { if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) { - customLogs.add(blockMaterialData); + customLogs.add(blockBlockData); } else { - customLeaves.add(blockMaterialData); + customLeaves.add(blockBlockData); xp = 0; // Leaves don't grant XP } } - customBlockMap.put(blockMaterialData, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp)); + customBlockMap.put(blockBlockData, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp)); } } } diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java index 16be6e00e..218827c0a 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomEntityConfig.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.config.mods; import java.util.HashMap; import org.bukkit.Material; -import org.bukkit.material.MaterialData; +import org.bukkit.inventory.ItemStack; import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.datatypes.mods.CustomEntity; @@ -54,7 +54,7 @@ public class CustomEntityConfig extends ConfigLoader { canBeSummoned = false; } - CustomEntity entity = new CustomEntity(xpMultiplier, canBeTamed, tamingXp, canBeSummoned, (canBeSummoned ? new MaterialData(callOfTheWildMaterial, callOfTheWildData).toItemStack(1) : null), callOfTheWildAmount); + CustomEntity entity = new CustomEntity(xpMultiplier, canBeTamed, tamingXp, canBeSummoned, (canBeSummoned ? new ItemStack(callOfTheWildMaterial) : null), callOfTheWildAmount); customEntityTypeMap.put(entityTypeName, entity); customEntityClassMap.put(clazz == null ? null : clazz.getName(), entity); diff --git a/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java b/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java index 2ccb5c611..f770ca002 100755 --- a/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java +++ b/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java @@ -15,7 +15,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.material.Dye; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionType; @@ -53,7 +53,6 @@ public class TreasureConfig extends ConfigLoader { protected boolean validateKeys() { // Validate all the settings! List reason = new ArrayList(); - for (String tier : config.getConfigurationSection("Enchantment_Drop_Rates").getKeys(false)) { double totalEnchantDropRate = 0; double totalItemDropRate = 0; @@ -136,7 +135,7 @@ public class TreasureConfig extends ConfigLoader { */ Material material; - if (materialName.contains("INK_SACK")) { + if (materialName.contains("INK_SAC")) { material = Material.INK_SAC; } else if (materialName.contains("COAL")) { material = Material.COAL; @@ -234,33 +233,33 @@ public class TreasureConfig extends ConfigLoader { } item.setItemMeta(itemMeta); } - } else if (materialName.contains("INK_SACK")) { - String color = materialName.substring(9); - - try { - Dye dye = new Dye(); - dye.setColor(DyeColor.valueOf(color.toUpperCase().trim())); - - item = dye.toItemStack(amount); - - if (config.contains(type + "." + treasureName + ".Custom_Name")) { - ItemMeta itemMeta = item.getItemMeta(); - itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name"))); - item.setItemMeta(itemMeta); - } - - if (config.contains(type + "." + treasureName + ".Lore")) { - ItemMeta itemMeta = item.getItemMeta(); - List lore = new ArrayList(); - for (String s : config.getStringList(type + "." + treasureName + ".Lore")) { - lore.add(ChatColor.translateAlternateColorCodes('&', s)); - } - itemMeta.setLore(lore); - item.setItemMeta(itemMeta); - } - } catch (IllegalArgumentException ex) { - reason.add("Invalid Dye_Color: " + color); - } +// } else if (materialName.contains("INK_SAC")) { +// String color = materialName.substring(9); +// +// try { +// Dye dye = new Dye(); +// dye.setColor(DyeColor.valueOf(color.toUpperCase().trim())); +// +// item = dye.toItemStack(amount); +// +// if (config.contains(type + "." + treasureName + ".Custom_Name")) { +// ItemMeta itemMeta = item.getItemMeta(); +// itemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', config.getString(type + "." + treasureName + ".Custom_Name"))); +// item.setItemMeta(itemMeta); +// } +// +// if (config.contains(type + "." + treasureName + ".Lore")) { +// ItemMeta itemMeta = item.getItemMeta(); +// List lore = new ArrayList(); +// for (String s : config.getStringList(type + "." + treasureName + ".Lore")) { +// lore.add(ChatColor.translateAlternateColorCodes('&', s)); +// } +// itemMeta.setLore(lore); +// item.setItemMeta(itemMeta); +// } +// } catch (IllegalArgumentException ex) { +// reason.add("Invalid Dye_Color: " + color); +// } } else if (material != null) { item = new ItemStack(material, amount, data); @@ -316,16 +315,40 @@ public class TreasureConfig extends ConfigLoader { continue; } if (dropper.equals("Flowers")) { - for (int i = 0; i < 9; i++) { - AddHylianTreasure(StringUtils.getFriendlyConfigMaterialDataString(new MaterialData(Material.ROSE_RED, (byte) i)), hylianTreasure); - } + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POPPY), hylianTreasure); AddHylianTreasure(StringUtils.getPrettyItemString(Material.DANDELION), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.BLUE_ORCHID), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.ALLIUM), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.AZURE_BLUET), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.ORANGE_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.PINK_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.RED_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.WHITE_TULIP), hylianTreasure); continue; } if (dropper.equals("Pots")) { - for (int i = 0; i < 14; i++) { - AddHylianTreasure(StringUtils.getFriendlyConfigMaterialDataString(new MaterialData(Material.FLOWER_POT, (byte) i)), hylianTreasure); - } + AddHylianTreasure(StringUtils.getPrettyItemString(Material.FLOWER_POT), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_DANDELION), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_POPPY), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_BLUE_ORCHID), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_ALLIUM), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_AZURE_BLUET), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_RED_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_ORANGE_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_WHITE_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_PINK_TULIP), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_OXEYE_DAISY), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_OAK_SAPLING), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_SPRUCE_SAPLING), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_BIRCH_SAPLING), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_JUNGLE_SAPLING), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_OXEYE_DAISY), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_OXEYE_DAISY), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_FERN), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_DEAD_BUSH), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_RED_MUSHROOM), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_BROWN_MUSHROOM), hylianTreasure); + AddHylianTreasure(StringUtils.getPrettyItemString(Material.POTTED_CACTUS), hylianTreasure); continue; } AddHylianTreasure(dropper, hylianTreasure); diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java b/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java index 62f7ed160..8458c43fb 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/MaterialType.java @@ -21,7 +21,7 @@ public enum MaterialType { return Material.LEATHER; case WOOD: - return Material.OAK_PLANKS; + return Material.OAK_WOOD; case STONE: return Material.COBBLESTONE; diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 97978a051..2f4343ce5 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -216,7 +216,6 @@ public class BlockListener implements Listener { /* WOOD CUTTING */ else if (BlockUtils.isLog(blockState) && ItemUtils.isAxe(heldItem) && SkillType.WOODCUTTING.getPermissions(player) && !mcMMO.getPlaceStore().isTrue(blockState)) { WoodcuttingManager woodcuttingManager = mcMMOPlayer.getWoodcuttingManager(); - if (woodcuttingManager.canUseTreeFeller(heldItem)) { woodcuttingManager.processTreeFeller(blockState); } diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java b/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java index bdd7590c0..daba54a66 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java @@ -20,14 +20,14 @@ public class Excavation { * @return the list of treasures that could be found */ protected static List getTreasures(BlockState blockState) { - String friendly = StringUtils.getFriendlyConfigMaterialDataString(blockState.getData()); + String friendly = StringUtils.getFriendlyConfigBlockDataString(blockState.getBlockData()); if (TreasureConfig.getInstance().excavationMap.containsKey(friendly)) return TreasureConfig.getInstance().excavationMap.get(friendly); return new ArrayList(); } protected static int getBlockXP(BlockState blockState) { - int xp = ExperienceConfig.getInstance().getXp(SkillType.EXCAVATION, blockState.getData()); + int xp = ExperienceConfig.getInstance().getXp(SkillType.EXCAVATION, blockState.getBlockData()); if (xp == 0 && mcMMO.getModManager().isCustomExcavationBlock(blockState)) { xp = mcMMO.getModManager().getBlock(blockState).getXpGain(); diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java index 923daa920..cdc97ca3a 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java @@ -279,7 +279,7 @@ public class FishingManager extends SkillManager { */ public void handleFishing(Item fishingCatch) { this.fishingCatch = fishingCatch; - int fishXp = ExperienceConfig.getInstance().getXp(SkillType.FISHING, fishingCatch.getItemStack().getData()); + int fishXp = ExperienceConfig.getInstance().getXp(SkillType.FISHING, fishingCatch.getItemStack().getType().createBlockData()); int treasureXp = 0; Player player = getPlayer(); FishingTreasure treasure = null; diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 7f77d9dd5..cbd75636d 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -112,18 +112,22 @@ public class HerbalismManager extends SkillManager { * @param blockState The {@link BlockState} to check ability activation for */ public void herbalismBlockCheck(BlockState blockState) { + System.out.print(">>1"); Player player = getPlayer(); Material material = blockState.getType(); boolean oneBlockPlant = !(material == Material.CACTUS || material == Material.CHORUS_PLANT || material == Material.SUGAR_CANE); // Prevents placing and immediately breaking blocks for exp if (oneBlockPlant && mcMMO.getPlaceStore().isTrue(blockState)) { + System.out.print(">>1.5"); return; } + System.out.print(">>2"); if (!canBlockCheck()) { return; } + System.out.print(">>3"); Collection drops = null; int amount = 1; @@ -131,6 +135,7 @@ public class HerbalismManager extends SkillManager { boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility()); if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) { + System.out.print(">>4"); CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState); xp = customBlock.getXpGain(); @@ -139,28 +144,34 @@ public class HerbalismManager extends SkillManager { } } else { + System.out.print(">>5"); if(material == Material.CHORUS_FLOWER && blockState.getRawData() != 5) { return; } - xp = ExperienceConfig.getInstance().getXp(skill, blockState.getData()); + xp = ExperienceConfig.getInstance().getXp(skill, blockState.getBlockData()); if (Config.getInstance().getDoubleDropsEnabled(skill, material) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.HERBALISM_DOUBLE_DROPS)) { drops = blockState.getBlock().getDrops(); + System.out.print(">>6"); } if (!oneBlockPlant) { + System.out.print(">>7"); amount = Herbalism.calculateMultiBlockPlantDrops(blockState); xp *= amount; } if (Permissions.greenThumbPlant(player, material)) { + System.out.print(">>8"); processGreenThumbPlants(blockState, greenTerra); } } + System.out.print(">>9"); applyXpGain(xp, XPGainReason.PVE); if (drops == null) { + System.out.print(">>10"); return; } @@ -199,7 +210,7 @@ public class HerbalismManager extends SkillManager { return false; } - String friendly = StringUtils.getFriendlyConfigMaterialDataString(blockState.getData()); + String friendly = StringUtils.getFriendlyConfigBlockDataString(blockState.getBlockData()); if (!TreasureConfig.getInstance().hylianMap.containsKey(friendly)) return false; List treasures = TreasureConfig.getInstance().hylianMap.get(friendly); @@ -320,11 +331,11 @@ public class HerbalismManager extends SkillManager { switch (blockState.getType()) { - case POTATO: - case CARROT: + case POTATOES: + case CARROTS: case BEETROOTS: case WHEAT: - Crops crops = (Crops) blockState.getData(); + Crops crops = (Crops) blockState.getBlockData(); if (greenTerra) { crops.setState(CropState.MEDIUM); @@ -349,7 +360,7 @@ public class HerbalismManager extends SkillManager { return true; case NETHER_WART_BLOCK: - NetherWarts warts = (NetherWarts) blockState.getData(); + NetherWarts warts = (NetherWarts) blockState.getBlockData(); if (greenTerra || greenThumbStage > 2) { warts.setState(NetherWartsState.STAGE_TWO); @@ -364,7 +375,7 @@ public class HerbalismManager extends SkillManager { return true; case COCOA: - CocoaPlant plant = (CocoaPlant) blockState.getData(); + CocoaPlant plant = (CocoaPlant) blockState.getBlockData(); if (greenTerra || getGreenThumbStage() > 1) { plant.setSize(CocoaPlantSize.MEDIUM); diff --git a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java index 92f74f696..7445db8af 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java @@ -6,6 +6,7 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; import org.bukkit.Material; import org.bukkit.block.BlockState; +import org.bukkit.inventory.ItemStack; public class Mining { @@ -15,7 +16,7 @@ public class Mining { * @param blockState The {@link BlockState} to check ability activation for */ public static int getBlockXp(BlockState blockState) { - int xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, blockState.getData()); + int xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, blockState.getBlockData()); if (xp == 0 && mcMMO.getModManager().isCustomMiningBlock(blockState)) { xp = mcMMO.getModManager().getBlock(blockState).getXpGain(); @@ -86,12 +87,12 @@ public class Mining { case REDSTONE_ORE: case STONE: case PRISMARINE: - Misc.dropItem(Misc.getBlockCenter(blockState), blockState.getData().toItemStack(1)); + Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); return; default: if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { - Misc.dropItem(Misc.getBlockCenter(blockState), blockState.getData().toItemStack(1)); + Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); } return; } diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 12c1dcc9c..05b91da66 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -16,6 +16,7 @@ import com.gmail.nossr50.util.EventUtils; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.skills.SkillUtils; +import org.bukkit.inventory.ItemStack; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; @@ -146,7 +147,7 @@ public class MiningManager extends SkillManager { xp += Mining.getBlockXp(blockState); } - Misc.dropItem(Misc.getBlockCenter(blockState), blockState.getData().toItemStack(1)); // Initial block that would have been dropped + Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); // Initial block that would have been dropped if (!mcMMO.getPlaceStore().isTrue(blockState)) { for (int i = 1; i < dropMultiplier; i++) { diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index 07374f903..5716cfe86 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -22,7 +22,7 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import java.util.Map; import java.util.Map.Entry; @@ -89,7 +89,7 @@ public class RepairManager extends SkillManager { Material repairMaterial = repairable.getRepairMaterial(); byte repairMaterialMetadata = repairable.getRepairMaterialMetadata(); - ItemStack toRemove = new MaterialData(repairMaterial, repairMaterialMetadata).toItemStack(1); + ItemStack toRemove = new ItemStack(repairMaterial); short startDurability = item.getDurability(); diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index ab7efb3f8..c529638d3 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -20,7 +20,7 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import java.util.Map; import java.util.Map.Entry; @@ -108,9 +108,7 @@ public class SalvageManager extends SkillManager { enchantBook = arcaneSalvageCheck(enchants); } - byte salvageMaterialMetadata = (salvageable.getSalvageMaterialMetadata() != (byte) -1) ? salvageable.getSalvageMaterialMetadata() : 0; - - ItemStack salvageResults = new MaterialData(salvageable.getSalvageMaterial(), salvageMaterialMetadata).toItemStack(salvageableAmount); + ItemStack salvageResults = new ItemStack(salvageable.getSalvageMaterial(), salvageableAmount); //Call event if (EventUtils.callSalvageCheckEvent(player, item, salvageResults, enchantBook).isCancelled()) { diff --git a/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java b/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java index b0695ec8a..0ee84d598 100644 --- a/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java +++ b/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java @@ -2,7 +2,7 @@ package com.gmail.nossr50.skills.smelting; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.AdvancedConfig; @@ -47,7 +47,7 @@ public class Smelting { public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance(); protected static int getResourceXp(ItemStack smelting) { - MaterialData data = smelting.getData(); + BlockData data = smelting.getType().createBlockData(); return mcMMO.getModManager().isCustomOre(data) ? mcMMO.getModManager().getBlock(data).getSmeltingXpGain() : ExperienceConfig.getInstance().getXp(SkillType.SMELTING, data); } diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index 443c2f4ce..976aed4e5 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -21,7 +21,7 @@ import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; public class UnarmedManager extends SkillManager { public UnarmedManager(McMMOPlayer mcMMOPlayer) { @@ -59,7 +59,7 @@ public class UnarmedManager extends SkillManager { return false; } - MaterialData data = blockState.getData(); + BlockData data = blockState.getBlockData(); switch (blockState.getType()) { case STONE_BRICKS: diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index 8d3fe4070..307840b60 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -44,7 +44,7 @@ public final class Woodcutting { return mcMMO.getModManager().getBlock(blockState).getXpGain(); } - return ExperienceConfig.getInstance().getXp(SkillType.WOODCUTTING, blockState.getData()); + return ExperienceConfig.getInstance().getXp(SkillType.WOODCUTTING, blockState.getBlockData()); } /** diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java index 98a841948..6e6bb8a7d 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java @@ -45,6 +45,7 @@ public class WoodcuttingManager extends SkillManager { * @param blockState Block being broken */ public void woodcuttingBlockCheck(BlockState blockState) { + System.out.print(">>HEYO"); int xp = Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.DEFAULT); switch (blockState.getType()) { diff --git a/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/src/main/java/com/gmail/nossr50/util/BlockUtils.java index d092e3eb9..3e8aa5405 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/src/main/java/com/gmail/nossr50/util/BlockUtils.java @@ -134,7 +134,7 @@ public final class BlockUtils { * @return true if the block is an ore, false otherwise */ public static boolean isOre(BlockState blockState) { - return MaterialUtils.isOre(blockState.getData()); + return MaterialUtils.isOre(blockState.getBlockData()); } /** @@ -170,8 +170,9 @@ public final class BlockUtils { * @return true if the block should affected by Green Terra, false otherwise */ public static boolean affectedByGreenTerra(BlockState blockState) { - if (ExperienceConfig.getInstance().isSkillBlock(SkillType.HERBALISM, blockState.getData())) + if (ExperienceConfig.getInstance().isSkillBlock(SkillType.HERBALISM, blockState.getBlockData())) { return true; + } return mcMMO.getModManager().isCustomHerbalismBlock(blockState); } @@ -185,7 +186,7 @@ public final class BlockUtils { * otherwise */ public static Boolean affectedBySuperBreaker(BlockState blockState) { - if (ExperienceConfig.getInstance().isSkillBlock(SkillType.MINING, blockState.getData())) + if (ExperienceConfig.getInstance().isSkillBlock(SkillType.MINING, blockState.getBlockData())) return true; return isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState); @@ -200,7 +201,7 @@ public final class BlockUtils { * otherwise */ public static boolean affectedByGigaDrillBreaker(BlockState blockState) { - if (ExperienceConfig.getInstance().isSkillBlock(SkillType.EXCAVATION, blockState.getData())) + if (ExperienceConfig.getInstance().isSkillBlock(SkillType.EXCAVATION, blockState.getBlockData())) return true; return mcMMO.getModManager().isCustomExcavationBlock(blockState); } @@ -213,7 +214,7 @@ public final class BlockUtils { * @return true if the block is a log, false otherwise */ public static boolean isLog(BlockState blockState) { - if (ExperienceConfig.getInstance().isSkillBlock(SkillType.WOODCUTTING, blockState.getData())) + if (ExperienceConfig.getInstance().isSkillBlock(SkillType.WOODCUTTING, blockState.getBlockData())) return true; return mcMMO.getModManager().isCustomLog(blockState); } diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index a20f0a5da..8276e4c2a 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -511,7 +511,7 @@ public final class ItemUtils { } public static boolean isSmeltable(ItemStack item) { - return item != null && MaterialUtils.isOre(item.getData()); + return item != null && 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().getData())) { + if (recipe instanceof FurnaceRecipe && MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getType().createBlockData())) { return true; } } @@ -681,18 +681,6 @@ public final class ItemUtils { case JUNGLE_LOG: case OAK_LOG: case SPRUCE_LOG: - case OAK_WOOD: - case ACACIA_WOOD: - case BIRCH_WOOD: - case DARK_OAK_WOOD: - case STRIPPED_ACACIA_WOOD: - case JUNGLE_WOOD: - case SPRUCE_WOOD: - case STRIPPED_BIRCH_WOOD: - case STRIPPED_DARK_OAK_WOOD: - case STRIPPED_JUNGLE_WOOD: - case STRIPPED_OAK_WOOD: - case STRIPPED_SPRUCE_WOOD: case STRIPPED_ACACIA_LOG: case STRIPPED_BIRCH_LOG: case STRIPPED_DARK_OAK_LOG: diff --git a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java index 28ffab8bb..108ea31c9 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java @@ -1,13 +1,13 @@ package com.gmail.nossr50.util; import com.gmail.nossr50.mcMMO; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; public final class MaterialUtils { private MaterialUtils() {} - protected static boolean isOre(MaterialData data) { - switch (data.getItemType()) { + protected static boolean isOre(BlockData data) { + switch (data.getMaterial()) { case COAL_ORE: case DIAMOND_ORE: case NETHER_QUARTZ_ORE: diff --git a/src/main/java/com/gmail/nossr50/util/ModManager.java b/src/main/java/com/gmail/nossr50/util/ModManager.java index 87ef1acb7..16239bee6 100644 --- a/src/main/java/com/gmail/nossr50/util/ModManager.java +++ b/src/main/java/com/gmail/nossr50/util/ModManager.java @@ -10,7 +10,7 @@ import org.bukkit.block.BlockState; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Entity; import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.Config; @@ -33,14 +33,14 @@ public class ModManager { private List customLeggings = new ArrayList(); // Block Mods - private List customExcavationBlocks = new ArrayList(); - private List customHerbalismBlocks = new ArrayList(); - private List customMiningBlocks = new ArrayList(); - private List customOres = new ArrayList(); - private List customLogs = new ArrayList(); - private List customLeaves = new ArrayList(); - private List customAbilityBlocks = new ArrayList(); - private HashMap customBlockMap = new HashMap(); + private List customExcavationBlocks = new ArrayList(); + private List customHerbalismBlocks = new ArrayList(); + private List customMiningBlocks = new ArrayList(); + private List customOres = new ArrayList(); + private List customLogs = new ArrayList(); + private List customLeaves = new ArrayList(); + private List customAbilityBlocks = new ArrayList(); + private HashMap customBlockMap = new HashMap(); // Entity Mods private HashMap customEntityClassMap = new HashMap(); @@ -130,7 +130,7 @@ public class ModManager { return Config.getInstance().getToolModsEnabled() && customSwords.contains(material); } - public boolean isCustomOre(MaterialData data) { + public boolean isCustomOre(BlockData data) { return Config.getInstance().getBlockModsEnabled() && customOres.contains(data); } @@ -162,7 +162,7 @@ public class ModManager { return customBlockMap.get(state.getData()); } - public CustomBlock getBlock(MaterialData data) { + public CustomBlock getBlock(BlockData data) { return customBlockMap.get(data); } diff --git a/src/main/java/com/gmail/nossr50/util/StringUtils.java b/src/main/java/com/gmail/nossr50/util/StringUtils.java index f7ceb9ad2..bc656b926 100644 --- a/src/main/java/com/gmail/nossr50/util/StringUtils.java +++ b/src/main/java/com/gmail/nossr50/util/StringUtils.java @@ -5,8 +5,9 @@ import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.SecondaryAbility; import org.bukkit.Material; import org.bukkit.TreeSpecies; +import org.bukkit.block.data.Ageable; import org.bukkit.entity.EntityType; -import org.bukkit.material.MaterialData; +import org.bukkit.block.data.BlockData; public class StringUtils { @@ -37,16 +38,32 @@ public class StringUtils { return createPrettyEnumString(species.toString()); } - public static String getWildcardConfigMaterialDataString(MaterialData data) { - return StringUtils.getPrettyItemString(data.getItemType()).replace(" ", "_") + "|*"; + public static String getWildcardConfigBlockDataString(BlockData data) { + return StringUtils.getPrettyItemString(data.getMaterial()).replace(" ", "_") + "|*"; } - public static String getFriendlyConfigMaterialDataString(MaterialData data) { - return getPrettyItemString(data.getItemType()).replace(" ", "_"); + public static String getFriendlyConfigBlockDataString(BlockData data) { + switch(data.getMaterial()){ + case COCOA: + case WHEAT: + case BEETROOTS: + case CARROTS: + case POTATOES: + case NETHER_WART_BLOCK: { + if (data instanceof Ageable) { + Ageable ageData = (Ageable) data; + if (ageData.getAge() == ageData.getMaximumAge()) { + return getPrettyItemString(data.getMaterial()).replace(" ", "_") + "_Ripe"; + } + } + return getPrettyItemString(data.getMaterial()).replace(" ", "_") + "_Ungrown"; + } + } + return getPrettyItemString(data.getMaterial()).replace(" ", "_"); } - public static String getExplicitConfigMaterialDataString(MaterialData data) { - return StringUtils.getPrettyItemString(data.getItemType()).replace(" ", "_") + "|" + data.getData(); + public static String getExplicitConfigBlockDataString(BlockData data) { + return StringUtils.getPrettyItemString(data.getMaterial()).replace(" ", "_"); } public static String getPrettySecondaryAbilityString(SecondaryAbility secondaryAbility) { diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index be785453d..7954ed569 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -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 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(); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index e2f6e9660..171d5c7b6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -376,7 +376,7 @@ Skills: Summon_Length: 240 Summon_Max_Amount: 10 Ocelot: - Item_Material: RAW_FISH + Item_Material: COD Item_Amount: 10 Summon_Amount: 1 Summon_Length: 240 diff --git a/src/main/resources/experience.yml b/src/main/resources/experience.yml index 5f04a656e..324675004 100644 --- a/src/main/resources/experience.yml +++ b/src/main/resources/experience.yml @@ -140,48 +140,54 @@ Experience: Snow_Block: 40 Soul_Sand: 40 Woodcutting: - Acacia: 90 - Birch: 90 - Dark_Oak: 90 - Generic: 70 - Jungle: 100 - Redwood: 80 + Oak_Log: 70 + Spruce_Log: 80 + Birch_Log: 90 + Jungle_Log: 100 + Acacia_Log: 90 + Dark_Oak_Log: 90 + Stripped_Oak_Log: 70 + Stripped_Spruce_Log: 80 + Stripped_Birch_Log: 90 + Stripped_Jungle_Log: 100 + Stripped_Acacia_Log: 90 + Stripped_Dark_Oak_Log: 90 Huge_Mushroom_1: 70 Huge_Mushroom_2: 70 Herbalism: Allium: 300 Azure_Bluet: 150 - Beetroot_Block_Ripe: 50 + Beetroots_Ripe: 50 Blue_Orchid: 150 Brown_Mushroom: 150 Cactus: 30 - Carrot_Ripe: 50 + Carrots_Ripe: 50 Chorus_Flower: 25 Chorus_Plant: 1 Cocoa_Ripe: 30 - Crops_Ripe: 50 + Wheat_Ripe: 50 Dead_Bush: 30 Lilac: 50 Melon_Block: 20 - Nether_Warts_Ripe: 50 + Nether_Wart_Ripe: 50 Orange_Tulip: 150 Oxeye_Daisy: 150 Peony: 50 Pink_Tulip: 150 Poppy: 100 - Potato_Ripe: 50 + Potatoes_Ripe: 50 Pumpkin: 20 Red_Mushroom: 150 Red_Tulip: 150 Rose_Bush: 50 - Small_Fern: 10 - Small_Grass: 10 + Fern: 10 + Grass: 10 Sugar_Cane_Block: 30 Sunflower: 50 Tall_Grass: 50 - Tall_Fern: 50 + Large_Fern: 50 Vine: 10 - Water_Lily: 100 + Lily_Pad: 100 White_Tulip: 150 Dandelion: 100 Mining: diff --git a/src/main/resources/repair.vanilla.yml b/src/main/resources/repair.vanilla.yml index a270791ab..f228633c8 100644 --- a/src/main/resources/repair.vanilla.yml +++ b/src/main/resources/repair.vanilla.yml @@ -46,19 +46,19 @@ Repairables: # Wooden repairables ### # Tools - WOOD_SWORD: + WOODEN_SWORD: MinimumLevel: 0 XpMultiplier: .25 - WOOD_SHOVEL: + WOODEN_SHOVEL: MinimumLevel: 0 XpMultiplier: .16 - WOOD_PICKAXE: + WOODEN_PICKAXE: MinimumLevel: 0 XpMultiplier: .5 - WOOD_AXE: + WOODEN_AXE: MinimumLevel: 0 XpMultiplier: .5 - WOOD_HOE: + WOODEN_HOE: MinimumLevel: 0 XpMultiplier: .25 # diff --git a/src/main/resources/salvage.vanilla.yml b/src/main/resources/salvage.vanilla.yml index c7d943203..37f92729d 100644 --- a/src/main/resources/salvage.vanilla.yml +++ b/src/main/resources/salvage.vanilla.yml @@ -46,19 +46,19 @@ Salvageables: # Wooden salvageables ### # Tools - WOOD_SWORD: + WOODEN_SWORD: MinimumLevel: 0 XpMultiplier: .25 - WOOD_SHOVEL: + WOODEN_SHOVEL: MinimumLevel: 0 XpMultiplier: .16 - WOOD_PICKAXE: + WOODEN_PICKAXE: MinimumLevel: 0 XpMultiplier: .5 - WOOD_AXE: + WOODEN_AXE: MinimumLevel: 0 XpMultiplier: .5 - WOOD_HOE: + WOODEN_HOE: MinimumLevel: 0 XpMultiplier: .25 # diff --git a/src/main/resources/treasures.yml b/src/main/resources/treasures.yml index 6d5bb8bd1..2dd3d0459 100755 --- a/src/main/resources/treasures.yml +++ b/src/main/resources/treasures.yml @@ -39,7 +39,6 @@ Fishing: Amount: 1 XP: 200 Rarity: COMMON - //!! LAPIS_LAZULI: Amount: 20 XP: 200 @@ -773,7 +772,7 @@ Shake: XP: 0 Drop_Chance: 30.0 Drop_Level: 0 - RAW_BEEF: + BEEF: Amount: 1 XP: 0 Drop_Chance: 30.0 @@ -867,7 +866,7 @@ Shake: XP: 0 Drop_Chance: 3.0 Drop_Level: 0 - SNOW_BALL: + SNOWBALL: Amount: 2 XP: 0 Drop_Chance: 97.0 diff --git a/src/util/java/mcMMO/PotionConfigGenerator.java b/src/util/java/mcMMO/PotionConfigGenerator.java index e592a731f..30e1d96a9 100644 --- a/src/util/java/mcMMO/PotionConfigGenerator.java +++ b/src/util/java/mcMMO/PotionConfigGenerator.java @@ -379,7 +379,7 @@ public class PotionConfigGenerator { children.put(new Ingredient(Material.RABBIT_FOOT), new WriteablePotion(current.mat, PotionType.JUMP)); children.put(new Ingredient(Material.MAGMA_CREAM), new WriteablePotion(current.mat, PotionType.FIRE_RESISTANCE)); children.put(new Ingredient(Material.SUGAR), new WriteablePotion(current.mat, PotionType.SPEED)); - children.put(new Ingredient(Material.RAW_FISH, 3), new WriteablePotion(current.mat, PotionType.WATER_BREATHING)); + children.put(new Ingredient(Material.COD, 3), new WriteablePotion(current.mat, PotionType.WATER_BREATHING)); children.put(new Ingredient(Material.SPECKLED_MELON), new WriteablePotion(current.mat, PotionType.INSTANT_HEAL)); children.put(new Ingredient(Material.SPIDER_EYE), new WriteablePotion(current.mat, PotionType.POISON)); children.put(new Ingredient(Material.GHAST_TEAR), new WriteablePotion(current.mat, PotionType.REGEN));