Skip to content

Commit

Permalink
GH-44 Fix drop switching (Closes #44)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrdzn committed Aug 14, 2023
1 parent 064cb15 commit 289afdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ public void open(Player player) {
return;
} else if (action == MenuAction.SWITCH_DROP) {
if (userSetting.hasDisabledDrop(menuSlotItemKey)) {
userSetting.addDisabledDrop(menuSlotItemKey);
} else {
userSetting.removeDisabledDrop(menuSlotItemKey);
} else {
userSetting.addDisabledDrop(menuSlotItemKey);
}

this.messageFacade.sendMessage(player, messageConfig.getDropSwitched(), "{DROP}", menuSlotItemKey);
Expand All @@ -192,9 +192,9 @@ public void open(Player player) {
return;
} else if (action == MenuAction.SWITCH_DROP) {
if (userSetting.hasDisabledDrop(menuSlotItemKey)) {
userSetting.addDisabledDrop(menuSlotItemKey);
} else {
userSetting.removeDisabledDrop(menuSlotItemKey);
} else {
userSetting.addDisabledDrop(menuSlotItemKey);
}

this.messageFacade.sendMessage(player, messageConfig.getDropSwitched(), "{DROP}", menuSlotItemKey);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.zrdzn.minecraft.lovelydrop.user;

import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
Expand Down Expand Up @@ -30,7 +29,7 @@ public boolean hasDisabledDrop(String dropKey) {
}

public Set<String> getDisabledDrops() {
return Collections.unmodifiableSet(this.disabledDrops);
return this.disabledDrops;
}

public void removeDisabledDrop(String dropKey) {
Expand All @@ -50,7 +49,7 @@ public boolean hasDropToInventory(String dropKey) {
}

public Map<String, Boolean> getDropsToInventory() {
return Collections.unmodifiableMap(this.dropsToInventory);
return this.dropsToInventory;
}

}

0 comments on commit 289afdc

Please sign in to comment.