Skip to content

Commit

Permalink
Fixed creation of islands fails due to name already exists when disab…
Browse files Browse the repository at this point in the history
…ling name requirement (#1686)
  • Loading branch information
OmerBenGera committed Apr 14, 2023
1 parent 8c32814 commit 4ce19da
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -7,6 +7,7 @@
import com.bgsoftware.superiorskyblock.api.world.algorithm.IslandCreationAlgorithm;
import com.bgsoftware.superiorskyblock.api.wrappers.BlockPosition;
import com.bgsoftware.superiorskyblock.api.wrappers.SuperiorPlayer;
import com.bgsoftware.superiorskyblock.core.Text;
import com.bgsoftware.superiorskyblock.core.events.EventResult;
import com.bgsoftware.superiorskyblock.core.logging.Debug;
import com.bgsoftware.superiorskyblock.core.logging.Log;
Expand Down Expand Up @@ -66,7 +67,7 @@ public CompletableFuture<IslandCreationResult> createIsland(Island.Builder build
Log.debug(Debug.CREATE_ISLAND, builder.owner.getName(), schematic.getName(), lastIslandPosition);

// Making sure an island with the same name does not exist.
if (plugin.getGrid().getIsland(builder.islandName) != null) {
if (!Text.isBlank(builder.islandName) && plugin.getGrid().getIsland(builder.islandName) != null) {
Log.debugResult(Debug.CREATE_ISLAND, "Creation Failed", "Island with the name " + builder.islandName + " already exists.");
return CompletableFuture.completedFuture(new IslandCreationResult(IslandCreationResult.Status.NAME_OCCUPIED, null, null, false));
}
Expand Down

0 comments on commit 4ce19da

Please sign in to comment.