From 032c0894de1c11e7af010ff21b2ad7875185b658 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 22 Mar 2020 07:44:09 +0100 Subject: [PATCH] Send message on failing reset (Java heap space) --- .../de/steamwar/bausystem/commands/CommandReset.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandReset.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandReset.java index 66de795..8df6984 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandReset.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandReset.java @@ -4,11 +4,14 @@ import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.world.ArenaSection; import de.steamwar.bausystem.world.Welt; +import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.logging.Level; + public class CommandReset implements CommandExecutor { @Override @@ -24,8 +27,13 @@ public class CommandReset implements CommandExecutor { for(ArenaSection section : BauSystem.getSections()){ if(section.inRegion(player.getLocation())){ - section.reset(); - player.sendMessage(BauSystem.PREFIX + "§7Region zurückgesetzt"); + try { + section.reset(); + player.sendMessage(BauSystem.PREFIX + "§7Region zurückgesetzt"); + }catch(Exception e){ + player.sendMessage(BauSystem.PREFIX + "§cFehler beim Zurücksetzen der Region"); + Bukkit.getLogger().log(Level.WARNING, "Failed reset", e); + } return false; } }