Repository: Plugily-Projects/MurderMystery Branch: master Commit: 287f62df0903 Files: 90 Total size: 388.5 KB Directory structure: gitextract_4vxfrib5/ ├── .checkstyle/ │ └── checkstyle.xml ├── .editorconfig ├── .github/ │ ├── CHANGELOG.md │ ├── CONTRIBUTORS.md │ ├── FUNDING.yml │ ├── LICENSE.md │ ├── README.md │ ├── building/ │ │ ├── build.gradle.kts │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── pom.xml │ │ └── settings.gradle.kts │ └── workflows/ │ ├── deploy-development.yml │ └── deploy-master.yml ├── .gitignore ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── lib/ │ ├── CorpseReborn.jar │ └── README.md ├── pom.xml ├── pom.xml.versionsBackup └── src/ └── main/ ├── java/ │ └── plugily/ │ └── projects/ │ └── murdermystery/ │ ├── HookManager.java │ ├── Main.java │ ├── api/ │ │ ├── events/ │ │ │ ├── game/ │ │ │ │ ├── MurderGameCorpseSpawnEvent.java │ │ │ │ └── package-info.java │ │ │ └── player/ │ │ │ └── package-info.java │ │ └── package-info.java │ ├── arena/ │ │ ├── Arena.java │ │ ├── ArenaEvents.java │ │ ├── ArenaManager.java │ │ ├── ArenaRegistry.java │ │ ├── ArenaUtils.java │ │ ├── corpse/ │ │ │ ├── Corpse.java │ │ │ └── Stand.java │ │ ├── managers/ │ │ │ ├── MapRestorerManager.java │ │ │ └── ScoreboardManager.java │ │ ├── role/ │ │ │ └── Role.java │ │ ├── special/ │ │ │ ├── SpecialBlock.java │ │ │ ├── SpecialBlockEvents.java │ │ │ ├── mysterypotion/ │ │ │ │ ├── MysteryPotion.java │ │ │ │ └── MysteryPotionRegistry.java │ │ │ └── pray/ │ │ │ ├── Prayer.java │ │ │ └── PrayerRegistry.java │ │ └── states/ │ │ ├── InGameState.java │ │ ├── RestartingState.java │ │ ├── StartingState.java │ │ └── WaitingState.java │ ├── boot/ │ │ ├── AdditionalValueInitializer.java │ │ ├── MessageInitializer.java │ │ └── PlaceholderInitializer.java │ ├── commands/ │ │ └── arguments/ │ │ ├── ArgumentsRegistry.java │ │ ├── admin/ │ │ │ ├── RolePassArgument.java │ │ │ └── arena/ │ │ │ └── SpecialBlockRemoverArgument.java │ │ └── game/ │ │ └── RoleSelectorArgument.java │ ├── events/ │ │ └── PluginEvents.java │ ├── handlers/ │ │ ├── CorpseHandler.java │ │ ├── lastwords/ │ │ │ ├── LastWord.java │ │ │ └── LastWordsManager.java │ │ ├── setup/ │ │ │ ├── LocationCategory.java │ │ │ ├── SetupCategoryManager.java │ │ │ ├── SpecificCategory.java │ │ │ └── SwitchCategory.java │ │ ├── skins/ │ │ │ └── sword/ │ │ │ ├── SwordSkin.java │ │ │ └── SwordSkinManager.java │ │ └── trails/ │ │ ├── BowTrailsHandler.java │ │ ├── Trail.java │ │ └── TrailsManager.java │ └── utils/ │ └── ItemPosition.java └── resources/ ├── arena_selector.yml ├── arenas.yml ├── bungee.yml ├── config.yml ├── internal/ │ ├── data.yml │ └── leaderboards_data.yml ├── language.yml ├── lastwords.yml ├── leaderboards.yml ├── locales/ │ └── language_default.yml ├── mysql.yml ├── permissions.yml ├── plugin.yml ├── powerups.yml ├── rewards.yml ├── signs.yml ├── skins.yml ├── special_blocks.yml ├── special_items.yml ├── spectator.yml ├── stats.yml └── trails.yml ================================================ FILE CONTENTS ================================================ ================================================ FILE: .checkstyle/checkstyle.xml ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*.java] indent_size = 2 charset = utf-8 ================================================ FILE: .github/CHANGELOG.md ================================================ ### 2.1.6 Release (17.01.2026) * Updated minigamesbox to 1.4.5 ### 2.1.5 Release (13.07.2025) * Updated minigamesbox to 1.4.3 ### 2.1.4 Release (09.06.2025) * Fixed ICCE: Found class org.bukkit.inventory.InventoryView * Fixed PlugilyEntityPickupItemEvent IAE greater 0 on paper 1.21 + * Updated to minigamesbox 1.4.2 ### 2.1.3 Release (03.05.2025) * Added config option to not spawn more than 1 gold per spawner "GOLD_MULTIPLE" * Fixed respawn location of spectators * Changed bow dropped message now gets only to players without the role murderer * Fixed on Murderer Leave the new murderer message was send to all players instead of new murderer * Fixed default rewards.yml * Fixed onMurdererDeath the subtitle did not translate placeholders * Fixed spectator mode - since core usage its not needed to substract by one the playersleft value * Updated to minigamesbox 1.4.1 ### 2.1.2 Release (13.03.2025) * Updated to minigamesbox 1.4.0 ### 2.1.1 Release (18.02.2025) * Fixed PotionEffects on different server versions * Fixed Spectators sometimes counted as players * Updated to minigamesbox 1.3.16 ### 2.1.0 Release (13.07.2024) * Changed onDisable process to make sure all data gets saved even on mysql * Fixed Detective bow glitches away on startup * Fixed gold removing and therefore not working mystery cauldrons and prayers on newer mc versions * Fixed prayer grants new gold after usage ### 2.0.10 Release (09.07.2024) * Updated to minigamesbox 1.3.11 * Fixed arena after playing does not reset the arena options from config ### 2.0.9 Release (25.06.2024) * Updated to minigamesbox 1.3.10 ### 2.0.8 Release (18.06.2024) * Updated to minigamesbox 1.3.9 * Updated API ### 2.0.7 Release (24.04.2024) * Fixed bug where the murderer gets teleported to the lobby to fast when arena ends * Updated to minigamesbox 1.3.8 ### 2.0.6 Release (15.01.2024) * Fixed Hungerlose option in config.yml * Changed Round chances are now full numbers (no ,xx) * Updated to minigamesbox 1.3.7 ### 2.0.5 Release (13.01.2024) * Updated to minigamesbox 1.3.6 ### 2.0.4 Release (03.01.2024) * Added new command /mma locale to set your locale * Fixed GameProfile API 1.20 change * Fixed none kits related plugins issues ### 2.0.3 Release (31.12.2023) * Added 1.20.3 & 1.20.4 support * Updated to minigamesbox 1.3.4 ### 2.0.2 Release (29.11.2023) * Fixed cauldronclick adds gold instead of removing gold * Fixed IAE on particles * Removed debug messages * Updated to minigamesbox 1.3.3 ### 2.0.1 Release (21.08.2023) * Updated to minigamesbox 1.3.2-SNAPSHOT to fix urgent bugs ### 2.0.0 Release (08.08.2023) * Added up to 1.20 compatibility * Added sword skins.yml * Added trails.yml * Changed supported languages [https://translate.plugily.xyz] * Changed plugin base is based on MinigamesCore [https://github.com/Plugily-Projects/MiniGamesBox] * Changed native java building to java17, java 8 downloadable on our discord [https://discord.plugily.xyz] * Fixed all known bugs ### 1.8.0 Release (05.08.2021 - 2022) * Improved leaderboard command * Added murderer and detective chance placeholders to scoreboard * Now weather changing will be cancelled when a game is running * Now users can use placeholderapi placeholders in bossbar, titles, without player specified * Added option to determine if the deletion of arena needs confirmation or not ### 1.7.9 Release (30.05.2021 - 01.08.2021) * Added forcestart item * Added murderer and detective pass (Command and Item to activate) * Added new stat (new tables on mysql needs to be manually added murderer_pass, detective_pass *or* recreated) * Added special_items.yml * Added 1.17 support * Reuse XMaterial for specialitems * Fix NoSuchMethodError when hasCooldown method is not existed in 1.11 and lowest versions * Removed lobbyitems.yml * Removed Rainbow Bed option >>> beta1 * Fixed party (parties v3.1.0) not working anymore * Fixed when plugins scoreboards not re-appeared after game end * Fixed join maxplayers did not match the arena with highest player amount * Removed temp added scoreboard rewards ### 1.7.8 Release (15.04.2021 - 10.05.2021) * Added /mm join maxplayers which tries to get the arena with the highest amount of players * Added placeholder arena_players_online * Added new RewardType scoreboard_add * Changed Now the arena will be set to isDone false if the world is not exist, after the plugin loaded. * Changed randomjoin mechanics -> Searches for starting -> random join -> Searches for waiting -> random join * Fixed arrow trails are only on player ### 1.7.7 Release (31.03.2021 - 13.04.2021) * Fixed NoSuchElementException when iterating through players in gold locations but there is no player available. * Fixed issue when there was no murderer in game and it caused to not choose another one. * Fix when arena selector GUI does not opened * Fixed NPE on ArrowEvents and other version improvements ### 1.7.6 Release (19.03.2021) * Fixed Last words & trails for non op players * Fixed particle issues * Fixed invisible bug for spectators that joined while ingame * Fixed trail particle are random even on bow shoot * Changed config.yml Item values of states and added all states * Added trails blacklist ### 1.7.5 Release (01.02.2021 - 14.03.2021) * Added modifiable arena state names to language * Added configurable map selector items * Added legacy support * Added support for multiple last words that will randomize * Added a lot of new Trails (Should support every particle name that is supported since 1.8) * Added TeleportArgument (/mma tp) * Added new RewardType scoreboard_remove * Changed trails will now randomize if you got perms for more than one * Cached armor stands will be removed after block break if type is matches * Now special block holograms will get removed after game stop, after game start, it will show again * Fixed CME error when removing special blocks ### 1.7.4 Release (25.01.2021 - 28.01.2021) * Fix stack trace array length is 0 when trying to send exception to service * Updated commonsbox to fix actionbar problems * Fixed spectators can not see each other after joining game while being ingame ### 1.7.3 Release (18.01.2021 - 22.01.2021) * Fixed mm items are not removed if inventory manager is enabled and the server is stopping * Fixed 2nd last char of name gets removed if only one murderer ### 1.7.2 Release (10.01.2021 - 18.01.2021) * Fix NPE for armor stand hologram location is null * Fixed issue when sign instances section not found in file * Fixed arena join permission * Added 1.11+ compatibility * Added murderer and detective shuffler to avoid the same characters when you are only playing with the same people * Added option to disable death message completely ### 1.7.1 Release (04.01.2021) * Changed summary message for one murderer round * Changed Innocents will be killed if they kill the detective (if ENABLE_KILL_DETECTIVE_IF_INNOCENT_KILLED enabled) * Added customizable item name in arena selector gui ### 1.7.0 Release (29.12.2020) * Rewritten scoreboardlib (fixed flickering and color matching) -> 122 chars for 1.14 up and 48 for lower versions * Fixed issue that murderer is not removed from alive list if there are only 2 players left * Fixed player teleport on void death while in lobby stage >>> b2 * Attempt to fix scoreboard problems >>> b1 * Fix NoSuchMethodError when CommandSender#spigot does not exists on 1.11 * Updated ScoreboardLib to fix problems with color matching * Now spectators will not launch fireworks once game stopped ### 1.6.9 Release (28.11.2020) * Fixed joining through a sign while hotbar slot for leave-item is active * Fixed gold visuals broke the whole plugin while enabled ### 1.6.8 Release (10.11.2020) * Fixed particle effects not working on 1.13+ ### 1.6.7 Release (02.11.2020 - 08.11.2020) * Added particle effect to gold spawn locations to show where gold will spawn * Added death/spectator roles therefore users will not get rewards if they are spectator * Added rainbow beds ### 1.6.6 Stable (31.10.2020) * Fixed armorstands are not correctly displayed * Fixed dead body heads * Fixed locales not working * Fixed heads * Fixed sign loading * Fixed sign after arena validation * Fixed new arena is not proper registered * Fixed scoreboard friendly fire caused players visible * Fixed arrows can damage entities outside the game * Changed disabled arrow bouncing ### 1.6.5 (07.10.2020 - 29.10.2020) * Added special blocks remove command /mma removeblock * Fixed hologram spawn item height (bow) * Fixed the bow item got not removed on some cases * Another fix for cauldron click event * Fixed locations of special blocks on setup menu * Optimized special block click performance * Fixed stacked armorstands * Fixed players will die under water ### 1.6.4 Hotfix (05.10.2020) * Fixed cauldron click event * Fixed detectives will get bow from prayer ### 1.6.3 Release (19.09.2020 - 02.10.2020) * Updated locales to latest version * Added the possibility to disable the innocent locator * Added the possibility to change messages of locales on language.yml * Fixed adding cauldrons to the arena * Removed HolographicDisplays dependency ### 1.6.2 Release (15.08.2020 - 13.09.2020) * (Developer Alert - Changed class names) * Added support for 1.16 hex colors * Added ArenaSelector * Added config option to play sound when adding score to user * Added new reward type gold_pickup * Fixed NPE when trying to teleport players to lobby location * Fixed no permission message not found * Fixed goldrush & goldban prayer did not reset on game end * Fixed MYSQL stats can't update * Fixed special blocks registering click twice * Fixed IllegalPluginAccessException on plugin disable * Fixed wrong order in trails * Fixed local values got no reset * Changed Death prefix can now be changed * Changed message delay of "Waiting for players" from 15 to 45 seconds * Optimized player corpse heads on paper * Reworked version checker ### 1.6.1 Release (01.07.2020 - 27.07.2020) * Added missing 1.14 & 1.15 & 1.16 Materials * Added simple head corpse when no CorpseReborn is installed * Added new reward event -> death * Changed Reduce message will now only come on debug mode * Changed mysql updates to do only one instead of more than 10 (should improve performance) * Fixed spectators that wasn't ingame got rewards * Fixed reset of contributions not applied when leaving ingame * Fixed in rare cases is the speed not the default one after changing it with spectator menu * Fixed sword is flying further after player hit * Fixed separate chat (and prefix for death players) ### 1.6.0 Release * Fixed spectators preventing arrows * Fixed editor value "spawn gold time" * Added bungeemode Arena shuffler * Added option to disable separate chat * Added 1.16.x compatibility * Added possibility to change table name of mysql database * Removed stats save on quitevent as it wasn't necessary * Fixed different sword cooldown time than 5 seconds * Fixed bungeemanager enable null text error * Optimized murderer leave before they got the sword * Optimized the death respawn location * Fixed prayer multi gold ### 1.5.5 Hotfix * Fixed language list getting ### 1.5.4 Release * Added new config values to change arrow amount of fake detective and bow on gold * Fixed properties getting on language list * Disabled creating of reducedDependencyPom ### 1.5.3 Release * Added a config value to disable detective killing on innocent kill * Added a config value to change the spawner mode * Added a way to disable gold spawn limit * Added a config value to change the get bow from gold value (default: 10) * Added Murderer speed can be disabled * Added Murderer speed multiplier can be changed * Added Now you can change the hit range and max range of the flying sword * Fixed an 1.15.x reporter service plugin crash * Fixed murderer can kill other murderer with bow * Fixed amount of arrows on gold pickup * Changed default language value as there does not exist /mm admin * Updated setup tips Feedback page link * Optimized sword fly * Fixed Stats will now get saved on restart stage * Fixed stats were not loaded on bungee mode * Fixed chances are not displayed on new players for the first round (occurred for all who using mysql database) ### 1.5.2 Release * Fixed Commands.Main-Command.Heads not found ### 1.5.1 Release (20.03.2020) * Fixed broken language * Added PlaceholderAPI for some per player messages * Fixed Parties Integration * Attempt to fix player respawn ### 1.5.0 Release (20.12.2019 - 17.03.2020) (by Tigerpanzer) * Fixed spectator gui opened on physical actions * Added option to control the time between gold spawns * Added better option to allow only 1 murderer/detectives * Fixed division by null error * Fixed murderer can kill other murderer * Fixed bungeecord shutdown when game ends (Thanks to barpec12) * Added option to hide chances * Changed the setup radius of enchanting table and cauldron to 15 * PlaceholderAPI placeholders are no longer case sensitive * Added arena state placeholders for PlaceholderAPI: * %murdermystery_{arena id}:{data}% where data types are: * players - amount of players in arena * max_players - max players in arena * state - current state raw enum name eg. STARTING * state_pretty - prettified name of enum eg. Waiting (instead WAITING_FOR_PLAYERS) * mapname - name of arena map * Fixed mysql database - Create a new one and your stats should be saved correctly (Thanks to add5tar) * Fixed loading arena values (Some values had a wrong file location) * Added party dependency, you can join with more players to one arena * Fixed murder gets sword as spectator * Changed murder speed boost from potion to walkspeed to hide particles * Added Connect-To-Hub boolean to bungee.yml * Added End-Location-Hub boolean to bungee.yml ### 1.4.1 Release (05.12.2019 - 13.12.2019) (by Tigerpanzer) * Added a new MOTD Manager in the bungee.yml (Now you can define the states on yourself) * Now the values in bungee.yml will work * Arena will not be stopped anymore on starting phase when there are null players (only resetting it to waiting for players) * You can now activate short commands (/start and /leave) * Fixed incompatibility with chatcontrol * Minecraft 1.15 compatible * Fixed the murderer draw when murderer leaves ingame * Fixed SummaryMessage (murderer will now be strike out) ### 1.4.0 Release (26.10.2019 - 16.11.2019) (by Tigerpanzer) * Fixed incompatibility with essentials respawn * You can now choose your own cooldown for sword attack/fly and bow shoot * Clearer way of error reporting * Added option to change murderer sword item * Added options to specify arrows amount * Added a way to configure how many murderers & detectives are selected for a game (definable per arena) * Changed the way of drop bow (The bow will be dropped if the last detective die) * Fixed scoreboard innocents count * Added compass distance to bow and player locator * Fixed the +- message for minus points in score messages * Fixed the exp and level save on InventoryManager * Fixed instant respawn bug on last murderer ### 1.3.1 Release (11/18.10.2019) (by Tigerpanzer) * Fixed that you can sleep in beds * Fixed player spawning after a death in blocks * Fixed arena stop when it will be called due to reload, stop, delete * Fixed the NoSuchMethodException on arena sign load when the sign isn´t a wallsign * Dropped 1.11 support ### 1.3.0 Release (21.09.2019 - 03.10.2019) (by Tigerpanzer) * Changed the way how randomjoin works (now it will search for the most players first) * Fixed wrong location of corpse, hologram and bow spawn after player left the game * Fixed when you took death prayer you could die in next game * Fixed getting damage from fire after you join a game * Fixed the hero name in the summary message was always none * Inventories will now properly regenerate on plugin disable * Changed that player will be a spectator when the starting time is under 3 * Added option to disable fall damage in the arena * Fixed sound after player death that could be heard in lobby * Fixed the ArrayIndexOutOfBoundsException when the murder left before the game starts (crashing game) * Now players can´t interact with armorstands when they are in the arena * Now players can´t destroy itemframes, paintings, and armorstands when they are in the arena * Proofread and updated locales ~Plajer ### 1.2.1 Release (11/13.09.2019) (by Tigerpanzer) * Added a lobby time shorter when the maximum player size is reached * The sword will be now available at cooldown to hit someone as murder (after a 1 sec throw cooldown because the sword is not available if you throw it) * Fixed 1.14 ClassNotFoundException error when a paper server version is used * Fix GUI opening on physical actions (Especially on redstone block) (thanks to BestMark) * Fix null on getting corpse data from corpse reborn (thanks to BestMark) ### 1.2.0 Release (08/09.09.2019) (by Tigerpanzer) * Added name tags hide feature in game * Game will now properly end when murderer dies by environment * Detective will now drop bow when dies by environment * Fixed 1.14 NoClassFound error when user tries to pick up an arrow * You shouldn't be teleported to spawn on death in game (you'll stay at the death location) * Murderer will no longer throw the sword if you interact physically with redstone mechanisms * Fixed issue that you could join full games before they started (in game you join as spectator) now proper full game permission check will occur and do the thing to allow or disallow you to join * /mm randomjoin will now really join random arena not first one it find good to join * Updated bunch of locales * Fixed Russian locale was broken * Added Slovak and Turkish locales (thanks to POEditor contributors) * Fixed bug that auto respawn didn't work ### 1.1.6 Release (13/29.07.2019) * Changed Chinese (Simplified) locale prefix from zh to cn and Chinese (Traditional) from zh_hk to zh_tw * Respawn will now properly work on 1.14 * Fixed /vda typo in force start command * Prettified special blocks setup messages * Dropped leaderheads support, leaderheads now uses PlaceholderAPI to retrieve statistics and we do support PAPI so please use that ### 1.1.5 Release (12.07.2019) * Fixed errors in console when joining game via sign ### 1.1.4 Release (15.06.2019 - 10.07.2019) * Plugin will no longer send error messages `failed to register events` if corpse reborn wasn't installed * Join permission message outputs required permission node now * Added Portuguese (BR) locale (`pt_br` in config.yml) * Locales with special characters like Russian or Korean will now work properly and won't be seen as `?` characters * Added configurable murderer thrown sword speed * Added 1.14 sign game states (thanks to montlikadani) ### 1.1.3 Release (01/08.06.2019) * Fixed boss bar when disabled could throw errors breaking the game * Fixed PlaceholderAPI placeholders didn't work on in-game scoreboard * Fixed locales never worked if there was no locales folder * Fixed new arena name message wasn't sent in setup editor ### 1.1.2 Release (21/25.05.2019) * Fixed that you couldn't edit arena via /mm edit * You will now receive additional message when adding gold/player spawns that 4 is minimum spawns amount so you can add more * Totally recoded arena setup gui UI and code structure, now all changes applies to arena instantly * Arena setup map name option now is chat based not name tag based * Added shift + right click to delete all gold/player spawns (useful if you made a mistke, better than nothing) * Added sign spawn protection radius warning, non opped players can't join via signs if sign is in radius of spawn protection * Debug section is no longer visible part of config, it can be added manually but won't be there by default from now * Reload command is no longer discouraged and reloads both config and language file * Sword does fly bit faster now (from 0.5 to 0.65 fly speed) * Murderer no longer always receive lose statistic even on win * Fixed boss bar displays game end message instead of waiting for players after start up * /mma help and /mm help will display help pages now * Players shouldn't be able to interact with flower pots and paintings anymore ### 1.1.1 Release (28.04.2019 - 18.05.2019) * Relocate Plajer's Lair Services and TigerHix's ScoreboardLib packages in order to avoid conflict between our minigames if used on same server * Fixed saving user data on plugin disable while using MySQL * /mma delete and reload require confirmation before execution now, theymust be typed twice to execute * Added permissions for increased chance of being murderer or detective, node: `murdermystery.role.murderer.<1/100>` or `murdermystery.role.detective.<1/100>` the number is the amount of bonus points to give on arena join * Fixed update notify message was sent to everybody without proper permission check * First time database creation is now made async not in main server thread * Implemented faster Hikari connection pool library and removed BoneCP, jar size is now 3 times smaller too * Apache commons-io is now shaded into jar, 1.14 removed it * Recoded whole commands structure * Scoreboard colors were broken sometimes, this is now fixed (I hope so) ### 1.1.0 Release (28.04.2019) * Fixed wins/loses weren't properly assigned on game end, only murderer received these stats * You can no longer join the game if it's in restarting state * You can no longer swap items via hands (i.e. main hand > off hand) when being in game * Added `win` and `lose` sections to rewards.yml when player wins or loses the game * CorpseReborn is made now soft-dependency, it will enable corpses feature if present but won't otherwise ### 1.0.3 Release (20.04.2019) * Fixed MySQL database didn't work due to create statement failure * Now /mma reload command will force stop all current games before Arenas reload, still command usage is discouraged! (uservoice report) * Leaderheads stats placeholders length has been decreased to fit in the sign (uservoice report) ### 1.0.2 Release (19.04.2019) * Fixed Hero in game summary was always `Nobody` * Fixed error when nobody was alive and game has ended then the exception would occur * Now when typing /mma forcestart with only 1 player game won't start * Added few pro tips when editing arena via /mm edit ### 1.0.1 Release (18.04.2019) * CorpseReborn and HolographicDisplays are now set as soft dependencies in plugin.yml to allow plugin loader to load them before MurderMystery starts and avoid plugin start failure ### 1.0.0 Release (28.10.2018-16.04.2019) * Added Russian, Spanish and Dutch locales support * Detective bow will now spawn bit higher to avoid touching the floor * Spectators can no longer pickup the bow * Added arenas.yml instances section check to avoid errors * Added death cases caused by fall, game won't break anymore when murderer or detective dies from fall * /murdermystery and /murdermysteryadmin commands will now work in game for non ops * Sword can no longer go through walls/solid blocks * Bow no longer loses durability on arrow shoot * New users will now start with default value of contributions for each role 1 not 0 that would throw errors in lobby stage * Fixed action bar colors were broken * Fixed game end announce didn't happen * Fixed sword glitch after throwing it * Users cannot longer pickup anything from the ground * Spectators cannot use special blocks anymore * CorpseReborn and HolographicDisplays are no longer hardcoded dependencies in plugin.yml so without them plugin will start with fancy message to install them without throwing not user-friendly exception * Fixed kills, loses and wins statistics weren't added anytime * Misc code performance improvements * Removed Locale suggester > Release Candidate 2 (28.03.2019) * Setup GUI will now display 0 minimum players option if accidentally set * Bow Time prayer will now add new arrow to the inventory not set and override current amount * Improvement for bow cooldown display action bar * Fixed corpses were instantly removed on spawn, timer was set in ticks not seconds * Fixed spectator items didn't work on death (spigot bug) * Fixed corpse will no longer spawn on ending location when leaving game via /mm leave if you were fake detective or a detective * Fixed bow couldn't be picked up by innocents * Fixed more than one corpse was spawned on death * Fixed you couldn't receive bow when you had more than 10 gold taken (you have 9 gold and pickup 2 then you cannot get bow cause you have 11 not 10) * Fixed more corpses could spawn on death by arrow * Fixed last words didn't display on death other than by arrow * Fixed message Game-Started which was copied from Village Defense > Release Candidate 1 (24/26.03.2019) * Now clicking corpses in game won't open their inventories * Improved sign manager * Removed ' character from default join permission node * Crucial block center calculations fix - now holograms will display properly * Fixed prayer particle display and arena setup * Fixed single compensation prayer from Confessional did give gold but it was useless as user gold statistics weren't increased * Now using special blocks if game has ended/not started (in lobby) is blocked * Bow Time prayer (receive bow + arrows) is applied to everyone * Bow Time prayer has been nerfed, only 1 arrow is given not whole stack now * Now player health will be set to full when joining the game * Bow drop announcement will no longer appear when only 1 player has left in the game * When game ends users will get reset their non persistent user data (like gained gold amount) > Pre 5 (24.03.2019) * Abandoned the direct try-catch exception handling in most of methods and event listeners in favour of logger listening, code looks better now * Fixed setup inventory didn't work * Using new Scoreboard library, whole game will perform now much better without lags * Now language.yml file is cached on load so it will drastically reduce lag of plugin > Pre 4 (11.01.2019-06.02.2019) * Added useSSL=false argument in mysql.yml address to avoid mysql warnings in console (not harmful) * Added %MAX_PLAYERS% placeholder in scoreboard > Pre 3 (30.10.2018/26.12.2018) * Now arena is stopped 10 seconds after the game ends not 5 seconds after * Arena is now properly clean up after the game when using bungee mode * Fixed arrows weren't given to innocents when they got 10 gold ingots * Fixed /mma forcestart wasn't working properly if there were not enough players to start * In case of server crash players' inventories will be loaded on join from backup from Murder Mystery minigame if exists * When murderer picked up gold, it's amount didn't increase - now it's fixed > Pre 2 (28.10.2018) * Fixed wrong cast error when you were damaged by skeleton's arrow (https://plajer.xyz/errorservice/viewer.php?id=336) * Fixed NPE when murderer was null - I must use player objects instead of these terrible UUID's > Pre 1 (11/20.10.2018) * Minimum amount of players cannot be now less than 2 (game will automatically set it to 2 if so) * Block destroying item frames and paintings * Added mystery cauldron and mystery potions (soon more) * Added praise the developer block (end portal and levers) * Fixed only one gold ingot could be picked up from few ones in a stack * Fixed scores weren't added to account * Added bow trails * Native 1.13 support added * Added PAPI placeholders in scoreboard * Added murdermystery.command.override permission * Added setup video link to the game ### 0.0.8 Beta (06/07.10.2018) * Added throwable sword for murderer * Added multiple last words * Fixed gold not spawning * Fixed starting scoreboard gamestate wasn't displayed * Murderer sword won't be taken now when he receives additional arrows * Now actions that gives you score (like +15 score for gold pickup will properly format without %action% placeholder) * Added 1.13 and 1.13.1 support * Removed 1.9 and 1.10 support * Added spectator settings * API recode * JavaDocs created * Fixed throwable sword angle * You cannot join game now infinitely through command * Added corpses override option in config * Now players that will leave game will be visible by other players outside game * Fixed some potions amplifiers were 1 level higher, amplifiers are counted from 0 ### 0.0.7 Beta (03.10.2018) * Added PAPI placeholders in chat (chat formatting must be enabled) * General code improvements and changes * Added %MAPNAME% placeholder in scoreboard * Added checking for minimum players amount in lobby to start ================================================ FILE: .github/CONTRIBUTORS.md ================================================ ## This file is dedicated to **Murder Mystery** project's all-time contributors. ## **very outdated, please nag me if you still see it here** **I'm sincerely glad to everyone who supported our project every time!** **Contributors are listed in alphabetical order, every contributor is equally important!** * Adolfo Garolfo - Spanish translator * Andrei - Romanian translator * [Borc55](https://www.spigotmc.org/members/borc55.108890/) - Czech translator * [ColaIan](https://www.spigotmc.org/members/colaian.608965/) - Chinese (Traditional) translator * [Dianox](https://www.spigotmc.org/members/dianox.74931/) - French translator * EnderBoyHUN - Hungarian translator * HStreamGamer - Vietnamese translator * [KitsuneSakul](https://www.spigotmc.org/members/kitsunesakul.61401/) - Czech translator * [Melonzrix](https://www.spigotmc.org/members/melongun77.147284/) - German translator * [montlikadani](https://www.spigotmc.org/members/toldi.251100/) - Hungarian translator * [N4TH4NOT](https://www.spigotmc.org/members/n4th4not.400311/) - French translator * SteveFox - Italian translator * [Tigerkatze](https://www.spigotmc.org/members/tigerkatze.414545/) - Main tester, German translator and one of current maintainers of Murder Mystery project * [zuhir](https://www.spigotmc.org/members/zuhir.31452/) - Spanish translator * 壁灯 - Chinese (Simplified) translator **Thanks to these companies for providing free licenses for MurderMystery open source work:** * Code Whale Inc. - POEditor open source project license **Also thanks to every bug reporters for reporting us those nasty bugs, and code contributors for making Murder Mystery better!** `Please note that translators are put here only if their contribution to the language is higher than 15% of total strings and language is used in plugin` ![](https://i.imgur.com/LFakRC8.png) ================================================ FILE: .github/FUNDING.yml ================================================ patreon: plugily ================================================ FILE: .github/LICENSE.md ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: .github/README.md ================================================ ![](https://images.plugily.xyz/banner/display.php?id=MurderMystery) # Murder Mystery [![Maven Repository](https://maven.plugily.xyz/api/badge/latest/releases/plugily/projects/murdermystery?color=40c14a&name=Maven&prefix=v)](https://maven.plugily.xyz/#/releases/plugily/projects/murdermystery) [![JavaDoc Repository](https://maven.plugily.xyz/api/badge/latest/releases/plugily/projects/murdermystery?color=40c14a&name=JavaDoc&prefix=v)](https://maven.plugily.xyz/javadoc/releases/plugily/projects/murdermystery/latest) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Plugily-Projects_MurderMystery&metric=sqale_rating)](https://sonarcloud.io/summary/overall?id=Plugily-Projects_MurderMystery) [![Discord](https://img.shields.io/discord/345628548716822530.svg?color=7289DA&style=for-the-badge&logo=discord)](https://discord.plugily.xyz) [![Patreon]( https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/plugily) Murder Mystery is a Minecraft minigame designed for small and big servers. This minigame is unique and very configurable, 100% free and open source! Be the murderer and kill everyone in the game! Beware of the detective and armored innocents! As a detective you must kill the murderer and protect as much innocents as you can! As an innocent you must just survive till the end! Have fun using it! Leave a good rating if you really like it. ## Want to contribute in this project? [**💣 Issues Reporting (Discord)**](https://discordapp.com/invite/UXzUdTP) [**❤ Make Donation**](https://www.paypal.me/plugilyprojects) # Credits ## Open Source Libraries | Library | Author | License | |------------------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------------------------------------| | [ScoreboardLib](https://github.com/TigerHix/ScoreboardLib/) | [TigerHix](https://github.com/TigerHix) | [LGPLv3](https://github.com/TigerHix/ScoreboardLib/blob/master/LICENSE) | | [HikariCP](https://github.com/brettwooldridge/HikariCP) | [brettwooldridge](https://github.com/brettwooldridge) | [Apache License 2.0](https://github.com/brettwooldridge/HikariCP/blob/dev/LICENSE) | | [bStats](https://github.com/Bastian/bStats-Metrics) | [Bastian](https://github.com/Bastian) | [LGPLv3](https://github.com/Bastian/bStats-Metrics/blob/master/LICENSE) | | [Commons Box](https://github.com/Plajer/Commons-Box) | [Plajer](https://github.com/Plajer) | [GPLv3](https://github.com/Plajer/Commons-Box/blob/master/LICENSE.md) | | [MiniGamesBox](https://github.com/Plugily-Projects/MiniGamesBox) | [Plugily Projets](https://github.com/Plugily-Projects) | [GPLv3](https://github.com/Plugily-Projects/MiniGamesBox/blob/master/LICENSE.md) | ## Open Source Licenses #### Code Whale jetbrains logo Thanks to Code Whale for Open Source license for POEditor project. ## Contributors This section will be updated soon ================================================ FILE: .github/building/build.gradle.kts ================================================ plugins { id("signing") `maven-publish` id ("com.gradleup.shadow") version "9.0.0-beta5" java } repositories { mavenLocal() maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") maven("https://oss.sonatype.org/content/repositories/snapshots") maven("https://oss.sonatype.org/content/repositories/central") maven { name = "papermc" url = uri("https://repo.papermc.io/repository/maven-public/") } maven(uri("https://maven.plugily.xyz/releases")) maven(uri("https://maven.plugily.xyz/snapshots")) maven(uri("https://repo.maven.apache.org/maven2/")) } dependencies { implementation("plugily.projects:MiniGamesBox-Classic:1.3.17") { isTransitive = false } compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT") compileOnly("org.jetbrains:annotations:24.0.1") compileOnly(files("lib/CorpseReborn.jar")) } group = "plugily.projects" version = "2.1.1-SNAPSHOT1" description = "MurderMystery" java { withJavadocJar() } tasks { build { dependsOn(shadowJar) } shadowJar { archiveClassifier.set("") relocate("plugily.projects.minigamesbox", "plugily.projects.murdermystery.minigamesbox") relocate("com.zaxxer.hikari", "plugily.projects.murdermystery.database.hikari") minimize() } processResources { filesMatching("**/plugin.yml") { expand(project.properties) } } javadoc { options.encoding = "UTF-8" } } publishing { repositories { maven { name = "Releases" url = uri("https://maven.plugily.xyz/releases") credentials { username = System.getenv("MAVEN_USERNAME") password = System.getenv("MAVEN_PASSWORD") } } maven { name = "Snapshots" url = uri("https://maven.plugily.xyz/snapshots") credentials { username = System.getenv("MAVEN_USERNAME") password = System.getenv("MAVEN_PASSWORD") } } } publications { create("mavenJava") { from(components["java"]) } } } ================================================ FILE: .github/building/gradlew ================================================ #!/bin/sh # # Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 # ############################################################################## # # Gradle start up script for POSIX generated by Gradle. # # Important for running: # # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is # noncompliant, but you have some other compliant shell such as ksh or # bash, then to run this script, type that shell name before the whole # command line, like: # # ksh Gradle # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: # * functions; # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # «${var#prefix}», «${var%suffix}», and «$( cmd )»; # * compound commands having a testable exit status, especially «case»; # * various built-in commands including «command», «set», and «ulimit». # # Important for patching: # # (2) This script targets any POSIX shell, so it avoids extensions provided # by Bash, Ksh, etc; in particular arrays are avoided. # # The "traditional" practice of packing multiple parameters into a # space-separated string is a well documented source of bugs and security # problems, so this is (mostly) avoided, by progressively accumulating # options in "$@", and eventually passing that to Java. # # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; # see the in-line comments for details. # # There are tweaks for specific operating systems such as AIX, CygWin, # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. # ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link app_path=$0 # Need this for daisy-chained symlinks. while APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path [ -h "$app_path" ] do ls=$( ls -ld "$app_path" ) link=${ls#*' -> '} case $link in #( /*) app_path=$link ;; #( *) app_path=$APP_HOME$link ;; esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s ' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { echo "$*" } >&2 die () { echo echo "$*" echo exit 1 } >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "$( uname )" in #( CYGWIN* ) cygwin=true ;; #( Darwin* ) darwin=true ;; #( MSYS* | MINGW* ) msys=true ;; #( NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD=$JAVA_HOME/jre/sh/java else JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD=java if ! command -v java >/dev/null 2>&1 then die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi # Collect all arguments for the java command, stacking in reverse order: # * args from the command line # * the main class name # * -classpath # * -D...appname settings # * --module-path (only if needed) # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) # Now convert the arguments - kludge to limit ourselves to /bin/sh for arg do if case $arg in #( -*) false ;; # don't mess with options #( /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath [ -e "$t" ] ;; #( *) false ;; esac then arg=$( cygpath --path --ignore --mixed "$arg" ) fi # Roll the args list around exactly as many times as the number of # args, so each arg winds up back in the position where it started, but # possibly modified. # # NB: a `for` loop captures its iteration list before it begins, so # changing the positional parameters here affects neither the number of # iterations, nor the values presented in `arg`. shift # remove old arg set -- "$@" "$arg" # push replacement arg done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ org.gradle.wrapper.GradleWrapperMain \ "$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then die "xargs is not available" fi # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. # # In Bash we could simply go: # # readarray ARGS < <( xargs -n1 <<<"$var" ) && # set -- "${ARGS[@]}" "$@" # # but POSIX shell has neither arrays nor command substitution, so instead we # post-process each arg (as a line of input to sed) to backslash-escape any # character that might be a shell metacharacter, then use eval to reverse # that process (while maintaining the separation between arguments), and wrap # the whole thing up as a single "set" statement. # # This will of course break if any of these variables contains a newline or # an unmatched quote. # eval "set -- $( printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | xargs -n1 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | tr '\n' ' ' )" '"$@"' exec "$JAVACMD" "$@" ================================================ FILE: .github/building/gradlew.bat ================================================ @rem @rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem @rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem @rem SPDX-License-Identifier: Apache-2.0 @rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Resolve any "." and ".." in APP_HOME to make it shorter. for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute echo. 1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute echo. 1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 goto fail :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! set EXIT_CODE=%ERRORLEVEL% if %EXIT_CODE% equ 0 set EXIT_CODE=1 if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal :omega ================================================ FILE: .github/building/pom.xml ================================================ 4.0.0 plugily.projects murdermystery 2.1.2-SNAPSHOT0 MurderMystery 1.8 UTF-8 GNU General Public License v3 https://www.gnu.org/licenses/gpl-3.0.en.html plugilyprojects https://maven.plugily.xyz/releases plugilyprojects-snapshots https://maven.plugily.xyz/snapshots spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ papermc https://repo.papermc.io/repository/maven-public/ io.papermc.paper paper-api 1.21.4-R0.1-SNAPSHOT provided org.jetbrains annotations 23.0.0 provided plugily.projects MiniGamesBox-Classic 1.4.0 compile true org.golde corpsereborn 2.14.0 system ${project.basedir}/lib/CorpseReborn.jar src/main/resources true org.apache.maven.plugins maven-compiler-plugin 3.14.0 ${java.version} ${java.version} UTF-8 org.apache.maven.plugins maven-site-plugin 3.21.0 org.apache.maven.plugins maven-deploy-plugin 3.1.4 org.apache.maven.plugins maven-project-info-reports-plugin 3.9.0 org.apache.maven.plugins maven-javadoc-plugin 3.11.2 Murder Mystery API docs for v${project.version} Minecraft survival minigame. Be the murderer, innocent or the detective! Don't be killed during the game to win! API documentation for hooking Murder Mystery with your plugin. org.apache.maven.plugins maven-jar-plugin 3.4.2 org.apache.maven.plugins maven-shade-plugin 3.6.0 package shade true com.zaxxer.hikari plugily.projects.murdermystery.database.hikari plugily.projects.minigamesbox plugily.projects.murdermystery.minigamesbox false plugily.projects betty-maven-plugin 1.0.2 ${project.basedir}/CHANGELOG.md org.apache.maven.wagon wagon-ssh 3.5.3 Release https://maven.plugily.xyz/releases Snapshot https://maven.plugily.xyz/snapshots ================================================ FILE: .github/building/settings.gradle.kts ================================================ rootProject.name = "murdermystery" ================================================ FILE: .github/workflows/deploy-development.yml ================================================ name: Bump and Publish Development Branch on: push: branches: [ development ] workflow_dispatch: jobs: bump: runs-on: ubuntu-latest steps: - name: Checkout Latest Commit uses: actions/checkout@v4.2.2 - name: Bump Version id: bump uses: Plugily-Projects/version-bump-action@v10 with: github-token: ${{ secrets.github_token }} auto-version-bump: true - name: Print Version run: "echo 'New Version: ${{steps.bump.outputs.version}}'" publish: needs: bump runs-on: ubuntu-latest steps: - name: Checkout Latest Commit uses: actions/checkout@v4.2.2 with: ref: 'development' - name: Set up JDK uses: actions/setup-java@v4.6.0 with: distribution: 'temurin' java-version: '21' java-package: jdk - name: Set up Maven uses: stCarolas/setup-maven@v5 with: maven-version: 3.8.2 - name: Cache uses: actions/cache@v4.2.2 with: path: ~/.m2/repository key: maven-${{ hashFiles('**/pom.xml') }} restore-keys: maven- - name: Publish with Maven uses: s4u/maven-settings-action@v3.1.0 with: servers: | [{ "id": "Snapshot", "username": "${{ secrets.SNAPSHOTSUSERNAME }}", "password": "${{ secrets.SNAPSHOTSPASSWORD }}" }] - run: mvn clean verify compile package site:site javadoc:javadoc javadoc:jar deploy -DaltDeploymentRepository=Snapshot::https://maven.plugily.xyz/snapshots -f pom.xml ================================================ FILE: .github/workflows/deploy-master.yml ================================================ name: Bump and Publish Master Branch on: pull_request: types: - closed workflow_dispatch: jobs: bump: if: github.event.pull_request.merged runs-on: ubuntu-latest steps: - name: Checkout Latest Commit uses: actions/checkout@v4.2.2 - name: Bump Version id: bump uses: Plugily-Projects/version-bump-action@v10 with: github-token: ${{ secrets.github_token }} auto-version-bump: false auto-version-bump-release: true - name: Print Version run: "echo 'New Version: ${{steps.bump.outputs.version}}'" publish: needs: bump runs-on: ubuntu-latest steps: - name: Checkout Latest Commit uses: actions/checkout@v4.2.2 with: ref: 'master' - name: Set up JDK uses: actions/setup-java@v4.6.0 with: distribution: 'temurin' java-version: '21' java-package: jdk - name: Set up Maven uses: stCarolas/setup-maven@v5 with: maven-version: 3.8.2 - name: Cache uses: actions/cache@v4.2.2 with: path: ~/.m2/repository key: maven-${{ hashFiles('**/pom.xml') }} restore-keys: maven- - name: Publish with Maven uses: s4u/maven-settings-action@v3.1.0 with: servers: | [{ "id": "Release", "username": "${{ secrets.RELEASESUSERNAME }}", "password": "${{ secrets.RELEASESPASSWORD }}" }] - run: mvn clean verify compile package site:site javadoc:javadoc javadoc:jar deploy -DaltDeploymentRepository=Release::https://maven.plugily.xyz/releases -f pom.xml ================================================ FILE: .gitignore ================================================ /out/ /generated/ /minecraft/ /target/ ================================================ FILE: gradle/wrapper/gradle-wrapper.properties ================================================ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists ================================================ FILE: lib/README.md ================================================ _This lib folder contains external libs that are not provided by their author with Maven._ **(The following libraries located in this folder have been released in compliance with the license therein)** CorpseReborn (License: No License | https://www.spigotmc.org/resources/authors/ericgolde555.23398/ | https://github.com/egold555/CorpseReborn ) If you are the owner of one of these libraries feel free to contact us if you want removal of your lib ( https://discord.plugily.xyz or management@plugily.xyz ) . ================================================ FILE: pom.xml ================================================ 4.0.0 plugily.projects murdermystery 2.1.6 MurderMystery 1.8 UTF-8 GNU General Public License v3 https://www.gnu.org/licenses/gpl-3.0.en.html plugilyprojects https://maven.plugily.xyz/releases plugilyprojects-snapshots https://maven.plugily.xyz/snapshots spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ papermc https://repo.papermc.io/repository/maven-public/ io.papermc.paper paper-api 1.21.4-R0.1-SNAPSHOT provided org.jetbrains annotations 23.0.0 provided plugily.projects MiniGamesBox-Classic 1.4.5 compile true org.golde corpsereborn 2.14.0 system ${project.basedir}/lib/CorpseReborn.jar src/main/resources true org.apache.maven.plugins maven-compiler-plugin 3.14.0 ${java.version} ${java.version} UTF-8 org.apache.maven.plugins maven-site-plugin 3.21.0 org.apache.maven.plugins maven-deploy-plugin 3.1.4 org.apache.maven.plugins maven-project-info-reports-plugin 3.9.0 org.apache.maven.plugins maven-javadoc-plugin 3.11.2 Murder Mystery API docs for v${project.version} Minecraft survival minigame. Be the murderer, innocent or the detective! Don't be killed during the game to win! API documentation for hooking Murder Mystery with your plugin. org.apache.maven.plugins maven-jar-plugin 3.4.2 org.apache.maven.plugins maven-shade-plugin 3.6.0 package shade true com.zaxxer.hikari plugily.projects.murdermystery.database.hikari plugily.projects.minigamesbox plugily.projects.murdermystery.minigamesbox false plugily.projects betty-maven-plugin 1.0.2 ${project.basedir}/CHANGELOG.md org.apache.maven.wagon wagon-ssh 3.5.3 Release https://maven.plugily.xyz/releases Snapshot https://maven.plugily.xyz/snapshots ================================================ FILE: pom.xml.versionsBackup ================================================ 4.0.0 plugily.projects murdermystery 2.1.1-SNAPSHOT1 MurderMystery 1.8 UTF-8 GNU General Public License v3 https://www.gnu.org/licenses/gpl-3.0.en.html plugilyprojects https://maven.plugily.xyz/releases plugilyprojects-snapshots https://maven.plugily.xyz/snapshots jitpack https://jitpack.io codemc-repo https://repo.codemc.org/repository/maven-public/ spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ papermc https://papermc.io/repo/repository/maven-public/ io.papermc.paper paper-api 1.21.4-R0.1-SNAPSHOT provided org.jetbrains annotations 23.0.0 provided plugily.projects MiniGamesBox-Classic 1.3.17-SNAPSHOT12 compile true org.golde corpsereborn 2.14.0 system ${project.basedir}/lib/CorpseReborn.jar src/main/resources true org.apache.maven.plugins maven-compiler-plugin 3.14.0 ${java.version} ${java.version} org.apache.maven.plugins maven-site-plugin 3.21.0 org.apache.maven.plugins maven-deploy-plugin 3.1.4 org.apache.maven.plugins maven-project-info-reports-plugin 3.9.0 org.apache.maven.plugins maven-javadoc-plugin 3.11.2 Murder Mystery API docs for v${project.version} Minecraft survival minigame. Be the murderer, innocent or the detective! Don't be killed during the game to win! API documentation for hooking Murder Mystery with your plugin. org.apache.maven.plugins maven-jar-plugin 3.4.2 org.apache.maven.plugins maven-shade-plugin 3.6.0 package shade true com.zaxxer.hikari plugily.projects.murdermystery.database.hikari plugily.projects.minigamesbox plugily.projects.murdermystery.minigamesbox false plugily.projects betty-maven-plugin 1.0.2 ${project.basedir}/CHANGELOG.md org.apache.maven.wagon wagon-ssh 3.5.3 Release https://maven.plugily.xyz/releases Snapshot https://maven.plugily.xyz/snapshots ================================================ FILE: src/main/java/plugily/projects/murdermystery/HookManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; import plugily.projects.murdermystery.Main; import java.util.EnumMap; import java.util.Map; /** * @author Plajer *

* Created at 28.04.2019 */ public class HookManager { //todo implement in minigamescore as bb citiziens could benefit from too private final Map hooks = new EnumMap<>(HookFeature.class); private final Main plugin; public HookManager(Main plugin) { this.plugin = plugin; enableHooks(); } private void enableHooks() { for(HookFeature feature : HookFeature.values()) { boolean hooked = true; for(Hook requiredHook : feature.getRequiredHooks()) { if(!Bukkit.getPluginManager().isPluginEnabled(requiredHook.getPluginName())) { hooks.put(feature, false); plugin.getDebugger().debug("[HookManager] Feature {0} won't be enabled because " + requiredHook.getPluginName() + " is not installed! Please install it in order to enable this feature in-game!", feature.name()); hooked = false; break; } } if(hooked) { hooks.put(feature, true); plugin.getDebugger().debug("[HookManager] Feature {0} enabled!", feature.name()); } } } public boolean isFeatureEnabled(HookFeature feature) { return hooks.getOrDefault(feature, false); } public enum HookFeature { CORPSES(Hook.CORPSE_REBORN); private final Hook[] requiredHooks; HookFeature(Hook... requiredHooks) { this.requiredHooks = requiredHooks; } public Hook[] getRequiredHooks() { return requiredHooks; } } public enum Hook { CORPSE_REBORN("CorpseReborn"); private final String pluginName; Hook(String pluginName) { this.pluginName = pluginName; } public String getPluginName() { return pluginName; } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/Main.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery; import org.jetbrains.annotations.TestOnly; import plugily.projects.minigamesbox.classic.PluginMain; import plugily.projects.minigamesbox.classic.handlers.setup.SetupInventory; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSetupCategoryManager; import plugily.projects.minigamesbox.classic.utils.services.metrics.Metrics; import plugily.projects.murdermystery.arena.*; import plugily.projects.murdermystery.arena.special.SpecialBlockEvents; import plugily.projects.murdermystery.arena.special.mysterypotion.MysteryPotionRegistry; import plugily.projects.murdermystery.arena.special.pray.PrayerRegistry; import plugily.projects.murdermystery.boot.AdditionalValueInitializer; import plugily.projects.murdermystery.boot.MessageInitializer; import plugily.projects.murdermystery.boot.PlaceholderInitializer; import plugily.projects.murdermystery.commands.arguments.ArgumentsRegistry; import plugily.projects.murdermystery.events.PluginEvents; import plugily.projects.murdermystery.handlers.CorpseHandler; import plugily.projects.murdermystery.handlers.lastwords.LastWordsManager; import plugily.projects.murdermystery.handlers.setup.SetupCategoryManager; import plugily.projects.murdermystery.handlers.skins.sword.SwordSkinManager; import plugily.projects.murdermystery.handlers.trails.BowTrailsHandler; import plugily.projects.murdermystery.handlers.trails.TrailsManager; /** * Created by Tigerpanzer_02 on 13.03.2022 */ public class Main extends PluginMain { private ArenaRegistry arenaRegistry; private ArenaManager arenaManager; private ArgumentsRegistry argumentsRegistry; private LastWordsManager lastWordsManager; private TrailsManager trailsManager; private SwordSkinManager swordSkinManager; private HookManager hookManager; private CorpseHandler corpseHandler; @TestOnly public Main() { super(); } @Override public void onEnable() { long start = System.currentTimeMillis(); MessageInitializer messageInitializer = new MessageInitializer(this); super.onEnable(); getDebugger().debug("[System] [Plugin] Initialization start"); arenaRegistry = new ArenaRegistry(this); new PlaceholderInitializer(this); messageInitializer.registerMessages(); new AdditionalValueInitializer(this); initializePluginClasses(); if(getConfigPreferences().getOption("HIDE_NAMETAGS")) { getServer().getScheduler().scheduleSyncRepeatingTask(this, () -> getServer().getOnlinePlayers().forEach(ArenaUtils::updateNameTagsVisibility), 60, 140); } getDebugger().debug("Full {0} plugin enabled", getName()); getDebugger() .debug( "[System] [Plugin] Initialization finished took {0}ms", System.currentTimeMillis() - start); } public void initializePluginClasses() { addFileName("lastwords"); addFileName("powerups"); addFileName("skins"); addFileName("special_blocks"); addFileName("trails"); Arena.init(this); ArenaUtils.init(this); new ArenaEvents(this); arenaManager = new ArenaManager(this); arenaRegistry.registerArenas(); getSignManager().loadSigns(); getSignManager().updateSigns(); argumentsRegistry = new ArgumentsRegistry(this); lastWordsManager = new LastWordsManager(this); new BowTrailsHandler(this); MysteryPotionRegistry.init(this); PrayerRegistry.init(this); new SpecialBlockEvents(this); trailsManager = new TrailsManager(this); hookManager = new HookManager(this); corpseHandler = new CorpseHandler(this); swordSkinManager = new SwordSkinManager(this); new PluginEvents(this); addPluginMetrics(); } private void addPluginMetrics() { getMetrics() .addCustomChart( new Metrics.SimplePie( "hooked_addons", () -> { if(getServer().getPluginManager().getPlugin("MurderMystery-Extension") != null) { return "Extension"; } return "None"; })); } @Override public ArenaRegistry getArenaRegistry() { return arenaRegistry; } @Override public ArgumentsRegistry getArgumentsRegistry() { return argumentsRegistry; } @Override public ArenaManager getArenaManager() { return arenaManager; } public LastWordsManager getLastWordsManager() { return lastWordsManager; } public TrailsManager getTrailsManager() { return trailsManager; } public SwordSkinManager getSwordSkinManager() { return swordSkinManager; } public HookManager getHookManager() { return hookManager; } public CorpseHandler getCorpseHandler() { return corpseHandler; } @Override public PluginSetupCategoryManager getSetupCategoryManager(SetupInventory setupInventory) { return new SetupCategoryManager(setupInventory); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/api/events/game/MurderGameCorpseSpawnEvent.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.api.events.game; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; import plugily.projects.minigamesbox.api.events.PlugilyEvent; import plugily.projects.murdermystery.arena.Arena; /** * @author Tigerpanzer_02 *

* Created at 15.04.2022 */ public class MurderGameCorpseSpawnEvent extends PlugilyEvent implements Cancellable { private static final HandlerList HANDLERS = new HandlerList(); private boolean isCancelled = false; private final Player player; private final Location location; public MurderGameCorpseSpawnEvent(Arena arena, Player player, Location location) { super(arena); this.player = player; this.location = location; } public static HandlerList getHandlerList() { return HANDLERS; } @Override public HandlerList getHandlers() { return HANDLERS; } @Override public boolean isCancelled() { return isCancelled; } @Override public void setCancelled(boolean cancelled) { isCancelled = cancelled; } public Player getPlayer() { return player; } public Location getLocation() { return location; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/api/events/game/package-info.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * All in-game related events. */ package plugily.projects.murdermystery.api.events.game; ================================================ FILE: src/main/java/plugily/projects/murdermystery/api/events/player/package-info.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /* * Murder Mystery is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Murder Mystery is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Murder Mystery. If not, see . */ /** * All in-game player related events. */ package plugily.projects.murdermystery.api.events.player; ================================================ FILE: src/main/java/plugily/projects/murdermystery/api/package-info.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Package with all API events and methods to hook with Murder Mystery. */ package plugily.projects.murdermystery.api; ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/Arena.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitTask; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.managers.PluginMapRestorerManager; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.hologram.ArmorStandHologram; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.murdermystery.HookManager; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.corpse.Corpse; import plugily.projects.murdermystery.arena.corpse.Stand; import plugily.projects.murdermystery.arena.managers.MapRestorerManager; import plugily.projects.murdermystery.arena.managers.ScoreboardManager; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.arena.special.SpecialBlock; import plugily.projects.murdermystery.arena.states.InGameState; import plugily.projects.murdermystery.arena.states.RestartingState; import plugily.projects.murdermystery.arena.states.StartingState; import plugily.projects.murdermystery.arena.states.WaitingState; import java.util.*; /** * @author Tigerpanzer_02 *

* Created at 17.12.2021 */ public class Arena extends PluginArena { private static Main plugin; private final List spectators = new ArrayList<>(); private final List deaths = new ArrayList<>(); private final List detectives = new ArrayList<>(); private final List murderers = new ArrayList<>(); private final List goldSpawned = new ArrayList<>(); private final List corpses = new ArrayList<>(); private final List stands = new ArrayList<>(); private final List specialBlocks = new ArrayList<>(); private List goldSpawnPoints = new ArrayList<>(); private List playerSpawnPoints = new ArrayList<>(); private int spawnGoldTimer = 0; private int spawnGoldTime = 0; private boolean detectiveDead; private boolean murdererLocatorReceived; private boolean hideChances; private boolean goldVisuals = false; private final Map gameCharacters = new EnumMap<>(CharacterType.class); private final MapRestorerManager mapRestorerManager; private ArmorStandHologram bowHologram; public Arena(String id) { super(id); setPluginValues(); setScoreboardManager(new ScoreboardManager(this)); mapRestorerManager = new MapRestorerManager(this); setMapRestorerManager(mapRestorerManager); addGameStateHandler(IArenaState.IN_GAME, new InGameState()); addGameStateHandler(IArenaState.RESTARTING, new RestartingState()); addGameStateHandler(IArenaState.STARTING, new StartingState()); addGameStateHandler(IArenaState.WAITING_FOR_PLAYERS, new WaitingState()); } public static void init(Main plugin) { Arena.plugin = plugin; } @Override public Main getPlugin() { return plugin; } @Override public PluginMapRestorerManager getMapRestorerManager() { return mapRestorerManager; } private void setPluginValues() { } public void addCorpse(Corpse corpse) { if(plugin.getHookManager().isFeatureEnabled(HookManager.HookFeature.CORPSES)) { corpses.add(corpse); } } public List getCorpses() { return corpses; } public List getStands() { return stands; } public void addHead(Stand stand) { stands.add(stand); } public void setSpawnGoldTime(int spawnGoldTime) { this.spawnGoldTime = spawnGoldTime; } public void setHideChances(boolean hideChances) { this.hideChances = hideChances; } public boolean isDetectiveDead() { return detectiveDead; } public void setDetectiveDead(boolean detectiveDead) { this.detectiveDead = detectiveDead; } public boolean isMurdererLocatorReceived() { return murdererLocatorReceived; } public void setMurdererLocatorReceived(boolean murdererLocatorReceived) { this.murdererLocatorReceived = murdererLocatorReceived; } public Map getGameCharacters() { return gameCharacters; } public boolean isHideChances() { return hideChances; } @NotNull public List getGoldSpawned() { return goldSpawned; } @NotNull public List getGoldSpawnPoints() { return goldSpawnPoints; } public void setGoldSpawnPoints(@NotNull List goldSpawnPoints) { this.goldSpawnPoints = goldSpawnPoints; } private BukkitTask visualTask; public void startGoldVisuals() { if(visualTask != null) { return; } visualTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> { if(!goldVisuals || !plugin.isEnabled() || goldSpawnPoints.isEmpty() || getArenaState() != IArenaState.WAITING_FOR_PLAYERS) { //we need to cancel it that way as the arena class is an task visualTask.cancel(); return; } for(Location goldLocations : goldSpawnPoints) { Location goldLocation = goldLocations.clone(); goldLocation.add(0, 0.4, 0); Bukkit.getOnlinePlayers().forEach(player -> VersionUtils.sendParticles("REDSTONE", player, goldLocation, 10)); } }, 20L, 20L); } public boolean isGoldVisuals() { return goldVisuals; } public void setGoldVisuals(boolean goldVisuals) { this.goldVisuals = goldVisuals; if(goldVisuals) { startGoldVisuals(); } } public void loadSpecialBlock(SpecialBlock block) { if(!specialBlocks.contains(block)) { specialBlocks.add(block); } switch(block.getSpecialBlockType()) { case MYSTERY_CAULDRON: block.setArmorStandHologram(new ArmorStandHologram(plugin.getBukkitHelper().getBlockCenter(block.getLocation()), new MessageBuilder(plugin.getLanguageManager().getLanguageMessage("In-Game.Messages.Arena.Playing.Special-Blocks.Cauldron.Hologram")).build())); break; case PRAISE_DEVELOPER: ArmorStandHologram prayer = new ArmorStandHologram(plugin.getBukkitHelper().getBlockCenter(block.getLocation())); for(String str : plugin.getLanguageManager().getLanguageMessage("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Hologram").split(";")) { prayer.appendLine(new MessageBuilder(str).build()); } block.setArmorStandHologram(prayer); break; case HORSE_PURCHASE: case RAPID_TELEPORTATION: //not yet implemented default: break; } } public List getSpecialBlocks() { return specialBlocks; } public int getTotalRoleChances(Role role) { int totalRoleChances = 0; for(Player p : getPlayersLeft()) { IUser user = getPlugin().getUserManager().getUser(p); totalRoleChances += getContributorValue(role, user); } //avoid division / 0 return totalRoleChances == 0 ? 1 : totalRoleChances; } public boolean isCharacterSet(Arena.CharacterType type) { return gameCharacters.containsKey(type); } public void setCharacter(Arena.CharacterType type, Player player) { gameCharacters.put(type, player); } public void setCharacter(Role role, Player player) { gameCharacters.put(role == Role.MURDERER ? CharacterType.MURDERER : CharacterType.DETECTIVE, player); } @Nullable public Player getCharacter(Arena.CharacterType type) { return gameCharacters.get(type); } public void addToDetectiveList(Player player) { detectives.add(player); } public boolean lastAliveDetective() { return aliveDetective() <= 1; } public int aliveDetective() { int alive = 0; for(Player player : getPlayersLeft()) { if(Role.isRole(Role.ANY_DETECTIVE, plugin.getUserManager().getUser(player), this) && isDetectiveAlive(player)) { alive++; } } return alive; } public boolean isDetectiveAlive(Player player) { for(Player p : getPlayersLeft()) { if(p == player && detectives.contains(p)) { return true; } } return false; } public List getDetectiveList() { return detectives; } public void addToMurdererList(Player player) { murderers.add(player); } public void removeFromMurdererList(Player player) { murderers.remove(player); } public boolean lastAliveMurderer() { return aliveMurderer() == 1; } public int aliveMurderer() { int alive = 0; for(Player player : getPlayersLeft()) { if(Role.isRole(Role.MURDERER, plugin.getUserManager().getUser(player), this) && isMurderAlive(player)) { alive++; } } return alive; } public boolean isMurderAlive(Player player) { for(Player p : getPlayersLeft()) { if(p == player && murderers.contains(p)) { return true; } } return false; } public List getMurdererList() { return murderers; } public void setBowHologram(ArmorStandHologram bowHologram) { if(bowHologram == null) { this.bowHologram = null; return; } this.bowHologram = bowHologram; } public ArmorStandHologram getBowHologram() { return bowHologram; } public void addDeathPlayer(Player player) { deaths.add(player); } public void removeDeathPlayer(Player player) { deaths.remove(player); } public boolean isDeathPlayer(Player player) { return deaths.contains(player); } public List getDeaths() { return deaths; } public void addSpectatorPlayer(Player player) { spectators.add(player); } public void removeSpectatorPlayer(Player player) { spectators.remove(player); } public boolean isSpectatorPlayer(Player player) { return spectators.contains(player); } public List getPlayerSpawnPoints() { return playerSpawnPoints; } public int getSpawnGoldTime() { return spawnGoldTime; } public int getSpawnGoldTimer() { return spawnGoldTimer; } public void setSpawnGoldTimer(int spawnGoldTimer) { this.spawnGoldTimer = spawnGoldTimer; } public void setPlayerSpawnPoints(@NotNull List playerSpawnPoints) { this.playerSpawnPoints = playerSpawnPoints; } public void adjustContributorValue(Role role, IUser user, int number) { user.adjustStatistic("CONTRIBUTION_" + role.name(), number); } private final Map murdererContributions = new HashMap<>(); private final Map detectiveContributions = new HashMap<>(); public Map getMurdererContributions() { return murdererContributions; } public Map getDetectiveContributions() { return detectiveContributions; } public int getContributorValue(Role role, IUser user) { if(role == Role.MURDERER && murdererContributions.containsKey(user)) { return murdererContributions.get(user); } else if(detectiveContributions.containsKey(user)) { return detectiveContributions.get(user); } Player player = user.getPlayer(); int contributor = user.getStatistic("CONTRIBUTION_" + role.name()); int increase = plugin.getPermissionsManager().getPermissionCategoryValue(role.name() + "_BOOSTER", player); int multiplicator = plugin.getPermissionsManager().getPermissionCategoryValue("CHANCES_BOOSTER", player); int calculatedContributor = (contributor + increase) * (multiplicator == 0 ? 1 :multiplicator); if(role == Role.MURDERER) { murdererContributions.put(user, calculatedContributor); } else { detectiveContributions.put(user, calculatedContributor); } return calculatedContributor; } public void resetContributorValue(Role role, IUser user) { user.setStatistic("CONTRIBUTION_" + role.name(), 1); } public enum CharacterType { MURDERER, DETECTIVE, FAKE_DETECTIVE, HERO } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/ArenaEvents.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.potion.PotionEffectType; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArenaEvents; import plugily.projects.minigamesbox.classic.handlers.items.SpecialItem; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder; import plugily.projects.minigamesbox.classic.utils.misc.complement.ComplementAccessor; import plugily.projects.minigamesbox.classic.utils.version.ServerVersion; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyEntityPickupItemEvent; import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerPickupArrow; import plugily.projects.minigamesbox.classic.utils.version.xseries.XPotion; import plugily.projects.minigamesbox.classic.utils.version.xseries.XSound; import plugily.projects.minigamesbox.classic.utils.version.xseries.inventory.XInventoryView; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.managers.MapRestorerManager; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.arena.special.pray.PrayerRegistry; import plugily.projects.murdermystery.utils.ItemPosition; /** * @author Plajer *

Created at 13.03.2018 */ public class ArenaEvents extends PluginArenaEvents { private final Main plugin; public ArenaEvents(Main plugin) { super(plugin); this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); } @Override public void handleIngameVoidDeath(Player victim, IPluginArena arena) { Arena pluginArena = plugin.getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } victim.damage(1000.0); if(arena.getArenaState() == IArenaState.IN_GAME) { VersionUtils.teleport(victim, pluginArena.getPlayerSpawnPoints().get(0)); } } @EventHandler public void onBowShot(EntityShootBowEvent event) { if(event.getEntityType() != EntityType.PLAYER) { return; } Player player = (Player) event.getEntity(); IUser user = plugin.getUserManager().getUser(player); if(!Role.isRole(Role.ANY_DETECTIVE, user)) { return; } if(user.getCooldown("bow_shot") > 0) { event.setCancelled(true); return; } int bowCooldown = plugin.getConfig().getInt("Bow.Cooldown", 5); if(bowCooldown <= 0) { return; } user.setCooldown("bow_shot", bowCooldown); plugin.getBukkitHelper().applyActionBarCooldown(player, bowCooldown); VersionUtils.setMaterialCooldown(player, event.getBow().getType(), 20 * (plugin.getConfig().getInt("Bow.Cooldown", 5))); } @EventHandler public void onArrowPickup(PlugilyPlayerPickupArrow e) { if(plugin.getArenaRegistry().isInArena(e.getPlayer())) { e.getItem().remove(); e.setCancelled(true); } } @EventHandler public void onItemPickup(PlugilyEntityPickupItemEvent e) { if(!(e.getEntity() instanceof Player)) { return; } Player player = (Player) e.getEntity(); Arena arena = plugin.getArenaRegistry().getArena(player); if(arena == null) { return; } IUser user = plugin.getUserManager().getUser(player); e.setCancelled(true); if(arena.getBowHologram() != null && e.getItem().equals(arena.getBowHologram().getEntityItem())) { if(!user.isSpectator() && Role.isRole(Role.INNOCENT, user, arena)) { XSound.BLOCK_LAVA_POP.play(player.getLocation(), 1F, 2F); ((MapRestorerManager) arena.getMapRestorerManager()).removeBowHolo(); e.getItem().remove(); for(Player loopPlayer : arena.getPlayersLeft()) { IUser loopUser = plugin.getUserManager().getUser(loopPlayer); if(Role.isRole(Role.INNOCENT, loopUser)) { ItemPosition.setItem(loopUser, ItemPosition.BOW_LOCATOR, new ItemStack(Material.AIR, 1)); } } arena.setCharacter(Arena.CharacterType.FAKE_DETECTIVE, player); ItemPosition.setItem(user, ItemPosition.BOW, new ItemStack(Material.BOW, 1)); ItemPosition.setItem(user, ItemPosition.INFINITE_ARROWS, new ItemStack(Material.ARROW, plugin.getConfig().getInt("Bow.Amount.Arrows.Fake", 3))); new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_PICKUP").asKey().player(player).arena(arena).sendArena(); } return; } if(e.getItem().getItemStack().getType() != Material.GOLD_INGOT) { return; } if(user.isSpectator() || arena.getArenaState() != IArenaState.IN_GAME) { return; } if(PrayerRegistry.getBan().contains(player)) { e.setCancelled(true); return; } e.getItem().remove(); XSound.BLOCK_LAVA_POP.play(player.getLocation(), 1, 1); arena.getGoldSpawned().remove(e.getItem()); ItemStack stack = new ItemStack(Material.GOLD_INGOT, e.getItem().getItemStack().getAmount()); if(PrayerRegistry.getRush().contains(player)) { stack.setAmount(3 * e.getItem().getItemStack().getAmount()); } ItemPosition.addItem(user, ItemPosition.GOLD_INGOTS, stack); user.adjustStatistic("LOCAL_GOLD", stack.getAmount()); ArenaUtils.addScore(user, ArenaUtils.ScoreAction.GOLD_PICKUP, stack.getAmount()); new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_GOLD").asKey().player(player).arena(arena).sendPlayer(); plugin.getRewardsHandler().performReward(player, plugin.getRewardsHandler().getRewardType("GOLD_PICKUP")); if(Role.isRole(Role.ANY_DETECTIVE, user, arena)) { ItemPosition.addItem(user, ItemPosition.ARROWS, new ItemStack(Material.ARROW, e.getItem().getItemStack().getAmount() * plugin.getConfig().getInt("Bow.Amount.Arrows.Detective", 3))); return; } if(user.getStatistic("LOCAL_GOLD") >= plugin.getConfig().getInt("Gold.Amount.Bow", 10)) { user.setStatistic("LOCAL_GOLD", 0); new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_SHOT_TITLE") .asKey() .player(player) .arena(arena) .sendPlayer(); ItemPosition.setItem(user, ItemPosition.BOW, new ItemStack(Material.BOW, 1)); ItemPosition.addItem( user, ItemPosition.ARROWS, new ItemStack(Material.ARROW, plugin.getConfig().getInt("Bow.Amount.Arrows.Gold", 3))); player .getInventory() .setItem( /* same for all roles */ ItemPosition.GOLD_INGOTS.getOtherRolesItemPosition(), null); } } @EventHandler public void onMurdererDamage(EntityDamageByEntityEvent e) { if(!(e.getDamager() instanceof Player) || e.getEntityType() != EntityType.PLAYER) { return; } Player attacker = (Player) e.getDamager(); IUser userAttacker = plugin.getUserManager().getUser(attacker); Player victim = (Player) e.getEntity(); IUser userVictim = plugin.getUserManager().getUser(victim); if(!ArenaUtils.areInSameArena(attacker, victim)) { return; } //we are killing player via damage() method so event can be cancelled safely, will work for detective damage murderer and others e.setCancelled(true); //better check this for future even if anyone else cannot use sword if(!Role.isRole(Role.MURDERER, userAttacker)) { return; } //check if victim is murderer if(Role.isRole(Role.MURDERER, userVictim)) { return; } if(VersionUtils.getItemInHand(attacker) == null || plugin.getSwordSkinManager().getMurdererSword(attacker) == null) { return; } //just don't kill user if item isn't murderer sword if(VersionUtils.getItemInHand(attacker).getType() != plugin.getSwordSkinManager().getMurdererSword(attacker).getType()) { return; } //check if sword has cooldown if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_11)) { if(plugin.getUserManager().getUser(attacker).getCooldown("sword_attack") > 0) { return; } } else if(attacker.hasCooldown(plugin.getSwordSkinManager().getMurdererSword(attacker).getType())) { return; } if(Role.isRole(Role.MURDERER, userVictim)) { plugin.getRewardsHandler().performReward(attacker, plugin.getRewardsHandler().getRewardType("KILL_MURDERER")); } else if(Role.isRole(Role.ANY_DETECTIVE, userVictim)) { plugin.getRewardsHandler().performReward(attacker, plugin.getRewardsHandler().getRewardType("KILL_DETECTIVE")); } XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation()); victim.damage(100.0); IUser user = plugin.getUserManager().getUser(attacker); user.adjustStatistic("KILLS", 1); user.adjustStatistic("LOCAL_KILLS", 1); ArenaUtils.addScore(user, ArenaUtils.ScoreAction.KILL_PLAYER, 0); Arena arena = plugin.getArenaRegistry().getArena(attacker); if(Role.isRole(Role.ANY_DETECTIVE, userVictim) && arena.lastAliveDetective()) { //if already true, no effect is done :) arena.setDetectiveDead(true); if(Role.isRole(Role.FAKE_DETECTIVE, userVictim)) { arena.setCharacter(Arena.CharacterType.FAKE_DETECTIVE, null); } ArenaUtils.dropBowAndAnnounce(arena, victim); } } @EventHandler public void onArrowDamage(EntityDamageByEntityEvent e) { if(!(e.getDamager() instanceof Arrow)) { return; } if(!(((Arrow) e.getDamager()).getShooter() instanceof Player)) { return; } Player attacker = (Player) ((Arrow) e.getDamager()).getShooter(); IUser userAttacker = plugin.getUserManager().getUser(attacker); if(plugin.getArenaRegistry().isInArena(attacker)) { e.setCancelled(true); e.getDamager().remove(); } if(e.getEntityType() != EntityType.PLAYER) { return; } Player victim = (Player) e.getEntity(); IUser userVictim = plugin.getUserManager().getUser(victim); if(!ArenaUtils.areInSameArena(attacker, victim)) { return; } //we won't allow to suicide if(attacker.equals(victim)) { e.setCancelled(true); return; } //dont kill murderer on bow damage if attacker is murderer if(Role.isRole(Role.MURDERER, userAttacker) && Role.isRole(Role.MURDERER, userVictim)) { e.setCancelled(true); return; } Arena arena = plugin.getArenaRegistry().getArena(attacker); if (arena == null) { return; } //we need to set it before the victim die, because of hero character if(Role.isRole(Role.MURDERER, userVictim)) { arena.setCharacter(Arena.CharacterType.HERO, attacker); } XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation()); victim.damage(100.0); userAttacker.adjustStatistic("KILLS", 1); if(Role.isRole(Role.MURDERER, userAttacker)) { userAttacker.adjustStatistic("LOCAL_KILLS", 1); arena.adjustContributorValue(Role.DETECTIVE, userAttacker, plugin.getRandom().nextInt(2)); ArenaUtils.addScore(userAttacker, ArenaUtils.ScoreAction.KILL_PLAYER, 0); } VersionUtils.sendTitles(victim, new MessageBuilder("IN_GAME_DEATH_SCREEN").asKey().build(), null, 5, 40, 50); if(Role.isRole(Role.MURDERER, userVictim)) { ArenaUtils.addScore(userAttacker, ArenaUtils.ScoreAction.KILL_MURDERER, 0); arena.adjustContributorValue(Role.MURDERER, userAttacker, plugin.getRandom().nextInt(2)); } else if(plugin.getConfigPreferences().getOption("BOW_KILL_DETECTIVE") && (Role.isRole(Role.ANY_DETECTIVE, userVictim) || Role.isRole(Role.INNOCENT, userVictim))) { if(Role.isRole(Role.MURDERER, userAttacker)) { VersionUtils.sendTitles(victim, null, new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_KILLED_YOU").asKey().build(), 5, 40, 5); } else { VersionUtils.sendTitles(victim, null, new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_INNOCENT_KILLED_YOU").asKey().build(), 5, 40, 5); } //if else, murderer killed, so don't kill him :) if(Role.isRole(Role.ANY_DETECTIVE, userAttacker) || Role.isRole(Role.INNOCENT, userAttacker)) { VersionUtils.sendSubTitle(attacker, new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_INNOCENT_KILLED_WRONGLY").asKey().build(), 5, 40, 5); attacker.damage(100.0); ArenaUtils.addScore(userAttacker, ArenaUtils.ScoreAction.INNOCENT_KILL, 0); plugin.getRewardsHandler().performReward(attacker, plugin.getRewardsHandler().getRewardType("KILL_DETECTIVE")); if(Role.isRole(Role.ANY_DETECTIVE, userAttacker) && arena.lastAliveDetective()) { arena.setDetectiveDead(true); if(Role.isRole(Role.FAKE_DETECTIVE, userAttacker)) { arena.setCharacter(Arena.CharacterType.FAKE_DETECTIVE, null); } ArenaUtils.dropBowAndAnnounce(arena, victim); } } } } @EventHandler(priority = EventPriority.HIGH) public void onPlayerDie(PlayerDeathEvent e) { Player player = e.getEntity(); Arena arena = plugin.getArenaRegistry().getArena(player); if(arena == null) { return; } IUser user = plugin.getUserManager().getUser(player); ComplementAccessor.getComplement().setDeathMessage(e, ""); e.getDrops().clear(); e.setDroppedExp(0); plugin.getCorpseHandler().spawnCorpse(player, arena); XPotion.BLINDNESS.buildPotionEffect(3 * 20, 1).apply(player); if(arena.getArenaState() == IArenaState.STARTING) { return; } else if(arena.getArenaState() == IArenaState.ENDING || arena.getArenaState() == IArenaState.RESTARTING) { player.getInventory().clear(); player.setFlying(false); player.setAllowFlight(false); user.setStatistic("LOCAL_GOLD", 0); return; } if(Role.isRole(Role.MURDERER, user, arena) && arena.lastAliveMurderer()) { ArenaUtils.onMurdererDeath(arena); } if(Role.isRole(Role.ANY_DETECTIVE, user) && arena.lastAliveDetective()) { arena.setDetectiveDead(true); if(Role.isRole(Role.FAKE_DETECTIVE, user)) { arena.setCharacter(Arena.CharacterType.FAKE_DETECTIVE, null); } ArenaUtils.dropBowAndAnnounce(arena, player); } user.adjustStatistic("DEATHS", 1); user.setSpectator(true); VersionUtils.setCollidable(player, false); player.setGameMode(GameMode.SURVIVAL); user.setStatistic("LOCAL_GOLD", 0); ArenaUtils.hidePlayer(player, arena); player.setAllowFlight(true); player.setFlying(true); player.getInventory().clear(); if(plugin.getConfigPreferences().getOption("HIDE_DEATH")) { new MessageBuilder(MessageBuilder.ActionType.DEATH).player(player).arena(arena).sendArena(); } if(arena.getArenaState() != IArenaState.ENDING && arena.getArenaState() != IArenaState.RESTARTING) { arena.addDeathPlayer(player); } //we must call it ticks later due to instant respawn bug Bukkit.getScheduler().runTaskLater(plugin, () -> { player.spigot().respawn(); plugin.getSpecialItemManager().addSpecialItemsOfStage(player, SpecialItem.DisplayStage.SPECTATOR); }, 5); } @EventHandler(priority = EventPriority.HIGHEST) public void onRespawn(PlayerRespawnEvent event) { Player player = event.getPlayer(); Arena arena = plugin.getArenaRegistry().getArena(player); if(arena == null) { return; } if(arena.getArenaState() == IArenaState.STARTING || arena.getArenaState() == IArenaState.WAITING_FOR_PLAYERS) { event.setRespawnLocation(arena.getLobbyLocation()); return; } if(arena.getArenaState() == IArenaState.RESTARTING) { event.setRespawnLocation(arena.getEndLocation()); return; } if(arena.getPlayers().contains(player)) { IUser user = plugin.getUserManager().getUser(player); org.bukkit.Location firstSpawn = arena.getPlayerSpawnPoints().get(0); if(player.getLocation().getWorld().equals(firstSpawn.getWorld())) { event.setRespawnLocation(player.getLocation()); } else { event.setRespawnLocation(firstSpawn); } player.setAllowFlight(true); player.setFlying(true); user.setSpectator(true); ArenaUtils.hidePlayer(player, arena); VersionUtils.setCollidable(player, false); player.setGameMode(GameMode.SURVIVAL); player.removePotionEffect(PotionEffectType.NIGHT_VISION); user.setStatistic("LOCAL_GOLD", 0); plugin.getRewardsHandler().performReward(player, plugin.getRewardsHandler().getRewardType("PLAYER_DEATH")); } } @EventHandler public void locatorDistanceUpdate(PlayerMoveEvent event) { Player player = event.getPlayer(); Arena arena = plugin.getArenaRegistry().getArena(player); if(arena == null) { return; } IUser user = plugin.getUserManager().getUser(player); //skip spectators if(user.isSpectator()) { return; } if(arena.getArenaState() == IArenaState.IN_GAME) { if(Role.isRole(Role.INNOCENT, user, arena)) { if(player.getInventory().getItem(ItemPosition.BOW_LOCATOR.getOtherRolesItemPosition()) != null) { ItemStack bowLocator = new ItemStack(Material.COMPASS, 1); ItemMeta bowMeta = bowLocator.getItemMeta(); ComplementAccessor.getComplement().setDisplayName(bowMeta, new MessageBuilder("IN_GAME_MESSAGES_ARENA_LOCATOR_BOW").asKey().player(player).arena(arena).build() + " §7| §a" + (int) Math.round(player.getLocation().distance(player.getCompassTarget()))); bowLocator.setItemMeta(bowMeta); ItemPosition.setItem(user, ItemPosition.BOW_LOCATOR, bowLocator); return; } } if(arena.isMurdererLocatorReceived() && Role.isRole(Role.MURDERER, user, arena) && arena.isMurderAlive(player)) { ItemStack innocentLocator = new ItemStack(Material.COMPASS, 1); ItemMeta innocentMeta = innocentLocator.getItemMeta(); for(Player p : arena.getPlayersLeft()) { Arena playerArena = plugin.getArenaRegistry().getArena(p); IUser playerUser = plugin.getUserManager().getUser(p); if(Role.isRole(Role.INNOCENT, playerUser, playerArena) || Role.isRole(Role.ANY_DETECTIVE, playerUser, playerArena)) { ComplementAccessor.getComplement().setDisplayName(innocentMeta, new MessageBuilder("IN_GAME_MESSAGES_ARENA_LOCATOR_INNOCENT").asKey().player(player).arena(arena).build() + " §7| §a" + (int) Math.round(player.getLocation().distance(p.getLocation()))); innocentLocator.setItemMeta(innocentMeta); ItemPosition.setItem(user, ItemPosition.INNOCENTS_LOCATOR, innocentLocator); } } } } } @EventHandler public void onDrop(PlayerDropItemEvent event) { if(plugin.getArenaRegistry().getArena(event.getPlayer()) != null && plugin.getArenaRegistry().getArena(event.getPlayer()).getArenaState() == IArenaState.IN_GAME) { event.setCancelled(true); } } @EventHandler public void onItemMove(InventoryClickEvent event) { if(event.getWhoClicked() instanceof Player && plugin.getArenaRegistry().isInArena((Player) event.getWhoClicked())) { if(XInventoryView.of(event.getView()).getType() == InventoryType.CRAFTING || XInventoryView.of(event.getView()).getType() == InventoryType.PLAYER) { event.setResult(Event.Result.DENY); } } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/ArenaManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArenaManager; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder; import plugily.projects.minigamesbox.classic.utils.actionbar.ActionBar; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.managers.MapRestorerManager; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.arena.special.SpecialBlock; import plugily.projects.murdermystery.utils.ItemPosition; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; /** * @author Plajer *

Created at 13.05.2018 */ public class ArenaManager extends PluginArenaManager { private final Main plugin; public ArenaManager(Main plugin) { super(plugin); this.plugin = plugin; } @Override public void joinAttempt(@NotNull Player player, @NotNull IPluginArena arena) { Arena pluginArena = (Arena) plugin.getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } super.joinAttempt(player, arena); ArenaUtils.updateNameTagsVisibility(player); } @Override public void leaveAttempt(@NotNull Player player, @NotNull IPluginArena arena) { Arena pluginArena = (Arena) plugin.getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } super.leaveAttempt(player, arena); if(pluginArena.isDeathPlayer(player)) { pluginArena.removeDeathPlayer(player); } IUser user = plugin.getUserManager().getUser(player); int localScore = user.getStatistic("LOCAL_SCORE"); if(localScore > user.getStatistic("HIGHEST_SCORE")) { user.setStatistic("HIGHEST_SCORE", localScore); } boolean playerHasMurdererRole = Role.isRole(Role.MURDERER, user, arena); if(playerHasMurdererRole) { pluginArena.removeFromMurdererList(player); } if(arena.getArenaState() == IArenaState.IN_GAME && !user.isSpectator()) { List playersLeft = arena.getPlayersLeft(); if(playersLeft.size() > 1) { if(playerHasMurdererRole) { if(pluginArena.getMurdererList().isEmpty()) { List players = new ArrayList<>(); for(Player gamePlayer : playersLeft) { IUser userGamePlayer = plugin.getUserManager().getUser(gamePlayer); if(gamePlayer == player || Role.isRole(Role.ANY_DETECTIVE, userGamePlayer, arena) || Role.isRole(Role.MURDERER, userGamePlayer, arena)) { continue; } players.add(gamePlayer); } Player newMurderer = players.get(players.size() == 1 ? 0 : ThreadLocalRandom.current().nextInt(players.size())); if(newMurderer != null) { plugin.getDebugger().debug("A murderer left the game. New murderer: {0}", newMurderer.getName()); pluginArena.setCharacter(Arena.CharacterType.MURDERER, newMurderer); pluginArena.addToMurdererList(newMurderer); } new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_CHANGE").asKey().player(player).arena(pluginArena).sendArena(); if(newMurderer != null) { new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_MURDERER").asKey().player(player).arena(pluginArena).sendPlayer(); plugin.getActionBarManager().addActionBar(player, new ActionBar((new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_CHANGE")).asKey(), ActionBar.ActionBarType.DISPLAY, 5)); ItemPosition.setItem(plugin.getUserManager().getUser(newMurderer), ItemPosition.MURDERER_SWORD, plugin.getSwordSkinManager().getRandomSwordSkin(player)); } } else { plugin.getDebugger().debug("No new murderer added as there are some"); } } else if(Role.isRole(Role.ANY_DETECTIVE, user, arena) && pluginArena.lastAliveDetective()) { pluginArena.setDetectiveDead(true); if(Role.isRole(Role.FAKE_DETECTIVE, user, arena)) { pluginArena.setCharacter(Arena.CharacterType.FAKE_DETECTIVE, null); } ArenaUtils.dropBowAndAnnounce(pluginArena, player); } plugin.getCorpseHandler().spawnCorpse(player, pluginArena); } else { stopGame(false, arena); } } } @Override public void stopGame(boolean quickStop, @NotNull IPluginArena arena) { Arena pluginArena = (Arena) plugin.getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } for(SpecialBlock specialBlock : pluginArena.getSpecialBlocks()) { if(specialBlock.getArmorStandHologram() != null) { specialBlock.getArmorStandHologram().delete(); } } ((MapRestorerManager) pluginArena.getMapRestorerManager()).removeBowHolo(); boolean murderWon = arena.getPlayersLeft().size() == pluginArena.aliveMurderer(); for(Player player : arena.getPlayersLeft()) { if(!quickStop) { IUser user = plugin.getUserManager().getUser(player); if(Role.isAnyRole(user, arena)) { boolean hasDeathRole = Role.isRole(Role.DEATH, user, arena); int multiplicator = 1; if(!hasDeathRole) { multiplicator = arena.getMaximumPlayers(); } pluginArena.adjustContributorValue(Role.MURDERER, user, plugin.getRandom().nextInt(10 * multiplicator)); pluginArena.adjustContributorValue(Role.DETECTIVE, user, plugin.getRandom().nextInt(10 * multiplicator)); if(!hasDeathRole) { boolean hasMurdererRole = Role.isRole(Role.MURDERER, user, arena); if(murderWon || !hasMurdererRole) { user.adjustStatistic("WINS", 1); plugin.getRewardsHandler().performReward(player, plugin.getRewardsHandler().getRewardType("WIN")); } else { user.adjustStatistic("LOSES", 1); plugin.getRewardsHandler().performReward(player, plugin.getRewardsHandler().getRewardType("LOSE")); } } else { user.adjustStatistic("LOSES", 1); plugin.getRewardsHandler().performReward(player, plugin.getRewardsHandler().getRewardType("LOSE")); } } } } super.stopGame(quickStop, arena); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/ArenaRegistry.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena; import org.bukkit.Location; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.PluginArenaRegistry; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.serialization.LocationSerializer; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.special.SpecialBlock; import java.util.ArrayList; import java.util.List; /** * Created by Tom on 27/07/2014. */ public class ArenaRegistry extends PluginArenaRegistry { private final Main plugin; public ArenaRegistry(Main plugin) { super(plugin); this.plugin = plugin; } @Override public PluginArena getNewArena(String id) { return new Arena(id); } @Override public boolean additionalValidatorChecks(ConfigurationSection section, PluginArena arena, String id) { boolean checks = super.additionalValidatorChecks(section, arena, id); if(!checks) return false; if(!section.getBoolean(id + ".isdone")) { plugin.getDebugger().sendConsoleMsg(new MessageBuilder("VALIDATOR_INVALID_ARENA_CONFIGURATION").asKey().value("NOT VALIDATED").arena(arena).build()); return false; } List playerSpawnPoints = new ArrayList<>(); for(String loc : section.getStringList(id + ".playerspawnpoints")) { org.bukkit.Location serialized = LocationSerializer.getLocation(loc); // Ignore the arena if world is not exist at least in spawn points if(serialized == null || serialized.getWorld() == null) { section.set(id + ".isdone", false); } else { playerSpawnPoints.add(serialized); } } ((Arena) arena).setSpawnGoldTime(section.getInt(id + ".spawngoldtime", 5)); ((Arena) arena).setHideChances(section.getBoolean(id + ".hidechances")); arena.setArenaOption("MURDERER_DIVIDER",section.getInt(id + ".playerpermurderer", 5)); arena.setArenaOption("DETECTIVE_DIVIDER",section.getInt(id + ".playerperdetective", 7)); ((Arena) arena).setGoldVisuals(section.getBoolean(id + ".goldvisuals")); ((Arena) arena).setPlayerSpawnPoints(playerSpawnPoints); List goldSpawnPoints = new ArrayList<>(); for(String loc : section.getStringList(id + ".goldspawnpoints")) { goldSpawnPoints.add(LocationSerializer.getLocation(loc)); } ((Arena) arena).setGoldSpawnPoints(goldSpawnPoints); List specialBlocks = new ArrayList<>(); for(String loc : section.getStringList(id + ".mystery-cauldrons")) { specialBlocks.add(new SpecialBlock(LocationSerializer.getLocation(loc), SpecialBlock.SpecialBlockType.MYSTERY_CAULDRON)); } for(String loc : section.getStringList(id + ".confessionals")) { specialBlocks.add(new SpecialBlock(LocationSerializer.getLocation(loc), SpecialBlock.SpecialBlockType.PRAISE_DEVELOPER)); } specialBlocks.forEach(((Arena) arena)::loadSpecialBlock); return true; } @Override public @Nullable Arena getArena(Player player) { IPluginArena pluginArena = super.getArena(player); if(pluginArena instanceof Arena) { return (Arena) pluginArena; } return null; } @Override public @Nullable Arena getArena(String id) { IPluginArena pluginArena = super.getArena(id); if(pluginArena instanceof Arena) { return (Arena) pluginArena; } return null; } public @NotNull List getPluginArenas() { List arenas = new ArrayList<>(); for(IPluginArena pluginArena : super.getArenas()) { if(pluginArena instanceof Arena) { arenas.add((Arena) pluginArena); } } return arenas; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/ArenaUtils.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArenaUtils; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder; import plugily.projects.minigamesbox.classic.utils.hologram.ArmorStandHologram; import plugily.projects.minigamesbox.classic.utils.misc.complement.ComplementAccessor; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XSound; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.utils.ItemPosition; /** * @author Plajer *

Created at 13.03.2018 */ public class ArenaUtils extends PluginArenaUtils { private ArenaUtils() { super(); } public static void onMurdererDeath(Arena arena) { for(Player player : arena.getPlayers()) { VersionUtils.sendSubTitle(player, new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_STOPPED").asKey().build(), 5, 40, 5); IUser loopUser = getPlugin().getUserManager().getUser(player); if(Role.isRole(Role.INNOCENT, loopUser, arena)) { addScore(loopUser, ScoreAction.SURVIVE_GAME, 0); } else if(Role.isRole(Role.ANY_DETECTIVE, loopUser, arena)) { addScore(loopUser, ScoreAction.WIN_GAME, 0); addScore(loopUser, ScoreAction.DETECTIVE_WIN_GAME, 0); } } //we must call it ticks later due to instant respawn bug Bukkit.getScheduler().runTask(getPlugin(), () -> getPlugin().getArenaManager().stopGame(false, arena)); } public static void updateInnocentLocator(Arena arena) { java.util.List list = arena.getPlayersLeft(); if(!arena.isMurdererLocatorReceived()) { ItemStack innocentLocator = new ItemStack(Material.COMPASS, 1); ItemMeta innocentMeta = innocentLocator.getItemMeta(); ComplementAccessor.getComplement() .setDisplayName( innocentMeta, new MessageBuilder("IN_GAME_MESSAGES_ARENA_LOCATOR_INNOCENT").asKey().build()); innocentLocator.setItemMeta(innocentMeta); for(Player p : list) { if(arena.isMurderAlive(p)) { ItemPosition.setItem(getPlugin().getUserManager().getUser(p), ItemPosition.INNOCENTS_LOCATOR, innocentLocator); } } arena.setMurdererLocatorReceived(true); for(Player p : list) { if(Role.isRole(Role.MURDERER, getPlugin().getUserManager().getUser(p), arena)) { continue; } new TitleBuilder("IN_GAME_MESSAGES_ARENA_LOCATOR_WATCH_OUT") .asKey() .player(p) .arena(arena) .sendPlayer(); } } for(Player p : list) { if(Role.isRole(Role.MURDERER, getPlugin().getUserManager().getUser(p), arena)) { continue; } for(Player murder : arena.getMurdererList()) { if(arena.isMurderAlive(murder)) { murder.setCompassTarget(p.getLocation()); } } break; } } public static void dropBowAndAnnounce(Arena arena, Player victim) { if(arena.getBowHologram() != null) { return; } for(Player player : arena.getPlayers()) { IUser user = arena.getPlugin().getUserManager().getUser(player); if(Role.isRole(Role.MURDERER, user, arena)) { continue; } new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_DROPPED").asKey().arena(arena).send(player); } ArmorStandHologram hologram = new ArmorStandHologram(victim.getLocation()).appendItem(new ItemStack(Material.BOW, 1)); arena.setBowHologram(hologram); addBowLocator(arena, hologram.getLocation()); } private static void addBowLocator(Arena arena, Location loc) { ItemStack bowLocator = new ItemStack(Material.COMPASS, 1); ItemMeta bowMeta = bowLocator.getItemMeta(); ComplementAccessor.getComplement() .setDisplayName( bowMeta, new MessageBuilder("IN_GAME_MESSAGES_ARENA_LOCATOR_BOW").asKey().build()); bowLocator.setItemMeta(bowMeta); for(Player p : arena.getPlayersLeft()) { IUser user = getPlugin().getUserManager().getUser(p); if(Role.isRole(Role.INNOCENT, user, arena)) { ItemPosition.setItem(user, ItemPosition.BOW_LOCATOR, bowLocator); p.setCompassTarget(loc); } } } public static void updateNameTagsVisibility(final Player p) { if(!getPlugin().getConfigPreferences().getOption("HIDE_NAMETAGS")) { return; } for(Player players : getPlugin().getServer().getOnlinePlayers()) { IPluginArena arena = getPlugin().getArenaRegistry().getArena(players); if(arena == null) { continue; } VersionUtils.updateNameTagsVisibility( p, players, "MMHide", arena.getArenaState() != IArenaState.IN_GAME); } } public static void addScore(IUser user, ScoreAction action, int amount) { XSound.matchXSound(XSound.ENTITY_EXPERIENCE_ORB_PICKUP.parseSound()) .play(user.getPlayer().getLocation(), 1F, 2F); if(action == ScoreAction.GOLD_PICKUP && amount > 1) { int score = action.points * amount; new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_BONUS") .asKey() .player(user.getPlayer()) .arena(user.getArena()) .integer(score) .value(action.action) .sendPlayer(); user.adjustStatistic("LOCAL_SCORE", score); return; } if(action == ScoreAction.DETECTIVE_WIN_GAME) { int innocents = 0; Arena arena = (Arena) user.getArena(); for(Player p : arena.getPlayersLeft()) { if(Role.isRole(Role.INNOCENT, getPlugin().getUserManager().getUser(p), arena)) { innocents++; } } int overallInnocents = 100 * innocents; user.adjustStatistic("LOCAL_SCORE", overallInnocents); new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_BONUS") .asKey() .player(user.getPlayer()) .arena(user.getArena()) .integer(overallInnocents) .value(new MessageBuilder(action.action).integer(innocents).build()) .sendPlayer(); return; } String msg = new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_BONUS") .asKey() .player(user.getPlayer()) .arena(user.getArena()) .integer(action.points) .value(action.action) .build(); if(action.points < 0) { msg = msg.replace("+", ""); } user.adjustStatistic("LOCAL_SCORE", action.points); user.getPlayer().sendMessage(msg); } public enum ScoreAction { KILL_PLAYER( 100, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_KILL_PLAYER") .asKey() .build()), KILL_MURDERER( 200, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_KILL_MURDERER") .asKey() .build()), GOLD_PICKUP( 15, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_PICKUP_GOLD") .asKey() .build()), SURVIVE_TIME( 150, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_SURVIVING_TIME") .asKey() .build()), SURVIVE_GAME( 200, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_SURVIVING_END") .asKey() .build()), WIN_GAME( 100, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_WIN").asKey().build()), DETECTIVE_WIN_GAME( 0, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_DETECTIVE") .asKey() .build()), INNOCENT_KILL( -100, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_KILL_INNOCENT") .asKey() .build()); int points; String action; ScoreAction(int points, String action) { this.points = points; this.action = action; } public int getPoints() { return points; } public String getAction() { return action; } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/corpse/Corpse.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.corpse; import org.golde.bukkit.corpsereborn.nms.Corpses; import plugily.projects.minigamesbox.classic.utils.hologram.ArmorStandHologram; /** * @author Plajer *

* Created at 07.08.2018 */ public class Corpse { private final ArmorStandHologram hologram; private final Corpses.CorpseData corpseData; public Corpse(ArmorStandHologram hologram, Corpses.CorpseData corpseData) { this.hologram = hologram; this.corpseData = corpseData; } public ArmorStandHologram getHologram() { return hologram; } public Corpses.CorpseData getCorpseData() { return corpseData; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/corpse/Stand.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.corpse; import org.bukkit.entity.ArmorStand; import plugily.projects.minigamesbox.classic.utils.hologram.ArmorStandHologram; /** * @author Plajer *

* Created at 07.08.2018 */ public class Stand { private final ArmorStandHologram hologram; private final ArmorStand stand; public Stand(ArmorStandHologram hologram, ArmorStand stand) { this.hologram = hologram; this.stand = stand; } public ArmorStandHologram getHologram() { return hologram; } public ArmorStand getStand() { return stand; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/managers/MapRestorerManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.managers; import org.bukkit.Bukkit; import org.bukkit.entity.Item; import org.golde.bukkit.corpsereborn.CorpseAPI.CorpseAPI; import plugily.projects.minigamesbox.classic.arena.managers.PluginMapRestorerManager; import plugily.projects.murdermystery.HookManager; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.corpse.Corpse; import plugily.projects.murdermystery.arena.corpse.Stand; import java.util.Objects; public class MapRestorerManager extends PluginMapRestorerManager { public final Arena arena; public MapRestorerManager(Arena arena) { super(arena); this.arena = arena; } @Override public void fullyRestoreArena() { cleanUpArena(); super.fullyRestoreArena(); } public void cleanUpArena() { removeBowHolo(); arena.setMurdererLocatorReceived(false); arena.getDetectiveContributions().clear(); arena.getMurdererContributions().clear(); arena.getGameCharacters().clear(); arena.getMurdererList().clear(); arena.getDetectiveList().clear(); arena.getDeaths().clear(); arena.setDetectiveDead(false); clearCorpses(); clearGold(); } public void removeBowHolo() { if(arena.getBowHologram() != null && !arena.getBowHologram().isDeleted()) { arena.getBowHologram().delete(); } arena.setBowHologram(null); } public void clearGold() { arena.getGoldSpawned().stream().filter(Objects::nonNull).forEach(Item::remove); arena.getGoldSpawned().clear(); } public void clearCorpses() { if(!arena.getPlugin().getHookManager().isFeatureEnabled(HookManager.HookFeature.CORPSES)) { for(Stand stand : arena.getStands()) { if(!stand.getHologram().isDeleted()) { stand.getHologram().delete(); } if(stand.getStand() != null) { stand.getStand().remove(); } } arena.getStands().clear(); return; } for(Corpse corpse : arena.getCorpses()) { if(!corpse.getHologram().isDeleted()) { corpse.getHologram().delete(); } if(corpse.getCorpseData() != null) { corpse.getCorpseData().destroyCorpseFromEveryone(); CorpseAPI.removeCorpse(corpse.getCorpseData()); } } arena.getCorpses().clear(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/managers/ScoreboardManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.managers; import org.bukkit.entity.Player; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.managers.PluginScoreboardManager; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.murdermystery.arena.role.Role; import java.util.ArrayList; import java.util.List; /** * @author Tigerpanzer_02 *

Created at 19.12.2021 */ public class ScoreboardManager extends PluginScoreboardManager { private final PluginArena arena; public ScoreboardManager(PluginArena arena) { super(arena); this.arena = arena; } @Override public List getScoreboardLines(Player player) { List lines; if(arena.getArenaState() == IArenaState.IN_GAME) { IUser user = arena.getPlugin().getUserManager().getUser(player); lines = arena .getPlugin() .getLanguageManager() .getLanguageList( "Scoreboard.Content." + arena.getArenaState().getFormattedName() + (Role.isRole(Role.MURDERER, user) ? "-Murderer" : "")); } else { lines = super.getScoreboardLines(player); } return lines; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/role/Role.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.role; import org.bukkit.entity.Player; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.user.User; import plugily.projects.murdermystery.arena.Arena; /** * @author Plajer *

* Created at 06.10.2018 */ public enum Role { /** * Detective or fake detective role */ ANY_DETECTIVE, /** * Detective role, he must kill murderer */ DETECTIVE, /** * Detective role, innocent who picked up bow became fake detective because he wasn't * detective by default */ FAKE_DETECTIVE, /** * Innocent player role, must survive to win */ INNOCENT, /** * Murderer role, must kill everyone to win */ MURDERER, /** * Spectator role, just look :D */ SPECTATOR, /** * Death role, when everyone died */ DEATH; /** * Checks whether player is playing specified role or not * * @param role role to check * @param user player to check * @return true if is playing it, false otherwise */ public static boolean isRole(Role role, IUser user) { return isRole(role, user, user.getArena()); } /** * Checks whether player is playing specified role or not * * @param role role to check * @param user player to check * @param arena the arena where to check * @return true if is playing it, false otherwise */ public static boolean isRole(Role role, IUser user, IPluginArena arena) { if(arena == null) return false; Arena pluginArena = (Arena) arena.getPlugin().getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return false; } Player player = user.getPlayer(); switch(role) { case DETECTIVE: return pluginArena.isCharacterSet(Arena.CharacterType.DETECTIVE) && pluginArena.getDetectiveList().contains(player); case FAKE_DETECTIVE: return player.equals(pluginArena.getCharacter(Arena.CharacterType.FAKE_DETECTIVE)); case MURDERER: return pluginArena.isCharacterSet(Arena.CharacterType.MURDERER) && pluginArena.getMurdererList().contains(player); case ANY_DETECTIVE: return isRole(Role.DETECTIVE, user) || isRole(Role.FAKE_DETECTIVE, user); case INNOCENT: return !isRole(Role.MURDERER, user) && !isRole(Role.ANY_DETECTIVE, user); case DEATH: return pluginArena.isDeathPlayer(player); case SPECTATOR: return pluginArena.isSpectatorPlayer(player); default: return false; } } /** * Checks whether player is playing a role or not * * @param user player to check * @return true if is playing one role, false otherwise */ public static boolean isAnyRole(User user) { return isAnyRole(user, user.getArena()); } private static final Role[] roles = Role.values(); /** * Checks whether player is playing a role or not * * @param user player to check * @param arena the player's arena * @return true if is playing one role, false otherwise */ public static boolean isAnyRole(IUser user, IPluginArena arena) { return arena != null && java.util.Arrays.stream(roles).anyMatch(role -> isRole(role, user, arena)); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/special/SpecialBlock.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.special; import org.bukkit.Location; import plugily.projects.minigamesbox.classic.utils.hologram.ArmorStandHologram; /** * @author Plajer *

* Created at 15.10.2018 */ public class SpecialBlock { private final Location location; private final SpecialBlockType specialBlockType; private ArmorStandHologram armorStandHologram; public SpecialBlock(Location location, SpecialBlockType specialBlockType) { this.location = location; this.specialBlockType = specialBlockType; } public Location getLocation() { return location; } public SpecialBlockType getSpecialBlockType() { return specialBlockType; } public ArmorStandHologram getArmorStandHologram() { return armorStandHologram; } public void setArmorStandHologram(ArmorStandHologram armorStandHologram) { this.armorStandHologram = armorStandHologram; } public enum SpecialBlockType { HORSE_PURCHASE, MYSTERY_CAULDRON, PRAISE_DEVELOPER, RAPID_TELEPORTATION } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/special/SpecialBlockEvents.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.special; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Item; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.inventory.ItemStack; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder; import plugily.projects.minigamesbox.classic.utils.helper.ItemUtils; import plugily.projects.minigamesbox.classic.utils.misc.complement.ComplementAccessor; import plugily.projects.minigamesbox.classic.utils.version.ServerVersion; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.special.mysterypotion.MysteryPotion; import plugily.projects.murdermystery.arena.special.mysterypotion.MysteryPotionRegistry; import plugily.projects.murdermystery.arena.special.pray.PrayerRegistry; import plugily.projects.murdermystery.utils.ItemPosition; /** * @author Plajer *

* Created at 16.10.2018 */ public class SpecialBlockEvents implements Listener { private final Main plugin; public SpecialBlockEvents(Main plugin) { this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); } @EventHandler public void onSpecialBlockClick(PlayerInteractEvent event) { if(event.getClickedBlock() == null) return; if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_11) && event.getHand() == org.bukkit.inventory.EquipmentSlot.OFF_HAND) { return; } Arena arena = plugin.getArenaRegistry().getArena(event.getPlayer()); if(arena == null) { return; } if(arena.getArenaState() != IArenaState.IN_GAME || plugin.getUserManager().getUser(event.getPlayer()).isSpectator()) { return; } for(SpecialBlock specialBlock : arena.getSpecialBlocks()) { if(event.getClickedBlock().getType() == XMaterial.LEVER.parseMaterial() && plugin.getBukkitHelper().getNearbyBlocks(specialBlock.getLocation(), 3).contains(event.getClickedBlock())) { onPrayLeverClick(event); return; } if(specialBlock.getLocation().getBlock().equals(event.getClickedBlock())) { switch(specialBlock.getSpecialBlockType()) { case MYSTERY_CAULDRON: onCauldronClick(event); return; case PRAISE_DEVELOPER: onPrayerClick(event); return; case HORSE_PURCHASE: case RAPID_TELEPORTATION: //not yet implemented default: break; } } } } private void onCauldronClick(PlayerInteractEvent event) { if(event.getClickedBlock().getType() != Material.CAULDRON) { return; } if(event.getPlayer().getInventory().getItem(/* same for all roles */ ItemPosition.POTION.getOtherRolesItemPosition()) != null) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_CAULDRON_POTION").asKey().player(event.getPlayer()).sendPlayer(); return; } IUser user = plugin.getUserManager().getUser(event.getPlayer()); int localGold = user.getStatistic("LOCAL_GOLD"); if(localGold < 1) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_NOT_ENOUGH_GOLD").asKey().player(event.getPlayer()).integer(1).sendPlayer(); return; } org.bukkit.Location blockLoc = event.getClickedBlock().getLocation(); VersionUtils.sendParticles("FIREWORKS_SPARK", event.getPlayer(), blockLoc, 10); Item item = blockLoc.getWorld().dropItemNaturally(blockLoc.clone().add(0, 1, 0), new ItemStack(Material.POTION, 1)); item.setPickupDelay(10000); Bukkit.getScheduler().runTaskLater(plugin, item::remove, 20); user.adjustStatistic("LOCAL_GOLD", -1); ItemPosition.removeItem(user, new ItemStack(Material.GOLD_INGOT, 1)); ItemPosition.setItem(user, ItemPosition.POTION, new ItemBuilder(XMaterial.POTION.parseItem()).name(MysteryPotionRegistry.getRandomPotion().getName()).build()); } private void onPrayerClick(PlayerInteractEvent event) { if(event.getClickedBlock().getType() != XMaterial.ENCHANTING_TABLE.parseMaterial()) { return; } event.setCancelled(true); IUser user = plugin.getUserManager().getUser(event.getPlayer()); int localGold = user.getStatistic("LOCAL_GOLD"); if(localGold < 1) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_NOT_ENOUGH_GOLD").asKey().player(event.getPlayer()).integer(1).sendPlayer(); return; } new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_CHAT").asKey().player(event.getPlayer()).sendPlayer(); user.adjustStatistic("LOCAL_PRAISES", 1); VersionUtils.sendParticles("FIREWORKS_SPARK", event.getPlayer(), event.getClickedBlock().getLocation(), 10); user.adjustStatistic("LOCAL_GOLD", -1); ItemPosition.removeItem(user, new ItemStack(Material.GOLD_INGOT, 1)); } private void onPrayLeverClick(PlayerInteractEvent event) { IUser user = plugin.getUserManager().getUser(event.getPlayer()); if(user.getStatistic("LOCAL_PRAISES") < 1) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PAY").asKey().player(event.getPlayer()).sendPlayer(); return; } PrayerRegistry.applyRandomPrayer(user); user.setStatistic("LOCAL_PRAISES", 0); } @EventHandler public void onMysteryPotionDrink(PlayerItemConsumeEvent event) { ItemStack item = event.getItem(); if(item.getType() != XMaterial.POTION.parseMaterial() || !ItemUtils.isItemStackNamed(item)) { return; } if(plugin.getArenaRegistry().getArena(event.getPlayer()) == null) { return; } String itemDisplayName = ComplementAccessor.getComplement().getDisplayName(item.getItemMeta()); IUser user = plugin.getUserManager().getUser(event.getPlayer()); for(MysteryPotion potion : MysteryPotionRegistry.getMysteryPotions()) { if(itemDisplayName.equals(potion.getName())) { event.setCancelled(true); event.getPlayer().sendMessage(potion.getSubtitle()); VersionUtils.sendTitles(event.getPlayer(), "", potion.getSubtitle(), 5, 40, 5); ItemPosition.setItem(user, ItemPosition.POTION, null); event.getPlayer().addPotionEffect(potion.getPotionEffect()); return; } } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/special/mysterypotion/MysteryPotion.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.special.mysterypotion; import org.bukkit.potion.PotionEffect; /** * @author Plajer *

* Created at 15.10.2018 */ public class MysteryPotion { private final String name; private final String subtitle; private final PotionEffect potionEffect; public MysteryPotion(String name, String subtitle, PotionEffect potionEffect) { this.name = name; this.subtitle = subtitle; this.potionEffect = potionEffect; } public String getName() { return name; } public String getSubtitle() { return subtitle; } public PotionEffect getPotionEffect() { return potionEffect; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/special/mysterypotion/MysteryPotionRegistry.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.special.mysterypotion; import org.bukkit.configuration.file.FileConfiguration; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XPotion; import plugily.projects.murdermystery.Main; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; /** * @author Plajer *

* Created at 15.10.2018 */ public class MysteryPotionRegistry { private static final List mysteryPotions = new ArrayList<>(); public static void init(Main plugin) { FileConfiguration config = ConfigUtils.getConfig(plugin, "special_blocks"); org.bukkit.configuration.ConfigurationSection section = config.getConfigurationSection("Special-Blocks.Cauldron-Potions"); if(section == null) { return; } for(String key : section.getKeys(false)) { mysteryPotions.add(new MysteryPotion(new MessageBuilder(section.getString(key + ".Name")).build(), new MessageBuilder(section.getString(key + ".Subtitle")).build(), XPotion.of(section.getString(key + ".Type", "").toUpperCase()).get().buildPotionEffect(section.getInt(key + ".Duration") * 20, section.getInt(key + ".Amplifier")))); } } public static MysteryPotion getRandomPotion() { return mysteryPotions.get(mysteryPotions.size() == 1 ? 0 : ThreadLocalRandom.current().nextInt(mysteryPotions.size())); } public static List getMysteryPotions() { return mysteryPotions; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/special/pray/Prayer.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.special.pray; /** * @author Plajer *

* Created at 16.10.2018 */ public class Prayer { private final PrayerType prayerType; private final boolean goodPray; private final String prayerDescription; public Prayer(PrayerType prayerType, boolean goodPray, String prayerDescription) { this.prayerType = prayerType; this.goodPray = goodPray; this.prayerDescription = prayerDescription; } public PrayerType getPrayerType() { return prayerType; } public boolean isGoodPray() { return goodPray; } public String getPrayerDescription() { return prayerDescription; } public enum PrayerType { BLINDNESS_CURSE, BOW_TIME, DETECTIVE_REVELATION, GOLD_BAN, GOLD_RUSH, INCOMING_DEATH, SINGLE_COMPENSATION, SLOWNESS_CURSE } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/special/pray/PrayerRegistry.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.special.pray; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; import plugily.projects.minigamesbox.api.arena.IArenaState; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.misc.MiscUtils; import plugily.projects.minigamesbox.classic.utils.version.ServerVersion; import plugily.projects.minigamesbox.classic.utils.version.xseries.XPotion; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.utils.ItemPosition; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; /** * @author Plajer *

* Created at 16.10.2018 */ public class PrayerRegistry { private static Main plugin; private static final List prayers = new ArrayList<>(); private static final List ban = new ArrayList<>(), rush = new ArrayList<>(); private PrayerRegistry() { } public static void init(Main plugin) { PrayerRegistry.plugin = plugin; //good prayers prayers.add(new Prayer(Prayer.PrayerType.DETECTIVE_REVELATION, true, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_DETECTIVE_REVELATION").asKey().build())); prayers.add(new Prayer(Prayer.PrayerType.GOLD_RUSH, true, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_GOLD_RUSH").asKey().build())); prayers.add(new Prayer(Prayer.PrayerType.SINGLE_COMPENSATION, true, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_SINGLE_COMPENSATION").asKey().build())); prayers.add(new Prayer(Prayer.PrayerType.BOW_TIME, true, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_BOW").asKey().build())); //bad prayers prayers.add(new Prayer(Prayer.PrayerType.SLOWNESS_CURSE, false, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_SLOWNESS").asKey().build())); prayers.add(new Prayer(Prayer.PrayerType.BLINDNESS_CURSE, false, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_BLINDNESS").asKey().build())); prayers.add(new Prayer(Prayer.PrayerType.GOLD_BAN, false, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_GOLD").asKey().build())); prayers.add(new Prayer(Prayer.PrayerType.INCOMING_DEATH, false, new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_DEATH").asKey().build())); } public static Prayer getRandomPray() { return prayers.get(ThreadLocalRandom.current().nextInt(prayers.size())); } public static List getPrayers() { return prayers; } public static void applyRandomPrayer(IUser user) { Prayer prayer = getRandomPray(); user.setStatistic("LOCAL_CURRENT_PRAY", prayer.getPrayerType().ordinal()); Player player = user.getPlayer(); Arena arena = plugin.getArenaRegistry().getArena(player); List prayMessage = plugin.getLanguageManager().getLanguageList("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Heard"); String feeling = plugin.getLanguageManager().getLanguageMessage("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Feeling." + (prayer.isGoodPray() ? "Blessed" : "Cursed")); int praySize = prayMessage.size(); for(int a = 0; a < praySize; a++) { prayMessage.set(a, prayMessage.get(a).replace("%feeling%", feeling).replace("%praise%", prayer.getPrayerDescription())); } switch(prayer.getPrayerType()) { case BLINDNESS_CURSE: XPotion.BLINDNESS.buildPotionEffect(Integer.MAX_VALUE, 1).apply(player); break; case BOW_TIME: if(!Role.isRole(Role.ANY_DETECTIVE, user, arena)) { ItemPosition.addItem(user, ItemPosition.BOW, new ItemStack(Material.BOW, 1)); } ItemPosition.setItem(user, ItemPosition.ARROWS, new ItemStack(Material.ARROW, plugin.getConfig().getInt("Bow.Amount.Arrows.Prayer", 2))); break; case DETECTIVE_REVELATION: Player characterType = null; if(arena != null) { characterType = arena.getCharacter(Arena.CharacterType.DETECTIVE); if(characterType == null) { characterType = arena.getCharacter(Arena.CharacterType.FAKE_DETECTIVE); } } String charName = characterType == null ? "????" : characterType.getName(); for(int a = 0; a < praySize; a++) { prayMessage.set(a, prayMessage.get(a).replace("%detective%", charName)); } break; case INCOMING_DEATH: new BukkitRunnable() { int time = 60; @Override public void run() { if(arena == null || arena.getArenaState() != IArenaState.IN_GAME || !arena.getPlayersLeft().contains(player)) { cancel(); return; } if(time-- == 0) { player.damage(1000); cancel(); } } }.runTaskTimer(plugin, 20, 20); break; case SINGLE_COMPENSATION: ItemPosition.addItem(user, ItemPosition.GOLD_INGOTS, new ItemStack(Material.GOLD_INGOT, 5)); user.adjustStatistic("LOCAL_GOLD", 5); break; case SLOWNESS_CURSE: XPotion.SLOWNESS.buildPotionEffect(Integer.MAX_VALUE, 1).apply(player); break; case GOLD_BAN: ban.add(player); break; case GOLD_RUSH: rush.add(player); break; default: break; } for(String msg : prayMessage) { MiscUtils.sendCenteredMessage(player, msg); } } public static List getBan() { return ban; } public static List getRush() { return rush; } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/states/InGameState.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.states; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.states.PluginInGameState; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.minigamesbox.classic.utils.version.xseries.XSound; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.ArenaUtils; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.utils.ItemPosition; /** * @author Plajer *

Created at 03.06.2019 */ public class InGameState extends PluginInGameState { @Override public void handleCall(PluginArena arena) { super.handleCall(arena); Arena pluginArena = (Arena) getPlugin().getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } // winner checks if(pluginArena.getTimer() <= 0) { getPlugin().getArenaManager().stopGame(false, pluginArena); } if(pluginArena.getPlayersLeft().size() == pluginArena.aliveMurderer()) { getPlugin().getArenaManager().stopGame(false, pluginArena); } distributeMurdererSword(pluginArena); //every 30 secs survive reward givePlayerSurviveReward(pluginArena); addInnocentLocator(pluginArena); if(pluginArena.getPlayersLeft().size() == pluginArena.aliveMurderer() + 1) { addMurdererSpeed(pluginArena); } spawnGold(pluginArena); } private void addMurdererSpeed(Arena pluginArena) { int multiplier = getPlugin().getConfig().getInt("Murderer.Speed", 3); if(multiplier > 1 && multiplier <= 10) { for(Player player : pluginArena.getMurdererList()) { if(pluginArena.isMurderAlive(player)) { // no potion because it adds particles which can be identified player.setWalkSpeed(0.1f * multiplier); } } } } private void distributeMurdererSword(Arena pluginArena) { int inGameLength = getPlugin().getConfig().getInt("Time-Manager.In-Game", 270); if(pluginArena.getTimer() <= (inGameLength - 10) && pluginArena.getTimer() > (inGameLength - 15)) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_SWORD_SOON").asKey().integer(pluginArena.getTimer() - (inGameLength - 15)).arena(pluginArena).sendArena(); for(Player p : pluginArena.getPlayers()) { XSound.UI_BUTTON_CLICK.play(p.getLocation(), 1, 1); } if(pluginArena.getTimer() == (inGameLength - 14)) { if(pluginArena.getMurdererList().isEmpty()) getPlugin().getArenaManager().stopGame(false, pluginArena); for(Player p : pluginArena.getMurdererList()) { IUser murderer = getPlugin().getUserManager().getUser(p); if(murderer.isSpectator() || !p.isOnline()) continue; p.getInventory().setHeldItemSlot(0); ItemPosition.setItem(murderer, ItemPosition.MURDERER_SWORD, pluginArena.getPlugin().getSwordSkinManager().getRandomSwordSkin(p)); } } } } private void spawnGold(Arena pluginArena) { //don't spawn it every time if(pluginArena.getSpawnGoldTimer() == pluginArena.getSpawnGoldTime()) { spawnSomeGold(pluginArena); pluginArena.setSpawnGoldTimer(0); } else { pluginArena.setSpawnGoldTimer(pluginArena.getSpawnGoldTimer() + 1); } } private void givePlayerSurviveReward(Arena pluginArena) { if(pluginArena.getTimer() % 30 == 0) { new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_TIME_LEFT").arena(pluginArena).sendArena(); for(Player p : pluginArena.getPlayersLeft()) { IUser user = getPlugin().getUserManager().getUser(p); if(Role.isRole(Role.INNOCENT, user, pluginArena)) { ArenaUtils.addScore(user, ArenaUtils.ScoreAction.SURVIVE_TIME, 0); } } } } private void addInnocentLocator(Arena pluginArena) { if(pluginArena.getTimer() <= 30 || pluginArena.getPlayersLeft().size() == pluginArena.aliveMurderer() + 1) { if(getPlugin().getConfigPreferences().getOption("MURDERER_LOCATOR")) { ArenaUtils.updateInnocentLocator(pluginArena); } } } private void spawnSomeGold(Arena arena) { int spawnPointsSize = arena.getGoldSpawnPoints().size(); if(spawnPointsSize == 0) { return; } //may users want to disable it and want much gold on their map xD if(!getPlugin().getConfigPreferences().getOption("GOLD_LIMITER")) { //do not exceed amount of gold per spawn if(arena.getGoldSpawned().size() >= spawnPointsSize) { return; } } if(getPlugin().getConfigPreferences().getOption("GOLD_SPAWNER_MODE_ALL")) { for(Location location : arena.getGoldSpawnPoints()) { dropGold(arena, location); } } else { Location loc = arena.getGoldSpawnPoints().get(getPlugin().getRandom().nextInt(spawnPointsSize)); dropGold(arena, loc); } } private void dropGold(Arena arena, Location location) { //spawn maximum 1 gold per spawner if(!getPlugin().getConfigPreferences().getOption("GOLD_MULTIPLE")) { for(Entity entity : location.getWorld().getNearbyEntities(location, 2, 2, 2)) { if(entity instanceof Item && XMaterial.GOLD_INGOT.isSimilar(((Item) entity).getItemStack())) { return; } } } arena.getGoldSpawned().add(location.getWorld().dropItem(location, new ItemStack(Material.GOLD_INGOT, 1))); getPlugin().getPowerupRegistry().spawnPowerup(location, arena); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/states/RestartingState.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.states; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.states.PluginRestartingState; import plugily.projects.murdermystery.arena.Arena; /** * @author Plajer *

* Created at 03.06.2019 */ public class RestartingState extends PluginRestartingState { @Override public void handleCall(PluginArena arena) { super.handleCall(arena); Arena pluginArena = (Arena) getPlugin().getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } if(arena.getTimer() <= 0) { if(pluginArena.isGoldVisuals()) { pluginArena.startGoldVisuals(); } } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/states/StartingState.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.arena.states; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.states.PluginStartingState; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.language.TitleBuilder; import plugily.projects.minigamesbox.classic.utils.actionbar.ActionBar; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.ArenaUtils; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.arena.special.pray.PrayerRegistry; import plugily.projects.murdermystery.utils.ItemPosition; import java.util.*; import java.util.stream.Collectors; /** * @author Plajer *

Created at 03.06.2019 */ public class StartingState extends PluginStartingState { int maxmurderer = 1; int maxdetectives = 1; @Override public void handleCall(PluginArena arena) { super.handleCall(arena); Arena pluginArena = (Arena) getPlugin().getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } if(!pluginArena.isHideChances()) { for(Player player : arena.getPlayersLeft()) { pluginArena.getPlugin().getActionBarManager().addActionBar(player, new ActionBar((new MessageBuilder("IN_GAME_MESSAGES_ARENA_ROLE_CHANCES_ACTION_BAR")).asKey().player(player).arena(pluginArena), ActionBar.ActionBarType.DISPLAY)); } } if(arena.getTimer() == 0 || arena.isForceStart()) { int size = pluginArena.getPlayerSpawnPoints().size(); for(Player player : arena.getPlayersLeft()) { VersionUtils.teleport(player, pluginArena.getPlayerSpawnPoints().get(getPlugin().getRandom().nextInt(size))); IUser user = arena.getPlugin().getUserManager().getUser(player); user.resetNonePersistentStatistics(); PrayerRegistry.getRush().remove(player); PrayerRegistry.getBan().remove(player); ArenaUtils.updateNameTagsVisibility(player); player.setGameMode(GameMode.ADVENTURE); getPlugin().getActionBarManager().clearActionBarsFromPlayer(player); } Set playersToSet = new HashSet<>(arena.getPlayersLeft()); getMaxRolesToSet(pluginArena); addRole(pluginArena, Role.MURDERER, playersToSet); addRole(pluginArena, Role.DETECTIVE, playersToSet); for(Player player : playersToSet) { new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_INNOCENT").asKey().player(player).arena(pluginArena).sendPlayer(); } arena.getPlugin().getDebugger().debug("After: Arena: {0} | Detectives = {1}, Murders = {2}, Players = {3} | Players: Detectives = {4}, Murders = {5}", arena.getId(), maxdetectives, maxmurderer, arena.getPlayersLeft().size(), pluginArena.getDetectiveList(), pluginArena.getMurdererList()); // Load and append special blocks hologram pluginArena.getSpecialBlocks().forEach(pluginArena::loadSpecialBlock); } } private void addRole(Arena arena, Role role, Set playersToSet) { String roleName = role.toString(); List chancesRanking = getPlugin().getUserManager().getUsers(arena).stream().filter(user -> playersToSet.contains(user.getPlayer())).sorted(Comparator.comparingInt(user -> arena.getContributorValue(role, user))).collect(Collectors.toList()); Collections.reverse(chancesRanking); List chancesPlayer = new ArrayList<>(); for(IUser user : chancesRanking) { chancesPlayer.add(user.getPlayer()); } getPlugin().getDebugger().debug("Arena {0} | Role add {1} | List {2}", arena.getId(), roleName, chancesPlayer); int amount = role == Role.MURDERER ? maxmurderer : maxdetectives; for(int i = 0; i < amount; i++) { IUser user = chancesRanking.get(i); Player userPlayer = user.getPlayer(); arena.setCharacter(role, userPlayer); arena.resetContributorValue(role, user); playersToSet.remove(userPlayer); new TitleBuilder("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_" + roleName).asKey().arena(arena).player(userPlayer).sendPlayer(); if(role == Role.MURDERER) { arena.getMurdererList().add(userPlayer); } else if(role == Role.DETECTIVE) { arena.getDetectiveList().add(userPlayer); userPlayer.getInventory().setHeldItemSlot(0); Bukkit.getScheduler().runTaskLater(arena.getPlugin(), () -> { ItemPosition.setItem(user, ItemPosition.BOW, new ItemStack(Material.BOW, 1)); ItemPosition.setItem(user, ItemPosition.INFINITE_ARROWS, new ItemStack(Material.ARROW, getPlugin().getConfig().getInt("Bow.Amount.Arrows.Detective", 3))); }, 20); } } } private void getMaxRolesToSet(Arena arena) { int playersSize = arena.getPlayersLeft().size(); arena.getPlugin().getDebugger().debug("Before: Arena: {0} | Detectives = {1}, Murders = {2}, Players = {3} | Configured: Detectives = {4}, Murders = {5}", arena.getId(), maxdetectives, maxmurderer, playersSize, arena.getArenaOption("DETECTIVE_DIVIDER"), arena.getArenaOption("MURDERER_DIVIDER")); if(arena.getArenaOption("MURDERER_DIVIDER") > 1 && playersSize > arena.getArenaOption("MURDERER_DIVIDER")) { maxmurderer = (playersSize / arena.getArenaOption("MURDERER_DIVIDER")); } if(arena.getArenaOption("DETECTIVE_DIVIDER") > 1 && playersSize > arena.getArenaOption("DETECTIVE_DIVIDER")) { maxdetectives = (playersSize / arena.getArenaOption("DETECTIVE_DIVIDER")); } if(playersSize - (maxmurderer + maxdetectives) < 1) { arena.getPlugin().getDebugger().debug("{0} Murderers and detectives amount was reduced because there are not enough players", arena.getId()); // Make sure to have one innocent! if(maxdetectives > 1) { maxdetectives--; } else if(maxmurderer > 1) { maxmurderer--; } } arena.getPlugin().getDebugger().debug("After: Arena: {0} | Detectives = {1}, Murders = {2}, Players = {3} | Configured: Detectives = {4}, Murders = {5}", arena.getId(), maxdetectives, maxmurderer, playersSize, arena.getArenaOption("DETECTIVE_DIVIDER"), arena.getArenaOption("MURDERER_DIVIDER")); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/arena/states/WaitingState.java ================================================ package plugily.projects.murdermystery.arena.states; import org.bukkit.configuration.file.FileConfiguration; import plugily.projects.minigamesbox.classic.arena.PluginArena; import plugily.projects.minigamesbox.classic.arena.states.PluginWaitingState; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.murdermystery.arena.Arena; public class WaitingState extends PluginWaitingState { @Override public void handleCall(PluginArena arena) { super.handleCall(arena); Arena pluginArena = (Arena) getPlugin().getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return; } if(arena.getTimer() <= 0) { FileConfiguration config = ConfigUtils.getConfig(getPlugin(), "arenas"); pluginArena.setGoldVisuals(config.getBoolean(pluginArena.getId() + ".goldvisuals")); } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/boot/AdditionalValueInitializer.java ================================================ package plugily.projects.murdermystery.boot; import plugily.projects.minigamesbox.api.preferences.IConfigPreferences; import plugily.projects.minigamesbox.classic.api.StatisticType; import plugily.projects.minigamesbox.classic.api.StatsStorage; import plugily.projects.minigamesbox.classic.arena.options.ArenaOption; import plugily.projects.minigamesbox.classic.arena.options.ArenaOptionManager; import plugily.projects.minigamesbox.classic.handlers.items.SpecialItemManager; import plugily.projects.minigamesbox.classic.handlers.permissions.PermissionCategory; import plugily.projects.minigamesbox.classic.handlers.permissions.PermissionsManager; import plugily.projects.minigamesbox.classic.handlers.reward.RewardType; import plugily.projects.minigamesbox.classic.handlers.reward.RewardsFactory; import plugily.projects.minigamesbox.classic.preferences.ConfigOption; import plugily.projects.murdermystery.Main; /** * @author Tigerpanzer_02 *

* Created at 15.10.2022 */ public class AdditionalValueInitializer { private final Main plugin; public AdditionalValueInitializer(Main plugin) { this.plugin = plugin; registerConfigOptions(); registerStatistics(); registerPermission(); registerRewards(); registerSpecialItems(); registerArenaOptions(); } private void registerConfigOptions() { getConfigPreferences().registerOption("CORPSES_INTEGRATION_OVERWRITE", new ConfigOption("Corpses.Integration-Overwrite", true)); getConfigPreferences().registerOption("BOW_KILL_DETECTIVE", new ConfigOption("Bow.Kill-Detective", true)); getConfigPreferences().registerOption("HIDE_DEATH", new ConfigOption("Hide.Death", false)); getConfigPreferences().registerOption("HIDE_NAMETAGS", new ConfigOption("Hide.Nametags", false)); getConfigPreferences().registerOption("GOLD_SPAWNER_MODE_ALL", new ConfigOption("Gold.Spawner-Mode", false)); getConfigPreferences().registerOption("GOLD_LIMITER", new ConfigOption("Gold.Limiter", false)); getConfigPreferences().registerOption("GOLD_MULTIPLE", new ConfigOption("Gold.Multiple", false)); getConfigPreferences().registerOption("MURDERER_LOCATOR", new ConfigOption("Murderer.Locator", true)); } private void registerStatistics() { getStatsStorage().registerStatistic("KILLS", new StatisticType("kills", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("DEATHS", new StatisticType("deaths", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("HIGHEST_SCORE", new StatisticType("highest_score", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("CONTRIBUTION_DETECTIVE", new StatisticType("contribution_detective", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("CONTRIBUTION_MURDERER", new StatisticType("contribution_murderer", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("PASS_MURDERER", new StatisticType("pass_murderer", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("PASS_DETECTIVE", new StatisticType("pass_detective", true, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("LOCAL_PRAISES", new StatisticType("local_praises", false, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("LOCAL_SCORE", new StatisticType("local_score", false, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("LOCAL_PRAY", new StatisticType("local_pray", false, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("LOCAL_GOLD", new StatisticType("local_gold", false, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("LOCAL_KILLS", new StatisticType("local_kills", false, "int(11) NOT NULL DEFAULT '0'")); getStatsStorage().registerStatistic("LOCAL_CURRENT_PRAY", new StatisticType("local_current_pray", false, "int(11) NOT NULL DEFAULT '0'")); } private void registerPermission() { getPermissionsManager().registerPermissionCategory("CHANCES_BOOSTER", new PermissionCategory("Chances-Boost", null)); getPermissionsManager().registerPermissionCategory("MURDERER_BOOSTER", new PermissionCategory("Murderer-Boost", null)); getPermissionsManager().registerPermissionCategory("DETECTIVE_BOOSTER", new PermissionCategory("Detective-Boost", null)); } private void registerRewards() { getRewardsHandler().registerRewardType("KILL_DETECTIVE", new RewardType("detective-kill")); getRewardsHandler().registerRewardType("KILL_MURDERER", new RewardType("murderer-kill")); getRewardsHandler().registerRewardType("WIN", new RewardType("win")); getRewardsHandler().registerRewardType("LOSE", new RewardType("lose")); getRewardsHandler().registerRewardType("PLAYER_DEATH", new RewardType("player-death")); getRewardsHandler().registerRewardType("GOLD_PICKUP", new RewardType("gold-pickup")); } private void registerSpecialItems() { getSpecialItemManager().registerSpecialItem("ROLE_PASS", "Role-Pass"); } private void registerArenaOptions() { getArenaOptionManager().registerArenaOption("DETECTIVE_DIVIDER", new ArenaOption("playerperdetective", 1)); getArenaOptionManager().registerArenaOption("MURDERER_DIVIDER", new ArenaOption("playerpermurderer", 1)); } private IConfigPreferences getConfigPreferences() { return plugin.getConfigPreferences(); } private StatsStorage getStatsStorage() { return plugin.getStatsStorage(); } private PermissionsManager getPermissionsManager() { return plugin.getPermissionsManager(); } private RewardsFactory getRewardsHandler() { return plugin.getRewardsHandler(); } private SpecialItemManager getSpecialItemManager() { return plugin.getSpecialItemManager(); } private ArenaOptionManager getArenaOptionManager() { return plugin.getArenaOptionManager(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/boot/MessageInitializer.java ================================================ package plugily.projects.murdermystery.boot; import plugily.projects.minigamesbox.classic.handlers.language.Message; import plugily.projects.minigamesbox.classic.handlers.language.MessageManager; import plugily.projects.minigamesbox.classic.utils.services.locale.Locale; import plugily.projects.minigamesbox.classic.utils.services.locale.LocaleRegistry; import plugily.projects.murdermystery.Main; import java.util.Arrays; /** * @author Tigerpanzer_02 *

* Created at 15.10.2022 */ public class MessageInitializer { private final Main plugin; public MessageInitializer(Main plugin) { this.plugin = plugin; } public void registerMessages() { getMessageManager().registerMessage("", new Message("", "")); getMessageManager().registerMessage("SCOREBOARD_ROLES_DETECTIVE", new Message("Scoreboard.Roles.Detective", "")); getMessageManager().registerMessage("SCOREBOARD_ROLES_MURDERER", new Message("Scoreboard.Roles.Murderer", "")); getMessageManager().registerMessage("SCOREBOARD_ROLES_INNOCENT", new Message("Scoreboard.Roles.Innocent", "")); getMessageManager().registerMessage("SCOREBOARD_ROLES_DEAD", new Message("Scoreboard.Roles.Dead", "")); getMessageManager().registerMessage("SCOREBOARD_DETECTIVE_ALIVE", new Message("Scoreboard.Detective.Alive", "")); getMessageManager().registerMessage("SCOREBOARD_DETECTIVE_BOW_DROPPED", new Message("Scoreboard.Detective.Bow.Dropped", "")); getMessageManager().registerMessage("SCOREBOARD_DETECTIVE_BOW_PICKED", new Message("Scoreboard.Detective.Bow.Picked", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_STOPPED", new Message("In-Game.Messages.Game-End.Placeholders.Murderer.Stopped", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_KILLED_YOU", new Message("In-Game.Messages.Game-End.Placeholders.Murderer.Killed.You", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_KILLED_ALL", new Message("In-Game.Messages.Game-End.Placeholders.Murderer.Killed.All", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_INNOCENT_KILLED_YOU", new Message("In-Game.Messages.Game-End.Placeholders.Innocent.Killed.You", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_INNOCENT_KILLED_WRONGLY", new Message("In-Game.Messages.Game-End.Placeholders.Innocent.Killed.All", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_NOBODY", new Message("In-Game.Messages.Game-End.Placeholders.Nobody", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_ROLE_CHANCES_ACTION_BAR", new Message("In-Game.Messages.Arena.Chances.Action-Bar", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_COOLDOWN", new Message("In-Game.Messages.Arena.Cooldown", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_LOCATOR_BOW", new Message("In-Game.Messages.Arena.Locator.Bow", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_LOCATOR_INNOCENT", new Message("In-Game.Messages.Arena.Locator.Innocent", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_LOCATOR_WATCH_OUT", new Message("In-Game.Messages.Arena.Locator.Watch-Out", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_NAME", new Message("In-Game.Messages.Arena.Pass.Name", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_ROLE_MURDERER_NAME", new Message("In-Game.Messages.Arena.Pass.Role.Murderer.Name", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_ROLE_MURDERER_LORE", new Message("In-Game.Messages.Arena.Pass.Role.Murderer.Lore", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_ROLE_DETECTIVE_NAME", new Message("In-Game.Messages.Arena.Pass.Role.Detective.Name", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_ROLE_DETECTIVE_LORE", new Message("In-Game.Messages.Arena.Pass.Role.Detective.Lore", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_FAIL", new Message("In-Game.Messages.Arena.Pass.Fail", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_SUCCESS", new Message("In-Game.Messages.Arena.Pass.Success", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PASS_CHANGE", new Message("In-Game.Messages.Arena.Pass.Change", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_TIME_LEFT", new Message("In-Game.Messages.Arena.Playing.Time-Left", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_CHANGE", new Message("In-Game.Messages.Arena.Playing.Role.Change", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_MURDERER", new Message("In-Game.Messages.Arena.Playing.Role.Murderer", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_DETECTIVE", new Message("In-Game.Messages.Arena.Playing.Role.Detective", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_ROLE_INNOCENT", new Message("In-Game.Messages.Arena.Playing.Role.Innocent", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_BONUS", new Message("In-Game.Messages.Arena.Playing.Score.Bonus", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_GOLD", new Message("In-Game.Messages.Arena.Playing.Score.Gold", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_KILL_PLAYER", new Message("In-Game.Messages.Arena.Playing.Score.Action.Kill.Player", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_KILL_MURDERER", new Message("In-Game.Messages.Arena.Playing.Score.Action.Kill.Murderer", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_KILL_INNOCENT", new Message("In-Game.Messages.Arena.Playing.Score.Action.Kill.Innocent", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_PICKUP_GOLD", new Message("In-Game.Messages.Arena.Playing.Score.Action.Pickup.Gold", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_SURVIVING_TIME", new Message("In-Game.Messages.Arena.Playing.Score.Action.Surviving.Time", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_SURVIVING_END", new Message("In-Game.Messages.Arena.Playing.Score.Action.Surviving.End", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_WIN", new Message("In-Game.Messages.Arena.Playing.Score.Action.Win", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SCORE_ACTION_DETECTIVE", new Message("In-Game.Messages.Arena.Playing.Score.Action.Detective", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SWORD_SOON", new Message("In-Game.Messages.Arena.Playing.Sword.Soon", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_CAULDRON_POTION", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Cauldron.Potion", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_CAULDRON_HOLOGRAM", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Cauldron.Hologram", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_NOT_ENOUGH_GOLD", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Not-Enough-Gold", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_HOLOGRAM", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Hologram", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_CHAT", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Chat", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PAY", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Pay", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_HEARD", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Heard", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_FEELING_BLESSED", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Feeling.Blessed", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_FEELING_CURSED", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Feeling.Cursed", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_DETECTIVE_REVELATION", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Gifts.Detective-Revelation", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_GOLD_RUSH", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Gifts.Gold-Rush", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_SINGLE_COMPENSATION", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Gifts.Single-Compensation", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_GIFTS_BOW", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Gifts.Bow", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_SLOWNESS", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Curses.Slowness", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_BLINDNESS", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Curses.Blindness", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_GOLD", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Curses.Gold", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_SPECIAL_BLOCKS_PRAY_PRAISE_CURSES_DEATH", new Message("In-Game.Messages.Arena.Playing.Special-Blocks.Pray.Praise.Curses.Death", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_DROPPED", new Message("In-Game.Messages.Arena.Playing.Bow.Dropped", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_PICKUP", new Message("In-Game.Messages.Arena.Playing.Bow.Pickup", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_SHOT_GOLD", new Message("In-Game.Messages.Arena.Playing.Bow.Shot.Gold", "")); getMessageManager().registerMessage("IN_GAME_MESSAGES_ARENA_PLAYING_BOW_SHOT_TITLE", new Message("In-Game.Messages.Arena.Playing.Bow.Shot.Title", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_CONTRIBUTION_DETECTIVE", new Message("Leaderboard.Statistics.Detective-Contribution", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_CONTRIBUTION_MURDERER", new Message("Leaderboard.Statistics.Murderer-Contribution", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_PASS_DETECTIVE", new Message("Leaderboard.Statistics.Detective-Pass", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_PASS_MURDERER", new Message("Leaderboard.Statistics.Murderer-Pass", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_KILLS", new Message("Leaderboard.Statistics.Kills", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_DEATHS", new Message("Leaderboard.Statistics.Deaths", "")); getMessageManager().registerMessage("LEADERBOARD_STATISTICS_HIGHEST_SCORE", new Message("Leaderboard.Statistics.Highest-Score", "")); } private MessageManager getMessageManager() { return plugin.getMessageManager(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/boot/PlaceholderInitializer.java ================================================ package plugily.projects.murdermystery.boot; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.jetbrains.annotations.Nullable; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.api.user.IUserManager; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.placeholder.Placeholder; import plugily.projects.minigamesbox.classic.handlers.placeholder.PlaceholderManager; import plugily.projects.minigamesbox.number.NumberUtils; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.ArenaRegistry; import plugily.projects.murdermystery.arena.role.Role; /** * @author Tigerpanzer_02 *

* Created at 15.10.2022 */ public class PlaceholderInitializer { private final Main plugin; public PlaceholderInitializer(Main plugin) { this.plugin = plugin; registerPlaceholders(); } private void registerPlaceholders() { getPlaceholderManager().registerPlaceholder(new Placeholder("detective_list", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } StringBuilder detectives = new StringBuilder(); for(Player p : pluginArena.getDetectiveList()) { detectives.append(p.getName()).append(", "); } int index = detectives.length() - 2; if(index > 0 && index < detectives.length()) { detectives.deleteCharAt(index); } return (pluginArena.isDetectiveDead() ? ChatColor.STRIKETHROUGH : "") + detectives.toString(); } }); getPlaceholderManager().registerPlaceholder(new Placeholder("murderer_list", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } StringBuilder murders = new StringBuilder(); for(Player p : pluginArena.getMurdererList()) { IUser user = getUserManager().getUser(p); int localKills = user.getStatistic("LOCAL_KILLS"); murders.append(p.getName()); if(pluginArena.getMurdererList().size() > 1) { murders.append(" (").append(localKills).append("), "); } } if(pluginArena.getMurdererList().size() > 1) { murders.deleteCharAt(murders.length() - 2); } return (pluginArena.aliveMurderer() == 1 ? "" : ChatColor.STRIKETHROUGH) + murders.toString(); } }); getPlaceholderManager().registerPlaceholder(new Placeholder("murderer_kills", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } int murdererKills = 0; for(Player p : pluginArena.getMurdererList()) { IUser user = getUserManager().getUser(p); int localKills = user.getStatistic("LOCAL_KILLS"); murdererKills += localKills; } return Integer.toString(murdererKills); } }); getPlaceholderManager().registerPlaceholder(new Placeholder("hero", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } Player hero = pluginArena.getCharacter(Arena.CharacterType.HERO); return hero != null ? hero.getName() : new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_NOBODY").asKey().build(); } }); getPlaceholderManager().registerPlaceholder(new Placeholder("murderer_chance", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } IUser user = getUserManager().getUser(player); return NumberUtils.round(((double) pluginArena.getContributorValue(Role.MURDERER, user) / (double) pluginArena.getTotalRoleChances(Role.MURDERER)) * 100.0, 0) + "%"; } }); getPlaceholderManager().registerPlaceholder(new Placeholder("detective_chance", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } IUser user = getUserManager().getUser(player); return NumberUtils.round(((double) pluginArena.getContributorValue(Role.DETECTIVE, user) / (double) pluginArena.getTotalRoleChances(Role.DETECTIVE)) * 100.0, 0) + "%"; } }); getPlaceholderManager().registerPlaceholder(new Placeholder("detective_status", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } if(pluginArena.isDetectiveDead()) { if(!pluginArena.isCharacterSet(Arena.CharacterType.FAKE_DETECTIVE)) { return new MessageBuilder("SCOREBOARD_DETECTIVE_BOW_DROPPED").asKey().build(); } else { return new MessageBuilder("SCOREBOARD_DETECTIVE_BOW_PICKED").asKey().build(); } } else { return new MessageBuilder("SCOREBOARD_DETECTIVE_ALIVE").asKey().build(); } } }); getPlaceholderManager().registerPlaceholder(new Placeholder("innocent_size", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } int innocents = 0; for(Player p : arena.getPlayersLeft()) { if(!Role.isRole(Role.MURDERER, getUserManager().getUser(p))) { innocents++; } } return Integer.toString(innocents); } }); getPlaceholderManager().registerPlaceholder(new Placeholder("player_role", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } IUser user = getUserManager().getUser(player); String role; if(pluginArena.isDeathPlayer(player)) { role = new MessageBuilder("SCOREBOARD_ROLES_DEAD").asKey().build(); } else if(Role.isRole(Role.MURDERER, user, arena)) { role = new MessageBuilder("SCOREBOARD_ROLES_MURDERER").asKey().build(); } else if(Role.isRole(Role.ANY_DETECTIVE, user, arena)) { role = new MessageBuilder("SCOREBOARD_ROLES_DETECTIVE").asKey().build(); } else { role = new MessageBuilder("SCOREBOARD_ROLES_INNOCENT").asKey().build(); } return role; } }); getPlaceholderManager().registerPlaceholder(new Placeholder("summary_player", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { return getSummary(player, arena); } @Nullable private String getSummary(Player player, IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } String summaryEnding; if(pluginArena.getMurdererList().containsAll(pluginArena.getPlayersLeft()) && pluginArena.getMurdererList().contains(player)) { summaryEnding = new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_WIN").asKey().arena(pluginArena).build(); } else if(!pluginArena.getMurdererList().containsAll(pluginArena.getPlayersLeft()) && !pluginArena.getMurdererList().contains(player)) { summaryEnding = new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_WIN").asKey().arena(pluginArena).build(); } else { summaryEnding = new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_LOSE").asKey().arena(pluginArena).build(); } return summaryEnding; } }); getPlaceholderManager().registerPlaceholder(new Placeholder("summary", Placeholder.PlaceholderType.ARENA, Placeholder.PlaceholderExecutor.ALL) { @Override public String getValue(Player player, IPluginArena arena) { return getSummary(arena); } @Override public String getValue(IPluginArena arena) { return getSummary(arena); } @Nullable private String getSummary(IPluginArena arena) { Arena pluginArena = getArenaRegistry().getArena(arena.getId()); if(pluginArena == null) { return null; } String summaryEnding; if(pluginArena.getMurdererList().containsAll(pluginArena.getPlayersLeft())) { summaryEnding = new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_KILLED_ALL").asKey().arena(pluginArena).build(); } else { summaryEnding = new MessageBuilder("IN_GAME_MESSAGES_GAME_END_PLACEHOLDERS_MURDERER_STOPPED").asKey().arena(pluginArena).build(); } return summaryEnding; } }); } private PlaceholderManager getPlaceholderManager() { return plugin.getPlaceholderManager(); } private ArenaRegistry getArenaRegistry() { return plugin.getArenaRegistry(); } private IUserManager getUserManager() { return plugin.getUserManager(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/commands/arguments/ArgumentsRegistry.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.commands.arguments; import plugily.projects.minigamesbox.classic.commands.arguments.PluginArgumentsRegistry; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.commands.arguments.admin.RolePassArgument; import plugily.projects.murdermystery.commands.arguments.admin.arena.SpecialBlockRemoverArgument; import plugily.projects.murdermystery.commands.arguments.game.RoleSelectorArgument; /** * @author Plajer *

* Created at 11.01.2019 */ public class ArgumentsRegistry extends PluginArgumentsRegistry { public ArgumentsRegistry(Main plugin) { super(plugin); //register basic arugments new RoleSelectorArgument(this); //register admin related arguments new SpecialBlockRemoverArgument(this); new RolePassArgument(this); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/commands/arguments/admin/RolePassArgument.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.commands.arguments.admin; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument; import plugily.projects.minigamesbox.classic.commands.arguments.data.LabelData; import plugily.projects.minigamesbox.classic.commands.arguments.data.LabeledCommandArgument; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.number.NumberUtils; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.commands.arguments.ArgumentsRegistry; /** * @author Tigerpanzer_02 *

* Created at 13.06.2021 */ public class RolePassArgument { public RolePassArgument(ArgumentsRegistry registry) { registry.mapArgument("murdermysteryadmin", new LabeledCommandArgument("rolepass", "murdermystery.admin.rolepass", CommandArgument.ExecutorType.BOTH, new LabelData("/mma rolepass [player]", "/mma rolepass [player] ", "&7Add or remove rolepass\n&6Permission: &7murdermystery.admin.rolepass")) { @Override public void execute(CommandSender sender, String[] args) { if(args.length < 4) { sender.sendMessage(ChatColor.RED + "Command: /mma rolepass [player]"); return; } //add/remove String addOrRemove = args[1]; if(!addOrRemove.equalsIgnoreCase("add") && !addOrRemove.equalsIgnoreCase("remove") && !addOrRemove.equalsIgnoreCase("set")) { sender.sendMessage(ChatColor.RED + "Command: /mma rolepass [player]"); return; } String roleArg = args[2]; Role role = Role.MURDERER; try { role = Role.valueOf(roleArg.toUpperCase()); } catch(IllegalArgumentException exception) { sender.sendMessage(ChatColor.RED + "Command: /mma rolepass [player]"); return; } if(role != Role.MURDERER && role != Role.DETECTIVE) { sender.sendMessage(ChatColor.RED + "Command: /mma rolepass [player]"); return; } java.util.Optional opt = NumberUtils.parseInt(args[3]); if(!opt.isPresent()) { sender.sendMessage(ChatColor.RED + "Command: /mma rolepass [player]"); return; } int amount = opt.orElse(0); //player Player player = args.length == 5 ? Bukkit.getPlayerExact(args[4]) : (Player) sender; if(player == null) { new MessageBuilder("COMMANDS_PLAYER_NOT_FOUND").asKey().send(sender); return; } IUser user = registry.getPlugin().getUserManager().getUser(player); switch(addOrRemove.toLowerCase()) { case "add": if(role == Role.MURDERER) { user.adjustStatistic("PASS_MURDERER", amount); } else { user.adjustStatistic("PASS_DETECTIVE", amount); } break; case "remove": if(role == Role.MURDERER) { user.adjustStatistic("PASS_MURDERER", -amount); } else { user.adjustStatistic("PASS_DETECTIVE", -amount); } break; case "set": if(role == Role.MURDERER) { user.setStatistic("PASS_MURDERER", amount); } else { user.setStatistic("PASS_DETECTIVE", amount); } break; default: break; } if(role == Role.MURDERER) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_CHANGE").asKey().player(player).integer(user.getStatistic("PASS_MURDERER")).value(Role.MURDERER.name()).sendPlayer(); } else { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_CHANGE").asKey().player(player).integer(user.getStatistic("PASS_DETECTIVE")).value(Role.DETECTIVE.name()).sendPlayer(); } } }); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/commands/arguments/admin/arena/SpecialBlockRemoverArgument.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.commands.arguments.admin.arena; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import plugily.projects.minigamesbox.api.arena.IPluginArena; import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument; import plugily.projects.minigamesbox.classic.commands.arguments.data.LabelData; import plugily.projects.minigamesbox.classic.commands.arguments.data.LabeledCommandArgument; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.minigamesbox.classic.utils.serialization.LocationSerializer; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.special.SpecialBlock; import plugily.projects.murdermystery.commands.arguments.ArgumentsRegistry; import java.util.ArrayList; import java.util.List; /** * @author Tigerpanzer_02 *

Created at 22.10.2020 */ public class SpecialBlockRemoverArgument { public SpecialBlockRemoverArgument(ArgumentsRegistry registry) { registry.mapArgument( "murdermysteryadmin", new LabeledCommandArgument( "removeblock", "murdermystery.admin.removeblock", CommandArgument.ExecutorType.PLAYER, new LabelData( "/mma removeblock", "/mma removeblock", "&7Removes the special block you are looking at \n&6Permission: &7murdermystery.admin.removeblock")) { @Override public void execute(CommandSender sender, String[] args) { // no need for check as argument is only for players Player player = (Player) sender; Block targetBlock = player.getTargetBlock(null, 7); if (targetBlock.getType() == Material.CAULDRON || targetBlock.getType() == XMaterial.ENCHANTING_TABLE.parseMaterial()) { for (IPluginArena arena : registry.getPlugin().getArenaRegistry().getArenas()) { Arena pluginArena = (Arena) registry.getPlugin().getArenaRegistry().getArena(arena.getId()); // do not check arenas that could not be the case if (pluginArena.getSpecialBlocks().isEmpty()) { continue; } if (pluginArena.getPlayerSpawnPoints().get(0).getWorld() != player.getWorld()) { continue; } // get all special blocks for (SpecialBlock specialBlock : new ArrayList<>(pluginArena.getSpecialBlocks())) { // check if targetBlock is specialblock if (specialBlock.getLocation().getBlock().equals(targetBlock)) { // get special blocks from config FileConfiguration config = ConfigUtils.getConfig(registry.getPlugin(), "arenas"); // remove special block from arena pluginArena.getSpecialBlocks().remove(specialBlock); // remove hologram if (specialBlock.getArmorStandHologram() != null) { specialBlock.getArmorStandHologram().delete(); } // remove special block from arena file String path = targetBlock.getType() == Material.CAULDRON ? ".mystery-cauldrons" : ".confessionals"; String serializedLoc = LocationSerializer.locationToString(specialBlock.getLocation()); List specialBlocksType = config.getStringList("instances." + arena.getId() + path); specialBlocksType.remove(serializedLoc); config.set("instances." + arena.getId() + path, specialBlocksType); // save arena config after removing special block ConfigUtils.saveConfig(registry.getPlugin(), config, "arenas"); new MessageBuilder("&cRemoved special block at loc " + serializedLoc + " from arena " + arena.getId()).player(player).sendPlayer(); return; } } } } new MessageBuilder("&cPlease target an special block to continue!").player(player).sendPlayer(); } }); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/commands/arguments/game/RoleSelectorArgument.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.commands.arguments.game; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.PluginMain; import plugily.projects.minigamesbox.classic.commands.arguments.data.CommandArgument; import plugily.projects.minigamesbox.classic.commands.arguments.data.LabelData; import plugily.projects.minigamesbox.classic.commands.arguments.data.LabeledCommandArgument; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem; import plugily.projects.minigamesbox.inventory.normal.NormalFastInv; import plugily.projects.murdermystery.arena.role.Role; import plugily.projects.murdermystery.commands.arguments.ArgumentsRegistry; import java.util.ArrayList; import java.util.List; public class RoleSelectorArgument implements Listener { public RoleSelectorArgument(ArgumentsRegistry registry) { registry.mapArgument("murdermystery", new LabeledCommandArgument("roleselector", "murdermystery.command.roleselector", CommandArgument.ExecutorType.PLAYER, new LabelData("/mm roleselector", "/mm roleselector", "&7Select a role\n&6Permission: &7murdermystery.command.roleselector")) { @Override public void execute(CommandSender sender, String[] args) { Player player = (Player) sender; if(registry.getPlugin().getBukkitHelper().checkIsInGameInstance(player)) { openRolePassMenu(player, registry.getPlugin()); } } }); } public static void openRolePassMenu(Player player, PluginMain plugin) { NormalFastInv gui = new NormalFastInv(plugin.getBukkitHelper().serializeInt(Role.values().length), new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_NAME").asKey().build()); List descriptionMurderer = new ArrayList<>(); plugin.getLanguageManager().getLanguageListFromKey("IN_GAME_MESSAGES_ARENA_PASS_ROLE_MURDERER_LORE").forEach(string -> descriptionMurderer.add(new MessageBuilder(string).integer(plugin.getUserManager().getUser(player).getStatistic("PASS_MURDERER")).build())); gui.addItem(new SimpleClickableItem(new ItemBuilder(XMaterial.IRON_SWORD.parseMaterial()) .name(new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_ROLE_MURDERER_NAME").asKey().build()) .lore(descriptionMurderer) .build(), event -> { IUser user = plugin.getUserManager().getUser(player); if(user.getStatistic("PASS_MURDERER") <= 0) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_FAIL").asKey().player(player).value(Role.MURDERER.name()).sendPlayer(); return; } user.adjustStatistic("PASS_MURDERER", -1); user.adjustStatistic("CONTRIBUTION_MURDERER", 999999999); new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_SUCCESS").asKey().player(player).value(Role.MURDERER.name()).sendPlayer(); })); List descriptionDetective = new ArrayList<>(); plugin.getLanguageManager().getLanguageListFromKey("IN_GAME_MESSAGES_ARENA_PASS_ROLE_DETECTIVE_LORE").forEach(string -> descriptionDetective.add(new MessageBuilder(string).integer(plugin.getUserManager().getUser(player).getStatistic("PASS_DETECTIVE")).build())); gui.addItem(new SimpleClickableItem(new ItemBuilder(XMaterial.BOW.parseMaterial()) .name(new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_ROLE_DETECTIVE_NAME").asKey().build()) .lore(descriptionDetective) .build(), event -> { IUser user = plugin.getUserManager().getUser(player); if(user.getStatistic("PASS_DETECTIVE") <= 0) { new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_FAIL").asKey().player(player).value(Role.DETECTIVE.name()).sendPlayer(); return; } user.adjustStatistic("PASS_DETECTIVE", -1); user.adjustStatistic("CONTRIBUTION_DETECTIVE", 999999999); new MessageBuilder("IN_GAME_MESSAGES_ARENA_PASS_SUCCESS").asKey().player(player).value(Role.DETECTIVE.name()).sendPlayer(); })); gui.refresh(); gui.open(player); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/events/PluginEvents.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.events; import org.bukkit.Location; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.EulerAngle; import org.bukkit.util.Vector; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.minigamesbox.classic.utils.version.ServerVersion; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.minigamesbox.classic.utils.version.xseries.XSound; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.arena.ArenaUtils; import plugily.projects.murdermystery.arena.role.Role; /** * @author Plajer *

Created at 05.08.2018 */ public class PluginEvents implements Listener { private final Main plugin; public PluginEvents(Main plugin) { this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); } @EventHandler public void onSwordThrow(PlayerInteractEvent event) { if(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.PHYSICAL) { return; } Player attacker = event.getPlayer(); Arena arena = plugin.getArenaRegistry().getArena(attacker); if(arena == null) { return; } IUser attackerUser = plugin.getUserManager().getUser(attacker); if(!Role.isRole(Role.MURDERER, attackerUser, arena)) { return; } ItemStack murdererSword = plugin.getSwordSkinManager().getMurdererSword(attacker); if(murdererSword == null) { return; } if(VersionUtils.getItemInHand(attacker).getType() != murdererSword.getType()) { return; } if(attackerUser.getCooldown("sword_shoot") > 0) { return; } createFlyingSword(attacker, attackerUser); int swordFlyCooldown = plugin.getConfig().getInt("Sword.Cooldown.Fly", 5); if(swordFlyCooldown <= 0) { return; } attackerUser.setCooldown("sword_shoot", swordFlyCooldown); if(ServerVersion.Version.isCurrentLower(ServerVersion.Version.v1_11)) { attackerUser.setCooldown("sword_attack", (plugin.getConfig().getInt("Sword.Cooldown.Attack", 1))); } else { VersionUtils.setMaterialCooldown(attacker ,plugin.getSwordSkinManager().getMurdererSword(attacker).getType(), 20 * (plugin.getConfig().getInt("Sword.Cooldown.Attack", 1))); } plugin.getBukkitHelper().applyActionBarCooldown(attacker, swordFlyCooldown); } private void createFlyingSword(Player attacker, IUser attackerUser) { Location loc = attacker.getLocation(); Vector vec = loc.getDirection(); vec.normalize().multiply(plugin.getConfig().getDouble("Sword.Speed", 0.65)); Location standStart = plugin.getBukkitHelper().rotateAroundAxisY(new Vector(1.0D, 0.0D, 0.0D), loc.getYaw()).toLocation(attacker.getWorld()).add(loc); standStart.setYaw(loc.getYaw()); ArmorStand stand = (ArmorStand) attacker.getWorld().spawnEntity(standStart, EntityType.ARMOR_STAND); stand.setVisible(false); if(ServerVersion.Version.isCurrentHigher(ServerVersion.Version.v1_8_8)) { stand.setInvulnerable(true); stand.setSilent(true); } VersionUtils.setItemInHand(stand, plugin.getSwordSkinManager().getMurdererSword(attacker)); stand.setRightArmPose(new EulerAngle(Math.toRadians(350.0), Math.toRadians(loc.getPitch() * -1.0), Math.toRadians(90.0))); VersionUtils.setCollidable(stand, false); stand.setGravity(false); stand.setRemoveWhenFarAway(true); if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_8_8)) { stand.setMarker(true); } Location initialise = plugin.getBukkitHelper().rotateAroundAxisY(new Vector(-0.8D, 1.45D, 0.0D), loc.getYaw()).toLocation(attacker.getWorld()).add(standStart) .add(plugin.getBukkitHelper().rotateAroundAxisY(plugin.getBukkitHelper().rotateAroundAxisX(new Vector(0.0D, 0.0D, 1.0D), loc.getPitch()), loc.getYaw())); int maxRange = plugin.getConfig().getInt("Sword.Fly.Range", 20); double maxHitRange = plugin.getConfig().getDouble("Sword.Fly.Radius", 0.5); new BukkitRunnable() { @Override public void run() { VersionUtils.teleport(stand, standStart.add(vec)); initialise.add(vec); initialise.getWorld().getNearbyEntities(initialise, maxHitRange, maxHitRange, maxHitRange) .forEach(entity -> { if(entity instanceof Player) { Player victim = (Player) entity; Arena arena = plugin.getArenaRegistry().getArena(victim); if(arena == null) { return; } if(!plugin.getUserManager().getUser(victim).isSpectator() && !victim.equals(attacker)) { killBySword(arena, attackerUser, victim); cancel(); stand.remove(); } } }); if(loc.distance(initialise) > maxRange || initialise.getBlock().getType().isSolid()) { cancel(); stand.remove(); } } }.runTaskTimer(plugin, 0, 1); } private void killBySword(Arena arena, IUser attackerUser, Player victim) { Arena victimArena = plugin.getArenaRegistry().getArena(victim); if(arena == null) { return; } IUser user = plugin.getUserManager().getUser(victim); // check if victim is murderer if(Role.isRole(Role.MURDERER, user, victimArena)) { return; } XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation(), 50, 1); victim.damage(100.0); attackerUser.adjustStatistic("LOCAL_KILLS", 1); attackerUser.adjustStatistic("KILLS", 1); arena.adjustContributorValue(Role.DETECTIVE, user, plugin.getRandom().nextInt(2)); ArenaUtils.addScore(attackerUser, ArenaUtils.ScoreAction.KILL_PLAYER, 0); if(Role.isRole(Role.ANY_DETECTIVE, user, victimArena) && arena.lastAliveDetective()) { if(Role.isRole(Role.FAKE_DETECTIVE, user, victimArena)) { arena.setCharacter(Arena.CharacterType.FAKE_DETECTIVE, null); } ArenaUtils.dropBowAndAnnounce(arena, victim); } } @EventHandler(priority = EventPriority.HIGH) // highest priority to fully protect our game public void onBlockBreak(BlockBreakEvent event) { Arena arena = plugin.getArenaRegistry().getArena(event.getPlayer()); if(arena == null) { return; } event.setCancelled(true); if(event.getBlock().getType() != XMaterial.ARMOR_STAND.parseMaterial()) { return; } plugin.getHologramManager().getArmorStands().removeIf(armorStand -> { boolean isSameType = armorStand.getLocation().getBlock().getType() == event.getBlock().getType(); if(isSameType) { armorStand.remove(); armorStand.setCustomNameVisible(false); } return isSameType; }); } @EventHandler(priority = EventPriority.HIGH) // highest priority to fully protect our game public void onBuild(BlockPlaceEvent event) { Arena arena = plugin.getArenaRegistry().getArena(event.getPlayer()); if(arena == null) { return; } event.setCancelled(true); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/CorpseHandler.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers; import org.bukkit.Bukkit; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.util.EulerAngle; import org.golde.bukkit.corpsereborn.CorpseAPI.CorpseAPI; import org.golde.bukkit.corpsereborn.CorpseAPI.events.CorpseClickEvent; import org.golde.bukkit.corpsereborn.CorpseAPI.events.CorpseSpawnEvent; import org.golde.bukkit.corpsereborn.nms.Corpses; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.hologram.ArmorStandHologram; import plugily.projects.minigamesbox.classic.utils.version.ServerVersion; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.murdermystery.Main; import plugily.projects.murdermystery.api.events.game.MurderGameCorpseSpawnEvent; import plugily.projects.murdermystery.arena.Arena; import plugily.projects.murdermystery.HookManager; import plugily.projects.murdermystery.arena.corpse.Corpse; import plugily.projects.murdermystery.arena.corpse.Stand; import java.util.HashMap; import java.util.Map; /** * @author Plajer *

* Created at 07.10.2018 */ public class CorpseHandler implements Listener { private final Main plugin; private Corpses.CorpseData lastSpawnedCorpse; private final Map registeredLastWords = new HashMap<>(); private final ItemStack head = XMaterial.PLAYER_HEAD.parseItem(); public CorpseHandler(Main plugin) { this.plugin = plugin; //run bit later than hook manager to ensure it's not null Bukkit.getScheduler().runTaskLater(plugin, () -> { if(plugin.getHookManager().isFeatureEnabled(HookManager.HookFeature.CORPSES)) { plugin.getServer().getPluginManager().registerEvents(this, plugin); } }, 20 * 7); } public void registerLastWord(String permission, String lastWord) { registeredLastWords.put(permission, lastWord); } @SuppressWarnings("deprecation") public void spawnCorpse(Player player, Arena arena) { MurderGameCorpseSpawnEvent murderGameCorpseSpawnEvent = new MurderGameCorpseSpawnEvent(arena, player.getPlayer(), player.getLocation()); Bukkit.getPluginManager().callEvent(murderGameCorpseSpawnEvent); if(murderGameCorpseSpawnEvent.isCancelled()) { return; } if(!plugin.getHookManager().isFeatureEnabled(HookManager.HookFeature.CORPSES)) { ArmorStand stand = player.getLocation().getWorld().spawn(player.getLocation().add(0.0D, -1.25D, 0.0D), ArmorStand.class); SkullMeta meta = (SkullMeta) head.getItemMeta(); meta = VersionUtils.setPlayerHead(player, meta); head.setItemMeta(meta); stand.setVisible(false); if(ServerVersion.Version.isCurrentEqualOrHigher(ServerVersion.Version.v1_16)) { stand.getEquipment().setHelmet(head); } else { stand.setHelmet(head); } stand.setGravity(false); stand.setCustomNameVisible(false); stand.setHeadPose(new EulerAngle(Math.toRadians(player.getLocation().getX()), Math.toRadians(player.getLocation().getPitch()), Math.toRadians(player.getLocation().getZ()))); plugin.getHologramManager().getArmorStands().add(stand); ArmorStandHologram hologram = getLastWordsHologram(player); arena.addHead(new Stand(hologram, stand)); Bukkit.getScheduler().runTaskLater(plugin, () -> { hologram.delete(); plugin.getHologramManager().getArmorStands().remove(stand); Bukkit.getScheduler().runTaskLater(plugin, stand::remove, 20 * 20); }, 15 * 20); return; } ArmorStandHologram hologram = getLastWordsHologram(player); Corpses.CorpseData corpse = CorpseAPI.spawnCorpse(player, player.getLocation()); lastSpawnedCorpse = corpse; //spawns 2 corpses - Corpses.CorpseData corpse = lastSpawnedCorpse = CorpseAPI.spawnCorpse(player, player.getLocation()); arena.addCorpse(new Corpse(hologram, corpse)); Bukkit.getScheduler().runTaskLater(plugin, () -> { hologram.delete(); Bukkit.getScheduler().runTaskLater(plugin, corpse::destroyCorpseFromEveryone, 20 * 20); }, 15 * 20); } private ArmorStandHologram getLastWordsHologram(Player player) { ArmorStandHologram hologram = new ArmorStandHologram(player.getLocation()); hologram.appendLine(new MessageBuilder(plugin.getLastWordsManager().getHologramTitle()).player(player).build()); hologram.appendLine(plugin.getLastWordsManager().getRandomLastWord(player)); return hologram; } @EventHandler public void onCorpseSpawn(CorpseSpawnEvent e) { if(lastSpawnedCorpse == null) { return; } if(plugin.getConfigPreferences().getOption("CORPSES_INTEGRATION_OVERWRITE") && !lastSpawnedCorpse.equals(e.getCorpse())) { e.setCancelled(true); } } @EventHandler public void onCorpseClick(CorpseClickEvent e) { if(plugin.getArenaRegistry().isInArena(e.getClicker())) { e.setCancelled(true); e.getClicker().closeInventory(); } } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/lastwords/LastWord.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.lastwords; /** * @author 2Wild4You, Tigerpanzer_02 *

* Created at 19.02.2021 */ public class LastWord { private final String message; private final String permission; public LastWord(String message, String permission) { this.message = message; this.permission = permission; } public String getMessage() { return message; } public String getPermission() { return permission; } public boolean hasPermission() { return !permission.isEmpty(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/lastwords/LastWordsManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.lastwords; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.murdermystery.Main; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; /** * @author 2Wild4You, Tigerpanzer_02 *

* Created at 19.02.2021 */ public class LastWordsManager { private final List registeredLastWords = new ArrayList<>(); private String hologramTitle = ""; public LastWordsManager(Main plugin) { registerLastWords(plugin); } public void registerLastWords(Main plugin) { FileConfiguration config = ConfigUtils.getConfig(plugin, "lastwords"); hologramTitle = config.getString("Last-Words.Hologram.Title", "-"); ConfigurationSection section = config.getConfigurationSection("Last-Words.Hologram.Content"); String path = "Last-Words.Hologram.Content."; for(String id : section.getKeys(false)) { addLastWord(new LastWord(new MessageBuilder(config.getString(path + id + ".Message")).build(), config.getString(path + id + ".Permission", ""))); } } public List getRegisteredLastWords() { return registeredLastWords; } public String getHologramTitle() { return hologramTitle; } public void addLastWord(LastWord lastWord) { registeredLastWords.add(lastWord); } public String getRandomLastWord(Player player) { //check perms List perms = registeredLastWords.stream().filter(lastWord -> player.hasPermission(lastWord.getPermission())).collect(Collectors.toList()); if(!perms.isEmpty()) { return perms.get(ThreadLocalRandom.current().nextInt(perms.size())).getMessage(); } //check default List noPerms = registeredLastWords.stream().filter(lastWord -> !lastWord.hasPermission()).collect(Collectors.toList()); if(!noPerms.isEmpty()) { return noPerms.get(ThreadLocalRandom.current().nextInt(noPerms.size())).getMessage(); } //fallback return registeredLastWords.get(0).getMessage(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/setup/LocationCategory.java ================================================ /* * * MurderMystery * Copyright (C) 2021 Plugily Projects - maintained by Tigerpanzer_02, 2Wild4You and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ package plugily.projects.murdermystery.handlers.setup; import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginLocationCategory; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSpecificCategory; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.CountItem; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.LocationItem; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.MultiLocationItem; import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder; import plugily.projects.minigamesbox.classic.utils.serialization.LocationSerializer; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.minigamesbox.inventory.normal.NormalFastInv; /** * @author Tigerpanzer_02 *

* Created at 01.07.2022 */ public class LocationCategory extends PluginLocationCategory { @Override public void addItems(NormalFastInv gui) { super.addItems(gui); MultiLocationItem starting = new MultiLocationItem(getSetupInventory(), new ItemBuilder(XMaterial.EMERALD_BLOCK.parseMaterial()), "Player Spawn Points", "Location where players will be randomly teleported when the game starts", "playerspawnpoints", 4, inventoryClickEvent -> { LocationSerializer.saveLoc(getSetupInventory().getPlugin(), getSetupInventory().getConfig(), "arenas", "instances." + getSetupInventory().getArenaKey() + "." + "startlocation", inventoryClickEvent.getWhoClicked().getLocation()); }, (emptyConsumer) -> { }, true, true, true); getItemList().add(starting); gui.setItem((getInventoryLine() * 9) + 2, starting); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/setup/SetupCategoryManager.java ================================================ package plugily.projects.murdermystery.handlers.setup; import plugily.projects.minigamesbox.classic.handlers.setup.SetupInventory; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSetupCategoryManager; import plugily.projects.minigamesbox.classic.handlers.setup.categories.SetupCategory; /** * @author Tigerpanzer_02 *

* Created at 01.07.2022 */ public class SetupCategoryManager extends PluginSetupCategoryManager { public SetupCategoryManager(SetupInventory setupInventory) { super(setupInventory); getCategoryHandler().put(SetupCategory.LOCATIONS, new LocationCategory()); getCategoryHandler().put(SetupCategory.SPECIFIC, new SpecificCategory()); getCategoryHandler().put(SetupCategory.SWITCH, new SwitchCategory()); super.init(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/setup/SpecificCategory.java ================================================ /* * * MurderMystery * Copyright (C) 2021 Plugily Projects - maintained by Tigerpanzer_02, 2Wild4You and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ package plugily.projects.murdermystery.handlers.setup; import org.bukkit.Material; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSpecificCategory; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.CountItem; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.MaterialLocationItem; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.MaterialMultiLocationItem; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.MultiLocationItem; import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder; import plugily.projects.minigamesbox.classic.utils.helper.MaterialUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.minigamesbox.inventory.normal.NormalFastInv; import java.util.Collections; /** * @author Tigerpanzer_02 *

* Created at 01.07.2022 */ public class SpecificCategory extends PluginSpecificCategory { @Override public void addItems(NormalFastInv gui) { super.addItems(gui); CountItem spawnGoldTime = new CountItem(getSetupInventory(), new ItemBuilder(XMaterial.REDSTONE_TORCH.parseMaterial()), "Gold Spawn Time (Seconds)", "How much gold should be spawned? \nThat means 1 gold spawned every ... seconds\nDefault: 5\nEvery 5 seconds it will spawn 1 gold", "spawngoldtime"); gui.setItem((getInventoryLine() * 9) + 1, spawnGoldTime); getItemList().add(spawnGoldTime); CountItem playerMurderer = new CountItem(getSetupInventory(), new ItemBuilder(XMaterial.IRON_SWORD.parseMaterial()), "Player Per Murderer", "How many murderer should be ingame? This means \none murderer for that amount of players. Default: \n5 players are 1 murderer, that means if we have \n14 Players it will calculate 2 murderer! \nSet it to 1 if you want only one murderer ", "playerpermurderer"); gui.setItem((getInventoryLine() * 9) + 2, playerMurderer); getItemList().add(playerMurderer); CountItem playerDetective = new CountItem(getSetupInventory(), new ItemBuilder(XMaterial.IRON_SWORD.parseMaterial()), "Player Per Murderer", "How many detectives should be ingame? This means \none detective for that amount of players. Default: \n7 players are 1 detective, that means if we have \n18 Players it will calculate 2 detectives! \nSet it to 1 if you want only one detective ", "playerperdetective"); gui.setItem((getInventoryLine() * 9) + 3, playerDetective); getItemList().add(playerDetective); MultiLocationItem goldSpawn = new MultiLocationItem(getSetupInventory(), new ItemBuilder(XMaterial.GOLD_INGOT.parseMaterial()), "Gold Spawn", "Add new gold spawn \n on the place you're standing at.", "goldspawnpoints", 4); gui.setItem((getInventoryLine() * 9) + 4, goldSpawn); getItemList().add(goldSpawn); MaterialMultiLocationItem mysteryCauldron = new MaterialMultiLocationItem(getSetupInventory(), new ItemBuilder(XMaterial.CAULDRON.parseMaterial()), "Mystery Cauldron", "Target a cauldron and add it to the game\nit will cost 1 gold per potion!\nConfigure cauldron potions \nin special_blocks.yml file!", "mystery-cauldrons", Collections.singleton(Material.CAULDRON), false, 0); gui.setItem((getInventoryLine() * 9) + 5, mysteryCauldron); getItemList().add(mysteryCauldron); MaterialMultiLocationItem confessional = new MaterialMultiLocationItem(getSetupInventory(), new ItemBuilder(XMaterial.ENCHANTING_TABLE.parseMaterial()), "Confessional", "Target enchanting table and\nadd praise to the developer\nconfessional, gift for\nthe developer costs 1 gold!\nAdd some levers in radius\nof 3 blocks near the enchant table\nto allow users to pray there!\nYou can either get gifts\nor curses from prayer!", "confessionals", Collections.singleton(XMaterial.ENCHANTING_TABLE.parseMaterial()), false, 0); gui.setItem((getInventoryLine() * 9) + 6, confessional); getItemList().add(confessional); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/setup/SwitchCategory.java ================================================ package plugily.projects.murdermystery.handlers.setup; import org.bukkit.plugin.java.JavaPlugin; import plugily.projects.minigamesbox.classic.PluginMain; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSwitchCategory; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.BooleanItem; import plugily.projects.minigamesbox.classic.handlers.setup.items.category.SwitchItem; import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.minigamesbox.inventory.normal.NormalFastInv; import plugily.projects.murdermystery.Main; import java.util.Arrays; /** * @author Tigerpanzer_02 *

* Created at 01.07.2022 */ public class SwitchCategory extends PluginSwitchCategory { @Override public void addItems(NormalFastInv gui) { super.addItems(gui); BooleanItem goldVisuals = new BooleanItem(getSetupInventory(), new ItemBuilder(XMaterial.REDSTONE.parseMaterial()), "Gold Visuals", "Enables gold visuals to spawn\nsome particle effects above gold locations", "goldvisuals"); gui.setItem((getInventoryLine() * 9) + 1, goldVisuals); getItemList().add(goldVisuals); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/skins/sword/SwordSkin.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.skins.sword; import org.bukkit.inventory.ItemStack; /** * @author Tigerpanzer_02 *

* Created at 03.04.2022 */ public class SwordSkin { private final ItemStack itemStack; private final String permission; public SwordSkin(ItemStack itemStack, String permission) { this.itemStack = itemStack; this.permission = permission; } public ItemStack getItemStack() { return itemStack; } public String getPermission() { return permission; } public boolean hasPermission() { return !permission.isEmpty(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/skins/sword/SwordSkinManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.skins.sword; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial; import plugily.projects.murdermystery.Main; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; /** * @author 2Wild4You, Tigerpanzer_02 *

Created at 19.02.2021 */ public class SwordSkinManager { private final List registeredSwordSkins = new ArrayList<>(); private final Map murdererSwords = new HashMap<>(); public SwordSkinManager(Main plugin) { registerSwordSkins(plugin); } public void registerSwordSkins(Main plugin) { FileConfiguration config = ConfigUtils.getConfig(plugin, "skins"); ConfigurationSection section = config.getConfigurationSection("Skins.Sword"); String path = "Skins.Sword."; for (String id : section.getKeys(false)) { addSwordSkin( new SwordSkin( XMaterial.matchXMaterial(config.getString(path + id + ".Material", "BEDROCK")) .orElse(XMaterial.BEDROCK) .parseItem(), config.getString(path + id + ".Permission", ""))); } } public List getRegisteredSwordSkins() { return registeredSwordSkins; } public void addSwordSkin(SwordSkin lastWord) { registeredSwordSkins.add(lastWord); } public ItemStack getRandomSwordSkin(Player player) { // check perms List perms = registeredSwordSkins.stream() .filter(swordSkin -> player.hasPermission(swordSkin.getPermission())) .collect(Collectors.toList()); if (!perms.isEmpty()) { ItemStack itemStack = perms.get(ThreadLocalRandom.current().nextInt(perms.size())).getItemStack(); murdererSwords.put(player, itemStack); return itemStack; } // check default List noPerms = registeredSwordSkins.stream() .filter(swordSkin -> !swordSkin.hasPermission()) .collect(Collectors.toList()); if (!noPerms.isEmpty()) { ItemStack itemStack = noPerms.get(ThreadLocalRandom.current().nextInt(noPerms.size())).getItemStack(); murdererSwords.put(player, itemStack); return itemStack; } // fallback ItemStack itemStack = registeredSwordSkins.get(0).getItemStack(); murdererSwords.put(player, itemStack); return itemStack; } public void removeMurdererSword(Player player) { murdererSwords.remove(player); } public ItemStack getMurdererSword(Player player) { return murdererSwords.get(player); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/trails/BowTrailsHandler.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.trails; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.scheduler.BukkitRunnable; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.murdermystery.Main; /** * @author 2Wild4You, Tigerpanzer_02 *

* Created at 19.02.2021 */ public class BowTrailsHandler implements Listener { private final Main plugin; public BowTrailsHandler(Main plugin) { this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); } @EventHandler public void onArrowShoot(EntityShootBowEvent event) { if(!(event.getEntity() instanceof Player && event.getProjectile() instanceof Arrow)) { return; } Entity projectile = event.getProjectile(); if(projectile.isDead() || projectile.isOnGround()) { return; } Player player = (Player) event.getEntity(); if(!plugin.getArenaRegistry().isInArena(player) || !plugin.getTrailsManager().gotAnyTrails(player)) { return; } Trail trail = plugin.getTrailsManager().getRandomTrail(player); plugin.getDebugger().debug("Spawning particle with perm {0} for player {1}", trail.getPermission(), player.getName()); new BukkitRunnable() { @Override public void run() { if(projectile.isDead() || projectile.isOnGround()) { plugin.getDebugger().debug("Stopped spawning particle with perm {0} for player {1}", trail.getPermission(), player.getName()); cancel(); } try { VersionUtils.sendParticles(trail.getName(), player, projectile.getLocation(), 3); }catch(Exception ignored) {} } }.runTaskTimer(plugin, 0, 0); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/trails/Trail.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.trails; /** * @author 2Wild4You, Tigerpanzer_02 *

* Created at 19.02.2021 */ public class Trail { private final String name; private final String permission; public Trail(String message, String permission) { this.name = message; this.permission = permission; } public String getName() { return name; } public String getPermission() { return permission; } public boolean hasPermission() { return !permission.isEmpty(); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/handlers/trails/TrailsManager.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.handlers.trails; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.minigamesbox.classic.utils.version.VersionUtils; import plugily.projects.murdermystery.Main; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; /** * @author Tigerpanzer_02 *

* Created at 19.02.2021 */ public class TrailsManager { private final List registeredTrails = new ArrayList<>(); private final List blacklistedTrails; public TrailsManager(Main plugin) { FileConfiguration config = ConfigUtils.getConfig(plugin, "trails"); blacklistedTrails = config.getStringList("Blacklisted-Trails"); registerTrails(); } public void registerTrails() { for (String particle : VersionUtils.getParticleValues()) { if (blacklistedTrails.contains(particle.toLowerCase())) { continue; } addTrail(new Trail(particle, "murdermystery.trails." + particle.toLowerCase())); } } public List getRegisteredTrails() { return registeredTrails; } public void addTrail(Trail lastWord) { registeredTrails.add(lastWord); } public boolean gotAnyTrails(Player player) { return registeredTrails.stream().anyMatch(trail -> player.hasPermission(trail.getPermission())); } public Trail getRandomTrail(Player player) { // check perms List perms = registeredTrails.stream() .filter(trail -> player.hasPermission(trail.getPermission())) .collect(Collectors.toList()); if (!perms.isEmpty()) { return perms.get(perms.size() == 1 ? 0 : ThreadLocalRandom.current().nextInt(perms.size())); } // fallback return registeredTrails.get(0); } } ================================================ FILE: src/main/java/plugily/projects/murdermystery/utils/ItemPosition.java ================================================ /* * MurderMystery - Find the murderer, kill him and survive! * Copyright (c) 2022 Plugily Projects - maintained by Tigerpanzer_02 and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package plugily.projects.murdermystery.utils; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import plugily.projects.minigamesbox.api.user.IUser; import plugily.projects.murdermystery.arena.role.Role; /** * @author Plajer *

* Created at 17.10.2018 */ public enum ItemPosition { ARROWS(2, 2), BOW(0, 1), BOW_LOCATOR(4, 4), MURDERER_SWORD(1, 1), INNOCENTS_LOCATOR(4, 4), INFINITE_ARROWS(9, 9), GOLD_INGOTS(8, 8), POTION(3, 3); private final int murdererItemPosition; private final int otherRolesItemPosition; ItemPosition(int murdererItemPosition, int otherRolesItemPosition) { this.murdererItemPosition = murdererItemPosition; this.otherRolesItemPosition = otherRolesItemPosition; } /** * Adds target item to specified hotbar position sorta different for each role. * Item will be added if there is already set or will be set when no item is set in the position. * * @param user player to add item to * @param itemPosition position of item to set/add * @param itemStack itemstack to be added at itemPostion or set at itemPosition */ public static void addItem(IUser user, ItemPosition itemPosition, ItemStack itemStack) { int itemPos = Role.isRole(Role.MURDERER, user) ? itemPosition.getMurdererItemPosition() : itemPosition.getOtherRolesItemPosition(); if(itemPos < 0) { return; } Inventory inv = user.getPlayer().getInventory(); ItemStack item = inv.getItem(itemPos); if(item != null) { item.setAmount(item.getAmount() + itemStack.getAmount()); return; } inv.setItem(itemPos, itemStack); } /** * Sets target item in specified hotbar position sorta different for each role. * If item there is already set it will be incremented by itemStack amount if possible. * * @param user player to set item to * @param itemPosition position of item to set * @param itemStack itemstack to set at itemPosition */ public static void setItem(IUser user, ItemPosition itemPosition, ItemStack itemStack) { if(Role.isRole(Role.MURDERER, user)) { user.getPlayer().getInventory().setItem(itemPosition.getMurdererItemPosition(), itemStack); } else { user.getPlayer().getInventory().setItem(itemPosition.getOtherRolesItemPosition(), itemStack); } } public static void removeItem(IUser user, ItemStack itemStack) { user.getPlayer().getInventory().removeItem(itemStack); } public int getMurdererItemPosition() { return murdererItemPosition; } public int getOtherRolesItemPosition() { return otherRolesItemPosition; } } ================================================ FILE: src/main/resources/arena_selector.yml ================================================ # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/arenas.yml ================================================ instances: default: lobbylocation: world,364.0,63.0,-72.0,0.0,0.0 startlocation: world,364.0,63.0,-72.0,0.0,0.0 endlocation: world,364.0,63.0,-72.0,0.0,0.0 minimumplayers: 2 maximumplayers: 10 mapname: mapname world: worldname signs: [ ] isdone: false playerspawnpoints: - world,364.0,63.0,-72.0,0.0,0.0 goldspawnpoints: - world,364.0,63.0,-72.0,0.0,0.0 mystery-cauldrons: - world,364.0,63.0,-72.0,0.0,0.0 playerpermurderer: 5 playerperdetective: 7 goldvisuals: false # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/bungee.yml ================================================ # Configuration for Bungeecord support. # Remember to enable it in config.yml (Bungee-Mode: true) # Your bungeecord server name where players will be teleported after game (main lobby with signs etc.) Hub: lobby # Should game server be closed after game? Shutdown-When-Game-Ends: true # Should the player connect to hub (e.g. Leave-Item) Connect-To-Hub: true # Should the End Location be the hub? (Players will be connected to hub at the End) End-Location-Hub: true # This is useful for bungee game systems. # %state% - Game state will be visible at MOTD. MOTD: Manager: false Message: "The actual game state of the minigame is %state%" Game-States: Inactive: "&lInactive..." In-Game: "&lIn-game" Starting: "&e&lStarting" Full-Game: "&4&lFULL" Ending: "&lEnding" Restarting: "&c&lRestarting" # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/config.yml ================================================ ## Thanks for using our plugins! ~Tigerpanzer_02 from Plugily Projects # murdermystery configuration file # # You can edit here the basic things of murdermystery # Please read everything CAREFULLY! # You don't want to break anything, do you? # # Select locale of MurderMystery, default it's English. # Available locales: # default - English language. Uses 'language.yml'. # See https://github.com/Plugily-Projects/locale_storage/tree/master/plugins/minecraft/murdermystery # Help us translate the project -> https://translate.plugily.xyz # Use filename of the language e.g. de_DE.yml -> locale: de_DE locale: default # Should we display a boss bar with additional arena information? Bossbar: Display: true # Interval in seconds between messages Interval: 10 # Should we hook into bungeecord? (If you wanna use arena per server option) # This option will let you access bungee.yml and its options. # You STILL need to use external addon for HUB server game signs # Check here for more info: https://wiki.plugily.xyz/ Bungee-Mode: false # Enable Inventory Manager for your games? (VERY USEFUL feature for MULTI ARENA) # This saves inventory of players and restores it after player leaves arena. # Saved elements: max health, health, food, experience, full inventory, armor contents, fire ticks, active potions Inventory-Manager: true Commands: # Commands which can be used in game, remove all of them to disable (only works if Block.In-Game.Commands = true) Whitelist: - me - help # Enable and Disable predefined shortened commands or add your own Shorter: '1': Short: "start" Executes: "murdermysteryadmin forcestart" Enabled: true '2': Short: "leave" Executes: "murdermystery leave" Enabled: true '3': Short: "stats" Executes: "murdermystery stats" Enabled: false '4': Short: "top" Executes: "murdermystery top" Enabled: true # Block some functions of your players Block: In-Game: # Should we block every not plugin associated commands in game? Commands: true # Should the leave command be blocked inside arena? Leave: false # Cancels Item Movement into player crafting, enchantment tables, anvils ... Item-Move: true ArmorStand: # Should we block armor stand destroy with double click? Destroy: true # Should we block armor stand interaction? Interact: true # Should these only be blocked while ingame and arena state is in_game? (e.g. Lobby and Ending is blocked) # Setting it to false means on all stages of the game the event will be cancelled. # Setting it to true means only while IN_GAME the event will be cancelled. Check: true # Should all interactions with interactive materials such as doors / buttons / fences / redstone be blocked during ingame # Full list see https://github.com/CryptoMorin/XSeries/blob/e84000a2bead7367d893cf8661f8d5432116adaa/core/src/main/java/com/cryptomorin/xseries/XTag.java#L2793 Interact: false # Enable this option when you're using MySQL, otherwise it won't work. # Be careful when changing this because there is NO migrator between # flat file and MySQL for player stats. # If this option is disabled it means all stats will be saved as flat file! Database: false # Should we enable in game rewards? See rewards.yml for more... # You should also check out our script engine tutorial for rewards! https://tutorial.plugily.xyz Rewards: false Chat: # Enable in game (eg. '[KIT][LEVEL] Tigerpanzer_02: hey') special formatting? # Formatting is configurable in language.yml # You can use PlaceholderAPI placeholders in chat format! Format: true Separate: # Should we enable a separate arena chat for players inside a arena # Useful on multi arena servers that don't want the same chat for all players on the server Arena: true # Should spectators only write with other spectators Spectators: true # Should we fire some cool fireworks at locations of every player at special events such as the game end? Firework: true # Should blocks behind game signs change their color based on game state? # They will change color to: # - white (waiting for players) stained glass # - yellow (starting) stained glass # - orange (in game) stained glass # - gray (ending) stained glass # - black (restarting) stained glass # or define your own at signs.yml! Sign-Block-States: true # Should holiday events for the plugin be enabled? # Eg. 4 days before and 4 days after Halloween special effects # for death, spooky! There are more holiday events! Check wiki! # Wiki: - Holidays: true # Should the plugin enable special powerups which can be found in powerups.yml Powerups: false # Should we create leaderboards out of the stats? Leaderboard: true Parties: # Should we try to hook into your current party plugin? (Supports well know party plugins, see wiki!) # It will group up all players with the party leader. The party leader can join with the whole party! External: true # Should we enable our own party system that can be only used for this plugin? # Check the wiki for commands Own: false Damage: # Should players get fall damage? Fall: false # Should players get drowning damage? Drowning: false # Should players get fire damage? Fire: false # Should players lose food ingame & get damage? Hunger: false Option: Player: # Disable player drops ingame? Drop: true Cycle: # Should we make permanent clear weather on all worlds where our arenas are? Weather: false # Should the time on the world your arenas are modified to stay at the same time? Daylight: Enable: false Time: 10000 # How many seconds game should take to start. Time-Manager: Waiting: 20 Starting: 60 Shorten-Waiting-Full: 15 Shorten-Waiting-Force: 5 In-Game: 270 Ending: 10 Restarting: 5 # Allow spectators on arena instances Spectators: true Update-Notifier: # Should we check for updates on plugin start/after admin join? # You REALLY should have this true! Enabled: true # Should we inform you when beta version is out? # BETA IS NOT ALWAYS AS STABLE AS NORMAL RELEASE! Notify-Beta-Versions: true Corpses: # Should we override corpses spawn from CorpsesReborn plugin? # When player will die outside game corpse won't be spawned! # Disable this if you don't want this! # WARNING: If disabled, two corpses will be spawned when player in-game dies Integration-Overwrite: true Gold: #Should we change spawner mode to spawn on all spawners instant of random one Spawner-Mode: false #Should we disable the gold spawn limit (It does not spawn more gold than spawner locations) Limiter: false #Should we spawn more than 1 gold at a spawner at the same time Multiple: false Amount: #How much gold should a player need to get a bow Bow: 10 #How much arrows should the player get? (Cause: Bow because enough gold collected) Arrows: 3 #How much arrows should a player with bow gets when he pick up a gold ingot? Pick-Up: 1 Bow: #Should Detectives be killed if they kill a innocent? Kill-Detective: true Amount: Arrows: #How much arrows should the detective gets on game start or when a player get a bow? Detective: 10 #How much arrows should the fake detective get? (Cause: Player pick up bow after detective died) Fake: 3 #How much arrows should the player get when the prayer gives a bow to him? Prayer: 2 #How much arrows should the player get after x picked up gold Gold: 3 #How long should be the bow shoot cooldown in seconds? Cooldown: 5 Hide: # Should we disable death messages, so the player dies without other recognizes it # It will not broadcast the death message to all ;) Death: false # Should players' name tags in game be hidden? Nametags: true Murderer: # Should the murderer get speed effect? # Enter a multiplier (min 2, max 10, 1 is normal speed) Speed: 3 # Should the Murderer get a locator with Innocent location information # gets the locator if arena time lower 30 and only one innocent left Locator: true Sword: # How many blocks per tick sword thrown by murderer should fly # Please avoid high values as it might look like the sword is # blinking each tick Speed: 0.65 Fly: # How many blocks should the sword fly Range: 20 # In what radius should we hit the players Radius: 0.5 Cooldown: #How long should be the sword attack after throw cooldown in seconds? #Its normal lower than Murderer-Sword-Fly-Cooldown! Attack: 1 #How long should be the sword fly cooldown in seconds? Fly: 5 # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 2 Core-Version: 6 ================================================ FILE: src/main/resources/internal/data.yml ================================================ ###############################[IMPORTANT]############################### # # Leave this file as it is! It is kinda an internal file! # ### !!!Do not change anything here!!! # ### THIS FILE AUTOMATICALLY REGENERATES ON SERVER RESTART # ###############################[IMPORTANT]############################### Plugin: Name: Short: mm Long: murdermystery Id: Spigot: 66614 BStats: 3038 Compatibility: Spigot: - "1.8" - "1.9" - "1.10" - "1.11" - "1.12" - "1.13" - "1.14" - "1.15" - "1.16" - "1.17" - "1.18" ================================================ FILE: src/main/resources/internal/leaderboards_data.yml ================================================ holograms: {} ================================================ FILE: src/main/resources/language.yml ================================================ # You can translate MurderMystery messages here. # Color codes (&) supported. # # Use \n to make new line # Some messages like item # descriptions don't support new lines # they are wrapped every 40 characters automatically # # Some messages support their own placeholders # like %player%, %kit% etc. # # Color scheme # Color: Placeholder: Value: "&4" Number: "&4" Player: "&b" Other: "&4" Chat: Issue: "&c" Messages: "&7" Special-Char: Contains: "[,],(,),{,},■,/,|,▸" Before: "&8" # # Command messages # Commands: Did-You-Mean: "%plugin_prefix% Did you mean /%value%?" Command-Executed: "%plugin_prefix% Command successfully executed!" Teleported-To-Lobby: "%plugin_prefix% Teleported to lobby!" Removed-Game-Instance: "%color_chat_issue%%plugin_prefix% Successfully removed game instance!" No-Arena-Like-That: "%color_chat_issue%%plugin_prefix% No arena with that ID!" Look-At-Sign: "%color_chat_issue%%plugin_prefix% You have to look at a sign to perform this command!" Type-Arena-Name: "%color_chat_issue%%plugin_prefix% Please type arena ID!" Hold-Any-Item: "%color_chat_issue%%plugin_prefix% You must hold any item!" No-Free-Arenas: "%color_chat_issue%%plugin_prefix% There are no free arenas!" Only-By-Player: "%color_chat_issue%%plugin_prefix% You can execute this command only as player!" Not-Playing: "%color_chat_issue%%plugin_prefix% You must play to execute this command!" No-Permission: "%color_chat_issue%%plugin_prefix% You don't have permission to use this command!" Player-Not-Found: "%color_chat_issue%%plugin_prefix% Target player %player% doesn't exist!" Invalid-Location-Teleport: "%color_chat_issue%%plugin_prefix% Location to teleport is invalid!" Wrong-Usage: "%color_chat_issue%%plugin_prefix% Wrong usage. Do %value%" Admin: Adjust-Statistic: "%plugin_prefix% Statistic %value% of %player% is now %number%!" Reload-Success: "%plugin_prefix% Arenas reloaded!" List: Header: "%plugin_name% arenas: Name State Players" Format: "%arena_name% %arena_state_placeholder% %arena_players_size%/%arena_max_players%" No-Arenas: "%color_chat_issue%%plugin_prefix% There are no game instances!" Spychat: Toggled: "%plugin_prefix% Game spy chat toggled to %value%" Main: Header: "&6----------------{%plugin_name% commands}----------" Description: - "&aGame commands:" - "&b/%plugin_short_command% stats: Shows your stats!" - "&b/%plugin_short_command% leave: Quits current arena!" - "&b/%plugin_short_command% join : Joins specified arena!" - "&b/%plugin_short_command% top : Shows top 10 players!" - "&b/%plugin_short_command% randomjoin: Join random arena!" Admin-Bonus-Description: "&b/%plugin_short_command%: Shows all the admin commands" Footer: "&6-------------------------------------------------" # # In-Game scoreboard messages # # Please do not use more chars than the scoreboard can handle! # Scoreboard supports up to 122 chars for 1.14+ and 48 chars for 1.13- (COLOR CODES INCLUDED.) # Placeholders: # https://wiki.plugily.xyz/REPLACEWITHPROJECTNAME/placeholders/language Scoreboard: Title: "&a&l%plugin_name%" Roles: Detective: "&bDetective" Murderer: "&cMurderer" Innocent: "&eInnocent" Dead: "Dead" Detective: Alive: "Detective &aAlive" Bow: Dropped: "%color_chat_issue%Bow Dropped" Picked: "Bow Not Dropped" Content: Waiting: - "" - "■ Players | %arena_players_size%" - "" - "■ Minimum Players | %arena_min_players%" - "" - " www.plugily.xyz" Starting: - "" - "■ Starting In | %arena_time%" - "" - "■ Players | %arena_players_size%" - "" - "■ Minimum Players | %arena_min_players%" - "" - " www.plugily.xyz" # Contents of scoreboard while ingame In-Game: - "" - "■ Role | %arena_player_role%" - "&f" - "■ Innocents | %arena_innocent_size%" - "&f" - "■ Time | %arena_time%" - "" - "■ %arena_detective_status%" - "" - "■ Score | %user_statistic_local_score%" - "" - " www.plugily.xyz" In-Game-Murderer: - "" - "■ Role | %arena_player_role%" - "&f" - "■ Innocents | %arena_innocent_size%" - "&f" - "■ Time | %arena_time%" - "" - "■ %arena_detective_status%" - "" - "■ Kills | %user_statistic_local_kills%" - "" - "■ Score | %user_statistic_local_score%" - "" - " www.plugily.xyz" # Contents of scoreboard while state is ending Ending: - "&f" - "&f" - "&cGAME ENDED" - "" - "&f" - "&f" - "" - " www.plugily.xyz" # Contents of scoreboard while state is restarting Restarting: - "&f" - "&f" - "&cRESTARTING GAME" - "" - "&f" - "&f" - "" - " www.plugily.xyz" # # Bossbar messages # # Bossbar needs to be enabled on config.yml Bossbar: Title: "%plugin_name% - www.plugily.xyz" Content: Waiting: - "Waiting for more players..." Starting: - "Starting in: %arena_time%" In-Game: - "Playing %plugin_name_uppercase% on PLUGILY.XYZ" - "Check the plugin creator out on PLUGILY.XYZ" - "Your role %arena_player_role%" Ending: - "Game has ended! You were playing on PLUGILY.XYZ" Restarting: - "Restarting the arena. You will be moved soon!" # # In-Game Messages # In-Game: #Used in most game messages. Plugin-Prefix: "(%plugin_name%)" Game-Chat-Format: "[%user_statistic_level%] %player% | %message%" You-Leveled-Up: "%plugin_prefix% You leveled up! You're now level %number%!" Commands-Blocked: "%color_chat_issue%%plugin_prefix% You have to leave the game first to perform commands. The only command that works is /%plugin_short_command% leave!" Join: Already-Playing: "%color_chat_issue%%plugin_prefix% You are already queued for a game! You can leave a game with /%plugin_short_command% leave." No-Permission: "%color_chat_issue%%plugin_prefix% You don't have %value% permission to join this arena!" Full-Game: "%color_chat_issue%%plugin_prefix% You don't have the permission to join full games!" No-Slots-For-Premium: "%color_chat_issue%%plugin_prefix% This game is already full of premium players! Sorry" # Join cancelled via external plugin that uses the API of our plugin. Cancelled-Via-API: "%color_chat_issue%%plugin_prefix% You can't join this game!" As-Party-Member: "%color_chat_issue%%plugin_prefix% You joined %arena_name% because the party leader joined it!" Arena-Not-Configured: "%color_chat_issue%%plugin_prefix% Arena is not configured yet! Contact your server's staff!" Title: "20,30,20;%arena_name%;%arena_players_size%/%arena_max_players%" Death: Tag: "&8Dead" Screen: "%color_chat_issue%You died!" Spectator: Blocked: "%color_chat_issue%%plugin_prefix% Spectators are disabled for this arena" You-Are-Spectator: "%plugin_prefix% You're now a spectator! You can fly now!" Spectator-Menu-Name: "%color_chat_issue%Alive players list" Target-Player-Health: "%color_chat_issue%Health: %number% | Role: %arena_player_role%" Spectator-Warning: "%plugin_prefix% You are a spectator!" Teleport: "%plugin_prefix% Teleported to %player%" Menu: Settings: Status: Enabled: "Enabled" Disabled: "Disabled" Changed-Speed: "Changed Speed to %number%" Auto-Teleport: "%value% auto teleport" Target-Player: Action-Bar: "%number% blocks away | Target %player%" Night-Vision: "%value% night vision" First-Person-Mode: Action-Bar: "&eSNEAK &cto leave! | Target %player%" Title: "&eSNEAK &cto leave!" Visibility: "%value% other spectator players" Messages: Join: "%plugin_prefix% %player% joined the game (%arena_players_size%/%arena_max_players%)!" Leave: "%plugin_prefix% %player% left the game (%arena_players_size%/%arena_max_players%)!" Death: "%plugin_prefix% %player% died!" Lobby: Start-In: "%plugin_prefix% The game starts in %arena_time% seconds!" Waiting-For-Players: "%plugin_prefix% Waiting for players... We need at least %arena_min_players% players to start." Enough-Players-To-Start: "%plugin_prefix% We now have enough players. The game is starting soon!" Reduced-Time: "%plugin_prefix% The time got reduced to %number% seconds" Max-Players: "%plugin_prefix% We reached max players for this round. Let's shorten the time!" Game-Started: "%plugin_prefix% The game has started!" Kicked-For-Premium-Slot: "%color_chat_issue%%plugin_prefix% %player% got removed from the game to make a place for premium players!" You-Were-Kicked-For-Premium-Slot: "%color_chat_issue%%plugin_prefix% You got kicked out of the game to make a place for a premium player!" Not-Enough-Space-For-Party: "%color_chat_issue%%plugin_prefix% Your party is bigger than free places on the arena %arena_name%" Game-End: Summary: - "&a&m--------------------------------------------------" - "%plugin_name%" - "" - "%arena_summary%" - "%arena_summary_player%" - "" - "&7Detective: %arena_detective_list%" - "&7Murderer: %arena_murderer_list% (%arena_murderer_kills%)" - "&7Hero: %arena_hero%" - "" - "&a&m--------------------------------------------------" Placeholders: Win: "&aYou won the game" Lose: "%color_chat_issue%You lost the game" Players: "&cThere are not enough players anymore. Arena got force stopped!" Murderer: Stopped: "The Murderer has been stopped!" Killed: You: "The murderer killed you!" All: "The Murderer has killed everyone." Innocent: Killed: You: "A player killed you with a Bow!" Wrongly: "You killed an innocent player!" Nobody: "Nobody" Admin: Set-Starting-In-To-0: "%plugin_prefix% An admin set waiting time to 0. The game starts now!" Arena: Chances: Action-Bar: "&cMurderer Chance: %arena_murderer_chance% &a- &bDetective Chance: %arena_detective_chance%" Cooldown: "&8&l[%value%&8&l] &6%number% seconds" Locator: Bow: "Bow locator" Innocent: "Innocent locator" Watch-Out: "5,20,5;Watch out!;The Murderer can now find survivors easily" Pass: Name: "Role pass menu" Role: Murderer: Name: "&cBe murderer" Lore: - "Cost 1 murderer pass" - "You got %number%" Detective: Name: "&bBe detective" Lore: - "Cost 1 detective pass" - "You got %number%" Fail: "%plugin_prefix% You do not got enough passes for %value% role" Success: "%plugin_prefix% You will be %value% next round!" Change: "%plugin_prefix% You now got %number% %value% passes!" Playing: Time-Left: "5,20,5;%arena_time% seconds left!;After %arena_time%s the Murderer will lose" Role: Change: "5,20,5;Previous %arena_player_role% has left!" Murderer: "5,20,5;ROLE | MURDERER; Kill all players!" Detective: "5,20,5;ROLE | DETECTIVE;Find and kill the murderer!" Innocent: "5,20,5;ROLE | INNOCENT;Stay alive as long as possible!" Score: Bonus: "+%number% score (%value%)" Gold: "Picked up gold!" Action: Kill: Player: "for killing players" Murderer: "for killing murderer" Innocent: "for killing innocent" Pickup: Gold: "for gold pickup" Surviving: Time: "for surviving 30 seconds" End: "for surviving till end" Win: "for winning the game" Detective: "for %number% innocents survived" Sword: Soon: "The Murderer gets their sword in %number% seconds!" Special-Blocks: Cauldron: Potion: "Please drink your current potion!" Hologram: "Mystery Potion - &e1 Gold" Not-Enough-Gold: "You need %number% gold for this!" Pray: Hologram: "Click to give gift;Pull lever to pray" Chat: "You prayed to the developer! Hope he will hear that!" Pay: "%color_chat_issue%Pay to pray!" Praise: Heard: - "" - "&7Developer hears your prayer." - "%feeling%" - "%praise%" Feeling: Blessed: "&aYou feel blessed." Cursed: "&cYou feel cursed." Gifts: Detective-Revelation: "&aYou know that &bCurrent detective &ais %detective%" Gold-Rush: "&aYou received power of ancients. For each gold you collect, you will receive 3 gold now." Single-Compensation: "&aDeveloper is proud of you! He rewarded you with 5 gold ingots!" Bow: "&aYou received bow from pleased developer!" Curses: Slowness: "%color_chat_issue%Your legs are much heavier than before." Blindness: "%color_chat_issue%Your eyes can't see that well anymore." Gold: "%color_chat_issue%Developer cursed you with gold ban! You cannot longer pickup any gold!" Death: "%color_chat_issue%You feel overpowering force of death. You know that you'll be dead in a minute!" Bow: Dropped: "5,20,5;The Bow has been dropped!;Find the Bow for a chance to kill the Murderer." Pickup: "A player has picked up the Bow!" Shot: Gold: "&a+1 Bow Shot!" Title: "5,20,5;;You collected 10 gold and got an arrow!" # # Sign messages # Signs: Please-Type-Arena-Name: "%color_chat_issue%%plugin_prefix% Please type arena name in second line!" Arena-Doesnt-Exists: "%color_chat_issue%%plugin_prefix% Arena with that name doesn't exists!" Created: "%plugin_prefix% Sign created successfully!" Removed: "%plugin_prefix% Sign successfully removed!" Lines: - "%plugin_prefix%" - "%arena_state_placeholder%" - "%arena_name%" - "[%arena_players_size%/%arena_max_players%]" # # Arena Selector messages # Arena-Selector: Inventory-Title: "%plugin_short_command% ▸ Arena selector" Item: Name: "%arena_name%" Lore: - "%plugin_name% - %arena_name%" - " " - " " - " Online: %arena_players_size%/%arena_max_players%" - " State: %arena_state_placeholder%" - " " - " " - "&aClick to join this arena" # # Validator messages # Validator: Invalid-Arena-Configuration: "Arena %arena_name% has invalid configuration! Missing node: %value%" Instance-Started: "Arena %arena_name% instance successfully started!" No-Instances-Created: "There are no arena instances created in configuration!" # # Placeholder messages inside plugin # Placeholders: Game-States: Waiting: "&lWaiting for players..." Starting: "&e&lStarting" Full-Game: "&4&lFULL" In-Game: "&lIn-game" Ending: "&lEnding" Restarting: "&c&lRestarting" Motd: Waiting: "&lYou can join this game..." Starting: "&e&lStarting" Full-Game: "&4&lFULL | Use another Server" In-Game: "&lIn-game | Click to spectate" Ending: "&lEnding | Server is closing" Restarting: "&c&lRestarting" # # Leaderboard messages # # Hologram function need to be enabled on config.yml Leaderboard: Type: Hologram: Header: "&6&lTop %number% in %value%" Format: "&e%number%. %player% (%value%)" Empty-Format: "&e%number%. Empty (0)" Chat: Header: "&8+-------+ &a&lYOUR STATS &8+-------+" Header-Other: "&8+---------+ &aSTATS FOR &b%player% &8+---------+" Footer: "&8+-----------------------------+" Format: "%value% ▸ &a%number%" Top: Type-Name: "%color_chat_issue%Please type statistic name to view!" Header: "&8&m+----------------+ [&6 Top 10 &8&m] +----------------+" Format: "&e#%number% %player% - %value% %user_statistic%" Statistics: Wins: "Wins ▸ %number%" Loses: "Loses ▸ %number%" Games-Played: "Games Played ▸ %number%" Level: "Level ▸ %number%" Exp: "Experience ▸ %number%" Next-Level-Exp: "Exp to Level Up ▸ %number%" Kills: "Kills ▸ %number%" Deaths: "Deaths ▸ %number%" Highest-Score: "Highest score ▸ %number%" Murderer-Pass: "Murderer passes ▸ %number%" Detective-Pass: "Detective passes ▸ %number%" Murderer-Contribution: "Murderer contribution ▸ %number%" Detective-Contribution: "Detective contribution ▸ %number%" Invalid-Name: "%color_chat_issue%Name of statistic is invalid! Type: %value%" Unknown-Player: "%color_chat_issue%Unknown Player" # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 2 ================================================ FILE: src/main/resources/lastwords.yml ================================================ Last-Words: Hologram: Title: "%player%'s last words:" Content: 'default': Message: "&fPlease respawn :(" 'meme': Message: "&fDespacito 2 is confirmed by God" Permission: "murdermystery.lastwords.meme" 'rage': Message: "&fWHY YOU KILLED ME?!!?" Permission: "murdermystery.lastwords.rage" 'pro': Message: "&fIt was lagging..." Permission: "murdermystery.lastwords.pro" 'hacker': Message: "Turn off your hacks..." Permission: "murdermystery.lastwords.hacker" ================================================ FILE: src/main/resources/leaderboards.yml ================================================ # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/locales/language_default.yml ================================================ ###############################[IMPORTANT]############################### # # Leave this file as it is! It is kinda an internal backup file! # ### !!!Do not change anything here!!! # ### THIS FILE AUTOMATICALLY REGENERATES ON SERVER RESTART # # Needed when the external api isn't working # ###############################[IMPORTANT]############################### # You can translate MurderMystery messages here. # Color codes (&) supported. # # Use \n to make new line # Some messages like item # descriptions don't support new lines # they are wrapped every 40 characters automatically # # Some messages support their own placeholders # like %player%, %kit% etc. # # Color scheme # Color: Placeholder: Value: "&4" Number: "&4" Player: "&b" Other: "&4" Chat: Issue: "&c" Messages: "&7" Special-Char: Contains: "[,],(,),{,},■,/,|,▸" Before: "&8" # # Command messages # Commands: Did-You-Mean: "%plugin_prefix% Did you mean /%value%?" Command-Executed: "%plugin_prefix% Command successfully executed!" Teleported-To-Lobby: "%plugin_prefix% Teleported to lobby!" Removed-Game-Instance: "%color_chat_issue%%plugin_prefix% Successfully removed game instance!" No-Arena-Like-That: "%color_chat_issue%%plugin_prefix% No arena with that ID!" Look-At-Sign: "%color_chat_issue%%plugin_prefix% You have to look at a sign to perform this command!" Type-Arena-Name: "%color_chat_issue%%plugin_prefix% Please type arena ID!" Hold-Any-Item: "%color_chat_issue%%plugin_prefix% You must hold any item!" No-Free-Arenas: "%color_chat_issue%%plugin_prefix% There are no free arenas!" Only-By-Player: "%color_chat_issue%%plugin_prefix% You can execute this command only as player!" Not-Playing: "%color_chat_issue%%plugin_prefix% You must play to execute this command!" No-Permission: "%color_chat_issue%%plugin_prefix% You don't have permission to use this command!" Player-Not-Found: "%color_chat_issue%%plugin_prefix% Target player %player% doesn't exist!" Invalid-Location-Teleport: "%color_chat_issue%%plugin_prefix% Location to teleport is invalid!" Wrong-Usage: "%color_chat_issue%%plugin_prefix% Wrong usage. Do %value%" Admin: Adjust-Statistic: "%plugin_prefix% Statistic %value% of %player% is now %number%!" Reload-Success: "%plugin_prefix% Arenas reloaded!" List: Header: "%plugin_name% arenas: Name State Players" Format: "%arena_name% %arena_state_placeholder% %arena_players_size%/%arena_max_players%" No-Arenas: "%color_chat_issue%%plugin_prefix% There are no game instances!" Spychat: Toggled: "%plugin_prefix% Game spy chat toggled to %value%" Main: Header: "&6----------------{%plugin_name% commands}----------" Description: - "&aGame commands:" - "&b/%plugin_short_command% stats: Shows your stats!" - "&b/%plugin_short_command% leave: Quits current arena!" - "&b/%plugin_short_command% join : Joins specified arena!" - "&b/%plugin_short_command% top : Shows top 10 players!" - "&b/%plugin_short_command% randomjoin: Join random arena!" Admin-Bonus-Description: "&b/%plugin_short_command%: Shows all the admin commands" Footer: "&6-------------------------------------------------" # # In-Game scoreboard messages # # Please do not use more chars than the scoreboard can handle! # Scoreboard supports up to 122 chars for 1.14+ and 48 chars for 1.13- (COLOR CODES INCLUDED.) # Placeholders: # https://wiki.plugily.xyz/REPLACEWITHPROJECTNAME/placeholders/language Scoreboard: Title: "&a&l%plugin_name%" Roles: Detective: "&bDetective" Murderer: "&cMurderer" Innocent: "&eInnocent" Dead: "Dead" Detective: Alive: "Detective &aAlive" Bow: Dropped: "%color_chat_issue%Bow Dropped" Picked: "Bow Not Dropped" Content: Waiting: - "" - "■ Players | %arena_players_size%" - "" - "■ Minimum Players | %arena_min_players%" - "" - " www.plugily.xyz" Starting: - "" - "■ Starting In | %arena_time%" - "" - "■ Players | %arena_players_size%" - "" - "■ Minimum Players | %arena_min_players%" - "" - " www.plugily.xyz" # Contents of scoreboard while ingame In-Game: - "" - "■ Role | %arena_player_role%" - "&f" - "■ Innocents | %arena_innocent_size%" - "&f" - "■ Time | %arena_time%" - "" - "■ %arena_detective_status%" - "" - "■ Score | %user_statistic_local_score%" - "" - " www.plugily.xyz" In-Game-Murderer: - "" - "■ Role | %arena_player_role%" - "&f" - "■ Innocents | %arena_innocent_size%" - "&f" - "■ Time | %arena_time%" - "" - "■ %arena_detective_status%" - "" - "■ Kills | %user_statistic_local_kills%" - "" - "■ Score | %user_statistic_local_score%" - "" - " www.plugily.xyz" # Contents of scoreboard while state is ending Ending: - "&f" - "&f" - "&cGAME ENDED" - "" - "&f" - "&f" - "" - " www.plugily.xyz" # Contents of scoreboard while state is restarting Restarting: - "&f" - "&f" - "&cRESTARTING GAME" - "" - "&f" - "&f" - "" - " www.plugily.xyz" # # Bossbar messages # # Bossbar needs to be enabled on config.yml Bossbar: Title: "%plugin_name% - www.plugily.xyz" Content: Waiting: - "Waiting for more players..." Starting: - "Starting in: %arena_time%" In-Game: - "Playing %plugin_name_uppercase% on PLUGILY.XYZ" - "Check the plugin creator out on PLUGILY.XYZ" - "Your role %arena_player_role%" Ending: - "Game has ended! You were playing on PLUGILY.XYZ" Restarting: - "Restarting the arena. You will be moved soon!" # # In-Game Messages # In-Game: #Used in most game messages. Plugin-Prefix: "(%plugin_name%)" Game-Chat-Format: "[%user_statistic_level%] %player% | %message%" You-Leveled-Up: "%plugin_prefix% You leveled up! You're now level %number%!" Commands-Blocked: "%color_chat_issue%%plugin_prefix% You have to leave the game first to perform commands. The only command that works is /%plugin_short_command% leave!" Join: Already-Playing: "%color_chat_issue%%plugin_prefix% You are already queued for a game! You can leave a game with /%plugin_short_command% leave." No-Permission: "%color_chat_issue%%plugin_prefix% You don't have %value% permission to join this arena!" Full-Game: "%color_chat_issue%%plugin_prefix% You don't have the permission to join full games!" No-Slots-For-Premium: "%color_chat_issue%%plugin_prefix% This game is already full of premium players! Sorry" # Join cancelled via external plugin that uses the API of our plugin. Cancelled-Via-API: "%color_chat_issue%%plugin_prefix% You can't join this game!" As-Party-Member: "%color_chat_issue%%plugin_prefix% You joined %arena_name% because the party leader joined it!" Arena-Not-Configured: "%color_chat_issue%%plugin_prefix% Arena is not configured yet! Contact your server's staff!" Title: "20,30,20;%arena_name%;%arena_players_size%/%arena_max_players%" Death: Tag: "&8Dead" Screen: "%color_chat_issue%You died!" Spectator: Blocked: "%color_chat_issue%%plugin_prefix% Spectators are disabled for this arena" You-Are-Spectator: "%plugin_prefix% You're now a spectator! You can fly now!" Spectator-Menu-Name: "%color_chat_issue%Alive players list" Target-Player-Health: "%color_chat_issue%Health: %number% | Role: %arena_player_role%" Spectator-Warning: "%plugin_prefix% You are a spectator!" Teleport: "%plugin_prefix% Teleported to %player%" Menu: Settings: Status: Enabled: "Enabled" Disabled: "Disabled" Changed-Speed: "Changed Speed to %number%" Auto-Teleport: "%value% auto teleport" Target-Player: Action-Bar: "%number% blocks away | Target %player%" Night-Vision: "%value% night vision" First-Person-Mode: Action-Bar: "&eSNEAK &cto leave! | Target %player%" Title: "&eSNEAK &cto leave!" Visibility: "%value% other spectator players" Messages: Join: "%plugin_prefix% %player% joined the game (%arena_players_size%/%arena_max_players%)!" Leave: "%plugin_prefix% %player% left the game (%arena_players_size%/%arena_max_players%)!" Death: "%plugin_prefix% %player% died!" Lobby: Start-In: "%plugin_prefix% The game starts in %arena_time% seconds!" Waiting-For-Players: "%plugin_prefix% Waiting for players... We need at least %arena_min_players% players to start." Enough-Players-To-Start: "%plugin_prefix% We now have enough players. The game is starting soon!" Reduced-Time: "%plugin_prefix% The time got reduced to %number% seconds" Max-Players: "%plugin_prefix% We reached max players for this round. Let's shorten the time!" Game-Started: "%plugin_prefix% The game has started!" Kicked-For-Premium-Slot: "%color_chat_issue%%plugin_prefix% %player% got removed from the game to make a place for premium players!" You-Were-Kicked-For-Premium-Slot: "%color_chat_issue%%plugin_prefix% You got kicked out of the game to make a place for a premium player!" Not-Enough-Space-For-Party: "%color_chat_issue%%plugin_prefix% Your party is bigger than free places on the arena %arena_name%" Game-End: Summary: - "&a&m--------------------------------------------------" - "%plugin_name%" - "" - "%arena_summary%" - "%arena_summary_player%" - "" - "&7Detective: %arena_detective_list%" - "&7Murderer: %arena_murderer_list% (%arena_murderer_kills%)" - "&7Hero: %arena_hero%" - "" - "&a&m--------------------------------------------------" Placeholders: Win: "&aYou won the game" Lose: "%color_chat_issue%You lost the game" Players: "&cThere are not enough players anymore. Arena got force stopped!" Murderer: Stopped: "The Murderer has been stopped!" Killed: You: "The murderer killed you!" All: "The Murderer has killed everyone." Innocent: Killed: You: "A player killed you with a Bow!" Wrongly: "You killed an innocent player!" Nobody: "Nobody" Admin: Set-Starting-In-To-0: "%plugin_prefix% An admin set waiting time to 0. The game starts now!" Arena: Chances: Action-Bar: "&cMurderer Chance: %arena_murderer_chance% &a- &bDetective Chance: %arena_detective_chance%" Cooldown: "&8&l[%value%&8&l] &6%number% seconds" Locator: Bow: "Bow locator" Innocent: "Innocent locator" Watch-Out: "5,20,5;Watch out!;The Murderer can now find survivors easily" Pass: Name: "Role pass menu" Role: Murderer: Name: "&cBe murderer" Lore: - "Cost 1 murderer pass" - "You got %number%" Detective: Name: "&bBe detective" Lore: - "Cost 1 detective pass" - "You got %number%" Fail: "You do not got enough passes for %value% role" Success: "You will be %value% next round!" Change: "You now got %number% %value% passes!" Playing: Time-Left: "5,20,5;%arena_time% seconds left!;After %arena_time%s the Murderer will lose" Role: Change: "5,20,5;Previous %arena_player_role% has left!" Murderer: "5,20,5;ROLE | MURDERER; Kill all players!" Detective: "5,20,5;ROLE | DETECTIVE;Find and kill the murderer!" Innocent: "5,20,5;ROLE | INNOCENT;Stay alive as long as possible!" Score: Bonus: "+%number% score (%value%)" Gold: "Picked up gold!" Action: Kill: Player: "for killing players" Murderer: "for killing murderer" Innocent: "for killing innocent" Pickup: Gold: "for gold pickup" Surviving: Time: "for surviving 30 seconds" End: "for surviving till end" Win: "for winning the game" Detective: "for %number% innocents survived" Sword: Soon: "The Murderer gets their sword in %number% seconds!" Special-Blocks: Cauldron: Potion: "Please drink your current potion!" Hologram: "Mystery Potion - &e1 Gold" Not-Enough-Gold: "You need %number% gold for this!" Pray: Hologram: "Click to give gift;Pull lever to pray" Chat: "You prayed to the developer! Hope he will hear that!" Pay: "%color_chat_issue%Pay to pray!" Praise: Heard: - "" - "&7Developer hears your prayer." - "%feeling%" - "%praise%" Feeling: Blessed: "&aYou feel blessed." Cursed: "&cYou feel cursed." Gifts: Detective-Revelation: "&aYou know that &bCurrent detective &ais %detective%" Gold-Rush: "&aYou received power of ancients. For each gold you collect, you will receive 3 gold now." Single-Compensation: "&aDeveloper is proud of you! He rewarded you with 5 gold ingots!" Bow: "&aYou received bow from pleased developer!" Curses: Slowness: "%color_chat_issue%Your legs are much heavier than before." Blindness: "%color_chat_issue%Your eyes can't see that well anymore." Gold: "%color_chat_issue%Developer cursed you with gold ban! You cannot longer pickup any gold!" Death: "%color_chat_issue%You feel overpowering force of death. You know that you'll be dead in a minute!" Bow: Dropped: "5,20,5;The Bow has been dropped!;Find the Bow for a chance to kill the Murderer." Pickup: "A player has picked up the Bow!" Shot: Gold: "&a+1 Bow Shot!" Title: "5,20,5;;You collected 10 gold and got an arrow!" # # Sign messages # Signs: Please-Type-Arena-Name: "%color_chat_issue%%plugin_prefix% Please type arena name in second line!" Arena-Doesnt-Exists: "%color_chat_issue%%plugin_prefix% Arena with that name doesn't exists!" Created: "%plugin_prefix% Sign created successfully!" Removed: "%plugin_prefix% Sign successfully removed!" Lines: - "%plugin_prefix%" - "%arena_state_placeholder%" - "%arena_name%" - "[%arena_players_size%/%arena_max_players%]" # # Arena Selector messages # Arena-Selector: Inventory-Title: "%plugin_short_command% ▸ Arena selector" Item: Name: "%arena_name%" Lore: - "%plugin_name% - %arena_name%" - " " - " " - " Online: %arena_players_size%/%arena_max_players%" - " State: %arena_state_placeholder%" - " " - " " - "&aClick to join this arena" # # Validator messages # Validator: Invalid-Arena-Configuration: "Arena %arena_name% has invalid configuration! Missing node: %value%" Instance-Started: "Arena %arena_name% instance successfully started!" No-Instances-Created: "There are no arena instances created in configuration!" # # Placeholder messages inside plugin # Placeholders: Game-States: Waiting: "&lWaiting for players..." Starting: "&e&lStarting" Full-Game: "&4&lFULL" In-Game: "&lIn-game" Ending: "&lEnding" Restarting: "&c&lRestarting" Motd: Waiting: "&lYou can join this game..." Starting: "&e&lStarting" Full-Game: "&4&lFULL | Use another Server" In-Game: "&lIn-game | Click to spectate" Ending: "&lEnding | Server is closing" Restarting: "&c&lRestarting" # # Leaderboard messages # # Hologram function need to be enabled on config.yml Leaderboard: Type: Hologram: Header: "&6&lTop %number% in %value%" Format: "&e%number%. %player% (%value%)" Empty-Format: "&e%number%. Empty (0)" Chat: Header: "&8+-------+ &a&lYOUR STATS &8+-------+" Header-Other: "&8+---------+ &aSTATS FOR &b%player% &8+---------+" Footer: "&8+-----------------------------+" Format: "%value% ▸ &a%number%" Top: Type-Name: "%color_chat_issue%Please type statistic name to view!" Header: "&8&m+----------------+ [&6 Top 10 &8&m] +----------------+" Format: "&e#%number% %player% - %value% %user_statistic%" Statistics: Wins: "Wins ▸ %number%" Loses: "Loses ▸ %number%" Games-Played: "Games Played ▸ %number%" Level: "Level ▸ %number%" Exp: "Experience ▸ %number%" Next-Level-Exp: "Exp to Level Up ▸ %number%" Kills: "Kills ▸ %number%" Deaths: "Deaths ▸ %number%" Highest-Score: "Highest score ▸ %number%" Murderer-Pass: "Murderer passes ▸ %number%" Detective-Pass: "Detective passes ▸ %number%" Murderer-Contribution: "Murderer contribution ▸ %number%" Detective-Contribution: "Detective contribution ▸ %number%" Invalid-Name: "%color_chat_issue%Name of statistic is invalid! Type: %value%" Unknown-Player: "%color_chat_issue%Unknown Player" # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/mysql.yml ================================================ # MySQL database configuration, you don't need to touch this unless you enabled MySQL support. # To enable MySQL support go to > config.yml and set 'Database' to true # Replace with your database address: jdbc:mysql://localhost:3306/?useSSL=false&autoReConnect=true # MySQL user name user: # MySQL user password password: # MySQL tablename table: mm_playerstats # Maximum life time for HikariCP database. # For documentation, see https://github.com/brettwooldridge/HikariCP#frequently-used # Default 1800000 = 30 minute maxLifeTime: 1800000 # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/permissions.yml ================================================ # You can create custom players permissions here. # Player with your custom permission will get int # All chances include murderer and detective Chances-Boost: # Do not use dots (.), they won't work. # Increase chance by 10 times chances-boost-5: 10 chances-boost-50: 50 # Increase chance by 100 times admin-boost: 100 Murderer-Boost: # Do not use dots (.), they won't work. # Increase murderer chance by 10 murderer-boost-5: 10 murderer-boost-50: 50 # Increase murderer chance by 100 admin-boost: 100 Detective-Boost: # Do not use dots (.), they won't work. # Increase detective chance by 10 detective-boost-5: 10 detective-boost-50: 50 # Increase detective chance by 100 admin-boost: 100 # Create custom exp boost permissions Exp-Boost: # Do not use dots (.), they won't work. # Increase exp by 10 percent exp-boost-10: 10 exp-boost-50: 50 # Increase exp by 300 percent admin-boost: 300 # Basic permissions for game, permissions explained here: https://wiki.plugily.xyz/ Basic: Full-Games: "plugilyprojects.fullgames" # represents arena name (NOT MAP NAME!), for example: 'plugilyprojects.join.ARENAnice' # use 'plugilyprojects.join.*' to enable access to all arenas Join: "plugilyprojects.join." Forcestart: "plugilyprojects.admin.forcestart" # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/plugin.yml ================================================ name: MurderMystery main: plugily.projects.murdermystery.Main authors: [ PlugilyProjects, Tigerpanzer_02 ] version: ${project.version} softdepend: [CorpseReborn, PlaceholderAPI, Parties, Spigot-Party-API-PAF, PartyAndFriends, ViaVersion, ProtocolSupport] api-version: 1.13 commands: MurderMystery: description: MurderMystery Commands usage: "\u00A76Correct usage: /murdermystery [option]" aliases: [mm, murder] MurderMysteryAdmin: description: MurderMysteryAdmin commands usage: "\u00A76Correct usage: /murdermysterya [option]" aliases: [mma, murderadmin] permissions: murdermystery.admin.*: default: op children: murdermystery.updatenotify: true murdermystery.admin: true murdermystery.admin.setup: true murdermystery.admin.delete: true murdermystery.admin.list: true murdermystery.admin.spychat: true murdermystery.admin.stopgame: true murdermystery.admin.forcestart: true murdermystery.admin.addsign: true murdermystery.admin.clear: true murdermystery.admin.sign.create: true murdermystery.admin.sign.break: true murdermystery.admin.reload: true murdermystery.command.override: true ================================================ FILE: src/main/resources/powerups.yml ================================================ ## Murder Mystery powerups.yml # Powerups: Pickup: Chat: "&a%player% picked the &4Powerup %value% up" Ended: Title: "&4Powerup %value% from %player%" Subtitle: "&chas ended" Chat: "&4Powerup %value% from %player% has ended%" Drop: Chance: 1 Content: Speed: active: true name: "&a&lSPEED BOOSTER" description: "&7Double speed for %number% seconds!" material: FEATHER # Add as many potion effects as you want # Format: PotionName, Duration, Amplifier potion-effect: - "SPEED, 15, 1" # PLAYER for pickup player | ALL for all arena players potion-type: PLAYER # like rewards execute: - "" Speed-All: active: true name: "&a&lSPEED BOOSTER FOR ALL" description: "&7Double speed for all players in the next %number% seconds!" material: FEATHER # Add as many potion effects as you want # Format: PotionName, Duration, Amplifier potion-effect: - "SPEED, 15, 1" # PLAYER for pickup player | ALL for all arena players potion-type: ALL # like rewards execute: - "" # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/rewards.yml ================================================ # # Plugily Projects rewards configuration # # Placeholders list: # https://wiki.plugily.xyz/minigame/placeholders # # Commands are executed by default BY CONSOLE, use "p:" to preform command by player # You can use chance to execute command adding "chance(NUMBER):" (ex chance(10):) at the beginning of command # # Commands examples: # - p:say Hello everyone in %arena_name%! # Player will say "Hello everyone in " # - broadcast Game %arena_name% has ended! # Will broadcast "Game has ended" message # - chance(1):p:say I was very lucky! # Player has 1% chance to say "I was very lucky!" # - p:chance(99):spawn # Player has 99% chance to teleport to spawn # ^ YOU CAN EVEN SWAP CHANCE WITH PLAYER! # - chance(50):eco give %player% 10 # Console has 10% chance to give player 10$ # # Performed rewards: # game-end # # You can unlock full potential of rewards using our script engine! (since 4.0.0) # Just add example reward: # - script:player.sendMessage("oh, hi %player%"); # It will send "oh, hi " to player! 100% plain java! # - script:server.broadcastMessage("hello everyone"); # Broadcasts "hello everyone" to whole server # - script:player.getInventory().addItem(new org.bukkit.inventory.ItemStack(org.bukkit.Material.DIRT)); # ^ Gives player dirt item (you must always use direct package names for not provided objects) # # All script provided objects: # player - Player object (API methods https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html) # arena - Plugin arena (API methods https://jd.plugily.xyz/apidocs/minecraft/PLUGILYPROJECTS/plugily/projects/PLUGILYPROJECTS/arena/Arena.html) # server - Bukkit server object (API methods https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html) # # Whole documentation of scripts soon! # Rewards must be enabled via config.yml first! rewards: # Commands performed when game is started game-start: - say %arena_name% has started - say Ooh and there are playing %arena_players_size% players # Commands performed when game is finished game-end: - say %arena_name% has ended - say Ooh and there were playing %arena_players_size% players # Commands executed when detective is killed detective-kill: - eco give %player% 2 - chance(10):eco give %player% 8 # Commands executed when murderer is killed murderer-kill: - eco give %player% 2 - chance(10):eco give %player% 8 # Commands executed when player wins the game win: - say I won the game! # Commands executed when player loses the game lose: - say I lost the game! player-death: - say I died! gold-pickup: - say You picked up gold! # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 2 Core-Version: 1 ================================================ FILE: src/main/resources/signs.yml ================================================ # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/skins.yml ================================================ Skins: Sword: 'default': Material: IRON_SWORD 'Stone': Material: STONE_SWORD Permission: "murdermystery.skins.sword.stone" ================================================ FILE: src/main/resources/special_blocks.yml ================================================ # # Murder Mystery special blocks configuration # Special-Blocks: Cauldron-Potions: Speed-I: # Uppercased potion effect type (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html) Type: SPEED # Duration of potion effect Duration: 10 # Amplifier of potion effect Amplifier: 1 # Name of potion Name: "&bSpeed Potion &7(10 sec)" # Subtitle message when you drink potion Subtitle: "&a10S of Speed" Mystery-I: Type: JUMP Duration: 20 Amplifier: 1 Name: "&7Mystery potion &8(???)" Subtitle: "&a20S of Jump Boost" Mystery-II: Type: SLOW Duration: 10 Amplifier: 1 # Beware that we use '&f' at the end to make it different from above! # Otherwise, it will count as Mystery-I potion! Name: "&7Mystery potion &8(???)&f" Subtitle: "&c10S of Slowness" Mystery-III: Type: INVISIBILITY Duration: 10 Amplifier: 1 # Beware that we use '&a' at the end to make it different from above! # Otherwise, it will count as Mystery-I potion! Name: "&7Mystery potion &8(???)&a" Subtitle: "&a10S of Invisibility" Mystery-IV: Type: BLINDNESS Duration: 5 Amplifier: 1 Name: "&7Mystery potion &8(???)&b" Subtitle: "&c5S of Blindness" Mystery-V: Type: NIGHT_VISION Duration: 25 Amplifier: 1 Name: "&7Mystery potion &8(???)&c" Subtitle: "&a25S of Night Vision" ================================================ FILE: src/main/resources/special_items.yml ================================================ # Custom special items. # You can also add your own special items! # # Stage: SERVER_JOIN, WAITING_FOR_PLAYERS, ENOUGH_PLAYERS_TO_START, LOBBY, IN_GAME, SPECTATOR, ENDING # # Please don't modify 'Kit-Menu', 'Leave-Lobby', 'Leave-Spectator', 'Player-List' and 'Spectator-Options', 'Forcestart' # nodes as they are hardcoded in code! # # Also see the wiki for further reference! Role-Pass: permission: "" execute: - "p:mm roleselector" displayname: "&c&lClick to open role pass menu &7(Right Click)" lore: - "&7Enjoy one round of guaranteed role with pass" material: CHEST slot: 4 stage: lobby force: true move: false # Uses bungee.yml configuration - if enabled it tries to connect to your hub Lobby-Leave: permission: "" execute: - "" displayname: "&c&lReturn to Lobby &7(Right Click)" lore: - "&7Right-click to leave to the lobby" material: BED slot: 8 stage: LOBBY force: true move: false # Uses bungee.yml configuration - if enabled it tries to connect to your hub Spectator-Leave: permission: "" execute: - "" displayname: "&c&lLeave the Game &7(Right Click)" lore: - "&7Right-click to leave to the lobby" material: BED slot: 8 stage: SPECTATOR force: true move: false Player-List: permission: "" execute: - "" displayname: "&a&lAlive Players &7(Right Click)" lore: - "&7Right-click to see alive players list" material: PLAYER_HEAD slot: 0 stage: SPECTATOR force: true move: false Spectator-Settings: permission: "" execute: - "" displayname: "&b&lSpectator Settings &7(Right Click)" lore: - "&7Right-click to adjust spectator settings" material: COMPASS slot: 4 stage: SPECTATOR force: true move: false Forcestart: permission: "plugily.projects.forcestart" execute: - "" displayname: "&c&lStart the game &7(Right Click)" lore: - "&7You need the following permission for it" - "&7plugily.projects.forcestart" material: EMERALD slot: 2 stage: ENOUGH_PLAYERS_TO_START force: true move: false Arena-Selector: disabled: true # disabled by default permission: "" execute: - "p:mm arenas" displayname: "&c&lArena selector &7(Right Click)" lore: - "&7Right-click to see all arenas" material: CHEST slot: 4 stage: SERVER_JOIN force: false move: false Stats: disabled: true # disabled by default permission: "" execute: - "p:mm stats" displayname: "&c&lStats &7(Right Click)" lore: - "&7Right-click to see your Stats" material: PLAYER_HEAD slot: 0 stage: SERVER_JOIN force: false move: false # Uses bungee.yml configuration - if enabled it tries to connect to your hub Back-To-Hub: disabled: true # disabled by default permission: "" execute: - "p:hub" displayname: "&c&lBack to Hub &7(Right Click)" lore: - "&7Right-click to return to lobby" material: Bed slot: 8 stage: SERVER_JOIN force: false move: false # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/spectator.yml ================================================ # Make sure to read the wiki for further reference! # section keys with DEFAULT_SPEED, SPEED1, SPEED2, SPEED3, SPEED4, AUTO_TELEPORT, NIGHT_VISION, FIRST_PERSON_MODE, SPECTATORS_VISIBILITY have a defined function Settings-Menu: Inventory-name: "&7Spectator settings" Content: 'DEFAULT_SPEED': material: LEATHER_BOOTS # slot at the inventory, 0 is first slot slot: 11 name: "Default Speed" description: - "Sets the default minecraft speed" permission: "" execute: # You could also add a potion effect by console command - "" 'SPEED1': material: CHAINMAIL_BOOTS slot: 12 name: "Speed I" description: - "Adds a speed 1 potion" permission: "" execute: - "" 'SPEED2': material: IRON_BOOTS slot: 13 name: "Speed II" description: - "Adds a speed 2 potion" permission: "" execute: - "" 'SPEED3': material: GOLDEN_BOOTS slot: 14 name: "Speed III" description: - "Adds a speed 3 potion" permission: "" execute: - "" 'SPEED4': material: DIAMOND_BOOTS slot: 15 name: "Speed IV" description: - "Adds a speed 4 potion" permission: "" execute: - "" 'AUTO_TELEPORT': material: COMPASS slot: 20 name: "Automatically teleport" description: - "Automatically teleports you to your targeted player" permission: "" execute: - "" 'NIGHT_VISION': material: ENDER_PEARL slot: 21 name: "Night vision" description: - "With nigh vision you will be able to see ghosts" permission: "" execute: - "" 'FIRST_PERSON_MODE': material: CLOCK slot: 23 name: "First person mode" description: - "When in first person mode you will spectate like you would play yourself" permission: "" execute: - "" 'SPECTATORS_VISIBILITY': material: REDSTONE slot: 24 name: "Spectators visibility" description: - "Its a good choice if you hate other players" permission: "" execute: - "" # Don't edit it. But who's stopping you? It's your server! # Really, don't edit ;p # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 Core-Version: 1 ================================================ FILE: src/main/resources/stats.yml ================================================ data-version: 1 ================================================ FILE: src/main/resources/trails.yml ================================================ #Add trails that you want to blacklist from all trails(particles) Blacklisted-Trails: - "elder_guardian" - "block_crack" - "item_crack" - "block_dust"