From 0e258a89a5bb899226dae5ebc0f4251b7b7e73a2 Mon Sep 17 00:00:00 2001 From: Shyanne Date: Sat, 11 Nov 2023 10:24:19 -0500 Subject: [PATCH] push this please this is embarrassing --- .../com/iridium/iridiumskyblock/configs/Configuration.java | 1 + .../iridiumskyblock/listeners/PlayerJoinListener.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/com/iridium/iridiumskyblock/configs/Configuration.java b/src/main/java/com/iridium/iridiumskyblock/configs/Configuration.java index e0e66d5a3..c56d840a4 100644 --- a/src/main/java/com/iridium/iridiumskyblock/configs/Configuration.java +++ b/src/main/java/com/iridium/iridiumskyblock/configs/Configuration.java @@ -54,6 +54,7 @@ public Configuration() { public boolean clearInventoryOnRegen = false; public boolean clearEnderChestOnRegen = false; public boolean allowPvPOnIslands = false; + public boolean islandCreateOnJoin = false; public int distance = 151; public int netherUnlockLevel = 10; public int endUnlockLevel = 20; diff --git a/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerJoinListener.java b/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerJoinListener.java index 14a3f2d75..258f95201 100644 --- a/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerJoinListener.java +++ b/src/main/java/com/iridium/iridiumskyblock/listeners/PlayerJoinListener.java @@ -1,6 +1,7 @@ package com.iridium.iridiumskyblock.listeners; import com.iridium.iridiumskyblock.IridiumSkyblock; +import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; @@ -12,4 +13,9 @@ public void onPlayerJoin(PlayerJoinEvent event) { IridiumSkyblock.getInstance().getTeamManager().sendIslandBorder(event.getPlayer()); } + @EventHandler + public void onServerJoin(PlayerJoinEvent event) { + if(IridiumSkyblock.getInstance().getConfiguration().islandCreateOnJoin && !event.getPlayer().hasPlayedBefore()) + Bukkit.getServer().dispatchCommand(event.getPlayer(), "is create"); + } }