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

View File

@ -14,6 +14,7 @@ Version 1.5.00-dev
+ Added Salmon, Clownfish, and Pufferfish to Fishing XP + Added Salmon, Clownfish, and Pufferfish to Fishing XP
+ Added new flowers and grasses to Herbalism XP + Added new flowers and grasses to Herbalism XP
+ Added option to config.yml which allows players to always catch fish, even when a treasure is found + Added option to config.yml which allows players to always catch fish, even when a treasure is found
+ Added option to config.yml to override vanilla Minecraft treasures
! Fishing XP now depends on the type of fish. ! Fishing XP now depends on the type of fish.
! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood. ! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood.
! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly. ! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly.

View File

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

View File

@ -223,6 +223,13 @@ public class PlayerListener implements Listener {
return; return;
case CAUGHT_FISH: 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)) { if (Permissions.vanillaXpBoost(player, SkillType.FISHING)) {
event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop())); event.setExpToDrop(fishingManager.handleVanillaXpBoost(event.getExpToDrop()));
} }

View File

@ -289,6 +289,7 @@ Skills:
Fishing: Fishing:
Level_Cap: 0 Level_Cap: 0
Drops_Enabled: true Drops_Enabled: true
Override_Vanilla_Treasures: true
# Always catch fish, even when treasure is found # Always catch fish, even when treasure is found
Extra_Fish: false Extra_Fish: false
Herbalism: Herbalism: