1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-07-03 22:24:43 +02:00

Added option to config.yml to override vanilla Minecraft treasures

This commit is contained in:
TfT_02
2014-02-15 11:55:36 +01:00
parent faa11a87a9
commit c744974192
4 changed files with 10 additions and 0 deletions
Changelog.txt
src/main
java
com
gmail
nossr50
resources

@ -452,6 +452,7 @@ public class Config extends AutoUpdateConfigLoader {
/* Fishing */
public boolean getFishingDropsEnabled() { return config.getBoolean("Skills.Fishing.Drops_Enabled", true); }
public boolean getFishingOverrideTreasures() { return config.getBoolean("Skills.Fishing.Override_Vanilla_Treasures", true); }
public boolean getFishingExtraFish() { return config.getBoolean("Skills.Fishing.Extra_Fish", true); }
/* Mining */

@ -223,6 +223,13 @@ public class PlayerListener implements Listener {
return;
case CAUGHT_FISH:
//TODO Update to new API once available! Waiting for case CAUGHT_TREASURE:
Item fishingCatch = (Item) event.getCaught();
if (Config.getInstance().getFishingOverrideTreasures() && fishingCatch.getItemStack().getType() != Material.RAW_FISH) {
fishingCatch.setItemStack(new ItemStack(Material.RAW_FISH, 1));
}
if (Permissions.vanillaXpBoost(player, SkillType.FISHING)) {
event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop()));
}