Commit Graph

58 Commits

Author SHA1 Message Date
TDSTOS
2be7272f06 Wire DataPackManager, add uninstall, update build
Swap Shadow plugin to com.gradleup.shadow v8.3.5 and add kotlin serialization plugin. Add relocations for bundled libraries (fastboard, Hikari) in the shadowJar.

Make DataPackManager a plugin-scoped property: initialize and install it during onLoad and call uninstall during onDisable. Add a convenience uninstall() that reads the target world from config and removes the datapack there. Also comment out writeNoiseSettingOverride with a warning that the simplified file crashes Minecraft 1.21.
2026-04-04 23:58:35 +02:00
TDSTOS
6141cde0b5 BlackPanther pounce on move; TheWorld & soup fixes
BlackPantherKit: Replace the old onHitEnemy logic with onMove(PlayerMoveEvent) to detect a landing pounce (checks downward movement, minimum fall, and solid ground). Applies AoE damage to nearby alive players, plays VFX/sounds, spawns a crater asynchronously, and resets the player's fallDistance; also fixes action bar target count and cleans up impact location usage.

TheWorldKit: Add explicit return types for ability getters and minor cleanup in giveItems when building and caching the ability item.

SoupListener: Harden interaction handling by checking event.item and hand, denying vanilla item/block use, using the live maxHealth attribute value, capping health/food/saturation with coerceAtMost, and only replacing the consumed stew with a bowl in the correct hand when actually consumed. Also set EventHandler ignoreCancelled to false to ensure proper handling.
2026-04-04 20:23:53 +02:00
TDSTOS
1f9a43fb89 Add DataPackManager & SurfaceBlockPopulator
Introduce DataPackManager to generate/install a datapack into the target world folder (biome overrides, simplified noise_settings) and call install() during onLoad after the world folder is prepared. Add SurfaceBlockPopulator to apply surface/sub-surface block overrides (for TerraformGenerator worlds) and register it in onEnable via a WorldInitEvent listener for the configured target world. Refactor WorldManager to extract deletion logic into deleteWorld() and delete existing world/_nether/_the_end before unpacking the selected map. Also update imports and wiring to support these changes.
2026-04-04 18:51:14 +02:00
TDSTOS
1382de63fc Add natural disasters system
Introduce a natural-disasters feature: add DisasterManager, an abstract NaturalDisaster base class, and four concrete implementations (Earthquake, Meteor, Thunder, Tornado). Integrate the manager into SpeedHG (property, initialization/start) so disasters run on a timed cycle with guards for game state, grace period and per-disaster validation. Implementations: Meteor spawns a non-destructive LargeFireball impact, Earthquake applies nausea/impulses and particles, Thunder triggers multiple lightning strikes with fire chance, Tornado creates a particle vortex and pulls nearby players (uses a coroutine for precomputation). Add localization keys for disaster warnings in en_US.yml. Safety/cancel logic and flight/timeout cutoffs included to avoid leaks or invalid triggers.
2026-04-04 07:13:39 +02:00
TDSTOS
8c2ab684bb Add perk system with GUI and integrations
Introduce a complete passive perk system: Perk base class, PerkManager (registration, selection, lifecycle, persistence), and PlayerPerksRepository (DB schema + upsert/find). Add four example perks (Oracle, Vampire, Featherweight, Bloodlust) and a single PerkEventDispatcher to route combat/environment/kill events to active perks. Provide PerkSelectorMenu GUI and /perks command, integrate perk initialization, registration, application and cleanup into SpeedHG and GameManager, and hook load/evict into StatsListener. Also add language entries and register the command in plugin.yml. This change enables players to select up to two passive perks, persists selections, and dispatches relevant events to perk implementations.
2026-04-04 03:16:43 +02:00
TDSTOS
88b0ba8b97 Refactor kits, add safety checks and fixes
Multiple refactors and defensive fixes across kits and event handling:

- RecraftManager: use Bukkit.getOnlinePlayers() collection API instead of stream.
- ActiveAbility: mark backing _hitsRequired as @Volatile for thread-safety.
- BlackPanther, Rattlesnake, TheWorld, Gladiator, Goblin, Venom, Voodoo: change how kit overrides are accessed (lazy or helper) to avoid stale initialization and improve readability.
- Gladiator: add an ended flag to avoid double-ending fights.
- Goblin & TheWorld: add game state checks to avoid restoring kits or operating on players after game end.
- Rattlesnake: guard scheduled miss task with player.isOnline check and simplify action bar call.
- Venom: clean up active shield tasks on kit removal and make damage handling null-safe with apply.
- Voodoo: wrap passive tick in runCatching and log failures to prevent uncaught exceptions from killing tasks.
- KitEventDispatcher: skip handling if victim is not alive, change interact handler to ignoreCancelled = false, and add isAlive helper.
- ItemBuilder: switch lore serialization to MiniMessage, disable default italic decoration, and reuse a MiniMessage instance.

These changes improve robustness, avoid race conditions, and add defensive guards against invalid state during scheduled tasks and event handling.
2026-04-04 02:48:17 +02:00
TDSTOS
5be2ae2674 Add podium ceremony and rank enhancements
Introduce a PodiumManager to run an end-of-round podium ceremony and integrate it into the lifecycle. Key changes:

- Add PodiumManager (new): builds podium columns, teleports and freezes top-3 players, spawns TextDisplay entities, posts staggered announcements, and runs a ranked firework show; includes cleanup to remove entities, blocks and cancel tasks.
- SpeedHG: initialize podiumManager and call podiumManager.cleanup() on disable.
- GameManager: trigger plugin.podiumManager.launch(winnerUUID) shortly after the win announcement.
- RankingManager: track elimination order during the round and expose getEliminationOrder() to determine placements.
- Rank: add sub-tier logic (I/II/III), firework color, and helper methods to produce formatted MiniMessage rank tags/components; improve cached component/prefix handling.
- ScoreboardManager: use Rank.getFormattedRankName(...) to show the formatted rank with sub-tier on scoreboards.

Purpose: provide a richer end-of-round experience (visuals, sounds, fireworks) and accurate top-3 determination using elimination order while adding rank sub-tiering and formatted rank output for UI elements.
2026-04-04 00:40:56 +02:00
TDSTOS
2434460c32 Update RankingManager.kt 2026-04-03 22:31:56 +02:00
TDSTOS
7b6557122b Add ranking system and /ranking command
Introduce a ranking system: add Rank enum and RankingManager enhancements (isRankingEnabled toggle, getRank(), RR change handling, rank-up/down detection and player notifications with titles/sounds). Add a new /ranking admin command (toggle, status, rank) with tab completion and register it in plugin startup. Surface player rank on the scoreboard (ScoreboardManager) and add related language entries and plugin.yml permission/command metadata. Logging updated to include ranked state.
2026-04-03 22:28:56 +02:00
TDSTOS
ab976cc2a4 Add RankingManager and integrate RR system
Introduce a new RankingManager that implements a per-round Rank Rating (RR) system (placement + kill-based scoring, placement games, kill caps and RR interpolation). Wire the manager into the plugin (SpeedHG): add field + initialization. Integrate into GameManager: call startRound at game start, registerRoundKill on kills, and onPlayerResult for eliminated players and the winner; adjust some stats calls (addLoss/addWin kept alongside ranking updates). Add corresponding English language messages for placement progress and result notifications.
2026-04-03 19:27:04 +02:00
TDSTOS
184443b7c6 Add custom game settings
Each kit now supports custom settings aswell as custom game settings like min_players
2026-03-28 23:51:32 +01:00
TDSTOS
5b00b51193 Update GUI-System
The GUI-System now gets its messages from the en_US.yml file for better customizability
2026-03-28 17:32:23 +01:00
TDSTOS
bab703601e Add four new kits and kit event hooks
Introduce Armorer, BlackPanther, Rattlesnake and Voodoo kit implementations and wire them into the plugin. Add new Kit hooks (onKillEnemy, onToggleSneak, onItemBreak) and PassiveAbility.onKillEnemy so kits can react to kills and item/sneak events. Update KitEventDispatcher to dispatch kill, sneak-toggle and item-break events, handle BlackPanther push-projectiles, and expose the ICE/black-panther PDC keys. Register the new kits in SpeedHG and add language entries for Rattlesnake and Armorer messages.
2026-03-28 17:23:39 +01:00
TDSTOS
84be2a30bc Add WorldManager and map-system support
Introduce WorldManager to select and unpack a random map ZIP into the server root before startup. The plugin now calls WorldManager.prepareRandomWorld() in onLoad (before onEnable) and reloads config there. Added map-system config options (enabled, zip-folder, target-world-name, maps) with example entries. WorldManager deletes existing world folders, extracts the chosen ZIP (with zip-slip protection) and logs progress.
2026-03-28 02:50:51 +01:00
TDSTOS
8e96a07a65 Add timer command, recraft module & recipes
Introduce a /timer admin command with tab completion (speedhg.admin.timer) and a parseTimeToSeconds utility; add CommandSender.sendMsg extension and language strings. Add RecraftManager module that enforces a configurable recraft-nerf (reduces extra recraft points for alive players) and starts from GameManager; wire the new module into GameManager. Register mushroom-stew shapeless recipes for cocoa and cactus in plugin startup and tidy command registration. Update plugin.yml with permission/command entries and adjust imports as needed.
2026-03-27 16:26:18 +01:00
TDSTOS
9682df5bf9 Update GameStateListener.kt 2026-03-27 02:18:15 +01:00
TDSTOS
07c2963e71 Add Feast, Pit modules and Discord webhook
Introduce two new game modules (FeastManager and PitManager) to handle timed endgame events: announcements, world edits, loot generation, teleportation and escape-prevention logic. Add DiscordWebhookManager to send asynchronous webhook messages (embeds/text) and wire it into SpeedHG and GameManager to broadcast game start/end events. Integrate managers into the game loop and reset lifecycle (startGame), add config entries for Discord, and add corresponding language strings. Also include small tweaks (killer XP reward, minor formatting) and updated resource files.
2026-03-27 02:15:44 +01:00
TDSTOS
72a58fdd9c Add Kit GUI (menu/anvil) and integrate MenuListener
Introduce a full chest-based kit selection UI and anvil search: add Menu, MenuHolder, KitSelectorMenu, KitItemFactory, AnvilSearchMenu (with AnvilSearchTracker) and a central MenuListener to dispatch menu and anvil interactions. Integrate the GUI into KitCommand (opens selector on no args, enforces mid-game selection rules, remove/replace backup kits when switching) and register MenuListener in the main plugin. Add permission speedhg.bypass and update ConnectListener to kick joiners when a game is running unless they have the bypass permission. Remove static playstyle lore from language file (now rendered dynamically), and apply small import/refactor cleanups (use wildcard imports for kit impls, java.util.* replacements).
2026-03-26 17:06:40 +01:00
TDSTOS
b2edcff447 Add Gladiator kit and WorldEdit support
Introduce the Gladiator kit feature and supporting infrastructure: add KitMetaData enum and new GladiatorKit implementation (items, abilities, fight lifecycle and region logic), register the kit in SpeedHG, and add language entries for the kit and some bolded kit names. Add WorldEditUtils.createCylinder helper to build/tear down arenas. Extend KitEventDispatcher with listeners to handle gladiator arena block interactions and explosion handling (with a helper to step glass color -> air). Also add ingame guards in several projectile handlers and remove a small TODO/comment in GameStateListener.
2026-03-26 04:13:26 +01:00
TDSTOS
0043a3e82c Update Stats Management 2026-03-26 01:07:12 +01:00
TDSTOS
2d720d962c Add persistent player stats and DB support
Introduce MySQL persistence and an in-memory stats system with async saving.

- Add HikariCP & MySQL connector dependencies and relocate libs in build.gradle.kts.
- Add DatabaseManager (HikariCP) to manage connection pool and lifecycle.
- Add PlayerStats data model and PlayerStatsRepository for table creation, reads, upserts and batch upserts (with prepared statements).
- Add StatsManager: coroutine-based cache, dirty-flags, async batch saves, auto-save (every 5 minutes), load/save APIs and shutdown save.
- Add StatsListener: load on AsyncPlayerPreLoginEvent and save on PlayerQuitEvent.
- Wire DB and stats into main plugin: connect on enable (disable plugin on fail), initialize StatsManager, save/disconnect on disable, register leaderboard command and stats listener.
- Update GameManager to record kills/wins/deaths and adjust scrimScore on events.
- Add LeaderboardCommand and language entries for leaderboard output; expose command in plugin.yml.
- Add database configuration section to config.yml.
- Minor refactor: KitCommand plugin accessor changed to a getter.

These changes provide a robust, pooled DB connection and efficient stats persistence (batched/upserted) to reduce DB load and ensure data safety during shutdown.
2026-03-26 00:10:26 +01:00
TDSTOS
ee79dd4bf4 Add Venom kit and integrate into game
Introduce a new Venom kit with aggressive (deafening wither beam) and defensive (shield of darkness) abilities by adding src/main/kotlin/.../VenomKit.kt. Wire the kit into the plugin: import and register Venom in SpeedHG (extracted registerKits()), and extend KitEventDispatcher to handle projectile interactions for Venom defensive playstyle (cancel/stop projectiles and reflect thrown potions). Update en_US.yml: add Venom localization/messages, adjust default prefix and some kit/scoreboard copytext, and add a no_permission message.
2026-03-25 23:33:57 +01:00
TDSTOS
0f95499a0f Add cachedItems to kits; prevent kit item drops
Introduce an abstract cachedItems property on Kit (ConcurrentHashMap<UUID, List<ItemStack>>) to track per-player kit items. Update implementations (BackupKit, GoblinKit, IceMageKit, TemplateKit) to override and initialize cachedItems. GameStateListener now checks dropped items against the selected kit cache and cancels drops (playing a sound) for kit items, and adds handlers to cancel item pickup/despawn outside active game states. Add necessary imports for ItemStack, UUID, ConcurrentHashMap and new event types.
2026-03-25 21:42:04 +01:00
TDSTOS
ef183f6add Update GameManager 2026-03-25 20:38:38 +01:00
TDSTOS
a3137ca211 Update SpeedHG.kt 2026-03-25 20:36:04 +01:00
TDSTOS
39622672bd Update GameManager 2026-03-25 18:32:28 +01:00
TDSTOS
237ce56614 Support Component placeholders in language API
Add support for passing Components as placeholders in LanguageManager (getComponent, getMessageList) and add Player extension overloads (sendMsg, trans) that accept component pairs. Replace usages of legacy serialized strings with direct Component placeholders across kits, scoreboard, and listeners (remove legacySerializer imports/usages). Also normalize placeholder keys (remove angle brackets in ConnectListener) and scope legacySerializer as private in Extensions.
2026-03-25 18:29:21 +01:00
TDSTOS
9385269c50 Bump gradle version from 8.10 to 8.14.4 2026-03-25 17:51:22 +01:00
TDSTOS
cc57803f38 Optimize imports 2026-03-25 17:48:27 +01:00
TDSTOS
e199ae24d4 Add BackupKit and mid-game kit selection
Introduce a BackupKit and allow players holding it to change kits mid-game while preventing normal kits from being picked once the game started. Changes:
- Add BackupKit implementation (kit with no abilities/items used for mid-round kit selection).
- Update KitCommand: import BackupKit and GameState, add isIngame helper, disallow normal kit picks during INGAME/INVINCIBILITY, permit BackupKit to swap kits mid-game (but prevent picking the same kit) and apply playstyles accordingly.
- Fix GoblinKit to also copy/restore the target's playstyle when stealing a kit and restore the player's original playstyle after timeout.
- Tweak IceMageKit slow effect chance (now ~1/3 chance using random.nextInt(3) < 1).
- Update en_US.yml: add messages and kit strings for backup and icemage, adjust ability_charged color, and add game/cannot-pick messages.

Also includes small import and formatting adjustments.
2026-03-25 17:47:42 +01:00
TDSTOS
ea86272c01 Add IceMage kit and playstyle support
Introduce a new IceMage kit and wire playstyle support across the plugin. Changes include:

- Add IceMageKit with aggressive/defensive active & passive abilities, item distribution, and lifecycle hooks; caches ability instances and given items to reduce allocations.
- Register IceMageKit in SpeedHG on plugin startup.
- Update KitCommand to require a playstyle argument, validate it, select the kit's playstyle, and provide tab-completion for playstyles.
- Extend KitEventDispatcher with IceMage-specific handlers: spawn a circular volley of snowballs on ability use (cancelling the original projectile), mark spawned snowballs with persistent data, and apply freeze/slow effects on hit.
- Adjust GoblinKit to use a plugin getter and make inner ability classes static to avoid capturing the outer instance.
- Update language lines and plugin.yml usage to reflect the new /kit <kitName> <playstyle> usage.

These changes implement the IceMage feature and ensure proper playstyle selection and event handling while keeping allocations low and behavior consistent.
2026-03-25 05:02:59 +01:00
TDSTOS
19bd708b59 Refactor language, kits, and event handling
Major refactor and bugfixes across language loading, kit lifecycle, and event handling:

- LanguageManager: Introduce LangData to hold string and list entries, load YAML lists alongside strings, and centralize retrieval (avoid reloading files at access time).
- GameManager: Use apply {} to configure worldBorder more concisely.
- KitManager.clearAll: Handle offline players by cleaning chargeData without calling lifecycle hooks (onActivate/onDeactivate cannot run for offline players).
- GoblinKit: Track per-player steal BukkitTask, cancel tasks on kit removal, only restore kits if player is still alive, and fix inventory removal by removing cached items and cleaning cache.
- KitEventDispatcher: Use null-safe chaining for victim passive hooks and early-return on non-block-position moves to ignore head-rotation events.
- GameStateListener: Add feastStarted flag placeholder and adjust iron ore handling/messages; add TODO for DB update.
- Extensions: Change legacySerializer visibility to internal.

These changes improve stability around scheduled tasks, offline cleanup, and language list support.
2026-03-25 03:28:52 +01:00
TDSTOS
cc265a1dea Add language entries; include prefix placeholders
Include the default prefix as a placeholder when deserializing messages (LanguageManager). Pass the invincibility time placeholder in GameManager broadcasts. Unify GoblinKit action bar messages to a single "ability_charged" language key. ScoreboardManager now imports legacySerializer and serializes the selected kit display name for the scoreboard. Large update to en_US.yml: added many game/timer/title/antirunner/build/craft/commands translations, updated player welcome and scoreboard title coloring, and added kits.goblin names, lore, items and messages.
2026-03-25 03:09:17 +01:00
TDSTOS
72c461ab28 Add KitCommand 2026-03-25 02:37:16 +01:00
TDSTOS
9d6bd6a6b8 Add kit system, KitManager and Goblin kit
Introduce a full kit framework and supporting utilities.

- Add core kit API: Kit, Playstyle, ActiveAbility, PassiveAbility, AbilityResult, charge state and PlayerChargeData.
- Implement KitManager for registration, lobby selections, apply/remove/clear lifecycle and charge tracking.
- Add KitEventDispatcher listener to centralize kit event handling (interact, hits, move) and integrate passive/active hooks.
- Provide example kit implementations: GoblinKit (functional abilities) and TemplateKit (reference).
- Add utilities: ItemBuilder and WorldEditUtils (WorldEdit-based sphere creation).
- Integrate into plugin: SpeedHG now initialises KitManager, registers kits and KitEventDispatcher, applies kits at game start and clears on end.
- LanguageManager: add default message/list/component helpers.
- Build changes: bump Kotlin plugin to 2.2.0 and add WorldEdit compileOnly deps; also expose legacySerializer in Extensions.

These changes implement the kit feature set (items, abilities, charge/recharge flow) and wire it into the game lifecycle.
2026-03-25 02:27:53 +01:00
TDSTOS
e411879b20 Remove legacy modules, add language & scoreboard
Large refactor removing many legacy subsystems (abilities, kit system, database repos, recraft, world manager, extensive config classes, lunar/luckperms integrations and various listeners/commands). Introduces a lightweight LanguageManager, AntiRunningManager, ScoreboardManager, ConnectListener and a SoupListener; simplifies the main SpeedHG plugin to initialize these components and register the connection listener. Build changes: update Gradle wrapper to 8.10, remove paperweight and several external dependencies, add fr.mrmicky:fastboard and simplify shadowJar/build task configuration. Adds default language resource (languages/en_US.yml) and updates plugin/config resources. Purpose: simplify and decouple the plugin, reduce dependency surface and prepare for a leaner, modular rewrite.
2026-03-25 00:55:20 +01:00
TDSTOS
b4db8dbfeb Add messages 2025-12-12 05:12:14 +01:00
TDSTOS
bb47145a73 Fix start errors 2025-12-12 05:12:09 +01:00
TDSTOS
1acb5681fc Add kit inventory 2025-12-11 19:47:45 +01:00
TDSTOS
c741739cdd Update kits 2025-12-11 19:47:40 +01:00
TDSTOS
05e0e2dcf9 Fix game states 2025-12-11 19:47:25 +01:00
TDSTOS
31c1e6e316 Add player repository 2025-12-11 19:47:06 +01:00
Laurin
3092a19086 Updated plugin.yml 2025-12-11 18:15:39 +01:00
TDSTOS
1d7ff8bd2f Add new kit & register 2025-12-09 19:57:55 +01:00
TDSTOS
7e54c8e9f1 Add new kits & recraft nerf 2025-12-09 16:06:17 +01:00
TDSTOS
cb788930ad Fix kit construction 2025-12-09 01:07:50 +01:00
TDSTOS
728b7534ac Update kit management & anchor kit 2025-12-09 01:01:00 +01:00
Laurin
a3b521940c Added kits.yml 2025-12-08 23:37:37 +01:00
TDSTOS
fef0072007 Add new game states and update 2025-12-08 21:59:40 +01:00
Laurin
590318772f Update game states & world management 2025-12-06 05:41:42 +01:00