Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
Added option to only work while in a chest
Browse files Browse the repository at this point in the history
  • Loading branch information
NopoTheGamer committed Oct 9, 2022
1 parent d58f2a2 commit e1f015f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/nopo/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ object Config: Vigilant(File("./config/skywars-sorter.toml")) {
)
var enabled = true

@Property(
type = PropertyType.SWITCH,
name = "Only Enable While In A Chest",
description = "Doesn't sort when you are in your inventory",
category = "Sorting"
)
var chestOnly = false

@Property(
type = PropertyType.SWITCH,
name = "Enable In Skywars",
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/nopo/SlotBind.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public LockedSlot(int boundTo) {
@SubscribeEvent
public void onWindowClick(SlotClickEvent slotClickEvent) {
if (!shouldBeEnabled()) return;
if (SkywarsSorter.config.getChestOnly() && !(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return;

LockedSlot locked = new LockedSlot(getSlotToBind(getSlotToBind(slotClickEvent.slot), slotClickEvent));

Expand Down

0 comments on commit e1f015f

Please sign in to comment.