You can not salvage without 1 rank in Scrap Collector now (unlocks at

level 2)
This commit is contained in:
nossr50 2019-06-10 22:46:03 -07:00
parent 46dee3c9b6
commit 3fe47c939a
5 changed files with 18 additions and 18 deletions

View File

@ -1,6 +1,9 @@
Version 2.1.76
Advanced Salvage has been renamed to Scrap Collector
Fixed a bug where Repair was repairing too much
Fixed a bug where Arcane Salvage was used to determine how many materials a player could salvage from an item
Fixed a bug where Arcane Salvage was used to determine how many materials a player could salvage from an item instead of Scrap Collector (formerly Advanced Salvage)
Fixed a bug where messages about an item being too damage to salvage were being sent twice
You can not salvage without at least 1 rank in Scrap Collector now (formerly Advanced Salvage)
Removed the minimum quantity field from the repair config
Removed the item data (metadata) field from repair config as its not used anymore
Salvage will no longer return the max amount of materials possible, instead you are guaranteed one item and then some luck is involved on how many items are returned.

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.76-SNAPSHOT</version>
<version>2.1.76</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -42,8 +42,8 @@ public class SalvageCommand extends SkillCommand {
if (canScrapCollector) {
messages.add(getStatMessage(false, true,
SubSkillType.SALVAGE_SCRAP_COLLECTOR,
String.valueOf(RankUtils.getRank(player, SubSkillType.REPAIR_ARCANE_FORGING)),
RankUtils.getHighestRankStr(SubSkillType.REPAIR_ARCANE_FORGING)));
String.valueOf(RankUtils.getRank(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR)),
RankUtils.getHighestRankStr(SubSkillType.SALVAGE_SCRAP_COLLECTOR)));
}
if (canArcaneSalvage) {

View File

@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
@ -25,6 +26,7 @@ import com.gmail.nossr50.skills.salvage.SalvageManager;
import com.gmail.nossr50.skills.taming.TamingManager;
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
@ -619,6 +621,7 @@ public class PlayerListener implements Listener {
/* SALVAGE CHECKS */
else if (type == Salvage.anvilMaterial
&& PrimarySkillType.SALVAGE.getPermissions(player)
&& RankUtils.hasUnlockedSubskill(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR)
&& mcMMO.getSalvageableManager().isSalvageable(heldItem)
&& heldItem.getAmount() <= 1) {
SalvageManager salvageManager = UserManager.getPlayer(player).getSalvageManager();

View File

@ -87,18 +87,12 @@ public class SalvageManager extends SkillManager {
return;
}
if (item.getDurability() != 0 && (!RankUtils.hasUnlockedSubskill(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR) || !Permissions.advancedSalvage(player))) {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.Adept.Damaged");
return;
}
int maxAmountSalvageable = Salvage.calculateSalvageableAmount(item.getDurability(), salvageable.getMaximumDurability(), salvageable.getMaximumQuantity());
int salvageableAmount = maxAmountSalvageable;
if (salvageableAmount == 0) {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Salvage.Skills.TooDamaged");
player.sendMessage(LocaleLoader.getString("Salvage.Skills.TooDamaged"));
return;
}