- Notifications
You must be signed in to change notification settings - Fork34
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 ourterms of service andprivacy 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?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBMachine.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/main/java/io/github/thebusybiscuit/sensibletoolbox/core/gui/STBInventoryGUI.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/main/java/io/github/thebusybiscuit/sensibletoolbox/core/gui/STBInventoryGUI.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBMachine.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There, easier to fix
src/main/java/io/github/thebusybiscuit/sensibletoolbox/api/items/BaseSTBMachine.javaShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…ms/BaseSTBMachine.javaCo-authored-by: Sfiguz7 <37039432+Sfiguz7@users.noreply.github.com>
| if (hasOpenGUI(player)) { | ||
| Debugger.getInstance().debug(player.getName() +" opened GUI for " +getOwningItem()); | ||
| setOpenGUI(player,this); | ||
| listener.onGUIOpened(player); | ||
| player.openInventory(inventory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 | ||
| publicvoidhideForAll() { | ||
| for (HumanEntityplayer :newArrayList<>(inventory.getViewers())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
getViewers already a List...
Uh oh!
There was an error while loading.Please reload this page.
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