Skip to content

Commit 623ff47

Browse files
committed
Fixed a bug in is spawn
1 parent d528160 commit 623ff47

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Change Log
22

3-
# Beta 29 - Grief Defender Port
3+
4+
# Beta 29.1 - Grief Defender Port
45
**REQUIRED: Sponge API 7.1 (SF 3682+); Grief Defender 1.12.2-4.3.0.622+; Permissions Plugin (ie. LuckPerms)**
56
**OPTIONAL: Nucleus 1.9.0-S7.1+**
7+
- Fixed a bug where `/is tp` | `/is spawn` would error if an argument was provided
68

7-
# Beta 29
8-
**REQUIRED: Sponge API 7.1 (SF 3682+); GP 1.12.2-4.3.0.622+; Permissions Plugin (ie. LuckPerms)**
9+
# Beta 29 - Grief Defender Port
10+
**REQUIRED: Sponge API 7.1 (SF 3682+); Grief Defender 1.12.2-4.3.0.622+; Permissions Plugin (ie. LuckPerms)**
911
**OPTIONAL: Nucleus 1.9.0-S7.1+**
1012
- Added support for one player to own multiple islands
1113
- `/is spawn` & `/is reset` will now display the chest GUI or island list if you have permission to use them on multiple islands

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Version
22
major=0
33
minor=29
4-
patch=0
4+
patch=1
55
api=S7.1
6-
suffix=GRIEF-DEFENDER-PR1
6+
suffix=GRIEF-DEFENDER-PR2
77
## Dependencies
88
spongeapi=7.1.0
99
spongeforge=1.12.2-2768-7.1.4

src/main/java/net/mohron/skyclaims/command/user/CommandSpawn.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
package net.mohron.skyclaims.command.user;
2020

2121
import java.util.Optional;
22+
import java.util.UUID;
2223
import java.util.function.Consumer;
2324
import net.mohron.skyclaims.command.CommandBase;
2425
import net.mohron.skyclaims.command.CommandIsland;
2526
import net.mohron.skyclaims.command.argument.Arguments;
2627
import net.mohron.skyclaims.permissions.Permissions;
2728
import net.mohron.skyclaims.util.CommandUtil;
2829
import net.mohron.skyclaims.world.Island;
30+
import net.mohron.skyclaims.world.IslandManager;
2931
import org.spongepowered.api.command.CommandException;
3032
import org.spongepowered.api.command.CommandPermissionException;
3133
import org.spongepowered.api.command.CommandResult;
@@ -60,12 +62,15 @@ public static void register() {
6062

6163
@Override
6264
public CommandResult execute(Player player, CommandContext args) throws CommandException {
63-
Optional<Island> island = args.getOne(ISLAND);
64-
if (island.isPresent()) {
65-
return sendPlayerToSpawn(player, island.get());
66-
} else {
67-
return listIslands(player, this::sendPlayerToSpawn);
65+
Optional<UUID> uuid = args.getOne(ISLAND);
66+
if (uuid.isPresent()) {
67+
final Optional<Island> island = IslandManager.get(uuid.get());
68+
if (island.isPresent()) {
69+
return sendPlayerToSpawn(player, island.get());
70+
}
6871
}
72+
73+
return listIslands(player, this::sendPlayerToSpawn);
6974
}
7075

7176
private CommandResult sendPlayerToSpawn(Player player, Island island) throws CommandException {

0 commit comments

Comments
 (0)