Make sure the inventory is open before running the task.

This commit is contained in:
Brianna 2019-12-21 15:27:38 -05:00
parent fa2c4b52e3
commit 58314408e0

View File

@ -189,7 +189,10 @@ public class GUIOverview extends Gui {
}
private void runTask() {
task = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, this::constructGUI, 5L, 5L);
task = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () -> {
if (inventory.getViewers().size() != 0)
this.constructGUI();
}, 5L, 5L);
}
List<String> getFurnaceDescription(Furnace furnace, Level level, Level nextLevel) {