Fix Recipe book dupe(s) and Block break dupes#89
Open
Sefiraat wants to merge 4 commits intoSlimefun:masterfrom
Open
Fix Recipe book dupe(s) and Block break dupes#89Sefiraat wants to merge 4 commits intoSlimefun:masterfrom
Sefiraat wants to merge 4 commits intoSlimefun:masterfrom
Conversation
TheBusyBiscuit
requested changes
Jul 6, 2021
src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBMachine.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/sensibletoolbox/core/gui/STBInventoryGUI.java
Outdated
Show resolved
Hide resolved
TheBusyBiscuit
requested changes
Jul 20, 2021
src/main/java/io/github/thebusybiscuit/sensibletoolbox/core/gui/STBInventoryGUI.java
Outdated
Show resolved
Hide resolved
WalshyDev
requested changes
Oct 1, 2021
src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBMachine.java
Outdated
Show resolved
Hide resolved
Alessio-Colombo
requested changes
Oct 1, 2021
src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBMachine.java
Show resolved
Hide resolved
…ms/BaseSTBMachine.java Co-authored-by: Sfiguz7 <[email protected]>
Alessio-Colombo
approved these changes
Oct 1, 2021
WalshyDev
reviewed
Oct 1, 2021
Comment on lines
+206
to
+210
| if (hasOpenGUI(player)) { | ||
| Debugger.getInstance().debug(player.getName() + " opened GUI for " + getOwningItem()); | ||
| setOpenGUI(player, this); | ||
| listener.onGUIOpened(player); | ||
| player.openInventory(inventory); |
Member
There was a problem hiding this comment.
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
WalshyDev
requested changes
Oct 1, 2021
|
|
||
| @Override | ||
| public void hideForAll() { | ||
| for (HumanEntity player : new ArrayList<>(inventory.getViewers())) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
STB Recipe books will allow users to remove items if opened twice fast enough (autoclicker makes this trivial) allowing for the removal of any STB/Vanilla/other registered recipe item assuming they are on the correct page before attempting.
STB machines allow their items to be removed if the machine is broken while being viewed either by TNT or a 2nd player.
Changes
For recipe book dupes, I added a check to see if the player has the inventory opened before allowing the 2nd instance to open. This resolved the dupe and has no noticable side effects on machine GUIs.
For the machines I added a check for viewing players and kick them out.
Related Issues
Don't think these have ever been reported weirdly!
Checklist
NonnullandNullableannotations to my methods to indicate their behaviour for null values