Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.util.Vector;

import world.bentobox.bentobox.BStats;
Expand Down Expand Up @@ -237,8 +238,9 @@ public void newIsland(Island oldIsland) throws IOException {
Bukkit.getScheduler().runTask(plugin, () -> postCreationTask(oldIsland));
} else {
// Determine if NMS (native Minecraft server) paste is needed based on player state
boolean useNMS = user.isOfflinePlayer() || !user.getWorld().equals(island.getWorld())
|| (user.getLocation().distance(island.getCenter()) >= Bukkit.getViewDistance() * 16D);
double dist = user.getLocation().distance(island.getCenter());
boolean useNMS = (user.getPlayer() instanceof ConsoleCommandSender) || !user.getWorld().equals(island.getWorld())
|| (dist >= Bukkit.getViewDistance() * 16D);
// Paste the blueprint, then run post-creation tasks
plugin.getBlueprintsManager().paste(addon, island, name, () -> postCreationTask(oldIsland), useNMS);
}
Expand Down