PC-954 Tweak error message when no reports are available for handling

Also close gui after clicking item and remove old un-necessary code.
This commit is contained in:
Keir Nellyer 2016-10-12 17:30:19 +01:00
parent f42678a9ef
commit ca09253292
2 changed files with 3 additions and 10 deletions

View File

@ -5,7 +5,6 @@ import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClient;
import mineplex.core.chatsnap.SnapshotManager; import mineplex.core.chatsnap.SnapshotManager;
@ -51,9 +50,6 @@ public class ReportCreatePage extends SimpleGui implements ReportCategoryCallba
public void addReport(ReportCategory category) public void addReport(ReportCategory category)
{ {
_reporter.closeInventory();
unregisterListener();
if (category == ReportCategory.CHAT_ABUSE) if (category == ReportCategory.CHAT_ABUSE)
{ {
if (hasSentMessage(_suspect.getAccountId())) if (hasSentMessage(_suspect.getAccountId()))
@ -106,14 +102,10 @@ public class ReportCreatePage extends SimpleGui implements ReportCategoryCallba
}); });
} }
public void unregisterListener()
{
HandlerList.unregisterAll(this);
}
@Override @Override
public void click(ReportCategoryButton button) public void click(ReportCategoryButton button)
{ {
_reporter.closeInventory();
addReport(button.getCategory()); addReport(button.getCategory());
} }
} }

View File

@ -50,6 +50,7 @@ public class ReportHandlePage extends SimpleGui implements ReportCategoryCallbac
@Override @Override
public void click(ReportCategoryButton button) public void click(ReportCategoryButton button)
{ {
_handler.closeInventory();
handleReport(button.getCategory()); handleReport(button.getCategory());
} }
@ -107,7 +108,7 @@ public class ReportHandlePage extends SimpleGui implements ReportCategoryCallbac
} }
else else
{ {
UtilPlayer.message(_handler, F.main(_plugin.getName(), C.cRed + "No report found, report queue is empty.")); UtilPlayer.message(_handler, F.main(_plugin.getName(), C.cRed + "No open " + F.elem(category.getName()) + " report(s) found."));
} }
})); }));
} }