Skip to content

Commit

Permalink
Prefix accessor names with mod ID
Browse files Browse the repository at this point in the history
To avoid conflicts with other mods overriding them.

Fixes #131
  • Loading branch information
YaLTeR committed May 12, 2024
1 parent 74ae20a commit 527bf8e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public List<Slot> getSlots() {

@Override
public Slot getSlotUnderMouse(double mouseX, double mouseY) {
return screenAccessor.invokeFindSlot(mouseX, mouseY);
return screenAccessor.mousetweaks$invokeFindSlot(mouseX, mouseY);
}

@Override
public boolean disableRMBDraggingFunctionality() {
screenAccessor.setSkipNextRelease(true);
screenAccessor.mousetweaks$setSkipNextRelease(true);

if (screenAccessor.getIsQuickCrafting() && screenAccessor.getQuickCraftingButton() == 1) {
screenAccessor.setIsQuickCrafting(false);
if (screenAccessor.mousetweaks$getIsQuickCrafting() && screenAccessor.mousetweaks$getQuickCraftingButton() == 1) {
screenAccessor.mousetweaks$setIsQuickCrafting(false);
return true;
}

Expand All @@ -56,7 +56,7 @@ public boolean disableRMBDraggingFunctionality() {

@Override
public void clickSlot(Slot slot, MouseButton mouseButton, boolean shiftPressed) {
screenAccessor.invokeSlotClicked(
screenAccessor.mousetweaks$invokeSlotClicked(
slot,
slot.index,
mouseButton.getValue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@

@Mixin(AbstractContainerScreen.class)
public interface AbstractContainerScreenAccessor {
@Invoker
Slot invokeFindSlot(double x, double y);
@Invoker("findSlot")
Slot mousetweaks$invokeFindSlot(double x, double y);

@Invoker
void invokeSlotClicked(Slot slot, int index, int button, ClickType clickType);
@Invoker("slotClicked")
void mousetweaks$invokeSlotClicked(Slot slot, int index, int button, ClickType clickType);

@Accessor
boolean getIsQuickCrafting();
@Accessor("isQuickCrafting")
boolean mousetweaks$getIsQuickCrafting();

@Accessor
void setIsQuickCrafting(boolean value);
@Accessor("isQuickCrafting")
void mousetweaks$setIsQuickCrafting(boolean value);

@Accessor
int getQuickCraftingButton();
@Accessor("quickCraftingButton")
int mousetweaks$getQuickCraftingButton();

@Accessor
void setSkipNextRelease(boolean value);
@Accessor("skipNextRelease")
void mousetweaks$setSkipNextRelease(boolean value);
}

0 comments on commit 527bf8e

Please sign in to comment.