-
Notifications
You must be signed in to change notification settings - Fork 33
Fix Recipe book dupe(s) and Block break dupes #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,10 @@ private static void setOpenGUI(Player player, InventoryGUI gui) { | |
} | ||
} | ||
|
||
private boolean hasOpenGUI(Player player) { | ||
Sefiraat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return getOpenGUI(player) == null; | ||
} | ||
|
||
@Override | ||
public void addGadget(ClickableGadget gadget) { | ||
int slot = gadget.getSlot(); | ||
|
@@ -197,10 +201,19 @@ public void show(Player player) { | |
monitor.doRepaint(); | ||
} | ||
} | ||
Debugger.getInstance().debug(player.getName() + " opened GUI for " + getOwningItem()); | ||
setOpenGUI(player, this); | ||
listener.onGUIOpened(player); | ||
player.openInventory(inventory); | ||
if (hasOpenGUI(player)) { | ||
Debugger.getInstance().debug(player.getName() + " opened GUI for " + getOwningItem()); | ||
setOpenGUI(player, this); | ||
listener.onGUIOpened(player); | ||
player.openInventory(inventory); | ||
Comment on lines
+206
to
+210
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shit is horrible Why don't we have a method to do the whole setOpenGUI, onGUIOpened and openInv.... out of scope here but fuck meeeeeeee |
||
} | ||
} | ||
|
||
@Override | ||
public void hideForAll() { | ||
for (HumanEntity player : new ArrayList<>(inventory.getViewers())) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getViewers already a List... |
||
hide((Player) player); | ||
} | ||
} | ||
|
||
@Override | ||
|
Uh oh!
There was an error while loading. Please reload this page.