mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
We don't need that potato.
This commit is contained in:
parent
28a78d820a
commit
b15f1dde28
@ -46,9 +46,6 @@ 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.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 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); }
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package com.gmail.nossr50.listeners;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
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;
|
||||||
@ -23,7 +22,6 @@ import org.bukkit.metadata.FixedMetadataValue;
|
|||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
|
|
||||||
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.runnables.PlayerUpdateInventoryTask;
|
import com.gmail.nossr50.runnables.PlayerUpdateInventoryTask;
|
||||||
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
import com.gmail.nossr50.skills.smelting.SmeltingManager;
|
||||||
@ -110,25 +108,15 @@ public class InventoryListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting();
|
List<MetadataValue> metadata = furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey);
|
||||||
|
|
||||||
if (smelting == null) {
|
if (metadata.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Material smeltingType = smelting.getType();
|
ItemStack smelting = ((Furnace) furnaceState).getInventory().getSmelting();
|
||||||
|
|
||||||
if (Config.getInstance().getPotatoEnabled() && smeltingType == Material.POTATO_ITEM) {
|
if (smelting == null || !ItemUtils.isSmeltable(smelting)) {
|
||||||
if ((Config.getInstance().getPotatoChance() / 100.0) >= Misc.getRandom().nextDouble()) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
furnaceState.getWorld().createExplosion(furnaceState.getLocation(), 4F, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<MetadataValue> metadata = furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey);
|
|
||||||
|
|
||||||
if (metadata.isEmpty() || !ItemUtils.isSmeltable(smelting)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +127,7 @@ public class InventoryListener implements Listener {
|
|||||||
return;
|
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)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
|
@ -26,9 +26,6 @@ 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: false
|
|
||||||
Potato_Explosion_Chance: 1
|
|
||||||
|
|
||||||
Scoreboards:
|
Scoreboards:
|
||||||
# Should mcMMO use scoreboards for /inspect?
|
# Should mcMMO use scoreboards for /inspect?
|
||||||
|
Loading…
Reference in New Issue
Block a user