mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
For Iaccidentally.
This commit is contained in:
parent
33610c8997
commit
7f0243b2df
@ -46,6 +46,9 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
||||||
public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); }
|
public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); }
|
||||||
|
|
||||||
|
public boolean getPotatoEnabled() { return config.getBoolean("General.Config.Potato_Explosion_Enabled", true); }
|
||||||
|
public int getPotatoChance() { return config.getInt("General.Config.Potato_Explosion_Chance", 1); }
|
||||||
|
|
||||||
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); }
|
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); }
|
||||||
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
|
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.listeners;
|
package com.gmail.nossr50.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.block.Furnace;
|
import org.bukkit.block.Furnace;
|
||||||
@ -21,6 +22,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
import com.gmail.nossr50.util.ItemUtils;
|
import com.gmail.nossr50.util.ItemUtils;
|
||||||
@ -118,6 +120,14 @@ public class InventoryListener implements Listener {
|
|||||||
if (furnaceState instanceof Furnace) {
|
if (furnaceState instanceof Furnace) {
|
||||||
ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting();
|
ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting();
|
||||||
|
|
||||||
|
if (Config.getInstance().getPotatoEnabled() && smelting.getType() == Material.POTATO_ITEM) {
|
||||||
|
if ((Config.getInstance().getPotatoChance() / 100.0) >= Misc.getRandom().nextDouble()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
furnaceState.getWorld().createExplosion(furnaceState.getLocation(), 4F, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && smelting != null && ItemUtils.isSmeltable(smelting)) {
|
if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && smelting != null && ItemUtils.isSmeltable(smelting)) {
|
||||||
// We can make this assumption because we (should) be the only ones using this exact metadata
|
// We can make this assumption because we (should) be the only ones using this exact metadata
|
||||||
Player player = plugin.getServer().getPlayer(furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).get(0).asString());
|
Player player = plugin.getServer().getPlayer(furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).get(0).asString());
|
||||||
|
@ -26,6 +26,9 @@ General:
|
|||||||
Verbose_Logging: false
|
Verbose_Logging: false
|
||||||
# Should mcMMO over-write configs to update, or make new ones ending in .new?
|
# Should mcMMO over-write configs to update, or make new ones ending in .new?
|
||||||
Config_Update_Overwrite: true
|
Config_Update_Overwrite: true
|
||||||
|
# Enable potato easter egg?
|
||||||
|
Potato_Explosion_Enabled: true
|
||||||
|
Potato_Explosion_Chance: 1
|
||||||
|
|
||||||
Scoreboards:
|
Scoreboards:
|
||||||
Inspect:
|
Inspect:
|
||||||
|
Loading…
Reference in New Issue
Block a user