Skip to content

Commit

Permalink
Added regenInventoryClear
Browse files Browse the repository at this point in the history
Added the config options clearInventoryOnRegen & clearEnderChestOnRegen to allow servers to clear player inventories when regenerating islands.
  • Loading branch information
sh0inx committed Sep 20, 2023
1 parent 9f975c1 commit fda8bb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ public void execute(User user, Island island, String[] args, IridiumTeams<Island
.replace("%prefix%", IridiumSkyblock.getInstance().getConfiguration().prefix)
)));

if(IridiumSkyblock.getInstance().getConfiguration().clearInventoryOnRegen) {
player.getInventory().clear();
}

if(IridiumSkyblock.getInstance().getConfiguration().clearEnderChestOnRegen) {
player.getEnderChest().clear();
}

IridiumSkyblock.getInstance().getIslandManager().generateIsland(island, schematicConfig.get()).thenRun(() -> Bukkit.getScheduler().runTask(IridiumSkyblock.getInstance(), () -> {
if (IridiumSkyblock.getInstance().getTeamManager().teleport(player, island.getHome(), island)) {
player.sendMessage(StringUtils.color(IridiumSkyblock.getInstance().getMessages().teleportingHome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public Configuration() {

public boolean obsidianBucket = true;
public boolean removeIslandBlocksOnDelete = false;
public boolean clearInventoryOnRegen = false;
public boolean clearEnderChestOnRegen = false;
public int distance = 151;
public int netherUnlockLevel = 10;
public int pasterDelayInTick = 1;
Expand Down

0 comments on commit fda8bb3

Please sign in to comment.