Add setting to turn off knock on wood XP orb drops for Tree Feller

This commit is contained in:
nossr50 2021-01-21 14:19:50 -08:00
parent c44e280773
commit ac57615383
4 changed files with 13 additions and 55 deletions

View File

@ -2,6 +2,9 @@ Version 2.1.172
Updated german locale (thanks TheBusyBiscuit)
Changed Fists to not be capitalized (en_US) when lowering/readying berserk
SkillActivationPerkEvent can now be called in async threads (thanks electronicboy)
You can now disable the XP orbs from being dropped when Knock On Wood triggers during Tree Feller
Added 'Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops' to advanced.yml
Removed a few never implemented settings from Skills.Woodcutting.TreeFeller in advanced.yml
Version 2.1.171
Fixed a bug where arrows shot by infinite bow enchant would duplicate

View File

@ -451,23 +451,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Woodcutting.HarvestLumber.MaxBonusLevel should be at least 1!");
}
/* KRAKEN */
if (getKrakenTriesBeforeRelease() < 1) {
reason.add("Kraken.Tries_Before_Release should be at least 1!");
}
if (getKrakenHealth() < 1) {
reason.add("Kraken.Health should be at least 1!");
}
if (getKrakenAttackInterval() < 1) {
reason.add("Kraken.Attack_Interval_Seconds should be at least 1!");
}
if (getKrakenAttackDamage() < 1) {
reason.add("Kraken.Attack_Damage should be at least 1!");
}
return noErrorsInConfig(reason);
}
@ -835,19 +818,5 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); }
/* WOODCUTTING */
/*public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }*/
/* KRAKEN STUFF */
public boolean getKrakenEnabled() { return config.getBoolean("Kraken.Enabled", true); }
public int getKrakenTriesBeforeRelease() { return config.getInt("Kraken.Tries_Before_Release", 50); }
public double getKrakenHealth() { return config.getDouble("Kraken.Health", 50.0D); }
public String getKrakenName() { return config.getString("Kraken.Name", "The Kraken"); }
public int getKrakenAttackInterval() { return config.getInt("Kraken.Attack_Interval_Seconds", 1); }
public double getKrakenAttackDamage() { return config.getDouble("Kraken.Attack_Damage", 1.0D); }
public boolean getKrakenGlobalEffectsEnabled() { return config.getBoolean("Kraken.Global_Effects", false); }
public boolean getKrakenEscapeAllowed() { return config.getBoolean("Kraken.Allow_Escaping", false); }
public String getServerUnleashMessage() { return config.getString("Kraken.Unleashed_Message.Server", ""); }
public String getPlayerUnleashMessage() { return config.getString("Kraken.Unleashed_Message.Player", ""); }
public String getPlayerDefeatMessage() { return config.getString("Kraken.Defeated_Message.Killed", ""); }
public String getPlayerEscapeMessage() { return config.getString("Kraken.Defeated_Message.Escape", ""); }
public boolean isKnockOnWoodXPOrbEnabled() { return config.getBoolean("Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops", true); }
}

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.skills.woodcutting;
import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
@ -306,9 +307,11 @@ public class WoodcuttingManager extends SkillManager {
Misc.spawnItemsFromCollection(Misc.getBlockCenter(blockState), block.getDrops(), ItemSpawnReason.TREE_FELLER_DISPLACED_BLOCK);
if(RankUtils.hasReachedRank(2, player, SubSkillType.WOODCUTTING_KNOCK_ON_WOOD)) {
if(RandomChanceUtil.rollDice(75, 100)) {
int randOrbCount = Math.max(1, Misc.getRandom().nextInt(20));
Misc.spawnExperienceOrb(blockState.getLocation(), randOrbCount);
if(AdvancedConfig.getInstance().isKnockOnWoodXPOrbEnabled()) {
if(RandomChanceUtil.rollDice(75, 100)) {
int randOrbCount = Math.max(1, Misc.getRandom().nextInt(20));
Misc.spawnExperienceOrb(blockState.getLocation(), randOrbCount);
}
}
}

View File

@ -582,26 +582,9 @@ Skills:
###
Woodcutting:
TreeFeller:
# If set to true then tree feller will not use the new system and will use its old behaviour
Classic: false
# This is the time in seconds to build a new charge of Tree Feller
ChargeRate: 600
Rank_Levels:
Rank_1:
TreeSizeMax: 100
Charges: 1
Rank_2:
TreeSizeMax: 200
Charges: 1
Rank_3:
TreeSizeMax: 200
Charges: 2
Rank_4:
TreeSizeMax: 200
Charges: 3
Rank_5:
TreeSizeMax: 500
Charges: 3
Knock_On_Wood:
Add_XP_Orbs_To_Drops: true
# Double Drops
HarvestLumber:
# ChanceMax & MaxBonusLevel are only used for Classic, I'll make that more clear in the future.