diff --git a/.gitignore b/.gitignore index 5819bfd4..810172fc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,5 @@ hs_err_pid* /.gradle/ /.settings/ /.idea/ -/build/ +**/build/ /bin/ diff --git a/FabledSkyBlock/Core/build.gradle b/FabledSkyBlock/Core/build.gradle new file mode 100644 index 00000000..b5de158c --- /dev/null +++ b/FabledSkyBlock/Core/build.gradle @@ -0,0 +1,62 @@ +import org.apache.tools.ant.filters.ReplaceTokens + +configurations { + extraLibs +} + +dependencies { + // Project Dependencies + compile project(':FabledSkyBlock-Legacy') + + // PlaceholderAPI + compileOnly (group: 'be.maximvdw', name: 'placeholderapi', version: '2.5.1') + compileOnly (group: 'me.clip', name: 'placeholderapi', version: '2.10.2') + + // Vault + compileOnly (group: 'net.milkbowl', name: 'vault', version: '1.7.1') + + // Leaderheads + compileOnly (group: 'me.robin', name: 'leaderheads', version: '1.0') + + // EpicSpawners + compileOnly (group: 'com.songoda', name: 'epicspawners', version: '6-pre4') + + // EpicAnchors + compileOnly (group: 'com.songoda', name: 'epicanchors', version: '1.2.5') + + // UltimateStacker + compileOnly (group: 'com.songoda', name: 'ultimatestacker', version: '1.3.1') + + // WildStacker + compileOnly (group: 'com.bgsoftware', name: 'wildstacker-api', version: 'b15') + + // WorldEdit + compileOnly (group: 'com.sk89q', name: 'worldedit', version: '7.0.0') + + // Apache Commons + extraLibs (group: 'org.apache.commons', name: 'commons-lang3', version: '3.0') + extraLibs (group: 'commons-io', name: 'commons-io', version: '2.5') + + // Spigot + compileOnly (group: 'org.spigotmc', name: 'spigot', version: '1.14.1') + + // Songoda Updater + extraLibs (group: 'com.songoda', name: 'songodaupdater', version: '1') + + configurations.compileOnly.extendsFrom(configurations.extraLibs) +} + +processResources { + from (sourceSets.main.resources.srcDirs) { + include '**/*.yml' + filter ReplaceTokens, tokens: ["version": project.property("version")] + } +} + +jar { + from { + configurations.extraLibs.collect { + it.isDirectory() ? it : zipTree(it) + } + } +} diff --git a/src/main/java/me/goodandevil/skyblock/SkyBlock.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/SkyBlock.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/SkyBlock.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/SkyBlock.java diff --git a/src/main/java/me/goodandevil/skyblock/api/SkyBlockAPI.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/SkyBlockAPI.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/SkyBlockAPI.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/SkyBlockAPI.java diff --git a/src/main/java/me/goodandevil/skyblock/api/ban/Ban.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/ban/Ban.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/ban/Ban.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/ban/Ban.java diff --git a/src/main/java/me/goodandevil/skyblock/api/biome/BiomeManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/biome/BiomeManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/biome/BiomeManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/biome/BiomeManager.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandBanEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandBanEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandBanEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandBanEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandBiomeChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandBiomeChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandBiomeChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandBiomeChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandCreateEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandCreateEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandCreateEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandCreateEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandDeleteEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandDeleteEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandDeleteEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandDeleteEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandInviteEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandInviteEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandInviteEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandInviteEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandKickEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandKickEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandKickEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandKickEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLevelChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLevelChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandLevelChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLevelChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLoadEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLoadEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandLoadEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLoadEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLocationChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLocationChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandLocationChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandLocationChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandMessageChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandMessageChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandMessageChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandMessageChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandOpenEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandOpenEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandOpenEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandOpenEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandOwnershipTransferEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandOwnershipTransferEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandOwnershipTransferEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandOwnershipTransferEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandPasswordChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandPasswordChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandPasswordChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandPasswordChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandRoleChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandRoleChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandRoleChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandRoleChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnbanEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnbanEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnbanEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnbanEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnloadEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnloadEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnloadEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUnloadEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUpgradeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUpgradeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandUpgradeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandUpgradeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/island/IslandWeatherChangeEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandWeatherChangeEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/island/IslandWeatherChangeEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/island/IslandWeatherChangeEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatSwitchEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatSwitchEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatSwitchEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandChatSwitchEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandEnterEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandEnterEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandEnterEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandEnterEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandExitEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandExitEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandExitEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandExitEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandJoinEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandJoinEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandJoinEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandJoinEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandLeaveEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandLeaveEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandLeaveEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandLeaveEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandSwitchEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandSwitchEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandSwitchEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerIslandSwitchEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerWithdrawMoneyEvent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerWithdrawMoneyEvent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/event/player/PlayerWithdrawMoneyEvent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/event/player/PlayerWithdrawMoneyEvent.java diff --git a/src/main/java/me/goodandevil/skyblock/api/invite/IslandInvitation.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/invite/IslandInvitation.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/invite/IslandInvitation.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/invite/IslandInvitation.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/Island.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/Island.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/Island.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/Island.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandBorderColor.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandBorderColor.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandBorderColor.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandBorderColor.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandEnvironment.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandEnvironment.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandEnvironment.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandEnvironment.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandLevel.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandLevel.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandLevel.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandLevel.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandLocation.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandLocation.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandLocation.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandLocation.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandManager.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandMessage.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandMessage.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandMessage.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandMessage.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandRole.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandRole.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandRole.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandRole.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandSetting.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandSetting.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandSetting.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandSetting.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandUpgrade.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandUpgrade.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandUpgrade.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandUpgrade.java diff --git a/src/main/java/me/goodandevil/skyblock/api/island/IslandWorld.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandWorld.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/island/IslandWorld.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/island/IslandWorld.java diff --git a/src/main/java/me/goodandevil/skyblock/api/levelling/LevellingManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/levelling/LevellingManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/levelling/LevellingManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/levelling/LevellingManager.java diff --git a/src/main/java/me/goodandevil/skyblock/api/structure/Structure.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/structure/Structure.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/structure/Structure.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/structure/Structure.java diff --git a/src/main/java/me/goodandevil/skyblock/api/structure/StructureManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/structure/StructureManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/structure/StructureManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/structure/StructureManager.java diff --git a/src/main/java/me/goodandevil/skyblock/api/utils/APIUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/utils/APIUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/utils/APIUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/utils/APIUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/api/visit/Visit.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/visit/Visit.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/api/visit/Visit.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/api/visit/Visit.java diff --git a/src/main/java/me/goodandevil/skyblock/ban/Ban.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/ban/Ban.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/ban/Ban.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/ban/Ban.java diff --git a/src/main/java/me/goodandevil/skyblock/ban/BanManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/ban/BanManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/ban/BanManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/ban/BanManager.java diff --git a/src/main/java/me/goodandevil/skyblock/biome/BiomeManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/biome/BiomeManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/biome/BiomeManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/biome/BiomeManager.java diff --git a/src/main/java/me/goodandevil/skyblock/command/CommandManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/CommandManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/CommandManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/CommandManager.java diff --git a/src/main/java/me/goodandevil/skyblock/command/SubCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/SubCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/SubCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/SubCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/SkyBlockCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/SkyBlockCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/SkyBlockCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/SkyBlockCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/AddUpgradeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/AddUpgradeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/AddUpgradeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/AddUpgradeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/CreateCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/CreateCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/CreateCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/CreateCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/DeleteCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/DeleteCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/DeleteCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/DeleteCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/GeneratorCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/GeneratorCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/GeneratorCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/GeneratorCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/LevelCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/LevelCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/LevelCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/LevelCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/OwnerCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/OwnerCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/OwnerCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/OwnerCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/RefreshHologramsCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RefreshHologramsCommand.java similarity index 84% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/RefreshHologramsCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RefreshHologramsCommand.java index d19949ae..89702a14 100644 --- a/src/main/java/me/goodandevil/skyblock/command/commands/admin/RefreshHologramsCommand.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RefreshHologramsCommand.java @@ -40,12 +40,14 @@ public class RefreshHologramsCommand extends SubCommand { Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")); FileConfiguration configLoad = config.getFileConfiguration(); - LeaderboardManager leaderboardManager = skyblock.getLeaderboardManager(); - leaderboardManager.clearLeaderboard(); - leaderboardManager.resetLeaderboard(); - leaderboardManager.setupLeaderHeads(); + Bukkit.getScheduler().runTaskAsynchronously(skyblock, () -> { + LeaderboardManager leaderboardManager = skyblock.getLeaderboardManager(); + leaderboardManager.clearLeaderboard(); + leaderboardManager.resetLeaderboard(); + leaderboardManager.setupLeaderHeads(); - skyblock.getHologramManager().resetHologram(); + Bukkit.getScheduler().runTask(skyblock, () -> skyblock.getHologramManager().resetHologram()); + }); messageManager.sendMessage(sender, configLoad.getString("Command.Island.Admin.RefreshHolograms.Refreshed.Message")); soundManager.playSound(sender, Sounds.NOTE_PLING.bukkitSound(), 1.0F, 1.0F); diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/ReloadCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/ReloadCommand.java similarity index 93% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/ReloadCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/ReloadCommand.java index c8d86bdb..c050088b 100644 --- a/src/main/java/me/goodandevil/skyblock/command/commands/admin/ReloadCommand.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/ReloadCommand.java @@ -90,11 +90,13 @@ public class ReloadCommand extends SubCommand { levellingManager.unregisterMaterials(); levellingManager.registerMaterials(); - leaderboardManager.clearLeaderboard(); - leaderboardManager.resetLeaderboard(); - leaderboardManager.setupLeaderHeads(); + Bukkit.getScheduler().runTaskAsynchronously(skyblock, () -> { + leaderboardManager.clearLeaderboard(); + leaderboardManager.resetLeaderboard(); + leaderboardManager.setupLeaderHeads(); - hologramManager.resetHologram(); + Bukkit.getScheduler().runTask(skyblock, () -> skyblock.getHologramManager().resetHologram()); + }); limitManager.reload(); diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveHologramCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveHologramCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveHologramCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveHologramCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveUpgradeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveUpgradeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveUpgradeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/RemoveUpgradeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetBiomeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetBiomeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/SetBiomeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetBiomeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetHologramCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetHologramCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/SetHologramCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetHologramCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSizeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSizeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSizeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSizeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSpawnCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSpawnCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSpawnCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SetSpawnCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/SettingsCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SettingsCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/SettingsCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/SettingsCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/StructureCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/StructureCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/StructureCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/StructureCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/admin/UpgradeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/UpgradeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/admin/UpgradeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/admin/UpgradeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/AcceptCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/AcceptCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/AcceptCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/AcceptCommand.java diff --git a/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BanCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BanCommand.java new file mode 100644 index 00000000..3ceb0da5 --- /dev/null +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BanCommand.java @@ -0,0 +1,146 @@ +package me.goodandevil.skyblock.command.commands.island; + +import me.goodandevil.skyblock.ban.Ban; +import me.goodandevil.skyblock.command.SubCommand; +import me.goodandevil.skyblock.config.FileManager; +import me.goodandevil.skyblock.config.FileManager.Config; +import me.goodandevil.skyblock.island.Island; +import me.goodandevil.skyblock.island.IslandManager; +import me.goodandevil.skyblock.island.IslandRole; +import me.goodandevil.skyblock.island.IslandWorld; +import me.goodandevil.skyblock.message.MessageManager; +import me.goodandevil.skyblock.sound.SoundManager; +import me.goodandevil.skyblock.utils.player.OfflinePlayer; +import me.goodandevil.skyblock.utils.version.Sounds; +import me.goodandevil.skyblock.utils.world.LocationUtil; +import org.bukkit.Bukkit; +import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.entity.Player; + +import java.io.File; +import java.util.UUID; + +public class BanCommand extends SubCommand { + + @Override + public void onCommandByPlayer(Player player, String[] args) { + Bukkit.getScheduler().runTaskAsynchronously(skyblock, () -> { + MessageManager messageManager = skyblock.getMessageManager(); + IslandManager islandManager = skyblock.getIslandManager(); + SoundManager soundManager = skyblock.getSoundManager(); + FileManager fileManager = skyblock.getFileManager(); + + Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")); + FileConfiguration configLoad = config.getFileConfiguration(); + + if (args.length == 1) { + Island island = islandManager.getIsland(player); + + if (island == null) { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Owner.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration() + .getBoolean("Island.Visitor.Banning")) { + if (island.hasRole(IslandRole.Owner, player.getUniqueId()) + || (island.hasRole(IslandRole.Operator, player.getUniqueId()) + && island.getSetting(IslandRole.Operator, "Ban").getStatus())) { + Player targetPlayer = Bukkit.getServer().getPlayer(args[0]); + + if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban")) + return; + + UUID targetPlayerUUID = null; + String targetPlayerName = null; + + if (targetPlayer == null) { + OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]); + targetPlayerUUID = targetPlayerOffline.getUniqueId(); + targetPlayerName = targetPlayerOffline.getName(); + + if (skyblock.getEconomyManager().hasPermission(skyblock.getWorldManager().getWorld(IslandWorld.Normal).getName(), Bukkit.getOfflinePlayer(targetPlayerUUID), "fabledskyblock.bypass.ban")) + return; + } else { + targetPlayerUUID = targetPlayer.getUniqueId(); + targetPlayerName = targetPlayer.getName(); + } + + if (targetPlayerUUID == null) { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Found.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (targetPlayerUUID.equals(player.getUniqueId())) { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Yourself.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (island.hasRole(IslandRole.Member, targetPlayerUUID) + || island.hasRole(IslandRole.Operator, targetPlayerUUID) + || island.hasRole(IslandRole.Owner, targetPlayerUUID)) { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Member.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (island.getBan().isBanned(targetPlayerUUID)) { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Already.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else { + messageManager.sendMessage(player, + configLoad.getString("Command.Island.Ban.Banned.Sender.Message").replace("%player", + targetPlayerName)); + soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); + + if (island.isCoopPlayer(targetPlayerUUID)) { + island.removeCoopPlayer(targetPlayerUUID); + } + + Ban ban = island.getBan(); + ban.addBan(player.getUniqueId(), targetPlayerUUID); + ban.save(); + + if (targetPlayer != null) { + if (islandManager.isPlayerAtIsland(island, targetPlayer)) { + messageManager.sendMessage(targetPlayer, + configLoad.getString("Command.Island.Ban.Banned.Target.Message") + .replace("%player", player.getName())); + soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); + + LocationUtil.teleportPlayerToSpawn(targetPlayer); + } + } + } + } else { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Permission.Message")); + soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F); + } + } else { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Disabled.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } + } else { + messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Invalid.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } + }); + } + + @Override + public void onCommandByConsole(ConsoleCommandSender sender, String[] args) { + sender.sendMessage("SkyBlock | Error: You must be a player to perform that command."); + } + + @Override + public String getName() { + return "ban"; + } + + @Override + public String getInfoMessagePath() { + return "Command.Island.Ban.Info.Message"; + } + + @Override + public String[] getAliases() { + return new String[0]; + } + + @Override + public String[] getArguments() { + return new String[0]; + } +} diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/BankCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BankCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/BankCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BankCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/BansCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BansCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/BansCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BansCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/BiomeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BiomeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/BiomeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BiomeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/BorderCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BorderCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/BorderCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/BorderCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/CancelCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CancelCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/CancelCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CancelCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/ChatCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ChatCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/ChatCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ChatCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/CloseCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CloseCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/CloseCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CloseCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/ConfirmCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ConfirmCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/ConfirmCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ConfirmCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/ControlPanelCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ControlPanelCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/ControlPanelCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ControlPanelCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/CoopCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CoopCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/CoopCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CoopCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/CreateCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CreateCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/CreateCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CreateCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/CurrentCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CurrentCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/CurrentCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/CurrentCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/DeleteCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/DeleteCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/DeleteCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/DeleteCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/DemoteCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/DemoteCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/DemoteCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/DemoteCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/DenyCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/DenyCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/DenyCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/DenyCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/InformationCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/InformationCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/InformationCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/InformationCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/InviteCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/InviteCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/InviteCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/InviteCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/KickAllCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/KickAllCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/KickAllCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/KickAllCommand.java diff --git a/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/KickCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/KickCommand.java new file mode 100644 index 00000000..9c1f2608 --- /dev/null +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/KickCommand.java @@ -0,0 +1,287 @@ +package me.goodandevil.skyblock.command.commands.island; + +import me.goodandevil.skyblock.api.event.island.IslandKickEvent; +import me.goodandevil.skyblock.api.utils.APIUtil; +import me.goodandevil.skyblock.command.SubCommand; +import me.goodandevil.skyblock.config.FileManager; +import me.goodandevil.skyblock.config.FileManager.Config; +import me.goodandevil.skyblock.island.Island; +import me.goodandevil.skyblock.island.IslandManager; +import me.goodandevil.skyblock.island.IslandRole; +import me.goodandevil.skyblock.island.IslandWorld; +import me.goodandevil.skyblock.message.MessageManager; +import me.goodandevil.skyblock.playerdata.PlayerData; +import me.goodandevil.skyblock.playerdata.PlayerDataManager; +import me.goodandevil.skyblock.scoreboard.Scoreboard; +import me.goodandevil.skyblock.scoreboard.ScoreboardManager; +import me.goodandevil.skyblock.sound.SoundManager; +import me.goodandevil.skyblock.utils.player.OfflinePlayer; +import me.goodandevil.skyblock.utils.version.Sounds; +import me.goodandevil.skyblock.utils.world.LocationUtil; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.entity.Player; + +import java.io.File; +import java.io.IOException; +import java.util.Set; +import java.util.UUID; + +public class KickCommand extends SubCommand { + + @Override + public void onCommandByPlayer(Player player, String[] args) { + Bukkit.getScheduler().runTaskAsynchronously(skyblock, () -> { + PlayerDataManager playerDataManager = skyblock.getPlayerDataManager(); + ScoreboardManager scoreboardManager = skyblock.getScoreboardManager(); + MessageManager messageManager = skyblock.getMessageManager(); + IslandManager islandManager = skyblock.getIslandManager(); + SoundManager soundManager = skyblock.getSoundManager(); + FileManager fileManager = skyblock.getFileManager(); + + PlayerData playerData = playerDataManager.getPlayerData(player); + + Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")); + + if (args.length == 1) { + Island island = islandManager.getIsland(player); + + if (island == null) { + messageManager.sendMessage(player, + languageConfig.getFileConfiguration().getString("Command.Island.Kick.Owner.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (island.hasRole(IslandRole.Owner, player.getUniqueId()) + || (island.hasRole(IslandRole.Operator, player.getUniqueId()) + && island.getSetting(IslandRole.Operator, "Kick").getStatus())) { + UUID targetPlayerUUID = null; + String targetPlayerName = null; + + Player targetPlayer = Bukkit.getServer().getPlayer(args[0]); + + if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban")) + return; + + Set islandMembers = island.getRole(IslandRole.Member), + islandOperators = island.getRole(IslandRole.Operator), + islandVisitors = islandManager.getVisitorsAtIsland(island); + + if (targetPlayer == null) { + OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]); + targetPlayerUUID = targetPlayerOffline.getUniqueId(); + targetPlayerName = targetPlayerOffline.getName(); + + if (skyblock.getEconomyManager().hasPermission(skyblock.getWorldManager().getWorld(IslandWorld.Normal).getName(), Bukkit.getOfflinePlayer(targetPlayerUUID), "fabledskyblock.bypass.ban")) + return; + } else { + targetPlayerUUID = targetPlayer.getUniqueId(); + targetPlayerName = targetPlayer.getName(); + } + + if (targetPlayerUUID.equals(player.getUniqueId())) { + messageManager.sendMessage(player, + languageConfig.getFileConfiguration().getString("Command.Island.Kick.Yourself.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (islandOperators.contains(player.getUniqueId()) + && islandOperators.contains(targetPlayerUUID)) { + messageManager.sendMessage(player, languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Role.Operator.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (island.getOwnerUUID().equals(targetPlayerUUID)) { + messageManager.sendMessage(player, + languageConfig.getFileConfiguration().getString("Command.Island.Kick.Role.Owner.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else if (island.isOpen() && islandVisitors.contains(targetPlayerUUID) && targetPlayer != null) { + if (island.isCoopPlayer(targetPlayerUUID)) { + messageManager.sendMessage(player, + languageConfig.getFileConfiguration().getString("Command.Island.Kick.Cooped.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } else { + IslandKickEvent islandKickEvent = new IslandKickEvent(island.getAPIWrapper(), + APIUtil.fromImplementation(IslandRole.Visitor), + Bukkit.getServer().getOfflinePlayer(targetPlayerUUID), player); + + Bukkit.getScheduler().runTask(skyblock, () -> Bukkit.getServer().getPluginManager().callEvent(islandKickEvent)); + + if (!islandKickEvent.isCancelled()) { + LocationUtil.teleportPlayerToSpawn(targetPlayer); + + messageManager.sendMessage(player, + languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Kicked.Sender.Message") + .replace("%player", targetPlayerName)); + soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); + + messageManager.sendMessage(targetPlayer, + languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Kicked.Target.Message") + .replace("%player", player.getName())); + soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); + } + } + } else if (islandMembers.contains(targetPlayerUUID) || islandOperators.contains(targetPlayerUUID)) { + IslandRole islandRole = IslandRole.Member; + + if (islandOperators.contains(targetPlayerUUID)) { + islandRole = IslandRole.Operator; + } + + IslandKickEvent islandKickEvent = new IslandKickEvent(island.getAPIWrapper(), + APIUtil.fromImplementation(islandRole), + Bukkit.getServer().getOfflinePlayer(targetPlayerUUID), player); + + Bukkit.getScheduler().runTask(skyblock, () -> Bukkit.getServer().getPluginManager().callEvent(islandKickEvent)); + + if (!islandKickEvent.isCancelled()) { + messageManager.sendMessage(player, + languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Kicked.Sender.Message") + .replace("%player", targetPlayerName)); + soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); + + if (targetPlayer == null) { + Config config = fileManager + .getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), + targetPlayerUUID.toString() + ".yml")); + FileConfiguration configLoad = config.getFileConfiguration(); + + configLoad.set("Statistics.Island.Playtime", null); + configLoad.set("Statistics.Island.Join", null); + configLoad.set("Island.Owner", null); + + try { + configLoad.save(config.getFile()); + } catch (IOException e) { + e.printStackTrace(); + } + } else { + messageManager.sendMessage(targetPlayer, + languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Kicked.Target.Message") + .replace("%player", player.getName())); + soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); + + if (islandManager.isPlayerAtIsland(island, targetPlayer)) { + LocationUtil.teleportPlayerToSpawn(targetPlayer); + } + + if (scoreboardManager != null) { + Scoreboard scoreboard = scoreboardManager.getScoreboard(targetPlayer); + scoreboard.cancel(); + scoreboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', languageConfig + .getFileConfiguration().getString("Scoreboard.Tutorial.Displayname"))); + scoreboard.setDisplayList(languageConfig.getFileConfiguration() + .getStringList("Scoreboard.Tutorial.Displaylines")); + scoreboard.run(); + } + + playerData = playerDataManager.getPlayerData(targetPlayer); + playerData.setPlaytime(0); + playerData.setMemberSince(null); + playerData.setOwner(null); + playerData.setChat(false); + playerData.save(); + } + + if (islandMembers.contains(targetPlayerUUID)) { + island.removeRole(IslandRole.Member, targetPlayerUUID); + } else if (islandOperators.contains(targetPlayerUUID)) { + island.removeRole(IslandRole.Operator, targetPlayerUUID); + } + + island.save(); + + Set islandMembersOnline = islandManager.getMembersOnline(island); + + if (islandMembersOnline.size() == 1) { + for (UUID islandMembersOnlineList : islandMembersOnline) { + if (!islandMembersOnlineList.equals(player.getUniqueId())) { + targetPlayer = Bukkit.getServer().getPlayer(islandMembersOnlineList); + PlayerData targetPlayerData = playerDataManager.getPlayerData(targetPlayer); + + if (targetPlayerData.isChat()) { + targetPlayerData.setChat(false); + messageManager.sendMessage(targetPlayer, fileManager + .getConfig(new File(skyblock.getDataFolder(), "language.yml")) + .getFileConfiguration().getString("Island.Chat.Untoggled.Message")); + } + } + } + } + + if (scoreboardManager != null) { + if (island.getRole(IslandRole.Member).size() == 0 + && island.getRole(IslandRole.Operator).size() == 0) { + Scoreboard scoreboard = scoreboardManager.getScoreboard(player); + scoreboard.cancel(); + scoreboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', languageConfig + .getFileConfiguration().getString("Scoreboard.Island.Solo.Displayname"))); + + if (islandManager.getVisitorsAtIsland(island).size() == 0) { + scoreboard.setDisplayList(languageConfig.getFileConfiguration() + .getStringList("Scoreboard.Island.Solo.Empty.Displaylines")); + } else { + scoreboard.setDisplayList(languageConfig.getFileConfiguration() + .getStringList("Scoreboard.Island.Solo.Occupied.Displaylines")); + } + + scoreboard.run(); + } + } + } + } else { + if (island.isOpen()) { + messageManager.sendMessage(player, languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Occupant.Visit.Open.Message")); + } else { + messageManager.sendMessage(player, languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Occupant.Visit.Closed.Message")); + } + + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } + } else { + if (island.isOpen()) { + messageManager.sendMessage(player, languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Permission.Visit.Open.Message")); + } else { + messageManager.sendMessage(player, languageConfig.getFileConfiguration() + .getString("Command.Island.Kick.Permission.Visit.Closed.Message")); + } + + soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F); + } + } else { + messageManager.sendMessage(player, + languageConfig.getFileConfiguration().getString("Command.Island.Kick.Invalid.Message")); + soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); + } + }); + } + + @Override + public void onCommandByConsole(ConsoleCommandSender sender, String[] args) { + sender.sendMessage("SkyBlock | Error: You must be a player to perform that command."); + } + + @Override + public String getName() { + return "kick"; + } + + @Override + public String getInfoMessagePath() { + return "Command.Island.Kick.Info.Message"; + } + + @Override + public String[] getAliases() { + return new String[0]; + } + + @Override + public String[] getArguments() { + return new String[0]; + } +} diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/LeaderboardCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/LeaderboardCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/LeaderboardCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/LeaderboardCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/LeaveCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/LeaveCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/LeaveCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/LeaveCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/LevelCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/LevelCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/LevelCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/LevelCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/MembersCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/MembersCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/MembersCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/MembersCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/OpenCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/OpenCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/OpenCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/OpenCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/OwnerCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/OwnerCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/OwnerCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/OwnerCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/PromoteCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/PromoteCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/PromoteCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/PromoteCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/PublicCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/PublicCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/PublicCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/PublicCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/SetSpawnCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/SettingsCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/SettingsCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/SettingsCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/SettingsCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/TeleportCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/TeleportCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/TeleportCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/TeleportCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/UnbanCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/UnbanCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/UnbanCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/UnbanCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/UnlockCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/UnlockCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/UnlockCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/UnlockCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/UpgradeCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/UpgradeCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/UpgradeCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/UpgradeCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/ValueCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ValueCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/ValueCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/ValueCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/VisitCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/VisitCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/VisitCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/VisitCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/VisitorsCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/VisitorsCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/VisitorsCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/VisitorsCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/VoteCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/VoteCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/VoteCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/VoteCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/WeatherCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/WeatherCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/WeatherCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/WeatherCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/ResetCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/ResetCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/ResetCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/ResetCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/RollbackCommand.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/RollbackCommand.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/RollbackCommand.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/command/commands/island/disabled/RollbackCommand.java diff --git a/src/main/java/me/goodandevil/skyblock/config/FileChecker.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/config/FileChecker.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/config/FileChecker.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/config/FileChecker.java diff --git a/src/main/java/me/goodandevil/skyblock/config/FileManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/config/FileManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/config/FileManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/config/FileManager.java diff --git a/src/main/java/me/goodandevil/skyblock/confirmation/Confirmation.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/confirmation/Confirmation.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/confirmation/Confirmation.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/confirmation/Confirmation.java diff --git a/src/main/java/me/goodandevil/skyblock/confirmation/ConfirmationTask.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/confirmation/ConfirmationTask.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/confirmation/ConfirmationTask.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/confirmation/ConfirmationTask.java diff --git a/src/main/java/me/goodandevil/skyblock/cooldown/Cooldown.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/Cooldown.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/cooldown/Cooldown.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/Cooldown.java diff --git a/src/main/java/me/goodandevil/skyblock/cooldown/CooldownManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/cooldown/CooldownManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownManager.java diff --git a/src/main/java/me/goodandevil/skyblock/cooldown/CooldownPlayer.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownPlayer.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/cooldown/CooldownPlayer.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownPlayer.java diff --git a/src/main/java/me/goodandevil/skyblock/cooldown/CooldownTask.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownTask.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/cooldown/CooldownTask.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownTask.java diff --git a/src/main/java/me/goodandevil/skyblock/cooldown/CooldownType.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownType.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/cooldown/CooldownType.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/cooldown/CooldownType.java diff --git a/src/main/java/me/goodandevil/skyblock/economy/EconomyManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/economy/EconomyManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/economy/EconomyManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/economy/EconomyManager.java diff --git a/src/main/java/me/goodandevil/skyblock/generator/Generator.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/generator/Generator.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/generator/Generator.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/generator/Generator.java diff --git a/src/main/java/me/goodandevil/skyblock/generator/GeneratorManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/generator/GeneratorManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/generator/GeneratorManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/generator/GeneratorManager.java diff --git a/src/main/java/me/goodandevil/skyblock/generator/GeneratorMaterial.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/generator/GeneratorMaterial.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/generator/GeneratorMaterial.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/generator/GeneratorMaterial.java diff --git a/src/main/java/me/goodandevil/skyblock/hologram/Hologram.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/hologram/Hologram.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/hologram/Hologram.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/hologram/Hologram.java diff --git a/src/main/java/me/goodandevil/skyblock/hologram/HologramManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/hologram/HologramManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/hologram/HologramManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/hologram/HologramManager.java diff --git a/src/main/java/me/goodandevil/skyblock/hologram/HologramType.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/hologram/HologramType.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/hologram/HologramType.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/hologram/HologramType.java diff --git a/src/main/java/me/goodandevil/skyblock/invite/Invite.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/invite/Invite.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/invite/Invite.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/invite/Invite.java diff --git a/src/main/java/me/goodandevil/skyblock/invite/InviteManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/invite/InviteManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/invite/InviteManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/invite/InviteManager.java diff --git a/src/main/java/me/goodandevil/skyblock/invite/InviteTask.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/invite/InviteTask.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/invite/InviteTask.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/invite/InviteTask.java diff --git a/src/main/java/me/goodandevil/skyblock/island/Island.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/Island.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/Island.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/Island.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandEnvironment.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandEnvironment.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandEnvironment.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandEnvironment.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandLevel.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandLevel.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandLevel.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandLevel.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandLocation.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandLocation.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandLocation.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandLocation.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandManager.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandMessage.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandMessage.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandMessage.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandMessage.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandPosition.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandPosition.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandPosition.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandPosition.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandRole.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandRole.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandRole.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandRole.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandSetting.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandSetting.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandSetting.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandSetting.java diff --git a/src/main/java/me/goodandevil/skyblock/island/IslandWorld.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandWorld.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/island/IslandWorld.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/island/IslandWorld.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/Leaderboard.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/Leaderboard.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/Leaderboard.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/Leaderboard.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardManager.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardPlayer.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardPlayer.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardPlayer.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardPlayer.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardTask.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardTask.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardTask.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/LeaderboardTask.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopBank.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopBank.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopBank.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopBank.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopLevel.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopLevel.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopLevel.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopLevel.java diff --git a/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopVotes.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopVotes.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopVotes.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/leaderboard/leaderheads/TopVotes.java diff --git a/src/main/java/me/goodandevil/skyblock/levelling/Chunk.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/Chunk.java similarity index 89% rename from src/main/java/me/goodandevil/skyblock/levelling/Chunk.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/Chunk.java index 92847fe1..1780be17 100644 --- a/src/main/java/me/goodandevil/skyblock/levelling/Chunk.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/Chunk.java @@ -93,19 +93,9 @@ public class Chunk { World world = chunkPosition.getWorld(); int x = chunkPosition.getX(); int z = chunkPosition.getZ(); - if (!world.isChunkLoaded(x, z)) { - // Try to load the chunk, but don't generate anything and ignore if we couldn't get it - if (world.loadChunk(x, z, false)) { - org.bukkit.Chunk chunk = world.getChunkAt(x, z); - ChunkSnapshot chunkSnapshot = chunk.getChunkSnapshot(); - if (isWildStackerEnabled) { - this.chunkSnapshots.add(new WildStackerChunkSnapshotWrapper(chunkSnapshot, com.bgsoftware.wildstacker.api.WildStackerAPI.getWildStacker().getSystemManager().getStackedSnapshot(chunk, true))); - } else { - this.chunkSnapshots.add(new ChunkSnapshotWrapper(chunkSnapshot)); - } - world.unloadChunk(x, z); - } - } else { + + // Try to load the chunk, but don't generate anything and ignore if we couldn't get it + if (world.isChunkLoaded(x, z) || world.loadChunk(x, z, false)) { org.bukkit.Chunk chunk = world.getChunkAt(x, z); ChunkSnapshot chunkSnapshot = chunk.getChunkSnapshot(); if (isWildStackerEnabled) { diff --git a/src/main/java/me/goodandevil/skyblock/levelling/ChunkPosition.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/ChunkPosition.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/levelling/ChunkPosition.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/ChunkPosition.java diff --git a/src/main/java/me/goodandevil/skyblock/levelling/ChunkSnapshotWrapper.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/ChunkSnapshotWrapper.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/levelling/ChunkSnapshotWrapper.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/ChunkSnapshotWrapper.java diff --git a/src/main/java/me/goodandevil/skyblock/levelling/LevelChunkSnapshotWrapper.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevelChunkSnapshotWrapper.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/levelling/LevelChunkSnapshotWrapper.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevelChunkSnapshotWrapper.java diff --git a/src/main/java/me/goodandevil/skyblock/levelling/LevellingManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevellingManager.java similarity index 90% rename from src/main/java/me/goodandevil/skyblock/levelling/LevellingManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevellingManager.java index cfcf2983..d020d5fb 100644 --- a/src/main/java/me/goodandevil/skyblock/levelling/LevellingManager.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevellingManager.java @@ -44,11 +44,6 @@ public class LevellingManager { private Set activeIslandScans = new HashSet<>(); private List materialStorage = new ArrayList<>(); - private Method getBlockTypeMethod = null; - private Method getBlockTypeIdMethod = null; - private Method getBlockTypeDataMethod = null; - private Method getMaterialMethod = null; - public LevellingManager(SkyBlock skyblock) { this.skyblock = skyblock; @@ -120,38 +115,17 @@ public class LevellingManager { ChunkSnapshot chunkSnapshot = chunkSnapshotList.getChunkSnapshot(); try { - org.bukkit.Material blockMaterial = org.bukkit.Material.AIR; + org.bukkit.Material blockMaterial; int blockData = 0; EntityType spawnerType = null; if (NMSVersion > 12) { - if (getBlockTypeMethod == null) { - getBlockTypeMethod = chunkSnapshot.getClass() - .getMethod("getBlockType", int.class, int.class, int.class); - } - - blockMaterial = (org.bukkit.Material) getBlockTypeMethod - .invoke(chunkSnapshot, x, y, z); + blockMaterial = chunkSnapshot.getBlockType(x, y, z); } else { - if (getBlockTypeIdMethod == null) { - getBlockTypeIdMethod = chunkSnapshot.getClass() - .getMethod("getBlockTypeId", int.class, int.class, int.class); - } + LegacyChunkSnapshotData data = LegacyChunkSnapshotFetcher.fetch(chunkSnapshot, x, y, z); - if (getBlockTypeDataMethod == null) { - getBlockTypeDataMethod = chunkSnapshot.getClass() - .getMethod("getBlockData", int.class, int.class, int.class); - } - - if (getMaterialMethod == null) { - getMaterialMethod = blockMaterial.getClass().getMethod("getMaterial", - int.class); - } - - blockMaterial = (org.bukkit.Material) getMaterialMethod.invoke( - blockMaterial, - (int) getBlockTypeIdMethod.invoke(chunkSnapshot, x, y, z)); - blockData = (int) getBlockTypeDataMethod.invoke(chunkSnapshot, x, y, z); + blockMaterial = data.getMaterial(); + blockData = data.getData(); } if (blacklistedMaterials.contains(blockMaterial)) diff --git a/src/main/java/me/goodandevil/skyblock/levelling/LevellingMaterial.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevellingMaterial.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/levelling/LevellingMaterial.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/LevellingMaterial.java diff --git a/src/main/java/me/goodandevil/skyblock/levelling/WildStackerChunkSnapshotWrapper.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/WildStackerChunkSnapshotWrapper.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/levelling/WildStackerChunkSnapshotWrapper.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/levelling/WildStackerChunkSnapshotWrapper.java diff --git a/src/main/java/me/goodandevil/skyblock/limit/LimitManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/limit/LimitManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/limit/LimitManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/limit/LimitManager.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Block.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Block.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Block.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Block.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Bucket.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Bucket.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Bucket.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Bucket.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Chat.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Chat.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Chat.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Chat.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Death.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Death.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Death.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Death.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Entity.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Entity.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Entity.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Entity.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/EpicSpawners.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/EpicSpawners.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/EpicSpawners.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/EpicSpawners.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Food.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Food.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Food.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Food.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Interact.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Interact.java similarity index 98% rename from src/main/java/me/goodandevil/skyblock/listeners/Interact.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Interact.java index cc55bf47..2a3fde22 100644 --- a/src/main/java/me/goodandevil/skyblock/listeners/Interact.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Interact.java @@ -201,6 +201,12 @@ public class Interact implements Listener { return; } + if (event.getItem() != null && event.getItem().getType() == Material.BONE_MEAL && !islandManager.hasPermission(player, block.getLocation(), "Place")) { + soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F); + event.setCancelled(true); + return; + } + if (block.getType() == Materials.SWEET_BERRY_BUSH.parseMaterial()) { if (!islandManager.hasPermission(player, block.getLocation(), "Destroy")) { event.setCancelled(true); @@ -783,6 +789,15 @@ public class Interact implements Listener { } } } + else if (entity.getType().equals(EntityType.SHEEP)) { + if (!islandManager.hasPermission(player, entity.getLocation(), "EntityPlacement")) { + event.setCancelled(true); + skyblock.getMessageManager().sendMessage(player, + skyblock.getFileManager().getConfig(new File(skyblock.getDataFolder(), "language.yml")) + .getFileConfiguration().getString("Island.Settings.Permission.Message")); + skyblock.getSoundManager().playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F); + } + } else if (entity.getType().equals(EntityType.ITEM_FRAME)){ if (!skyblock.getIslandManager().hasPermission(player, entity.getLocation(), "Storage")) { event.setCancelled(true); diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Inventory.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Inventory.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Inventory.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Inventory.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Item.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Item.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Item.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Item.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Join.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Join.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Join.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Join.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Move.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Move.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Move.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Move.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Portal.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Portal.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Portal.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Portal.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Projectile.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Projectile.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Projectile.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Projectile.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Quit.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Quit.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Quit.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Quit.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Respawn.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Respawn.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Respawn.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Respawn.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Spawner.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Spawner.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Spawner.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Spawner.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Teleport.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Teleport.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/Teleport.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/Teleport.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/UltimateStacker.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/UltimateStacker.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/UltimateStacker.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/UltimateStacker.java diff --git a/src/main/java/me/goodandevil/skyblock/listeners/WildStacker.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/WildStacker.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/listeners/WildStacker.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/listeners/WildStacker.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Bans.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Bans.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Bans.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Bans.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Biome.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Biome.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Biome.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Biome.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Border.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Border.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Border.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Border.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/ControlPanel.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Coop.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Coop.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Coop.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Coop.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Creator.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Creator.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Creator.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Creator.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Information.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Information.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Information.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Information.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Leaderboard.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Leaderboard.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Leaderboard.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Leaderboard.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Levelling.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Levelling.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Levelling.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Levelling.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Members.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Members.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Members.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Members.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Ownership.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Ownership.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Ownership.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Ownership.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Rollback.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Rollback.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Rollback.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Rollback.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Settings.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Settings.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Settings.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Settings.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Upgrade.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Upgrade.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Upgrade.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Upgrade.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Visit.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Visit.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Visit.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Visit.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Visitors.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Visitors.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Visitors.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Visitors.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/Weather.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Weather.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/Weather.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/Weather.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/admin/Creator.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Creator.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/admin/Creator.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Creator.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/admin/Generator.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Generator.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/admin/Generator.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Generator.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/admin/Levelling.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Levelling.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/admin/Levelling.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Levelling.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/admin/Settings.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Settings.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/admin/Settings.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Settings.java diff --git a/src/main/java/me/goodandevil/skyblock/menus/admin/Upgrade.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Upgrade.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/menus/admin/Upgrade.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/menus/admin/Upgrade.java diff --git a/src/main/java/me/goodandevil/skyblock/message/MessageManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/message/MessageManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/message/MessageManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/message/MessageManager.java diff --git a/src/main/java/me/goodandevil/skyblock/placeholder/EZPlaceholder.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/EZPlaceholder.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/placeholder/EZPlaceholder.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/EZPlaceholder.java diff --git a/src/main/java/me/goodandevil/skyblock/placeholder/MVdWPlaceholder.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/MVdWPlaceholder.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/placeholder/MVdWPlaceholder.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/MVdWPlaceholder.java diff --git a/src/main/java/me/goodandevil/skyblock/placeholder/Placeholder.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/Placeholder.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/placeholder/Placeholder.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/Placeholder.java diff --git a/src/main/java/me/goodandevil/skyblock/placeholder/PlaceholderManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/PlaceholderManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/placeholder/PlaceholderManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/placeholder/PlaceholderManager.java diff --git a/src/main/java/me/goodandevil/skyblock/playerdata/PlayerData.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/playerdata/PlayerData.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/playerdata/PlayerData.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/playerdata/PlayerData.java diff --git a/src/main/java/me/goodandevil/skyblock/playerdata/PlayerDataManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/playerdata/PlayerDataManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/playerdata/PlayerDataManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/playerdata/PlayerDataManager.java diff --git a/src/main/java/me/goodandevil/skyblock/playtime/PlaytimeTask.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/playtime/PlaytimeTask.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/playtime/PlaytimeTask.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/playtime/PlaytimeTask.java diff --git a/src/main/java/me/goodandevil/skyblock/scoreboard/Scoreboard.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/scoreboard/Scoreboard.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/scoreboard/Scoreboard.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/scoreboard/Scoreboard.java diff --git a/src/main/java/me/goodandevil/skyblock/scoreboard/ScoreboardManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/scoreboard/ScoreboardManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/scoreboard/ScoreboardManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/scoreboard/ScoreboardManager.java diff --git a/src/main/java/me/goodandevil/skyblock/sound/SoundManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/sound/SoundManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/sound/SoundManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/sound/SoundManager.java diff --git a/src/main/java/me/goodandevil/skyblock/stackable/Stackable.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/stackable/Stackable.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/stackable/Stackable.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/stackable/Stackable.java diff --git a/src/main/java/me/goodandevil/skyblock/stackable/StackableManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/stackable/StackableManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/stackable/StackableManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/stackable/StackableManager.java diff --git a/src/main/java/me/goodandevil/skyblock/structure/Structure.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/structure/Structure.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/structure/Structure.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/structure/Structure.java diff --git a/src/main/java/me/goodandevil/skyblock/structure/StructureManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/structure/StructureManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/structure/StructureManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/structure/StructureManager.java diff --git a/src/main/java/me/goodandevil/skyblock/upgrade/Upgrade.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/upgrade/Upgrade.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/upgrade/Upgrade.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/upgrade/Upgrade.java diff --git a/src/main/java/me/goodandevil/skyblock/upgrade/UpgradeManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/upgrade/UpgradeManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/upgrade/UpgradeManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/upgrade/UpgradeManager.java diff --git a/src/main/java/me/goodandevil/skyblock/usercache/UserCacheManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/usercache/UserCacheManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/usercache/UserCacheManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/usercache/UserCacheManager.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/AbstractAnvilGUI.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/AbstractAnvilGUI.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/AbstractAnvilGUI.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/AbstractAnvilGUI.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/ChatComponent.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/ChatComponent.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/ChatComponent.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/ChatComponent.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/GZipUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/GZipUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/GZipUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/GZipUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/Metrics.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/Metrics.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/Metrics.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/Metrics.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/NumberUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/NumberUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/NumberUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/NumberUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/StringUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/StringUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/StringUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/StringUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/item/InventoryUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/InventoryUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/item/InventoryUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/InventoryUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/item/ItemStackUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/ItemStackUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/item/ItemStackUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/ItemStackUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/item/MaterialUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/MaterialUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/item/MaterialUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/MaterialUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/item/SkullUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/SkullUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/item/SkullUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/SkullUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/item/nInventoryUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/nInventoryUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/item/nInventoryUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/item/nInventoryUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/math/VectorUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/math/VectorUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/math/VectorUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/math/VectorUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/player/NameFetcher.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/player/NameFetcher.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/player/NameFetcher.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/player/NameFetcher.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/player/OfflinePlayer.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/player/OfflinePlayer.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/player/OfflinePlayer.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/player/OfflinePlayer.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/Area.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Area.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/structure/Area.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Area.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/Location.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Location.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/structure/Location.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Location.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/SchematicUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/SchematicUtil.java similarity index 98% rename from src/main/java/me/goodandevil/skyblock/utils/structure/SchematicUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/SchematicUtil.java index 3f40ad8c..8cc87272 100644 --- a/src/main/java/me/goodandevil/skyblock/utils/structure/SchematicUtil.java +++ b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/SchematicUtil.java @@ -61,7 +61,7 @@ public class SchematicUtil { } }; - if (Bukkit.getPluginManager().isPluginEnabled("FastAsyncWorldEdit")) { + if (Bukkit.getPluginManager().isPluginEnabled("FastAsyncWorldEdit") || Bukkit.getPluginManager().isPluginEnabled("AsyncWorldEdit")) { Bukkit.getScheduler().runTaskAsynchronously(SkyBlock.getInstance(), pasteTask); } else { Bukkit.getScheduler().runTask(SkyBlock.getInstance(), pasteTask); diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/SelectionLocation.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/SelectionLocation.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/structure/SelectionLocation.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/SelectionLocation.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/Storage.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Storage.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/structure/Storage.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Storage.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/Structure.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Structure.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/structure/Structure.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/Structure.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/structure/StructureUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/StructureUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/structure/StructureUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/structure/StructureUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/version/Materials.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/Materials.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/version/Materials.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/Materials.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/version/NMSUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/NMSUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/version/NMSUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/NMSUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/version/SBiome.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/SBiome.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/version/SBiome.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/SBiome.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/version/Sounds.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/Sounds.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/version/Sounds.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/version/Sounds.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/LocationUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/LocationUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/LocationUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/LocationUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/WorldBorder.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/WorldBorder.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/WorldBorder.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/WorldBorder.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockData.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockData.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/block/BlockData.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockData.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDataType.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDataType.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDataType.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDataType.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDegreesType.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDegreesType.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDegreesType.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockDegreesType.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockStateType.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockStateType.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/block/BlockStateType.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockStateType.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/block/BlockUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/block/BlockUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityData.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityData.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityData.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityData.java diff --git a/src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityUtil.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityUtil.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityUtil.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/utils/world/entity/EntityUtil.java diff --git a/src/main/java/me/goodandevil/skyblock/visit/Visit.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/visit/Visit.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/visit/Visit.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/visit/Visit.java diff --git a/src/main/java/me/goodandevil/skyblock/visit/VisitManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/visit/VisitManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/visit/VisitManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/visit/VisitManager.java diff --git a/src/main/java/me/goodandevil/skyblock/visit/VisitTask.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/visit/VisitTask.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/visit/VisitTask.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/visit/VisitTask.java diff --git a/src/main/java/me/goodandevil/skyblock/world/WorldManager.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/world/WorldManager.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/world/WorldManager.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/world/WorldManager.java diff --git a/src/main/java/me/goodandevil/skyblock/world/generator/VoidGenerator.java b/FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/world/generator/VoidGenerator.java similarity index 100% rename from src/main/java/me/goodandevil/skyblock/world/generator/VoidGenerator.java rename to FabledSkyBlock/Core/src/main/java/me/goodandevil/skyblock/world/generator/VoidGenerator.java diff --git a/src/main/resources/config.yml b/FabledSkyBlock/Core/src/main/resources/config.yml similarity index 100% rename from src/main/resources/config.yml rename to FabledSkyBlock/Core/src/main/resources/config.yml diff --git a/src/main/resources/generators.yml b/FabledSkyBlock/Core/src/main/resources/generators.yml similarity index 100% rename from src/main/resources/generators.yml rename to FabledSkyBlock/Core/src/main/resources/generators.yml diff --git a/src/main/resources/language.yml b/FabledSkyBlock/Core/src/main/resources/language.yml similarity index 100% rename from src/main/resources/language.yml rename to FabledSkyBlock/Core/src/main/resources/language.yml diff --git a/src/main/resources/levelling.yml b/FabledSkyBlock/Core/src/main/resources/levelling.yml similarity index 100% rename from src/main/resources/levelling.yml rename to FabledSkyBlock/Core/src/main/resources/levelling.yml diff --git a/src/main/resources/limits.yml b/FabledSkyBlock/Core/src/main/resources/limits.yml similarity index 100% rename from src/main/resources/limits.yml rename to FabledSkyBlock/Core/src/main/resources/limits.yml diff --git a/src/main/resources/plugin.yml b/FabledSkyBlock/Core/src/main/resources/plugin.yml similarity index 100% rename from src/main/resources/plugin.yml rename to FabledSkyBlock/Core/src/main/resources/plugin.yml diff --git a/src/main/resources/settings.yml b/FabledSkyBlock/Core/src/main/resources/settings.yml similarity index 100% rename from src/main/resources/settings.yml rename to FabledSkyBlock/Core/src/main/resources/settings.yml diff --git a/src/main/resources/stackables.yml b/FabledSkyBlock/Core/src/main/resources/stackables.yml similarity index 100% rename from src/main/resources/stackables.yml rename to FabledSkyBlock/Core/src/main/resources/stackables.yml diff --git a/src/main/resources/structures.yml b/FabledSkyBlock/Core/src/main/resources/structures.yml similarity index 100% rename from src/main/resources/structures.yml rename to FabledSkyBlock/Core/src/main/resources/structures.yml diff --git a/src/main/resources/structures/default.structure b/FabledSkyBlock/Core/src/main/resources/structures/default.structure similarity index 100% rename from src/main/resources/structures/default.structure rename to FabledSkyBlock/Core/src/main/resources/structures/default.structure diff --git a/src/main/resources/upgrades.yml b/FabledSkyBlock/Core/src/main/resources/upgrades.yml similarity index 100% rename from src/main/resources/upgrades.yml rename to FabledSkyBlock/Core/src/main/resources/upgrades.yml diff --git a/src/main/resources/worlds.yml b/FabledSkyBlock/Core/src/main/resources/worlds.yml similarity index 100% rename from src/main/resources/worlds.yml rename to FabledSkyBlock/Core/src/main/resources/worlds.yml diff --git a/FabledSkyBlock/Legacy/build.gradle b/FabledSkyBlock/Legacy/build.gradle new file mode 100644 index 00000000..2a772951 --- /dev/null +++ b/FabledSkyBlock/Legacy/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compileOnly 'org.spigotmc:spigot:1.12.2' +} \ No newline at end of file diff --git a/FabledSkyBlock/Legacy/src/main/java/me/goodandevil/skyblock/levelling/LegacyChunkSnapshotData.java b/FabledSkyBlock/Legacy/src/main/java/me/goodandevil/skyblock/levelling/LegacyChunkSnapshotData.java new file mode 100644 index 00000000..4332a628 --- /dev/null +++ b/FabledSkyBlock/Legacy/src/main/java/me/goodandevil/skyblock/levelling/LegacyChunkSnapshotData.java @@ -0,0 +1,23 @@ +package me.goodandevil.skyblock.levelling; + +import org.bukkit.Material; + +public class LegacyChunkSnapshotData { + + private Material material; + private int data; + + public LegacyChunkSnapshotData(Material material, int data) { + this.material = material; + this.data = data; + } + + public Material getMaterial() { + return this.material; + } + + public int getData() { + return this.data; + } + +} diff --git a/FabledSkyBlock/Legacy/src/main/java/me/goodandevil/skyblock/levelling/LegacyChunkSnapshotFetcher.java b/FabledSkyBlock/Legacy/src/main/java/me/goodandevil/skyblock/levelling/LegacyChunkSnapshotFetcher.java new file mode 100644 index 00000000..e393508b --- /dev/null +++ b/FabledSkyBlock/Legacy/src/main/java/me/goodandevil/skyblock/levelling/LegacyChunkSnapshotFetcher.java @@ -0,0 +1,13 @@ +package me.goodandevil.skyblock.levelling; + +import org.bukkit.ChunkSnapshot; +import org.bukkit.Material; + +public class LegacyChunkSnapshotFetcher { + + // Uses a 1.12.2 jar in a separate project to avoid needing to use reflection during level scanning, much faster. + public static LegacyChunkSnapshotData fetch(ChunkSnapshot snapshot, int x, int y, int z) { + return new LegacyChunkSnapshotData(Material.getMaterial(snapshot.getBlockTypeId(x, y, z)), snapshot.getBlockData(x, y, z)); + } + +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index c47aa743..8cca8ecd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,74 +1,42 @@ -import org.apache.tools.ant.filters.ReplaceTokens -apply plugin: 'java' +allprojects { + apply plugin: 'java' + group = 'com.goodandevil.skyblock' + version = 'Build-78' +} -group 'com.songoda.fabledskyblock' -version 'Build-78' +subprojects { + sourceCompatibility = 1.8 -sourceCompatibility = 1.8 + repositories { + mavenCentral() + jcenter() -repositories { - mavenCentral() - jcenter() - - maven { - url 'http://repo.songoda.com/artifactory/private/' + maven { + url = 'http://repo.songoda.com/artifactory/private' + } } } +dependencies { + compile project(':FabledSkyBlock-Legacy') + compile project(':FabledSkyBlock-Core') +} + configurations { - shade - compile.extendsFrom shade + childJars } dependencies { - // PlaceholderAPI - implementation (group: 'be.maximvdw', name: 'placeholderapi', version: '2.5.1') - implementation (group: 'me.clip', name: 'placeholderapi', version: '2.10.2') - - // Vault - implementation (group: 'net.milkbowl', name: 'vault', version: '1.7.1') - - // Leaderheads - implementation (group: 'me.robin', name: 'leaderheads', version: '1.0') - - // EpicSpawners - implementation (group: 'com.songoda', name: 'epicspawners', version: '6-pre4') - - // EpicAnchors - implementation (group: 'com.songoda', name: 'epicanchors', version: '1.2.5') - - // UltimateStacker - implementation (group: 'com.songoda', name: 'ultimatestacker', version: '1.3.1') - - // WildStacker - implementation (group: 'com.bgsoftware', name: 'wildstacker-api', version: 'b15') - - // WorldEdit - implementation (group: 'com.sk89q', name: 'worldedit', version: '7.0.0') - - // Apache Commons - shade (group: 'org.apache.commons', name: 'commons-lang3', version: '3.0') - shade (group: 'commons-io', name: 'commons-io', version: '2.5') - - // Songoda Updater - shade (group: 'com.songoda', name: 'songodaupdater', version: '1') - - // Spigot - implementation (group: 'org.spigotmc', name: 'spigot', version: '1.14.1') -} - -processResources { - from (sourceSets.main.resources.srcDirs) { - include '**/*.yml' - filter ReplaceTokens, tokens: ["version": project.property("version")] + subprojects.each { + childJars project(it.path) } } jar { - configurations.shade.each { dep -> - from (project.zipTree(dep)) { - exclude '**/*.yml' - exclude 'META-INF', 'META-INF/**' + dependsOn configurations.childJars + from { + configurations.childJars.collect { + zipTree(it) } } } diff --git a/settings.gradle b/settings.gradle index 4b64804c..d254dfb3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,7 @@ rootProject.name = 'FabledSkyBlock' + +include(':FabledSkyBlock-Core') +project(':FabledSkyBlock-Core').projectDir = file('FabledSkyBlock/Core') + +include(':FabledSkyBlock-Legacy') +project(':FabledSkyBlock-Legacy').projectDir = file('FabledSkyBlock/Legacy') diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/BanCommand.java b/src/main/java/me/goodandevil/skyblock/command/commands/island/BanCommand.java deleted file mode 100644 index aeb40aee..00000000 --- a/src/main/java/me/goodandevil/skyblock/command/commands/island/BanCommand.java +++ /dev/null @@ -1,144 +0,0 @@ -package me.goodandevil.skyblock.command.commands.island; - -import me.goodandevil.skyblock.ban.Ban; -import me.goodandevil.skyblock.command.SubCommand; -import me.goodandevil.skyblock.config.FileManager; -import me.goodandevil.skyblock.config.FileManager.Config; -import me.goodandevil.skyblock.island.Island; -import me.goodandevil.skyblock.island.IslandManager; -import me.goodandevil.skyblock.island.IslandRole; -import me.goodandevil.skyblock.island.IslandWorld; -import me.goodandevil.skyblock.message.MessageManager; -import me.goodandevil.skyblock.sound.SoundManager; -import me.goodandevil.skyblock.utils.player.OfflinePlayer; -import me.goodandevil.skyblock.utils.version.Sounds; -import me.goodandevil.skyblock.utils.world.LocationUtil; -import org.bukkit.Bukkit; -import org.bukkit.command.ConsoleCommandSender; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.entity.Player; - -import java.io.File; -import java.util.UUID; - -public class BanCommand extends SubCommand { - - @Override - public void onCommandByPlayer(Player player, String[] args) { - MessageManager messageManager = skyblock.getMessageManager(); - IslandManager islandManager = skyblock.getIslandManager(); - SoundManager soundManager = skyblock.getSoundManager(); - FileManager fileManager = skyblock.getFileManager(); - - Config config = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")); - FileConfiguration configLoad = config.getFileConfiguration(); - - if (args.length == 1) { - Island island = islandManager.getIsland(player); - - if (island == null) { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Owner.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (fileManager.getConfig(new File(skyblock.getDataFolder(), "config.yml")).getFileConfiguration() - .getBoolean("Island.Visitor.Banning")) { - if (island.hasRole(IslandRole.Owner, player.getUniqueId()) - || (island.hasRole(IslandRole.Operator, player.getUniqueId()) - && island.getSetting(IslandRole.Operator, "Ban").getStatus())) { - Player targetPlayer = Bukkit.getServer().getPlayer(args[0]); - - if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban")) - return; - - UUID targetPlayerUUID = null; - String targetPlayerName = null; - - if (targetPlayer == null) { - OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]); - targetPlayerUUID = targetPlayerOffline.getUniqueId(); - targetPlayerName = targetPlayerOffline.getName(); - - if (skyblock.getEconomyManager().hasPermission(skyblock.getWorldManager().getWorld(IslandWorld.Normal).getName(), Bukkit.getOfflinePlayer(targetPlayerUUID), "fabledskyblock.bypass.ban")) - return; - } else { - targetPlayerUUID = targetPlayer.getUniqueId(); - targetPlayerName = targetPlayer.getName(); - } - - if (targetPlayerUUID == null) { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Found.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (targetPlayerUUID.equals(player.getUniqueId())) { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Yourself.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (island.hasRole(IslandRole.Member, targetPlayerUUID) - || island.hasRole(IslandRole.Operator, targetPlayerUUID) - || island.hasRole(IslandRole.Owner, targetPlayerUUID)) { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Member.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (island.getBan().isBanned(targetPlayerUUID)) { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Already.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else { - messageManager.sendMessage(player, - configLoad.getString("Command.Island.Ban.Banned.Sender.Message").replace("%player", - targetPlayerName)); - soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); - - if (island.isCoopPlayer(targetPlayerUUID)) { - island.removeCoopPlayer(targetPlayerUUID); - } - - Ban ban = island.getBan(); - ban.addBan(player.getUniqueId(), targetPlayerUUID); - ban.save(); - - if (targetPlayer != null) { - if (islandManager.isPlayerAtIsland(island, targetPlayer)) { - messageManager.sendMessage(targetPlayer, - configLoad.getString("Command.Island.Ban.Banned.Target.Message") - .replace("%player", player.getName())); - soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); - - LocationUtil.teleportPlayerToSpawn(targetPlayer); - } - } - } - } else { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Permission.Message")); - soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F); - } - } else { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Disabled.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } - } else { - messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Invalid.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } - } - - @Override - public void onCommandByConsole(ConsoleCommandSender sender, String[] args) { - sender.sendMessage("SkyBlock | Error: You must be a player to perform that command."); - } - - @Override - public String getName() { - return "ban"; - } - - @Override - public String getInfoMessagePath() { - return "Command.Island.Ban.Info.Message"; - } - - @Override - public String[] getAliases() { - return new String[0]; - } - - @Override - public String[] getArguments() { - return new String[0]; - } -} diff --git a/src/main/java/me/goodandevil/skyblock/command/commands/island/KickCommand.java b/src/main/java/me/goodandevil/skyblock/command/commands/island/KickCommand.java deleted file mode 100644 index e585cc9d..00000000 --- a/src/main/java/me/goodandevil/skyblock/command/commands/island/KickCommand.java +++ /dev/null @@ -1,283 +0,0 @@ -package me.goodandevil.skyblock.command.commands.island; - -import me.goodandevil.skyblock.api.event.island.IslandKickEvent; -import me.goodandevil.skyblock.api.utils.APIUtil; -import me.goodandevil.skyblock.command.SubCommand; -import me.goodandevil.skyblock.config.FileManager; -import me.goodandevil.skyblock.config.FileManager.Config; -import me.goodandevil.skyblock.island.Island; -import me.goodandevil.skyblock.island.IslandManager; -import me.goodandevil.skyblock.island.IslandRole; -import me.goodandevil.skyblock.island.IslandWorld; -import me.goodandevil.skyblock.message.MessageManager; -import me.goodandevil.skyblock.playerdata.PlayerData; -import me.goodandevil.skyblock.playerdata.PlayerDataManager; -import me.goodandevil.skyblock.scoreboard.Scoreboard; -import me.goodandevil.skyblock.scoreboard.ScoreboardManager; -import me.goodandevil.skyblock.sound.SoundManager; -import me.goodandevil.skyblock.utils.player.OfflinePlayer; -import me.goodandevil.skyblock.utils.version.Sounds; -import me.goodandevil.skyblock.utils.world.LocationUtil; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.command.ConsoleCommandSender; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.entity.Player; - -import java.io.File; -import java.io.IOException; -import java.util.Set; -import java.util.UUID; - -public class KickCommand extends SubCommand { - - @Override - public void onCommandByPlayer(Player player, String[] args) { - PlayerDataManager playerDataManager = skyblock.getPlayerDataManager(); - ScoreboardManager scoreboardManager = skyblock.getScoreboardManager(); - MessageManager messageManager = skyblock.getMessageManager(); - IslandManager islandManager = skyblock.getIslandManager(); - SoundManager soundManager = skyblock.getSoundManager(); - FileManager fileManager = skyblock.getFileManager(); - - PlayerData playerData = playerDataManager.getPlayerData(player); - - Config languageConfig = fileManager.getConfig(new File(skyblock.getDataFolder(), "language.yml")); - - if (args.length == 1) { - Island island = islandManager.getIsland(player); - - if (island == null) { - messageManager.sendMessage(player, - languageConfig.getFileConfiguration().getString("Command.Island.Kick.Owner.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (island.hasRole(IslandRole.Owner, player.getUniqueId()) - || (island.hasRole(IslandRole.Operator, player.getUniqueId()) - && island.getSetting(IslandRole.Operator, "Kick").getStatus())) { - UUID targetPlayerUUID = null; - String targetPlayerName = null; - - Player targetPlayer = Bukkit.getServer().getPlayer(args[0]); - - if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban")) - return; - - Set islandMembers = island.getRole(IslandRole.Member), - islandOperators = island.getRole(IslandRole.Operator), - islandVisitors = islandManager.getVisitorsAtIsland(island); - - if (targetPlayer == null) { - OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]); - targetPlayerUUID = targetPlayerOffline.getUniqueId(); - targetPlayerName = targetPlayerOffline.getName(); - - if (skyblock.getEconomyManager().hasPermission(skyblock.getWorldManager().getWorld(IslandWorld.Normal).getName(), Bukkit.getOfflinePlayer(targetPlayerUUID), "fabledskyblock.bypass.ban")) - return; - } else { - targetPlayerUUID = targetPlayer.getUniqueId(); - targetPlayerName = targetPlayer.getName(); - } - - if (targetPlayerUUID.equals(player.getUniqueId())) { - messageManager.sendMessage(player, - languageConfig.getFileConfiguration().getString("Command.Island.Kick.Yourself.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (islandOperators.contains(player.getUniqueId()) - && islandOperators.contains(targetPlayerUUID)) { - messageManager.sendMessage(player, languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Role.Operator.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (island.getOwnerUUID().equals(targetPlayerUUID)) { - messageManager.sendMessage(player, - languageConfig.getFileConfiguration().getString("Command.Island.Kick.Role.Owner.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else if (island.isOpen() && islandVisitors.contains(targetPlayerUUID) && targetPlayer != null) { - if (island.isCoopPlayer(targetPlayerUUID)) { - messageManager.sendMessage(player, - languageConfig.getFileConfiguration().getString("Command.Island.Kick.Cooped.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } else { - IslandKickEvent islandKickEvent = new IslandKickEvent(island.getAPIWrapper(), - APIUtil.fromImplementation(IslandRole.Visitor), - Bukkit.getServer().getOfflinePlayer(targetPlayerUUID), player); - Bukkit.getServer().getPluginManager().callEvent(islandKickEvent); - - if (!islandKickEvent.isCancelled()) { - LocationUtil.teleportPlayerToSpawn(targetPlayer); - - messageManager.sendMessage(player, - languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Kicked.Sender.Message") - .replace("%player", targetPlayerName)); - soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); - - messageManager.sendMessage(targetPlayer, - languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Kicked.Target.Message") - .replace("%player", player.getName())); - soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); - } - } - } else if (islandMembers.contains(targetPlayerUUID) || islandOperators.contains(targetPlayerUUID)) { - IslandRole islandRole = IslandRole.Member; - - if (islandOperators.contains(targetPlayerUUID)) { - islandRole = IslandRole.Operator; - } - - IslandKickEvent islandKickEvent = new IslandKickEvent(island.getAPIWrapper(), - APIUtil.fromImplementation(islandRole), - Bukkit.getServer().getOfflinePlayer(targetPlayerUUID), player); - Bukkit.getServer().getPluginManager().callEvent(islandKickEvent); - - if (!islandKickEvent.isCancelled()) { - messageManager.sendMessage(player, - languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Kicked.Sender.Message") - .replace("%player", targetPlayerName)); - soundManager.playSound(player, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); - - if (targetPlayer == null) { - Config config = fileManager - .getConfig(new File(new File(skyblock.getDataFolder().toString() + "/player-data"), - targetPlayerUUID.toString() + ".yml")); - FileConfiguration configLoad = config.getFileConfiguration(); - - configLoad.set("Statistics.Island.Playtime", null); - configLoad.set("Statistics.Island.Join", null); - configLoad.set("Island.Owner", null); - - try { - configLoad.save(config.getFile()); - } catch (IOException e) { - e.printStackTrace(); - } - } else { - messageManager.sendMessage(targetPlayer, - languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Kicked.Target.Message") - .replace("%player", player.getName())); - soundManager.playSound(targetPlayer, Sounds.IRONGOLEM_HIT.bukkitSound(), 1.0F, 1.0F); - - if (islandManager.isPlayerAtIsland(island, targetPlayer)) { - LocationUtil.teleportPlayerToSpawn(targetPlayer); - } - - if (scoreboardManager != null) { - Scoreboard scoreboard = scoreboardManager.getScoreboard(targetPlayer); - scoreboard.cancel(); - scoreboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', languageConfig - .getFileConfiguration().getString("Scoreboard.Tutorial.Displayname"))); - scoreboard.setDisplayList(languageConfig.getFileConfiguration() - .getStringList("Scoreboard.Tutorial.Displaylines")); - scoreboard.run(); - } - - playerData = playerDataManager.getPlayerData(targetPlayer); - playerData.setPlaytime(0); - playerData.setMemberSince(null); - playerData.setOwner(null); - playerData.setChat(false); - playerData.save(); - } - - if (islandMembers.contains(targetPlayerUUID)) { - island.removeRole(IslandRole.Member, targetPlayerUUID); - } else if (islandOperators.contains(targetPlayerUUID)) { - island.removeRole(IslandRole.Operator, targetPlayerUUID); - } - - island.save(); - - Set islandMembersOnline = islandManager.getMembersOnline(island); - - if (islandMembersOnline.size() == 1) { - for (UUID islandMembersOnlineList : islandMembersOnline) { - if (!islandMembersOnlineList.equals(player.getUniqueId())) { - targetPlayer = Bukkit.getServer().getPlayer(islandMembersOnlineList); - PlayerData targetPlayerData = playerDataManager.getPlayerData(targetPlayer); - - if (targetPlayerData.isChat()) { - targetPlayerData.setChat(false); - messageManager.sendMessage(targetPlayer, fileManager - .getConfig(new File(skyblock.getDataFolder(), "language.yml")) - .getFileConfiguration().getString("Island.Chat.Untoggled.Message")); - } - } - } - } - - if (scoreboardManager != null) { - if (island.getRole(IslandRole.Member).size() == 0 - && island.getRole(IslandRole.Operator).size() == 0) { - Scoreboard scoreboard = scoreboardManager.getScoreboard(player); - scoreboard.cancel(); - scoreboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', languageConfig - .getFileConfiguration().getString("Scoreboard.Island.Solo.Displayname"))); - - if (islandManager.getVisitorsAtIsland(island).size() == 0) { - scoreboard.setDisplayList(languageConfig.getFileConfiguration() - .getStringList("Scoreboard.Island.Solo.Empty.Displaylines")); - } else { - scoreboard.setDisplayList(languageConfig.getFileConfiguration() - .getStringList("Scoreboard.Island.Solo.Occupied.Displaylines")); - } - - scoreboard.run(); - } - } - } - } else { - if (island.isOpen()) { - messageManager.sendMessage(player, languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Occupant.Visit.Open.Message")); - } else { - messageManager.sendMessage(player, languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Occupant.Visit.Closed.Message")); - } - - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } - } else { - if (island.isOpen()) { - messageManager.sendMessage(player, languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Permission.Visit.Open.Message")); - } else { - messageManager.sendMessage(player, languageConfig.getFileConfiguration() - .getString("Command.Island.Kick.Permission.Visit.Closed.Message")); - } - - soundManager.playSound(player, Sounds.VILLAGER_NO.bukkitSound(), 1.0F, 1.0F); - } - } else { - messageManager.sendMessage(player, - languageConfig.getFileConfiguration().getString("Command.Island.Kick.Invalid.Message")); - soundManager.playSound(player, Sounds.ANVIL_LAND.bukkitSound(), 1.0F, 1.0F); - } - } - - @Override - public void onCommandByConsole(ConsoleCommandSender sender, String[] args) { - sender.sendMessage("SkyBlock | Error: You must be a player to perform that command."); - } - - @Override - public String getName() { - return "kick"; - } - - @Override - public String getInfoMessagePath() { - return "Command.Island.Kick.Info.Message"; - } - - @Override - public String[] getAliases() { - return new String[0]; - } - - @Override - public String[] getArguments() { - return new String[0]; - } -}