Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
77f41e2
move world generation to SkeletonWorldGenerator and copy skeleton dat…
Cinnazeyy Jul 14, 2025
9263206
generate skeleton on startup if not exists.
Cinnazeyy Jul 14, 2025
573884f
save skeleton to generate level.dat and remove uid.dat for multiverse…
Cinnazeyy Jul 14, 2025
d0b8173
fix async issues and cleanup generation related classes
Cinnazeyy Jul 20, 2025
16f0b39
add util methods for passing up exceptions in bukkit scheduler
Cinnazeyy Aug 3, 2025
779b31a
- pass schematic bytes into generateOutlines method of PlotGenerators
Cinnazeyy Aug 7, 2025
337a972
Merge branch 'update/1.21-data-abstraction' into update/world-generat…
Cinnazeyy Aug 7, 2025
fb9fd47
feat(gen): ✨ update emptychunkgenerator and provide it outside of plugin
Zoriot Aug 25, 2025
a4af0e0
Merge remote-tracking branch 'origin/update/world-generation-rework' …
Cinnazeyy Sep 17, 2025
198e014
Implement plot abandon functionality in the PlotHandler and rework Pl…
Cinnazeyy Nov 1, 2025
a87a7e3
move world generation to SkeletonWorldGenerator and copy skeleton dat…
Cinnazeyy Jul 14, 2025
73e9def
generate skeleton on startup if not exists.
Cinnazeyy Jul 14, 2025
0783dc6
save skeleton to generate level.dat and remove uid.dat for multiverse…
Cinnazeyy Jul 14, 2025
6571670
fix async issues and cleanup generation related classes
Cinnazeyy Jul 20, 2025
030be1f
add util methods for passing up exceptions in bukkit scheduler
Cinnazeyy Aug 3, 2025
fc403d6
- pass schematic bytes into generateOutlines method of PlotGenerators
Cinnazeyy Aug 7, 2025
35931a8
feat(gen): ✨ update emptychunkgenerator and provide it outside of plugin
Zoriot Aug 25, 2025
91e97ad
Implement plot abandon functionality in the PlotHandler and rework Pl…
Cinnazeyy Nov 1, 2025
73db572
fix incorrectly rebased imports
Cinnazeyy Nov 1, 2025
54a8333
Merge remote-tracking branch 'origin/update/world-generation-rework' …
Cinnazeyy Nov 1, 2025
a53c9f7
Implement TutorialPlotLoader.java.
Cinnazeyy Nov 25, 2025
17a8376
remove unused imports
Cinnazeyy Nov 25, 2025
3ca8cb7
add nbt dependency to gradle for parity with maven
Dec 2, 2025
e669434
Merge remote-tracking branch 'origin/update/world-generation-rework' …
Dec 2, 2025
aa53fa3
Merge branch 'update/1.21-data-abstraction' into update/world-generat…
Dec 2, 2025
4a9a6ce
fix merging issues
Dec 2, 2025
ac9a97a
feat: ✨ Remove VoidGen dependency
Zoriot Feb 16, 2026
af3ccc7
Merge branch 'main' into update/world-generation-rework
Cinnazeyy Apr 8, 2026
f3cfdfc
fix merge conflicts and use new GameRules api
Cinnazeyy Apr 8, 2026
ddeb946
ensure AbstractPlotLoader.pasteSchematic is run in main thread when c…
Cinnazeyy Apr 9, 2026
75e066b
run thread unsafe methods in Companion menues in main thread
Cinnazeyy Apr 9, 2026
546f4c6
make sure onException feedback runs on mainthread
Cinnazeyy Apr 9, 2026
7c3c4f1
make the tutorial system run async when possible
Cinnazeyy Apr 9, 2026
9947a05
set fixed spawn location for EmptyChunkGenerator
Cinnazeyy Apr 9, 2026
96859ec
use DefaultPlotLoader for plots with no completed schematic
Cinnazeyy Apr 9, 2026
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
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies {
implementation(libs.com.zaxxer.hikaricp) {
exclude(group = "org.slf4j")
}
implementation(libs.com.github.querz.nbt)
implementation(platform(libs.com.intellectualsites.bom.bom.newest))
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
compileOnly(libs.com.sk89q.worldguard.worldguard.bukkit)
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ io-papermc-paper-paper-api = "1.21.11-R0.1-SNAPSHOT" # https://artifactory.paper
li-cinnazeyy-langlibs-api = "1.5.2" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/li/cinnazeyy/LangLibs-API/
org-mariadb-jdbc-mariadb-java-client = "3.5.7" # https://central.sonatype.com/artifact/org.mariadb.jdbc/mariadb-java-client
com-intellectualsites-bom-bom-newest = "1.55" # Ref: https://github.com/IntellectualSites/bom
com-github-querz-nbt-newest = "6.1" # Ref: https://github.com/Querz/NBT
# Plugins
shadow = "9.3.1" # https://github.com/GradleUp/shadow/releases
git-version = "4.3.0" # https://github.com/palantir/gradle-git-version/releases
Expand All @@ -30,6 +31,7 @@ com-alpsbte-canvas = { module = "com.alpsbte:canvas", version.ref = "com-alpsbte
com-arcaniax-headdatabase-api = { module = "com.arcaniax:HeadDatabase-API", version.ref = "com-arcaniax-headdatabase-api" }
com-github-decentsoftware-eu-decentholograms = { module = "com.github.decentsoftware-eu:decentholograms", version.ref = "com-github-decentsoftware-eu-decentholograms" }
com-github-fierioziy-particlenativeapi-particlenativeapi-plugin = { module = "com.github.fierioziy.particlenativeapi:ParticleNativeAPI-plugin", version.ref = "com-github-fierioziy-particlenativeapi-particlenativeapi-plugin" }
com-github-querz-nbt = { module = "com.github.Querz:NBT", version.ref = "com-github-querz-nbt-newest" }
multiverse-core = { module = "org.mvplugins.multiverse.core:multiverse-core", version.ref = "multiverse-core" }
com-sk89q-worldguard-worldguard-bukkit = { module = "com.sk89q.worldguard:worldguard-bukkit", version.ref = "com-sk89q-worldguard-worldguard-bukkit" }
com-zaxxer-hikaricp = { module = "com.zaxxer:HikariCP", version.ref = "com-zaxxer-hikaricp" }
Expand Down
21 changes: 19 additions & 2 deletions src/main/java/com/alpsbte/plotsystem/PlotSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.alpsbte.plotsystem.core.holograms.HologramRegister;
import com.alpsbte.plotsystem.core.system.Builder;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.core.system.plot.generator.world.SkeletonWorldGenerator;
import com.alpsbte.plotsystem.core.system.plot.utils.PlotUtils;
import com.alpsbte.plotsystem.core.system.tutorial.AbstractTutorial;
import com.alpsbte.plotsystem.core.system.tutorial.BeginnerTutorial;
Expand All @@ -28,6 +30,7 @@
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.java.JavaPlugin;
import org.ipvp.canvas.MenuFunctionListener;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -117,14 +120,23 @@ public void onEnable() {

DecentHologramDisplay.registerPlugin(this);
HologramRegister.init();
PlotUtils.checkPlotsForLastActivity();
Utils.ChatUtils.checkForChatInputExpiry();
PlotUtils.Effects.startTimer();

// Start task that checks for and abandons inactive plots every hour
Bukkit.getScheduler().runTaskTimerAsynchronously(PlotSystem.getPlugin(), PlotHandler::abandonInactivePlots, 0L, 20 * 60 * 60L);

// Register tutorials
if (getConfig().getBoolean(ConfigPaths.TUTORIAL_ENABLE)) {
AbstractTutorial.registerTutorials(Collections.singletonList(BeginnerTutorial.class));
Bukkit.getScheduler().runTaskTimerAsynchronously(FancyNpcsPlugin.get().getPlugin(), new TutorialNPCTurnTracker(), 0, 1L);
Bukkit.getScheduler().runTaskTimer(FancyNpcsPlugin.get().getPlugin(), new TutorialNPCTurnTracker(), 0, 1L);
}

// Generate Skeleton World
if (Bukkit.getWorld("Skeleton") == null) {
getComponentLogger().info("No skeleton world found!");
getComponentLogger().info("Generating skeleton world...");
new SkeletonWorldGenerator();
}

pluginEnabled = true;
Expand Down Expand Up @@ -196,4 +208,9 @@ public void initDatabase() throws IOException, SQLException {
s.execute(initScript);
}
}

@Override
public ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
return new SkeletonWorldGenerator.EmptyChunkGenerator();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.alpsbte.plotsystem.commands.BaseCommand;
import com.alpsbte.plotsystem.core.database.DataProvider;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.core.system.plot.utils.PlotUtils;
import com.alpsbte.plotsystem.utils.Utils;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -43,10 +44,12 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N

sender.sendMessage(Utils.ChatUtils.getInfoFormat("Deleting plot..."));
Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> {
if (PlotUtils.Actions.deletePlot(plot)) {
sender.sendMessage(Utils.ChatUtils.getInfoFormat("Successfully deleted plot with the ID §6#" + plotID + "§a!"));
if (getPlayer(sender) != null) getPlayer(sender).playSound(getPlayer(sender).getLocation(), Utils.SoundUtils.DONE_SOUND, 1f, 1f);
} else sender.sendMessage(Utils.ChatUtils.getAlertFormat("An unexpected error has occurred!"));
if (!PlotHandler.deletePlot(plot)) {
sender.sendMessage(Utils.ChatUtils.getAlertFormat("An unexpected error has occurred!"));
return;
}
sender.sendMessage(Utils.ChatUtils.getInfoFormat("Successfully deleted plot with the ID §6#" + plotID + "§a!"));
if (getPlayer(sender) != null) getPlayer(sender).playSound(getPlayer(sender).getLocation(), Utils.SoundUtils.DONE_SOUND, 1f, 1f);
});
});
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.alpsbte.plotsystem.core.system.Builder;
import com.alpsbte.plotsystem.core.system.plot.AbstractPlot;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.core.system.plot.utils.PlotUtils;
import com.alpsbte.plotsystem.utils.Utils;
import com.alpsbte.plotsystem.utils.enums.Status;
Expand Down Expand Up @@ -67,10 +68,9 @@ public void onCommand(CommandSender sender, String[] args) {
}

Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> {
if (PlotUtils.Actions.abandonPlot(plot)) {
sender.sendMessage(Utils.ChatUtils.getInfoFormat(langUtil.get(sender, LangPaths.Message.Info.ABANDONED_PLOT, plot.getId() + "")));
player.playSound(player.getLocation(), Utils.SoundUtils.ABANDON_PLOT_SOUND, 1, 1);
}
if (!PlotHandler.abandonPlot(plot)) return;
sender.sendMessage(Utils.ChatUtils.getInfoFormat(langUtil.get(sender, LangPaths.Message.Info.ABANDONED_PLOT, plot.getId() + "")));
player.playSound(player.getLocation(), Utils.SoundUtils.ABANDON_PLOT_SOUND, 1, 1);
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.alpsbte.plotsystem.core.system.Builder;
import com.alpsbte.plotsystem.core.system.plot.AbstractPlot;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.core.system.plot.utils.PlotUtils;
import com.alpsbte.plotsystem.utils.Utils;
import com.alpsbte.plotsystem.utils.enums.Status;
Expand Down Expand Up @@ -75,7 +76,7 @@ public void onCommand(CommandSender sender, String[] args) {

Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> {

PlotUtils.Actions.submitPlot(plot);
PlotHandler.submitPlot(plot);
if (plotMembers.isEmpty()) {
// Plot was made alone
langUtil.broadcast(LangPaths.Message.Info.FINISHED_PLOT, String.valueOf(plot.getId()), plot.getPlotOwner().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.alpsbte.plotsystem.core.system.Builder;
import com.alpsbte.plotsystem.core.system.plot.AbstractPlot;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.generator.DefaultPlotGenerator;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.utils.Utils;
import com.alpsbte.plotsystem.utils.enums.Status;
import com.alpsbte.plotsystem.utils.io.LangPaths;
Expand Down Expand Up @@ -63,7 +63,7 @@ public void onCommand(CommandSender sender, String[] args) {
return;
}

Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> new DefaultPlotGenerator(plot, builder));
PlotHandler.assignAndGeneratePlot(builder, plot);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.alpsbte.plotsystem.core.system.Builder;
import com.alpsbte.plotsystem.core.system.plot.AbstractPlot;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.core.system.plot.utils.PlotUtils;
import com.alpsbte.plotsystem.utils.Utils;
import com.alpsbte.plotsystem.utils.enums.Status;
Expand Down Expand Up @@ -69,7 +70,7 @@ public void onCommand(CommandSender sender, String[] args) {
}

Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> {
PlotUtils.Actions.undoSubmit(plot);
PlotHandler.undoSubmit(plot);

sender.sendMessage(Utils.ChatUtils.getInfoFormat(langUtil.get(sender, LangPaths.Message.Info.UNDID_SUBMISSION, plot.getId() + "")));
player.playSound(player.getLocation(), Utils.SoundUtils.FINISH_PLOT_SOUND, 1, 1);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/alpsbte/plotsystem/core/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.alpsbte.plotsystem.core.system.Builder;
import com.alpsbte.plotsystem.core.system.CityProject;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.core.system.plot.TutorialPlot;
import com.alpsbte.plotsystem.core.system.plot.generator.DefaultPlotGenerator;
import com.alpsbte.plotsystem.core.system.plot.utils.PlotUtils;
import com.alpsbte.plotsystem.core.system.plot.world.PlotWorld;
import com.alpsbte.plotsystem.core.system.review.ReviewNotification;
Expand Down Expand Up @@ -123,7 +123,7 @@ public void onPlayerInteractAtEntity(@NotNull PlayerInteractAtEntityEvent event)
public void onPlayerQuitEvent(@NotNull PlayerQuitEvent event) {
final World w = event.getPlayer().getWorld();

DefaultPlotGenerator.playerPlotGenerationHistory.remove(event.getPlayer().getUniqueId());
PlotHandler.removePlayerFromGenerationHistory(event.getPlayer().getUniqueId());
ChatInput.awaitChatInput.remove(event.getPlayer().getUniqueId());
PlotUtils.Cache.clearCache(event.getPlayer().getUniqueId());

Expand Down Expand Up @@ -172,7 +172,7 @@ public void onInventoryClickEvent(@NotNull InventoryClickEvent event) {
}

@EventHandler
public void onlPlayerItemDropEvent(@NotNull PlayerDropItemEvent event) {
public void onPlayerItemDropEvent(@NotNull PlayerDropItemEvent event) {
if (event.getItemDrop().getItemStack().equals(CompanionMenu.getMenuItem(event.getPlayer())) ||
event.getItemDrop().getItemStack().equals(ReviewMenu.getMenuItem(event.getPlayer()))) {
event.setCancelled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import com.alpsbte.plotsystem.core.system.CityProject;
import com.alpsbte.plotsystem.core.system.Country;
import com.alpsbte.plotsystem.core.system.plot.Plot;
import com.alpsbte.plotsystem.core.system.plot.generator.DefaultPlotGenerator;
import com.alpsbte.plotsystem.core.system.plot.PlotHandler;
import com.alpsbte.plotsystem.utils.Utils;
import com.alpsbte.plotsystem.utils.enums.PlotDifficulty;
import com.alpsbte.plotsystem.utils.enums.Status;
import com.alpsbte.plotsystem.utils.io.ConfigPaths;
import com.alpsbte.plotsystem.utils.io.LangPaths;
import com.alpsbte.plotsystem.utils.io.LangUtil;
import com.alpsbte.plotsystem.utils.items.MenuItems;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.ipvp.canvas.mask.BinaryMask;
import org.ipvp.canvas.mask.Mask;
Expand All @@ -24,6 +25,7 @@

import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class CityProjectMenu extends AbstractPaginatedMenu {
Expand Down Expand Up @@ -64,7 +66,8 @@ protected void setPreviewItems() {
@Override
protected void setItemClickEventsAsync() {
getMenu().getSlot(0).setClickHandler((clickPlayer, clickInformation) ->
generateRandomPlot(clickPlayer, getValidCityProjects(selectedPlotDifficulty, clickPlayer, country), selectedPlotDifficulty));
CompletableFuture.runAsync(() ->
generateRandomPlot(clickPlayer, getValidCityProjects(selectedPlotDifficulty, clickPlayer, country), selectedPlotDifficulty)));

getMenu().getSlot(1).setClickHandler((clickPlayer, clickInformation) -> new CountryMenu(clickPlayer, country.getContinent(), selectedPlotDifficulty));

Expand Down Expand Up @@ -96,10 +99,32 @@ protected void setItemClickEventsAsync() {
CompanionMenu.clickEventTutorialItem(getMenu());
}

public void handleCityProjectClick(Player player, CityProject city) {
Builder builder = Builder.byUUID(player.getUniqueId());

PlotDifficulty plotDifficultyForCity;
try {
plotDifficultyForCity = selectedPlotDifficulty != null ? selectedPlotDifficulty : Plot.getPlotDifficultyForBuilder(city, builder).get();
} catch (ExecutionException | InterruptedException ex) {
sqlError(player, ex);
return;
}

List<Plot> unclaimedPlots = DataProvider.PLOT.getPlots(city, plotDifficultyForCity, Status.unclaimed);
if (unclaimedPlots.isEmpty()) {
player.sendMessage(Utils.ChatUtils.getAlertFormat(LangUtil.getInstance().get(player, LangPaths.Message.Error.NO_PLOTS_LEFT)));
Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> player.playSound(player.getLocation(), Utils.SoundUtils.ERROR_SOUND, 1, 1));
return;
}

Plot plot = unclaimedPlots.get(Utils.getRandom().nextInt(unclaimedPlots.size()));
PlotHandler.assignAndGeneratePlot(builder, plot);
}

public static boolean generateRandomPlot(Player player, @NotNull List<CityProject> items, PlotDifficulty selectedPlotDifficulty) {
PlotDifficulty difficulty = selectedPlotDifficulty;
if (items.isEmpty()) {
player.playSound(player, Utils.SoundUtils.ERROR_SOUND, 1, 1);
Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> player.playSound(player, Utils.SoundUtils.ERROR_SOUND, 1, 1));
return false;
}
CityProject randomCity = items.get(Utils.getRandom().nextInt(items.size()));
Expand All @@ -108,15 +133,14 @@ public static boolean generateRandomPlot(Player player, @NotNull List<CityProjec
try {
if (difficulty == null) difficulty = Plot.getPlotDifficultyForBuilder(randomCity, Builder.byUUID(player.getUniqueId())).get();
if (difficulty == null) difficulty = PlotDifficulty.EASY;

player.closeInventory();
new DefaultPlotGenerator(randomCity, difficulty, builder);
} catch (InterruptedException | ExecutionException e) {
sqlError(player, e);
return false;
}
player.playSound(player, Utils.SoundUtils.DONE_SOUND, 1, 1);
return true;
Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> player.closeInventory());
boolean successful = PlotHandler.assignAndGenerateRandomPlot(builder, randomCity, difficulty);
if (successful) Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> player.playSound(player, Utils.SoundUtils.DONE_SOUND, 1, 1));
return successful;
}

public static @NotNull @Unmodifiable List<CityProject> getValidCityProjects(PlotDifficulty selectedPlotDifficulty, Player player, @NotNull Country country) {
Expand Down Expand Up @@ -175,38 +199,20 @@ protected void setPaginatedItemClickEventsAsync(@NotNull List<?> source) {
clickPlayer.playSound(clickPlayer.getLocation(), Utils.SoundUtils.ERROR_SOUND, 1, 1);
return;
}

clickPlayer.closeInventory();
Builder builder = Builder.byUUID(clickPlayer.getUniqueId());

try {
PlotDifficulty plotDifficultyForCity = selectedPlotDifficulty != null ? selectedPlotDifficulty : Plot.getPlotDifficultyForBuilder(city, builder).get();
List<Plot> unclaimedPlots = DataProvider.PLOT.getPlots(city, plotDifficultyForCity, Status.unclaimed);
if (unclaimedPlots.isEmpty()) {
clickPlayer.sendMessage(Utils.ChatUtils.getAlertFormat(LangUtil.getInstance().get(clickPlayer, LangPaths.Message.Error.NO_PLOTS_LEFT)));
clickPlayer.playSound(clickPlayer.getLocation(), Utils.SoundUtils.ERROR_SOUND, 1, 1);
return;
}

if (selectedPlotDifficulty != null && PlotSystem.getPlugin().getConfig().getBoolean(ConfigPaths.ENABLE_SCORE_REQUIREMENT) && !DataProvider.DIFFICULTY.builderMeetsRequirements(builder, selectedPlotDifficulty)) {
clickPlayer.sendMessage(Utils.ChatUtils.getAlertFormat(LangUtil.getInstance().get(clickPlayer, LangPaths.Message.Error.PLAYER_NEEDS_HIGHER_SCORE)));
clickPlayer.playSound(clickPlayer.getLocation(), Utils.SoundUtils.ERROR_SOUND, 1, 1);
return;
}

new DefaultPlotGenerator(city, plotDifficultyForCity, builder);
} catch (ExecutionException | InterruptedException ex) {
sqlError(clickPlayer, ex);
}

CompletableFuture.runAsync(() -> handleCityProjectClick(clickPlayer, city));
});
slot++;
}
}

private static void sqlError(@NotNull Player clickPlayer, Exception ex) {
Utils.logSqlException(ex);
clickPlayer.sendMessage(Utils.ChatUtils.getAlertFormat(LangUtil.getInstance().get(clickPlayer, LangPaths.Message.Error.ERROR_OCCURRED)));
clickPlayer.playSound(clickPlayer.getLocation(), Utils.SoundUtils.ERROR_SOUND, 1, 1);
Bukkit.getScheduler().runTask(PlotSystem.getPlugin(), () -> {
clickPlayer.sendMessage(Utils.ChatUtils.getAlertFormat(LangUtil.getInstance().get(clickPlayer, LangPaths.Message.Error.ERROR_OCCURRED)));
clickPlayer.playSound(clickPlayer.getLocation(), Utils.SoundUtils.ERROR_SOUND, 1, 1);
});
Thread.currentThread().interrupt();
}
}
Loading
Loading