From 174ac8d8daf651a2cb00c2af0482894585feeffc Mon Sep 17 00:00:00 2001 From: Tofpu Date: Fri, 23 Feb 2024 02:11:10 +0200 Subject: [PATCH] v1.1.4 - bugfixes (#43) * Bump Lamp (command framework) to version `3.1.7` (#37) * Allow offline player data to be reset (#40) * Add JetBrains to `thank you` section * Sort session leaderboard (#42) * Bump the next release of sb2 to 1.1.3 * Remove empty directories, and rename `speedbridge-spigot-plugin` to just `spigot` * Make sure player is online before teleporting them to the lobby * Bump patch version to 1.1.4 --- README.md | 1 + build.gradle.kts | 5 +- ...ld.gradle.kts => gradle-wrapper.properties | 0 settings.gradle.kts | 4 +- speedbridge2-spigot-api/build.gradle.kts | 0 .../build.gradle.kts | 10 +- .../io/tofpu/speedbridge2/SpeedBridge.java | 0 .../command/AbstractLampRegistry.java | 0 .../speedbridge2/command/CommandManager.java | 0 .../speedbridge2/command/NameAndUUID.java | 21 ++++ .../AbstractCommandConditionWrapper.java | 0 .../condition/LampConditionRegistry.java | 0 .../condition/RestrictConsoleCondition.java | 0 .../RestrictDummyModelCondition.java | 0 .../condition/RestrictSetupCondition.java | 0 .../condition/annotation/RestrictConsole.java | 0 .../annotation/RestrictDummyModel.java | 0 .../condition/annotation/RestrictSetup.java | 0 .../command/context/AbstractLampContext.java | 0 .../command/context/GameIslandContext.java | 0 .../command/context/LampContextRegistry.java | 0 .../command/parser/AbstractLampParser.java | 0 .../command/parser/IslandParser.java | 0 .../command/parser/LampParseRegistry.java | 0 .../command/parser/NameAndUUIDParser.java | 24 +++++ .../command/parser/PlayerUUIDParser.java | 0 .../command/parser/annotation/PlayerUUID.java | 0 .../command/subcommand/CommandCompletion.java | 0 .../subcommand/HelpCommandGenerator.java | 0 .../subcommand/SpeedBridgeCommand.java | 62 +++++------- .../subcommand/debug/DestroyableLand.java | 0 .../subcommand/debug/EmptyBridgePlayer.java | 0 .../command/subcommand/debug/GameIsland2.java | 0 .../debug/SpeedBridgeDebugCommand.java | 0 .../speedbridge2/listener/GameListener.java | 0 .../game/GameInteractionListener.java | 0 .../listener/game/GameProtectionListener.java | 0 .../general/GeneralPluginListener.java | 0 .../general/PlayerConnectionListener.java | 0 .../island/IslandProtectionListener.java | 0 .../listener/island/IslandRegionListener.java | 0 .../listener/wrapper/EventWrapper.java | 0 .../listener/wrapper/SpeedBridgeListener.java | 0 .../wrappers/BlockBreakEventWrapper.java | 0 .../wrappers/BlockPlaceEventWrapper.java | 0 .../wrappers/PlayerInteractEventWrapper.java | 0 .../model/blockmenu/BlockMenuManager.java | 0 .../blockmenu/holder/BlockMenuHolder.java | 0 .../blockmenu/listener/BlockMenuListener.java | 0 .../speedbridge2/model/common/Message.java | 0 .../model/common/PlayerNameCache.java | 0 .../model/common/PluginExecutor.java | 0 .../common/config/ItemConfiguration.java | 0 .../common/config/PluginConfiguration.java | 0 .../config/category/BlockMenuCategory.java | 0 .../common/config/category/GameCategory.java | 0 .../config/category/GeneralCategory.java | 0 .../config/category/LeaderboardCategory.java | 0 .../common/config/category/LobbyCategory.java | 0 .../config/manager/ConfigurationManager.java | 0 .../AbstractItemActionSerializer.java | 0 .../config/serializer/ItemMetaSerializer.java | 0 .../serializer/ItemStackSerializer.java | 0 .../config/serializer/LocationSerializer.java | 0 .../config/serializer/MaterialSerializer.java | 0 .../serializer/UmbrellaItemSerializer.java | 0 .../common/database/DatabaseManager.java | 0 .../model/common/database/Databases.java | 0 .../common/database/wrapper/Database.java | 0 .../database/wrapper/DatabaseQuery.java | 0 .../common/database/wrapper/DatabaseSet.java | 0 .../database/wrapper/DatabaseTable.java | 0 .../presenter/MessagePresenterBase.java | 0 .../presenter/MessagePresenterHolder.java | 0 .../presenter/MessagePresenterHolderImpl.java | 0 .../presenter/type/MessagePairPresenter.java | 0 .../presenter/type/MessageTreePresenter.java | 0 .../common/umbrella/RunCommandItemAction.java | 0 .../umbrella/SerializableUmbrellaItem.java | 0 .../model/common/util/BridgeUtil.java | 0 .../model/common/util/DatabaseUtil.java | 0 .../model/common/util/FileUtil.java | 0 .../model/common/util/IgnoreMessage.java | 0 .../model/common/util/MessageUtil.java | 0 .../model/common/util/ReflectionUtil.java | 0 .../model/common/util/UmbrellaUtil.java | 0 .../model/common/util/UpdateChecker.java | 0 .../model/common/wrapper/ConfigurateFile.java | 0 .../common/wrapper/FileConfigurationType.java | 0 .../model/island/IslandDatabase.java | 0 .../model/island/IslandFactory.java | 0 .../model/island/IslandHandler.java | 0 .../model/island/IslandRepository.java | 0 .../model/island/IslandService.java | 0 .../model/island/arena/ArenaManager.java | 0 .../IslandDatabaseExceptionWrapper.java | 0 .../exception/IslandLoadFailureException.java | 0 .../model/island/object/EmptyIsland.java | 0 .../model/island/object/GameIsland.java | 0 .../model/island/object/Island.java | 0 .../model/island/object/IslandBuild.java | 0 .../model/island/object/IslandBuilder.java | 0 .../model/island/object/land/IslandLand.java | 0 .../island/object/setup/IslandBuildSetup.java | 0 .../island/object/setup/IslandSetup.java | 20 ++-- .../object/setup/IslandSetupFactory.java | 0 .../object/setup/IslandSetupHandler.java | 0 .../setup/umbrella/IslandSetupUmbrella.java | 0 .../object/umbrella/GameIslandUmbrella.java | 0 .../model/leaderboard/IslandBoard.java | 0 .../model/leaderboard/Leaderboard.java | 99 ++++++++++--------- .../model/leaderboard/LeaderboardMap.java | 0 .../model/leaderboard/loader/BoardLoader.java | 0 .../leaderboard/loader/IslandLoader.java | 0 .../loader/PlayerPositionLoader.java | 0 .../model/leaderboard/object/BoardPlayer.java | 0 .../leaderboard/object/IslandBoardPlayer.java | 0 .../model/player/PlayerDatabase.java | 0 .../model/player/PlayerFactory.java | 0 .../model/player/PlayerHandler.java | 21 ++-- .../model/player/PlayerService.java | 8 +- .../speedbridge2/model/player/ResetType.java | 5 + .../PlayerDatabaseExceptionWrapper.java | 0 .../PlayerDeletionFailureException.java | 0 .../exception/PlayerLoadFailureException.java | 0 .../PlayerUpdateFailureException.java | 0 .../PlayerUpdateNameFailureException.java | 0 .../model/player/loader/PlayerLoader.java | 0 .../model/player/object/BridgePlayer.java | 4 +- .../player/object/CommonBridgePlayer.java | 0 .../player/object/DummyBridgePlayer.java | 0 .../model/player/object/GamePlayer.java | 0 .../player/object/SenderBridgePlayer.java | 0 .../player/object/block/BlockChoice.java | 0 .../player/object/block/BlockDatabase.java | 0 .../model/player/object/score/Score.java | 0 .../player/object/score/ScoreDatabase.java | 2 +- .../player/object/session/SessionScore.java | 0 .../model/player/object/setup/SetupMeta.java | 0 .../model/player/object/stat/PlayerStat.java | 0 .../player/object/stat/PlayerStatType.java | 0 .../player/object/stat/StatsDatabase.java | 2 +- .../object/stat/type/SimplePlayerStat.java | 0 .../placeholderapi/PluginExpansion.java | 0 .../expansion/AbstractExpansion.java | 0 .../expansion/ExpansionHandler.java | 0 .../expansions/BestScoreExpansion.java | 0 .../expansion/expansions/BlocksExpansion.java | 0 .../expansions/IslandSlotExpansion.java | 0 .../expansions/LeaderboardExpansion.java | 0 .../expansions/PositionExpansion.java | 0 .../expansion/expansions/TimerExpansion.java | 0 .../expansions/TotalStatsExpansion.java | 0 .../model/support/worldedit/CuboidRegion.java | 0 .../model/support/worldedit/Vector.java | 0 .../plugin/SpeedBridgePlugin.java | 0 .../src/main/resources/plugin.yml | 0 157 files changed, 169 insertions(+), 119 deletions(-) rename speedbridge2-common/build.gradle.kts => gradle-wrapper.properties (100%) delete mode 100644 speedbridge2-spigot-api/build.gradle.kts rename {speedbridge2-spigot-plugin => spigot}/build.gradle.kts (88%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/SpeedBridge.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/AbstractLampRegistry.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/CommandManager.java (100%) create mode 100644 spigot/src/main/java/io/tofpu/speedbridge2/command/NameAndUUID.java rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/AbstractCommandConditionWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/LampConditionRegistry.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictConsoleCondition.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictDummyModelCondition.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictSetupCondition.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictConsole.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictDummyModel.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictSetup.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/context/AbstractLampContext.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/context/GameIslandContext.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/context/LampContextRegistry.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/parser/AbstractLampParser.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/parser/IslandParser.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/parser/LampParseRegistry.java (100%) create mode 100644 spigot/src/main/java/io/tofpu/speedbridge2/command/parser/NameAndUUIDParser.java rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/parser/PlayerUUIDParser.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/parser/annotation/PlayerUUID.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/CommandCompletion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/HelpCommandGenerator.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java (91%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/DestroyableLand.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/EmptyBridgePlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/GameIsland2.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/SpeedBridgeDebugCommand.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/GameListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/game/GameInteractionListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/game/GameProtectionListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/general/GeneralPluginListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/general/PlayerConnectionListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/island/IslandProtectionListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/island/IslandRegionListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/wrapper/EventWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/wrapper/SpeedBridgeListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockBreakEventWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockPlaceEventWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/PlayerInteractEventWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/blockmenu/BlockMenuManager.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/blockmenu/holder/BlockMenuHolder.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/blockmenu/listener/BlockMenuListener.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/Message.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/PlayerNameCache.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/PluginExecutor.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/ItemConfiguration.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/PluginConfiguration.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/category/BlockMenuCategory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GameCategory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GeneralCategory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LeaderboardCategory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LobbyCategory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/manager/ConfigurationManager.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/AbstractItemActionSerializer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemMetaSerializer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemStackSerializer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/LocationSerializer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/MaterialSerializer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/UmbrellaItemSerializer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/database/DatabaseManager.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/database/Databases.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/Database.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseQuery.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseSet.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseTable.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterBase.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolder.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolderImpl.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessagePairPresenter.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessageTreePresenter.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/RunCommandItemAction.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/SerializableUmbrellaItem.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/BridgeUtil.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/DatabaseUtil.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/FileUtil.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/IgnoreMessage.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/MessageUtil.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/ReflectionUtil.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/UmbrellaUtil.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/util/UpdateChecker.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/ConfigurateFile.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/FileConfigurationType.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/IslandDatabase.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/IslandFactory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/IslandHandler.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/IslandRepository.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/IslandService.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/arena/ArenaManager.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandDatabaseExceptionWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandLoadFailureException.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/EmptyIsland.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/GameIsland.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/Island.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuild.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuilder.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/land/IslandLand.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandBuildSetup.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java (91%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupFactory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupHandler.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/umbrella/IslandSetupUmbrella.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/island/object/umbrella/GameIslandUmbrella.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/IslandBoard.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java (73%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/LeaderboardMap.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/BoardLoader.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/IslandLoader.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/PlayerPositionLoader.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/BoardPlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/IslandBoardPlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/PlayerDatabase.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/PlayerFactory.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java (92%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java (94%) create mode 100644 spigot/src/main/java/io/tofpu/speedbridge2/model/player/ResetType.java rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDatabaseExceptionWrapper.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDeletionFailureException.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerLoadFailureException.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateFailureException.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateNameFailureException.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/loader/PlayerLoader.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java (98%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/CommonBridgePlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/DummyBridgePlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/GamePlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/SenderBridgePlayer.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockChoice.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockDatabase.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/score/Score.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java (98%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/session/SessionScore.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/setup/SetupMeta.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStat.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStatType.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java (98%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/type/SimplePlayerStat.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/PluginExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/AbstractExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/ExpansionHandler.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BestScoreExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BlocksExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/IslandSlotExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/LeaderboardExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/PositionExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TimerExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TotalStatsExpansion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/CuboidRegion.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/Vector.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/java/io/tofpu/speedbridge2/plugin/SpeedBridgePlugin.java (100%) rename {speedbridge2-spigot-plugin => spigot}/src/main/resources/plugin.yml (100%) diff --git a/README.md b/README.md index 6648ee1e..3b1ea94c 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ __Dependencies__ - PlaceholderAPI (Optional) __Thanks to__ +- [JetBrains](https://www.jetbrains.com/community/opensource/) - [GitBook](https://gitbook.com) - [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html) diff --git a/build.gradle.kts b/build.gradle.kts index 5124c46a..b19b2dd7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,7 @@ allprojects { } group = "io.tofpu.speedbridge2" - version = "1.1.0-" + "git rev-parse --short=8 HEAD".runCommand(rootDir) + version = "1.1.4-" + "git rev-parse --short=8 HEAD".runCommand(rootDir) repositories { mavenLocal() @@ -29,7 +29,7 @@ allprojects { dependencies { compileOnly("org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT") - implementation("com.github.Revxrsal.Lamp:common:3.0.3") + implementation("com.github.Revxrsal.Lamp:common:3.1.7") implementation("net.kyori:adventure-api:4.10.1") implementation("net.kyori:adventure-text-minimessage:4.10.1") @@ -55,6 +55,7 @@ allprojects { options.encoding = "UTF-8" options.compilerArgs.plusAssign("-parameters") sourceCompatibility = "8" + targetCompatibility = "8" } build { diff --git a/speedbridge2-common/build.gradle.kts b/gradle-wrapper.properties similarity index 100% rename from speedbridge2-common/build.gradle.kts rename to gradle-wrapper.properties diff --git a/settings.gradle.kts b/settings.gradle.kts index 66857bba..f3cad431 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,2 @@ rootProject.name = "SpeedBridge2" -include("speedbridge2-common") -include("speedbridge2-spigot-api") -include("speedbridge2-spigot-plugin") +include("spigot") diff --git a/speedbridge2-spigot-api/build.gradle.kts b/speedbridge2-spigot-api/build.gradle.kts deleted file mode 100644 index e69de29b..00000000 diff --git a/speedbridge2-spigot-plugin/build.gradle.kts b/spigot/build.gradle.kts similarity index 88% rename from speedbridge2-spigot-plugin/build.gradle.kts rename to spigot/build.gradle.kts index 7f6bb267..68a87851 100644 --- a/speedbridge2-spigot-plugin/build.gradle.kts +++ b/spigot/build.gradle.kts @@ -3,12 +3,10 @@ plugins { } dependencies { - implementation(project(":speedbridge2-common")) - compileOnly("org.xerial:sqlite-jdbc:3.36.0.3") compileOnly("com.sk89q:worldedit:6.0.0-SNAPSHOT") - implementation("com.github.Revxrsal.Lamp:bukkit:3.0.7") + implementation("com.github.Revxrsal.Lamp:bukkit:3.1.7") implementation("net.kyori:adventure-platform-bukkit:4.0.1") implementation("com.github.tofpu:DynamicClass:1.1") { @@ -58,8 +56,8 @@ tasks { } runServer { - minecraftVersion("1.20") - pluginJars(project.file("libs/worldedit-bukkit-7.2.15.jar")) -// pluginJars(project.file("libs/worldedit-bukkit-6.1.jar"))d + minecraftVersion("1.8.8") +// pluginJars(project.file("libs/worldedit-bukkit-7.2.15.jar")) + pluginJars(project.file("libs/worldedit-bukkit-6.1.jar")) } } \ No newline at end of file diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/SpeedBridge.java b/spigot/src/main/java/io/tofpu/speedbridge2/SpeedBridge.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/SpeedBridge.java rename to spigot/src/main/java/io/tofpu/speedbridge2/SpeedBridge.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/AbstractLampRegistry.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/AbstractLampRegistry.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/AbstractLampRegistry.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/AbstractLampRegistry.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/CommandManager.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/CommandManager.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/CommandManager.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/CommandManager.java diff --git a/spigot/src/main/java/io/tofpu/speedbridge2/command/NameAndUUID.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/NameAndUUID.java new file mode 100644 index 00000000..bd366936 --- /dev/null +++ b/spigot/src/main/java/io/tofpu/speedbridge2/command/NameAndUUID.java @@ -0,0 +1,21 @@ +package io.tofpu.speedbridge2.command; + +import java.util.UUID; + +public class NameAndUUID { + private final String playerName; + private final UUID playerUUID; + + public NameAndUUID(String playerName, UUID playerUUID) { + this.playerName = playerName; + this.playerUUID = playerUUID; + } + + public String playerName() { + return playerName; + } + + public UUID playerUUID() { + return playerUUID; + } +} diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/AbstractCommandConditionWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/AbstractCommandConditionWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/AbstractCommandConditionWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/AbstractCommandConditionWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/LampConditionRegistry.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/LampConditionRegistry.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/LampConditionRegistry.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/LampConditionRegistry.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictConsoleCondition.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictConsoleCondition.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictConsoleCondition.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictConsoleCondition.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictDummyModelCondition.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictDummyModelCondition.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictDummyModelCondition.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictDummyModelCondition.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictSetupCondition.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictSetupCondition.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictSetupCondition.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/RestrictSetupCondition.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictConsole.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictConsole.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictConsole.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictConsole.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictDummyModel.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictDummyModel.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictDummyModel.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictDummyModel.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictSetup.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictSetup.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictSetup.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/condition/annotation/RestrictSetup.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/context/AbstractLampContext.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/context/AbstractLampContext.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/context/AbstractLampContext.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/context/AbstractLampContext.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/context/GameIslandContext.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/context/GameIslandContext.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/context/GameIslandContext.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/context/GameIslandContext.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/context/LampContextRegistry.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/context/LampContextRegistry.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/context/LampContextRegistry.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/context/LampContextRegistry.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/AbstractLampParser.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/AbstractLampParser.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/AbstractLampParser.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/parser/AbstractLampParser.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/IslandParser.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/IslandParser.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/IslandParser.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/parser/IslandParser.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/LampParseRegistry.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/LampParseRegistry.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/LampParseRegistry.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/parser/LampParseRegistry.java diff --git a/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/NameAndUUIDParser.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/NameAndUUIDParser.java new file mode 100644 index 00000000..dfde874d --- /dev/null +++ b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/NameAndUUIDParser.java @@ -0,0 +1,24 @@ +package io.tofpu.speedbridge2.command.parser; + +import io.tofpu.dynamicclass.meta.AutoRegister; +import io.tofpu.speedbridge2.command.NameAndUUID; +import revxrsal.commands.process.ValueResolver; + +import java.util.UUID; + +@AutoRegister +public class NameAndUUIDParser extends AbstractLampParser { + private final AbstractLampParser uuidParser; + + public NameAndUUIDParser(LampParseRegistry registry, PlayerUUIDParser uuidParser) { + super(NameAndUUID.class, registry); + this.uuidParser = uuidParser; + } + + @Override + NameAndUUID parse(ValueResolver.ValueResolverContext context) { + String name = context.arguments().peekFirst(); + UUID parsedUUID = uuidParser.parse(context); + return new NameAndUUID(name, parsedUUID); + } +} diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/PlayerUUIDParser.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/PlayerUUIDParser.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/PlayerUUIDParser.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/parser/PlayerUUIDParser.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/annotation/PlayerUUID.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/parser/annotation/PlayerUUID.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/parser/annotation/PlayerUUID.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/parser/annotation/PlayerUUID.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/CommandCompletion.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/CommandCompletion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/CommandCompletion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/CommandCompletion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/HelpCommandGenerator.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/HelpCommandGenerator.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/HelpCommandGenerator.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/HelpCommandGenerator.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java similarity index 91% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java index 65772d70..a5101ab5 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/SpeedBridgeCommand.java @@ -1,5 +1,6 @@ package io.tofpu.speedbridge2.command.subcommand; +import io.tofpu.speedbridge2.command.NameAndUUID; import io.tofpu.speedbridge2.command.condition.annotation.RestrictConsole; import io.tofpu.speedbridge2.command.condition.annotation.RestrictDummyModel; import io.tofpu.speedbridge2.command.condition.annotation.RestrictSetup; @@ -17,6 +18,7 @@ import io.tofpu.speedbridge2.model.island.object.setup.IslandSetup; import io.tofpu.speedbridge2.model.island.object.setup.IslandSetupHandler; import io.tofpu.speedbridge2.model.player.PlayerService; +import io.tofpu.speedbridge2.model.player.ResetType; import io.tofpu.speedbridge2.model.player.object.BridgePlayer; import io.tofpu.speedbridge2.model.player.object.CommonBridgePlayer; import io.tofpu.speedbridge2.model.player.object.score.Score; @@ -26,14 +28,9 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import revxrsal.commands.annotation.AutoComplete; -import revxrsal.commands.annotation.Command; -import revxrsal.commands.annotation.Default; -import revxrsal.commands.annotation.Description; -import revxrsal.commands.annotation.Flag; -import revxrsal.commands.annotation.Subcommand; -import revxrsal.commands.annotation.Usage; +import revxrsal.commands.annotation.*; import revxrsal.commands.bukkit.annotation.CommandPermission; +import revxrsal.commands.bukkit.exception.MalformedEntitySelectorException; import java.util.ArrayList; import java.util.List; @@ -65,7 +62,7 @@ public SpeedBridgeCommand(final PlayerService playerService, final IslandService this.islandService = islandService; } - @Default + @DefaultFor("~") @Description("The Main Command") public String defaultCommand() { return INSTANCE.noArgument; @@ -138,31 +135,27 @@ public String onIslandDelete(final Island target) { @Description("Resets player properties") @CommandPermission("speedbridge.player.reset") @AutoComplete("@players *") - public void onPlayerReset(final CommonBridgePlayer sender, final @PlayerUUID UUID target, + public void onPlayerReset(final CommonBridgePlayer sender, final @PlayerUUID NameAndUUID target, final ResetType type) { - final BridgePlayer targetPlayer = playerService.getIfPresent(target); - - if (targetPlayer == null) { - throw new IllegalStateException(BridgeUtil.miniMessageToLegacy(INSTANCE.playerDoesntExist)); - } - - switch (type) { - case ALL: - onCompletion(targetPlayer.reset(), (Void) -> { - BridgeUtil.sendMessage(sender, String.format(INSTANCE.playerWiped, targetPlayer.getName())); - }); - break; - case SCORES: - onCompletion(targetPlayer.resetScores(), (Void) -> { - BridgeUtil.sendMessage(sender, String.format(INSTANCE.playerScoreReset, targetPlayer.getName())); - }); - break; - case STATS: - onCompletion(targetPlayer.resetStats(), (Void) -> { - BridgeUtil.sendMessage(sender, String.format(INSTANCE.playerStatsReset, targetPlayer.getName())); - }); - break; - } + String targetName = target.playerName(); + UUID targetId = target.playerUUID(); + + onCompletion(playerService.reset(targetId, type), unused -> { + String message = null; + switch (type) { + case ALL: + message = String.format(INSTANCE.playerWiped, targetName); + break; + case SCORES: + message = String.format(INSTANCE.playerScoreReset, targetName); + break; + case STATS: + message = String.format(INSTANCE.playerStatsReset, targetName); + break; + } + if (message == null) return; + BridgeUtil.sendMessage(sender, message); + }); } @Subcommand("modify") @@ -376,7 +369,6 @@ private Optional getRandomIsland() { @RestrictDummyModel @RestrictSetup @RestrictConsole - @Default public String onStartSetup(final BridgePlayer bridgePlayer, final Island island) { if (!isGeneralSetupComplete(bridgePlayer)) { return ""; @@ -456,8 +448,4 @@ private void onCompletion(final CompletableFuture future, final Consumer< consumer.accept(t); }); } - - public enum ResetType { - ALL, SCORES, STATS - } } diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/DestroyableLand.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/DestroyableLand.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/DestroyableLand.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/DestroyableLand.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/EmptyBridgePlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/EmptyBridgePlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/EmptyBridgePlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/EmptyBridgePlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/GameIsland2.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/GameIsland2.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/GameIsland2.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/GameIsland2.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/SpeedBridgeDebugCommand.java b/spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/SpeedBridgeDebugCommand.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/SpeedBridgeDebugCommand.java rename to spigot/src/main/java/io/tofpu/speedbridge2/command/subcommand/debug/SpeedBridgeDebugCommand.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/GameListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/GameListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/GameListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/GameListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/game/GameInteractionListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/game/GameInteractionListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/game/GameInteractionListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/game/GameInteractionListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/game/GameProtectionListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/game/GameProtectionListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/game/GameProtectionListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/game/GameProtectionListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/general/GeneralPluginListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/general/GeneralPluginListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/general/GeneralPluginListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/general/GeneralPluginListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/general/PlayerConnectionListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/general/PlayerConnectionListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/general/PlayerConnectionListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/general/PlayerConnectionListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/island/IslandProtectionListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/island/IslandProtectionListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/island/IslandProtectionListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/island/IslandProtectionListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/island/IslandRegionListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/island/IslandRegionListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/island/IslandRegionListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/island/IslandRegionListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/EventWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/EventWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/EventWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/EventWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/SpeedBridgeListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/SpeedBridgeListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/SpeedBridgeListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/SpeedBridgeListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockBreakEventWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockBreakEventWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockBreakEventWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockBreakEventWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockPlaceEventWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockPlaceEventWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockPlaceEventWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/BlockPlaceEventWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/PlayerInteractEventWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/PlayerInteractEventWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/PlayerInteractEventWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/listener/wrapper/wrappers/PlayerInteractEventWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/blockmenu/BlockMenuManager.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/blockmenu/BlockMenuManager.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/blockmenu/BlockMenuManager.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/blockmenu/BlockMenuManager.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/blockmenu/holder/BlockMenuHolder.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/blockmenu/holder/BlockMenuHolder.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/blockmenu/holder/BlockMenuHolder.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/blockmenu/holder/BlockMenuHolder.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/blockmenu/listener/BlockMenuListener.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/blockmenu/listener/BlockMenuListener.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/blockmenu/listener/BlockMenuListener.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/blockmenu/listener/BlockMenuListener.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/Message.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/Message.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/Message.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/Message.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/PlayerNameCache.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/PlayerNameCache.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/PlayerNameCache.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/PlayerNameCache.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/PluginExecutor.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/PluginExecutor.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/PluginExecutor.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/PluginExecutor.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/ItemConfiguration.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/ItemConfiguration.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/ItemConfiguration.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/ItemConfiguration.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/PluginConfiguration.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/PluginConfiguration.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/PluginConfiguration.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/PluginConfiguration.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/BlockMenuCategory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/BlockMenuCategory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/BlockMenuCategory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/BlockMenuCategory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GameCategory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GameCategory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GameCategory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GameCategory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GeneralCategory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GeneralCategory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GeneralCategory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/GeneralCategory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LeaderboardCategory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LeaderboardCategory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LeaderboardCategory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LeaderboardCategory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LobbyCategory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LobbyCategory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LobbyCategory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/category/LobbyCategory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/manager/ConfigurationManager.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/manager/ConfigurationManager.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/manager/ConfigurationManager.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/manager/ConfigurationManager.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/AbstractItemActionSerializer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/AbstractItemActionSerializer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/AbstractItemActionSerializer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/AbstractItemActionSerializer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemMetaSerializer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemMetaSerializer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemMetaSerializer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemMetaSerializer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemStackSerializer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemStackSerializer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemStackSerializer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/ItemStackSerializer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/LocationSerializer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/LocationSerializer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/LocationSerializer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/LocationSerializer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/MaterialSerializer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/MaterialSerializer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/MaterialSerializer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/MaterialSerializer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/UmbrellaItemSerializer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/UmbrellaItemSerializer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/UmbrellaItemSerializer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/config/serializer/UmbrellaItemSerializer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/DatabaseManager.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/DatabaseManager.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/DatabaseManager.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/DatabaseManager.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/Databases.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/Databases.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/Databases.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/Databases.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/Database.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/Database.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/Database.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/Database.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseQuery.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseQuery.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseQuery.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseQuery.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseSet.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseSet.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseSet.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseSet.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseTable.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseTable.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseTable.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/database/wrapper/DatabaseTable.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterBase.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterBase.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterBase.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterBase.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolder.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolder.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolder.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolder.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolderImpl.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolderImpl.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolderImpl.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/MessagePresenterHolderImpl.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessagePairPresenter.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessagePairPresenter.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessagePairPresenter.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessagePairPresenter.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessageTreePresenter.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessageTreePresenter.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessageTreePresenter.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/presenter/type/MessageTreePresenter.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/RunCommandItemAction.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/RunCommandItemAction.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/RunCommandItemAction.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/RunCommandItemAction.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/SerializableUmbrellaItem.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/SerializableUmbrellaItem.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/SerializableUmbrellaItem.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/umbrella/SerializableUmbrellaItem.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/BridgeUtil.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/BridgeUtil.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/BridgeUtil.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/BridgeUtil.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/DatabaseUtil.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/DatabaseUtil.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/DatabaseUtil.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/DatabaseUtil.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/FileUtil.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/FileUtil.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/FileUtil.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/FileUtil.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/IgnoreMessage.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/IgnoreMessage.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/IgnoreMessage.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/IgnoreMessage.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/MessageUtil.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/MessageUtil.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/MessageUtil.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/MessageUtil.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/ReflectionUtil.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/ReflectionUtil.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/ReflectionUtil.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/ReflectionUtil.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/UmbrellaUtil.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/UmbrellaUtil.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/UmbrellaUtil.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/UmbrellaUtil.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/UpdateChecker.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/UpdateChecker.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/util/UpdateChecker.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/util/UpdateChecker.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/ConfigurateFile.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/ConfigurateFile.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/ConfigurateFile.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/ConfigurateFile.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/FileConfigurationType.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/FileConfigurationType.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/FileConfigurationType.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/common/wrapper/FileConfigurationType.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandDatabase.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandDatabase.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandDatabase.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandDatabase.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandFactory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandFactory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandFactory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandFactory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandHandler.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandHandler.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandHandler.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandHandler.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandRepository.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandRepository.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandRepository.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandRepository.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandService.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandService.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/IslandService.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/IslandService.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/arena/ArenaManager.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/arena/ArenaManager.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/arena/ArenaManager.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/arena/ArenaManager.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandDatabaseExceptionWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandDatabaseExceptionWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandDatabaseExceptionWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandDatabaseExceptionWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandLoadFailureException.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandLoadFailureException.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandLoadFailureException.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/exception/IslandLoadFailureException.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/EmptyIsland.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/EmptyIsland.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/EmptyIsland.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/EmptyIsland.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/GameIsland.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/GameIsland.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/GameIsland.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/GameIsland.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/Island.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/Island.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/Island.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/Island.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuild.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuild.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuild.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuild.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuilder.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuilder.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuilder.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/IslandBuilder.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/land/IslandLand.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/land/IslandLand.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/land/IslandLand.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/land/IslandLand.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandBuildSetup.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandBuildSetup.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandBuildSetup.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandBuildSetup.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java similarity index 91% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java index 1b2ac5eb..7e0d4b23 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetup.java @@ -13,6 +13,7 @@ import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.entity.Player; import java.util.UUID; @@ -169,10 +170,11 @@ public void cancel() { resetState(); - // teleporting the player to the lobby location - player.getPlayer() - .teleport(ConfigurationManager.INSTANCE.getLobbyCategory() - .getLobbyLocation()); + Player bukkitPlayer = player.getPlayer(); + if (bukkitPlayer != null && bukkitPlayer.isOnline()) { + // teleporting the player to the lobby location + bukkitPlayer.teleport(ConfigurationManager.INSTANCE.getLobbyCategory().getLobbyLocation()); + } resetPlot(); } @@ -181,10 +183,12 @@ private void resetState() { player.toggleSetup(); // inactivate the setup umbrella - umbrella.inactivate(player.getPlayer()); - - // setting the player's gamemode back to survival - player.getPlayer().setGameMode(GameMode.SURVIVAL); + Player bukkitPlayer = player.getPlayer(); + umbrella.inactivate(bukkitPlayer); + if (bukkitPlayer != null && bukkitPlayer.isOnline()) { + // setting the player's gamemode back to survival + bukkitPlayer.setGameMode(GameMode.SURVIVAL); + } } /** diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupFactory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupFactory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupFactory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupFactory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupHandler.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupHandler.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupHandler.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/IslandSetupHandler.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/umbrella/IslandSetupUmbrella.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/umbrella/IslandSetupUmbrella.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/umbrella/IslandSetupUmbrella.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/setup/umbrella/IslandSetupUmbrella.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/umbrella/GameIslandUmbrella.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/umbrella/GameIslandUmbrella.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/island/object/umbrella/GameIslandUmbrella.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/island/object/umbrella/GameIslandUmbrella.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/IslandBoard.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/IslandBoard.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/IslandBoard.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/IslandBoard.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java similarity index 73% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java index 1cd3747d..63d9b5d4 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/Leaderboard.java @@ -11,14 +11,15 @@ import io.tofpu.speedbridge2.model.leaderboard.object.BoardPlayer; import io.tofpu.speedbridge2.model.leaderboard.object.IslandBoardPlayer; import io.tofpu.speedbridge2.model.player.PlayerService; -import io.tofpu.speedbridge2.model.player.object.score.Score; import io.tofpu.speedbridge2.model.player.object.BridgePlayer; +import io.tofpu.speedbridge2.model.player.object.score.Score; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; public final class Leaderboard { private final PlayerService playerService; @@ -58,7 +59,7 @@ public CompletableFuture loadAsync() { // global leaderboard operation try (final DatabaseQuery databaseQuery = DatabaseQuery.query("SELECT DISTINCT *" + - " FROM scores ORDER BY score")) { + " FROM scores ORDER BY score")) { final List uuidList = new ArrayList<>(); final Map globalBoardMap = new HashMap<>(); @@ -84,11 +85,11 @@ public CompletableFuture loadAsync() { final BoardPlayer value = BridgeUtil.toBoardPlayer(true, - resultSet); + resultSet); BridgeUtil.debug("Leaderboard#load(): value == " + value); if (value == null) { BridgeUtil.debug("Leaderboard#load(): value == null; " + - "continuing"); + "continuing"); continue; } @@ -105,53 +106,57 @@ public CompletableFuture loadAsync() { }); BridgeUtil.runBukkitAsync(() -> { - BridgeUtil.debug("Leaderboard#load(): refreshing the leaderboard!"); + BridgeUtil.debug("Leaderboard#load(): refreshing the leaderboard!"); - // per-player based position operation - for (final UUID uuid : positionMap.asMap() - .keySet()) { - this.positionMap.synchronous().refresh(uuid); - } + // per-player based position operation + for (final UUID uuid : positionMap.asMap() + .keySet()) { + this.positionMap.synchronous().refresh(uuid); + } - // update the global leaderboard - globalMap.updateLeaderboard(); - }, 20L * ConfigurationManager.INSTANCE.getLeaderboardCategory() - .getGlobalUpdateInterval(), 20L * ConfigurationManager.INSTANCE.getLeaderboardCategory() - .getGlobalUpdateInterval()); + // update the global leaderboard + globalMap.updateLeaderboard(); + }, 20L * ConfigurationManager.INSTANCE.getLeaderboardCategory() + .getGlobalUpdateInterval(), 20L * ConfigurationManager.INSTANCE.getLeaderboardCategory() + .getGlobalUpdateInterval()); BridgeUtil.runBukkitAsync(() -> { - // sessional leaderboard operation - final Map scoreMap = new HashMap<>(); - for (final BridgePlayer bridgePlayer : playerService.getBridgePlayers()) { - if (scoreMap.size() == 10) { - break; - } + // sessional leaderboard operation + final Map scoreMap = new HashMap<>(); + for (final BridgePlayer bridgePlayer : playerService.getBridgePlayers()) { + if (scoreMap.size() == 10) { + break; + } + + Score bestScore = null; + for (final Score score : bridgePlayer.getSessionScores()) { + // if the best score is not null, and best score is higher + // than or equal to 0 + if (bestScore != null && bestScore.compareTo(score) >= 0) { + continue; + } + bestScore = score; + } - Score bestScore = null; - for (final Score score : bridgePlayer.getSessionScores()) { - // if the best score is not null, and best score is higher - // than or equal to 0 - if (bestScore != null && bestScore.compareTo(score) >= 0) { - continue; - } - bestScore = score; - } + if (bestScore != null) { + final UUID uuid = bridgePlayer.getPlayerUid(); + scoreMap.put(uuid, new BoardPlayer(bridgePlayer.getName(), -1, uuid, bestScore)); + } + } - if (bestScore != null) { - final int position = scoreMap.size() + 1; - final UUID uuid = bridgePlayer.getPlayerUid(); - scoreMap.put(uuid, new BoardPlayer(bridgePlayer.getName(), position, uuid, bestScore)); - } - } + List sortedPlayers = scoreMap.values().stream() + .sorted(Comparator.comparing(BoardPlayer::getScore)) + .collect(Collectors.toList()); - this.sessionMap.clear(); - for (final Map.Entry entry : scoreMap.entrySet()) { - final BoardPlayer value = entry.getValue(); - this.sessionMap.put(value.getPosition(), value); - } - }, ConfigurationManager.INSTANCE.getLeaderboardCategory() - .getSessionUpdateInterval(), 20L * ConfigurationManager.INSTANCE.getLeaderboardCategory() - .getSessionUpdateInterval()); + this.sessionMap.clear(); + int position = 1; + for (BoardPlayer boardPlayer : sortedPlayers) { + this.sessionMap.put(position, new BoardPlayer(boardPlayer.getName(), position, boardPlayer.getOwner(), boardPlayer.getScore())); + position++; + } + }, ConfigurationManager.INSTANCE.getLeaderboardCategory() + .getSessionUpdateInterval(), 20L * ConfigurationManager.INSTANCE.getLeaderboardCategory() + .getSessionUpdateInterval()); return loadFuture; } @@ -179,11 +184,11 @@ public CompletableFuture retrieve(final UUID uniqueId) { * Given a position, retrieve the player at that position from the leaderboard * * @param leaderboardRetrieveType The type of leaderboard to retrieve. - * @param position The position of the player in the leaderboard. + * @param position The position of the player in the leaderboard. * @return A BoardPlayer object. */ public BoardPlayer retrieve(final LeaderboardRetrieveType leaderboardRetrieveType, - final int position) { + final int position) { switch (leaderboardRetrieveType) { case GLOBAL: return globalMap.get(position); @@ -197,7 +202,7 @@ public BoardPlayer retrieve(final LeaderboardRetrieveType leaderboardRetrieveTyp /** * Retrieve the island board for the given player and island slot. * - * @param uniqueId The UUID of the player. + * @param uniqueId The UUID of the player. * @param islandSlot The slot of the island board to retrieve. * @return The IslandBoard object. */ diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/LeaderboardMap.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/LeaderboardMap.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/LeaderboardMap.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/LeaderboardMap.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/BoardLoader.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/BoardLoader.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/BoardLoader.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/BoardLoader.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/IslandLoader.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/IslandLoader.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/IslandLoader.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/IslandLoader.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/PlayerPositionLoader.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/PlayerPositionLoader.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/PlayerPositionLoader.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/loader/PlayerPositionLoader.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/BoardPlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/BoardPlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/BoardPlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/BoardPlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/IslandBoardPlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/IslandBoardPlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/IslandBoardPlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/leaderboard/object/IslandBoardPlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerDatabase.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerDatabase.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerDatabase.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerDatabase.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerFactory.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerFactory.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerFactory.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerFactory.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java similarity index 92% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java index 7bcccd96..e623240c 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerHandler.java @@ -146,17 +146,18 @@ public Collection getBridgePlayers() { .values()); } - /** - * Resets the player's data - * - * @param uuid The UUID of the player to reset. - */ - public void reset(final UUID uuid) { - final BridgePlayer bridgePlayer = getIfPresent(uuid); - if (bridgePlayer == null) { - return; + public @NotNull CompletableFuture reset(final UUID uuid, ResetType resetType) { + BridgePlayer player = getOrDefault(uuid); + switch (resetType) { + case ALL: + return player.reset(); + case STATS: + return player.resetStats(); + case SCORES: + return player.resetScores(); + default: + throw new IllegalStateException("Unsupported reset type: " + resetType); } - bridgePlayer.reset(); } /** diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java similarity index 94% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java index bee9db94..61ac0786 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/PlayerService.java @@ -101,12 +101,16 @@ public Collection getBridgePlayers() { } /** - * Resets the player's data + * Resets all the player's data * * @param uuid The UUID of the player to reset. */ public void reset(final UUID uuid) { - playerHandler.reset(uuid); + reset(uuid, ResetType.ALL); + } + + public @NotNull CompletableFuture reset(final UUID uuid, ResetType resetType) { + return playerHandler.reset(uuid, resetType); } public void shutdown() { diff --git a/spigot/src/main/java/io/tofpu/speedbridge2/model/player/ResetType.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/ResetType.java new file mode 100644 index 00000000..4481df0a --- /dev/null +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/ResetType.java @@ -0,0 +1,5 @@ +package io.tofpu.speedbridge2.model.player; + +public enum ResetType { + ALL, SCORES, STATS +} \ No newline at end of file diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDatabaseExceptionWrapper.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDatabaseExceptionWrapper.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDatabaseExceptionWrapper.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDatabaseExceptionWrapper.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDeletionFailureException.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDeletionFailureException.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDeletionFailureException.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerDeletionFailureException.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerLoadFailureException.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerLoadFailureException.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerLoadFailureException.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerLoadFailureException.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateFailureException.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateFailureException.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateFailureException.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateFailureException.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateNameFailureException.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateNameFailureException.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateNameFailureException.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/exception/PlayerUpdateNameFailureException.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/loader/PlayerLoader.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/loader/PlayerLoader.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/loader/PlayerLoader.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/loader/PlayerLoader.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java similarity index 98% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java index 1bfb5e62..5b3d6d1e 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/BridgePlayer.java @@ -267,13 +267,13 @@ public CompletableFuture resetScores() { leaderboard.reset(getPlayerUid()); IslandBoard.reset(getPlayerUid()); - return (CompletableFuture) Databases.SCORE_DATABASE.delete(getPlayerUid()); + return Databases.SCORE_DATABASE.delete(getPlayerUid()); } public CompletableFuture resetStats() { this.statsMap.clear(); - return (CompletableFuture) Databases.STATS_DATABASE.delete(getPlayerUid()); + return Databases.STATS_DATABASE.delete(getPlayerUid()); } public void setGamePlayer(final GamePlayer gamePlayer) { diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/CommonBridgePlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/CommonBridgePlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/CommonBridgePlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/CommonBridgePlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/DummyBridgePlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/DummyBridgePlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/DummyBridgePlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/DummyBridgePlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/GamePlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/GamePlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/GamePlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/GamePlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/SenderBridgePlayer.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/SenderBridgePlayer.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/SenderBridgePlayer.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/SenderBridgePlayer.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockChoice.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockChoice.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockChoice.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockChoice.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockDatabase.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockDatabase.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockDatabase.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/block/BlockDatabase.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/score/Score.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/score/Score.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/score/Score.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/score/Score.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java similarity index 98% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java index f28c3aa6..c41b0374 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/score/ScoreDatabase.java @@ -75,7 +75,7 @@ public ScoreDatabase() { }); } - public CompletableFuture delete(final UUID uuid) { + public CompletableFuture delete(final UUID uuid) { return PluginExecutor.runAsync(() -> { try (final DatabaseQuery query = DatabaseQuery.query("DELETE FROM scores " + "WHERE uid = ?")) { diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/session/SessionScore.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/session/SessionScore.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/session/SessionScore.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/session/SessionScore.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/setup/SetupMeta.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/setup/SetupMeta.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/setup/SetupMeta.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/setup/SetupMeta.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStat.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStat.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStat.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStat.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStatType.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStatType.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStatType.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/PlayerStatType.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java similarity index 98% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java index e47c6c20..d14429a8 100644 --- a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java +++ b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/StatsDatabase.java @@ -75,7 +75,7 @@ public StatsDatabase() { }); } - public CompletableFuture delete(final UUID uuid) { + public CompletableFuture delete(final UUID uuid) { return PluginExecutor.runAsync(() -> { try (final DatabaseQuery query = DatabaseQuery.query( "SELECT * FROM stats WHERE " + "uid = ?")) { diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/type/SimplePlayerStat.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/type/SimplePlayerStat.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/type/SimplePlayerStat.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/player/object/stat/type/SimplePlayerStat.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/PluginExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/PluginExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/PluginExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/PluginExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/AbstractExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/AbstractExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/AbstractExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/AbstractExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/ExpansionHandler.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/ExpansionHandler.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/ExpansionHandler.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/ExpansionHandler.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BestScoreExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BestScoreExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BestScoreExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BestScoreExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BlocksExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BlocksExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BlocksExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/BlocksExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/IslandSlotExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/IslandSlotExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/IslandSlotExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/IslandSlotExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/LeaderboardExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/LeaderboardExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/LeaderboardExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/LeaderboardExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/PositionExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/PositionExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/PositionExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/PositionExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TimerExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TimerExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TimerExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TimerExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TotalStatsExpansion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TotalStatsExpansion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TotalStatsExpansion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/placeholderapi/expansion/expansions/TotalStatsExpansion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/CuboidRegion.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/CuboidRegion.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/CuboidRegion.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/CuboidRegion.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/Vector.java b/spigot/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/Vector.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/Vector.java rename to spigot/src/main/java/io/tofpu/speedbridge2/model/support/worldedit/Vector.java diff --git a/speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/plugin/SpeedBridgePlugin.java b/spigot/src/main/java/io/tofpu/speedbridge2/plugin/SpeedBridgePlugin.java similarity index 100% rename from speedbridge2-spigot-plugin/src/main/java/io/tofpu/speedbridge2/plugin/SpeedBridgePlugin.java rename to spigot/src/main/java/io/tofpu/speedbridge2/plugin/SpeedBridgePlugin.java diff --git a/speedbridge2-spigot-plugin/src/main/resources/plugin.yml b/spigot/src/main/resources/plugin.yml similarity index 100% rename from speedbridge2-spigot-plugin/src/main/resources/plugin.yml rename to spigot/src/main/resources/plugin.yml