Skip to content

Commit

Permalink
Added option to config.yml to override vanilla Minecraft treasures
Browse files Browse the repository at this point in the history
  • Loading branch information
TfT-02 committed Mar 29, 2014
1 parent faa11a8 commit c744974
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Version 1.5.00-dev
+ Added Salmon, Clownfish, and Pufferfish to Fishing 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 to override vanilla Minecraft treasures
! 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.
! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/gmail/nossr50/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ public boolean getDoubleDropsDisabled(SkillType skill) {

/* 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 */
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/gmail/nossr50/listeners/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ public void onPlayerFishHighest(PlayerFishEvent event) {
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()));
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ Skills:
Fishing:
Level_Cap: 0
Drops_Enabled: true
Override_Vanilla_Treasures: true
# Always catch fish, even when treasure is found
Extra_Fish: false
Herbalism:
Expand Down

0 comments on commit c744974

Please sign in to comment.