mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-12 13:54:22 +01:00
Uses and catches specific IOException for new islands
Relates to c3442c29ba
This commit is contained in:
parent
e8810d41d9
commit
27c1b6505c
@ -1,5 +1,6 @@
|
||||
package world.bentobox.bentobox.api.commands.island;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
@ -93,7 +94,7 @@ public class IslandCreateCommand extends CompositeCommand {
|
||||
.reason(Reason.CREATE)
|
||||
.name(name)
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
getPlugin().logError("Could not create island for player. " + e.getMessage());
|
||||
user.sendMessage(e.getMessage());
|
||||
return false;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package world.bentobox.bentobox.api.commands.island;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -139,7 +140,7 @@ public class IslandResetCommand extends ConfirmableCommand {
|
||||
.name(name);
|
||||
if (noPaste) builder.noPaste();
|
||||
builder.build();
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
getPlugin().logError("Could not create island for player. " + e.getMessage());
|
||||
user.sendMessage(e.getMessage());
|
||||
return false;
|
||||
|
@ -35,7 +35,7 @@ public class NewIsland {
|
||||
|
||||
private NewIslandLocationStrategy locationStrategy;
|
||||
|
||||
public NewIsland(Builder builder) throws Exception {
|
||||
public NewIsland(Builder builder) throws IOException {
|
||||
plugin = BentoBox.getInstance();
|
||||
this.user = builder.user2;
|
||||
this.reason = builder.reason2;
|
||||
@ -137,7 +137,7 @@ public class NewIsland {
|
||||
* @return Island
|
||||
* @throws Exception
|
||||
*/
|
||||
public Island build() throws Exception {
|
||||
public Island build() throws IOException {
|
||||
if (user2 != null) {
|
||||
NewIsland newIsland = new NewIsland(this);
|
||||
return newIsland.getIsland();
|
||||
|
Loading…
Reference in New Issue
Block a user