Fishing now always gives fish in addition to treasure (configurable)

Fixing salvage oopsies
This commit is contained in:
nossr50 2019-04-10 04:06:06 -07:00
parent 2170c6de24
commit 75bb3f181d
7 changed files with 32 additions and 22 deletions

View File

@ -25,6 +25,7 @@ Version 2.2.0
All config nodes now include a comment with the default value of the node to use as reference
Expanded settings relating to purging users who have not leveled or users who had not logged in for many months
Acrobatic's Dodge XP increased from 120 -> 480
Fishing's always catch fish setting now defaults to true instead of false
NOTE: Not every config key that was renamed will be listed here
Admins will now be notified if a player trips over-fishing exploit detection 3+ times in a row (Locale: "Fishing.OverFishingDetected")
Note: Admins are players who are op or have adminchat permission.

View File

@ -606,10 +606,6 @@ public class MainConfig extends ConfigValidated {
return getBooleanValue(SKILLS, FISHING, OVERRIDE_VANILLA_TREASURES);
}
public boolean getFishingExtraFish() {
return getBooleanValue(SKILLS, FISHING, EXTRA_FISH);
}
public double getFishingLureModifier() {
return getDoubleValue(SKILLS, FISHING, LURE_MODIFIER);
}

View File

@ -165,13 +165,6 @@ public class ExperienceConfig extends ConfigValidated {
reason.add(EXPERIENCE + "." + COMBAT + "." + MULTIPLIER + "." + ANIMALS + " should be at least 0!");
}
/* Fishing */
// TODO: Add validation for each fish type once enum is available.
if (getFishingShakeXP() <= 0) {
reason.add(EXPERIENCE + "." + FISHING + "." + SHAKE + " should be greater than 0!");
}
/* Repair */
if (getRepairXPBase() <= 0) {
reason.add(EXPERIENCE + "." + REPAIR + "." + BASE1 + " should be greater than 0!");
@ -374,9 +367,6 @@ public class ExperienceConfig extends ConfigValidated {
return BarStyle.SOLID;
}
public int getFishingShakeXP() {
return getIntValue(EXPERIENCE, FISHING, SHAKE);
}
/* Repair */
public double getRepairXPBase() {

View File

@ -1,8 +1,19 @@
package com.gmail.nossr50.config.hocon.skills.fishing;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigFishing {
@Setting(value = "General")
private ConfigFishingGeneral fishingGeneral = new ConfigFishingGeneral();
public ConfigFishingGeneral getFishingGeneral() {
return fishingGeneral;
}
public boolean isAlwaysCatchFish() {
return fishingGeneral.isAlwaysCatchFish();
}
}

View File

@ -0,0 +1,18 @@
package com.gmail.nossr50.config.hocon.skills.fishing;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ConfigFishingGeneral {
private static final boolean ALWAYS_CATCH_FISH_DEFAULT = true;
@Setting(value = "Always-Catch-Fish", comment = "Enables fish to be caught alongside treasure." +
"\nDefault value: "+ALWAYS_CATCH_FISH_DEFAULT)
private boolean alwaysCatchFish = ALWAYS_CATCH_FISH_DEFAULT;
public boolean isAlwaysCatchFish() {
return alwaysCatchFish;
}
}

View File

@ -327,7 +327,7 @@ public class FishingManager extends SkillManager {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE, "Fishing.Ability.TH.MagicFound");
}
if (MainConfig.getInstance().getFishingExtraFish()) {
if (mcMMO.getConfigManager().getConfigFishing().isAlwaysCatchFish()) {
Misc.dropItem(player.getEyeLocation(), fishingCatch.getItemStack());
}
@ -438,7 +438,7 @@ public class FishingManager extends SkillManager {
Misc.dropItem(target.getLocation(), drop);
CombatUtils.dealDamage(target, Math.min(Math.max(target.getMaxHealth() / 4, 1), 10), EntityDamageEvent.DamageCause.CUSTOM, getPlayer()); // Make it so you can shake a mob no more than 4 times.
applyXpGain(ExperienceConfig.getInstance().getFishingShakeXP(), XPGainReason.PVE);
applyXpGain(mcMMO.getConfigManager().getConfigExperience().getShakeXP(), XPGainReason.PVE);
}
}

View File

@ -128,13 +128,7 @@ public class SalvageManager extends SkillManager {
Misc.dropItems(location, salvageResults, 1);
// BWONG BWONG BWONG - CLUNK!
<<<<<<< HEAD
if (mcMMO.getConfigManager().getConfigSalvage().getGeneral().isAnvilUseSounds()) {
SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL);
=======
if (Config.getInstance().getSalvageAnvilUseSoundsEnabled()) {
// SoundManager.sendSound(player, player.getLocation(), SoundType.ANVIL);
>>>>>>> f1204f8a2aa8b402dc84a4b76c46665e02edb767
SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_BREAK);
//player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F);