From b4d9337329bef6f8a4032a1a0097e97cf13c3b57 Mon Sep 17 00:00:00 2001 From: Momshroom Date: Sun, 29 Dec 2024 19:13:20 -0600 Subject: [PATCH] Revert regression, restoring material based salvage permissions (#5130) * Revert regression. Fixes salvage permissions by material type --------- Signed-off-by: Momshroom --- .../gmail/nossr50/skills/salvage/SalvageManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index 59d50ad3b..319a517db 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -78,6 +78,17 @@ public class SalvageManager extends SkillManager { } } + // Permissions checks on material and item types + if (!Permissions.salvageItemType(player, salvageable.getSalvageItemType())) { + NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); + return; + } + + if (!Permissions.salvageMaterialType(player, salvageable.getSalvageMaterialType())) { + NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission"); + return; + } + /*int skillLevel = getSkillLevel();*/ int minimumSalvageableLevel = salvageable.getMinimumLevel();