From dc4401ffb0cbb38b2329b67dd454e830a5ca1612 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 29 Mar 2019 17:57:48 -0700 Subject: [PATCH] Add missing Herbalism entries to config --- Changelog.txt | 3 ++- src/main/java/com/gmail/nossr50/listeners/BlockListener.java | 4 ++++ src/main/resources/config.yml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index c741a286f..740f37af4 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -152,9 +152,10 @@ Version 2.2.0 Added API method to check if a skill was being level capped Version 2.1.30 - Fixed yet another bug involving double drops + Fixed double drops behaving oddly DoubleDrop config tables now must contain all things that can possibly be doubled, such as the Ore block, the ore itself, etc. Added the following items to the DoubleDrop tables for Mining: Coal, Diamond, Emerald, Glowstone_Dust, Iron_Ingot, Lapis_Lazuli, Nether_Quartz, Redstone, Cobblestone + Added the following items to the DoubleDrop tables for Herbalism: Beetroot, Carrot, Cocoa_Beans, Melon_Slice, Potatoe NOTE: I'm gonna have to blame Bukkit on this one, several API methods I used are actually unfinished and kind of janky. So I hacked something together to make them work. diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 99ef04fa1..67b63285a 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -70,11 +70,15 @@ public class BlockListener implements Listener { continue; if(event.getBlock().getState().getMetadata(mcMMO.doubleDrops).size() > 0) + { event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); + event.getBlock().getState().removeMetadata(mcMMO.doubleDrops, plugin); + } else if(event.getBlock().getState().getMetadata(mcMMO.tripleDrops).size() > 0) { event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); event.getBlock().getState().getWorld().dropItemNaturally(event.getBlockState().getLocation(), is); + event.getBlock().getState().removeMetadata(mcMMO.tripleDrops, plugin); } } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 48ff249cb..158042536 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -422,14 +422,19 @@ Skills: Double_Drops: Herbalism: Beetroots: true + Beetroot: true Brown_Mushroom: true Cactus: true Carrots: true + Carrot: true Cocoa: true + Cocoa_Beans: true Wheat: true Melon: true + Melon_Slice: true Nether_Wart: true Potatoes: true + Potatoe: true Pumpkin: true Red_Mushroom: true Sugar_Cane: true