From 9fa101d53eb632759d13e1680595ed7488717ff2 Mon Sep 17 00:00:00 2001 From: OmerBenGera Date: Fri, 30 Sep 2022 12:34:59 +0300 Subject: [PATCH] Fixed errors when generating other worlds for islands are ignored (#1376) --- .../bgsoftware/superiorskyblock/core/messages/Message.java | 1 + .../bgsoftware/superiorskyblock/listener/PortalsListener.java | 4 ++++ src/main/resources/lang/de-DE.yml | 1 + src/main/resources/lang/en-US.yml | 1 + src/main/resources/lang/es-ES.yml | 1 + src/main/resources/lang/fr-FR.yml | 1 + src/main/resources/lang/it-IT.yml | 1 + src/main/resources/lang/iw-IL.yml | 1 + src/main/resources/lang/pl-PL.yml | 1 + src/main/resources/lang/vi-VN.yml | 1 + src/main/resources/lang/zh-CN.yml | 1 + 11 files changed, 14 insertions(+) diff --git a/src/main/java/com/bgsoftware/superiorskyblock/core/messages/Message.java b/src/main/java/com/bgsoftware/superiorskyblock/core/messages/Message.java index 771d6c3d7..0d35c72e1 100644 --- a/src/main/java/com/bgsoftware/superiorskyblock/core/messages/Message.java +++ b/src/main/java/com/bgsoftware/superiorskyblock/core/messages/Message.java @@ -312,6 +312,7 @@ public enum Message { COOP_LIMIT_EXCEED, CREATE_ISLAND, CREATE_ISLAND_FAILURE, + CREATE_WORLD_FAILURE, DEBUG_MODE_DISABLED, DEBUG_MODE_ENABLED, DEBUG_MODE_FILTER, diff --git a/src/main/java/com/bgsoftware/superiorskyblock/listener/PortalsListener.java b/src/main/java/com/bgsoftware/superiorskyblock/listener/PortalsListener.java index 6cd136b70..4b624641f 100644 --- a/src/main/java/com/bgsoftware/superiorskyblock/listener/PortalsListener.java +++ b/src/main/java/com/bgsoftware/superiorskyblock/listener/PortalsListener.java @@ -231,6 +231,10 @@ public boolean preventPlayerPortal(Player player, Location portalLocation, Playe } superiorPlayer.teleport(schematic.adjustRotation(destinationLocation)); + }, error -> { + generatingSchematicsIslands.remove(island.getUniqueId()); + error.printStackTrace(); + Message.CREATE_WORLD_FAILURE.send(player); }); } catch (NullPointerException ignored) { diff --git a/src/main/resources/lang/de-DE.yml b/src/main/resources/lang/de-DE.yml index 0c4ea0f48..ca0512b28 100644 --- a/src/main/resources/lang/de-DE.yml +++ b/src/main/resources/lang/de-DE.yml @@ -382,6 +382,7 @@ COOP_LIMIT_EXCEED: '&c&lFehler | &7Du hast die maximale Anzahl an Koop-Spielern CREATE_ISLAND: '&e&lInsel | &7Neue Insel bei {0} in {1}ms erstellt.' CREATE_ISLAND_FAILURE: '&c&lError | &7Beim Erstellen deiner Insel ist ein Fehler aufgetreten. Bitte wende dich an den Administrator, um das Problem zu untersuchen.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Debug-Modus umgeschaltet &cOFF&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Debug-Modus &aON&7 umgeschaltet.' DEBUG_MODE_FILTER: '&e&lDebug | &7Debug-Filter erfolgreich aktualisiert!' diff --git a/src/main/resources/lang/en-US.yml b/src/main/resources/lang/en-US.yml index a124513d8..d1a46678e 100644 --- a/src/main/resources/lang/en-US.yml +++ b/src/main/resources/lang/en-US.yml @@ -292,6 +292,7 @@ COOP_BANNED_PLAYER: '&c&lError | &7This player is banned from the island and can COOP_LIMIT_EXCEED: '&c&lError | &7You reached the maximum amount of coop players the island can have.' CREATE_ISLAND: '&e&lIsland | &7Created a new island at {0} in {1}ms.' CREATE_ISLAND_FAILURE: '&c&lError | &7An error occurred while creating your island. Please contact the administrator to investigate the issue.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Toggled debug mode &cOFF&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Toggled debug mode &aON&7.' DEBUG_MODE_FILTER: '&e&lDebug | &7Successfully updated the debug filter!' diff --git a/src/main/resources/lang/es-ES.yml b/src/main/resources/lang/es-ES.yml index 6e17ba2ae..0ecca4533 100644 --- a/src/main/resources/lang/es-ES.yml +++ b/src/main/resources/lang/es-ES.yml @@ -292,6 +292,7 @@ COOP_BANNED_PLAYER: '&c&lError | &7Este jugador está prohibido de la isla y no COOP_LIMIT_EXCEED: '&c&lError | &7Alcanzaste la cantidad máxima de jugadores cooperativos que puede tener la isla.' CREATE_ISLAND: '&e&lIsla | &7Creó una nueva isla en {0} en {1}ms.' CREATE_ISLAND_FAILURE: '&c&lError | &7Se produjo un error al crear su isla. Comuníquese con el administrador para investigar el problema.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Modo de depuración &cAPAGADO&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Modo de depuración &aENCENDIDO&7.' DEBUG_MODE_FILTER: '&e&lDebug | &7Se actualizó correctamente el filtro de depuración.!' diff --git a/src/main/resources/lang/fr-FR.yml b/src/main/resources/lang/fr-FR.yml index 72ba9eaf9..00a8114e7 100644 --- a/src/main/resources/lang/fr-FR.yml +++ b/src/main/resources/lang/fr-FR.yml @@ -292,6 +292,7 @@ COOP_BANNED_PLAYER: '&c&lErreur | &7Ce joueur est banni de l''île et ne peut pa COOP_LIMIT_EXCEED: '&c&lErreur | &7Vous avez atteint le nombre maximal de coopérateurs d''île.' CREATE_ISLAND: '&e&lIle | &7Création d''une nouvelle île aux coordonnées {0} en {1}ms.' CREATE_ISLAND_FAILURE: '&c&lErreur | &7Une erreur est survenue ors de la création de votre île. Veuillez contacter un administrateur et le notifier de ce problème.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Débogage &cDÉSACTIVÉ&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Débogage &aACTIVÉ&7.' DEBUG_MODE_FILTER: '&e&lDebug | &7Filtres de débogage mis à jour !!' diff --git a/src/main/resources/lang/it-IT.yml b/src/main/resources/lang/it-IT.yml index b4c3d404b..9f9f3eafb 100644 --- a/src/main/resources/lang/it-IT.yml +++ b/src/main/resources/lang/it-IT.yml @@ -295,6 +295,7 @@ COOP_BANNED_PLAYER: '&c&lErrore | &7Questo giocatore è bannato dall''isola e no COOP_LIMIT_EXCEED: '&c&lErrore | &7Hai raggiunto il numero massimo di giocatori coop che l''isola può avere.' CREATE_ISLAND: '&e&lIsola | &7Creata una nuova isola a {0} in {1}ms.' CREATE_ISLAND_FAILURE: '&c&lErrore | &7Si è verificato un errore durante la creazione della tua isola. Si prega di contattare l''amministratore per indagare sul problema.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Debug mode &cOFF&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Debug mode &aON&7.' DEBUG_MODE_FILTER: '&e&lDebug | &7Aggiornato il filtro di debug con successo!' diff --git a/src/main/resources/lang/iw-IL.yml b/src/main/resources/lang/iw-IL.yml index a17f33f60..4ac732492 100644 --- a/src/main/resources/lang/iw-IL.yml +++ b/src/main/resources/lang/iw-IL.yml @@ -303,6 +303,7 @@ COOP_BANNED_PLAYER: '&c&lהאיגש | &7הלועפ ףתשמכ ףסוותהל ל COOP_LIMIT_EXCEED: '&c&lError | &7You reached the maximum amount of coop players the island can have.' CREATE_ISLAND: '&e&lיא | &7היינשה תופילא {1} ךות {0} ב שדח יא תרצי.' CREATE_ISLAND_FAILURE: '&c&lError | &7An error occurred while creating your island. Please contact the administrator to investigate the issue.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Toggled debug mode &cOFF&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Toggled debug mode &aON&7.' DEBUG_MODE_FILTER: '&e&lDebug | &7Successfully updated the debug filter!' diff --git a/src/main/resources/lang/pl-PL.yml b/src/main/resources/lang/pl-PL.yml index 6f6c8c3cd..7e31510be 100644 --- a/src/main/resources/lang/pl-PL.yml +++ b/src/main/resources/lang/pl-PL.yml @@ -294,6 +294,7 @@ COOP_BANNED_PLAYER: '&c&lBlad | &7Ten gracz jest zablokowany na wyspie i nie moz COOP_LIMIT_EXCEED: '&c&lBlad | &7Osiagnales maksymalna liczbe czlonków co-op na wyspie.' CREATE_ISLAND: '&e&lWyspa | &7Stworzono wyspe na {0} w {1}ms.' CREATE_ISLAND_FAILURE: '&c&lBlad | &7Wystapil blad ze stworzeniem wyspy. Skontaktuj sie z administracja.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lDebug | &7Tryb debug mode &cWylaczony&7.' DEBUG_MODE_ENABLED: '&e&lDebug | &7Tryb debug mode &aWlaczony&7.' DEBUG_MODE_FILTER: '&e&lDebug | &7Pomyslnie zaktualizowano debug filter!' diff --git a/src/main/resources/lang/vi-VN.yml b/src/main/resources/lang/vi-VN.yml index baac67798..92647f17c 100644 --- a/src/main/resources/lang/vi-VN.yml +++ b/src/main/resources/lang/vi-VN.yml @@ -336,6 +336,7 @@ COOP_BANNED_PLAYER: '&c&lLỗi | &7Người chơi này đang bị cấm khỏi COOP_LIMIT_EXCEED: '&c&lLỗi | &7Bạn đã đạt số lượng người chơi co-op tối đa mà hòn đảo có thể có.' CREATE_ISLAND: '&e&lĐảo | &7Tạo một hòn đảo mới tại {0} trong {1}ms.' CREATE_ISLAND_FAILURE: '&c&lLỗi | &7Đã xảy ra lỗi khi tạo đảo của bạn. Vui lòng liên hệ với quản trị viên để điều tra vấn đề.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&lGỡ Lỗi | &7Chế độ gỡ lỗi đã được &cTẮT&7.' DEBUG_MODE_ENABLED: '&e&lGỡ Lỗi | &7Chế độ gỡ lỗi đã được &aBẬT&7.' DEBUG_MODE_FILTER: '&e&lGỡ Lỗi | &7Đã cập nhật thành công bộ lọc gỡ lỗi!' diff --git a/src/main/resources/lang/zh-CN.yml b/src/main/resources/lang/zh-CN.yml index efcde8a1d..700a1c661 100644 --- a/src/main/resources/lang/zh-CN.yml +++ b/src/main/resources/lang/zh-CN.yml @@ -292,6 +292,7 @@ COOP_BANNED_PLAYER: '&c&l错误 | &7这个玩家被岛屿禁封了,不能成 COOP_LIMIT_EXCEED: '&c&lError | &7You reached the maximum amount of coop players the island can have.' CREATE_ISLAND: '&e&l岛屿 | &7已为你创建新岛屿,耗时 &b{1}ms &7开始冒险吧!' CREATE_ISLAND_FAILURE: '&c&l错误 | &7在为你创建岛屿时出现了问题,请联系管理员.' +CREATE_WORLD_FAILURE: '&c&lError | &7An error occurred while generating your world. Please contact the administrator to investigate the issue.' DEBUG_MODE_DISABLED: '&e&l调试 | &7除错模式 &c关闭&7.' DEBUG_MODE_ENABLED: '&e&l调试 | &7除错模式 &a开启&7.' DEBUG_MODE_FILTER: '&e&l调试 | &7已更新除错模式筛选器!'