diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index cc2f28182..17383dcba 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -46,9 +46,6 @@ public class Config extends AutoUpdateConfigLoader { public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); } public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); } - public boolean getPotatoEnabled() { return config.getBoolean("General.Potato_Explosion_Enabled", false); } - public int getPotatoChance() { return config.getInt("General.Potato_Explosion_Chance", 1); } - public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); } public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); } diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 33d0707b5..2f414f4c6 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -2,7 +2,6 @@ package com.gmail.nossr50.listeners; import java.util.List; -import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.Furnace; @@ -23,7 +22,6 @@ import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.runnables.PlayerUpdateInventoryTask; import com.gmail.nossr50.skills.smelting.SmeltingManager; @@ -110,25 +108,15 @@ public class InventoryListener implements Listener { return; } - ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting(); + List metadata = furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey); - if (smelting == null) { + if (metadata.isEmpty()) { return; } - Material smeltingType = smelting.getType(); + ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting(); - if (Config.getInstance().getPotatoEnabled() && smeltingType == Material.POTATO_ITEM) { - if ((Config.getInstance().getPotatoChance() / 100.0) >= Misc.getRandom().nextDouble()) { - event.setCancelled(true); - furnaceState.getWorld().createExplosion(furnaceState.getLocation(), 4F, true); - return; - } - } - - List metadata = furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey); - - if (metadata.isEmpty() || !ItemUtils.isSmeltable(smelting)) { + if (smelting == null || !ItemUtils.isSmeltable(smelting)) { return; } @@ -139,7 +127,7 @@ public class InventoryListener implements Listener { return; } - event.setResult(UserManager.getPlayer(player).getSmeltingManager().smeltProcessing(smeltingType, event.getResult())); + event.setResult(UserManager.getPlayer(player).getSmeltingManager().smeltProcessing(smelting.getType(), event.getResult())); } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f708af2ee..9154898af 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -26,9 +26,6 @@ General: Verbose_Logging: false # Should mcMMO over-write configs to update, or make new ones ending in .new? Config_Update_Overwrite: true - # Enable potato easter egg? - Potato_Explosion_Enabled: false - Potato_Explosion_Chance: 1 Scoreboards: # Should mcMMO use scoreboards for /inspect?