Skip to content

Commit

Permalink
fix alchemy xp permission issue Fixes #5131
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Jan 3, 2025
1 parent 90fe8ee commit 1db0aae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version 2.2.030
Fixed bug where Smelting permission was needed for Alchemy XP gain
Fixed material based salvage permissions not functioning (Thanks Momshroom)

Version 2.2.029
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,15 @@ public void onInventoryClickEventNormal(InventoryClickEvent event) {
McMMOPlayer mmoPlayer = UserManager.getPlayer(player);

if (event.getInventory() instanceof FurnaceInventory furnaceInventory) {
if (!mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(player, PrimarySkillType.SMELTING))
return;
//Switch owners
ContainerMetadataUtils.processContainerOwnership(furnaceInventory.getHolder(), player);
}

if (event.getInventory() instanceof BrewerInventory brewerInventory) {
if (!mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(player, PrimarySkillType.ALCHEMY))
return;
// switch owners
ContainerMetadataUtils.processContainerOwnership(brewerInventory.getHolder(), player);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public static boolean isContainerOwned(BlockState blockState) {
}

public static void processContainerOwnership(BlockState blockState, Player player) {
if (!mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(player, PrimarySkillType.SMELTING))
return;

if (getContainerOwner(blockState) != null) {
if (getContainerOwner(blockState).getUniqueId().equals(player.getUniqueId()))
return;
Expand Down

0 comments on commit 1db0aae

Please sign in to comment.