Small cleanup

This commit is contained in:
Indyuce 2020-07-20 17:52:00 +02:00
parent f193fdd706
commit a1b4b1aff1
2 changed files with 13 additions and 3 deletions

View File

@ -1,9 +1,18 @@
package net.Indyuce.mmoitems.api.edition;
public interface Edition {
/*
* processes the player input; returns true if edition should be closed or
* false if it should continue
*/
public boolean output(String input);
public void enable(String... message);
/*
* true if after successful edition, the GUI should go back to the
* previously opened GUI or if it should just be ignored
*/
public boolean shouldGoBack();
}

View File

@ -21,7 +21,8 @@ public abstract class EditionProcess {
public void input(String input) {
if (edition.output(input)) {
if(edition.shouldGoBack()) inv.open();
if (edition.shouldGoBack())
inv.open();
close();
}
}