Commit Graph

138 Commits

Author SHA1 Message Date
YouHaveTrouble 47ade3e0c0 Refactor PreventStabby plugin to enhance PvP and environment controls
Reconfiguration of the PreventStabby plugin involved removal of PlayerDamageListener and the introduction of two new listeners: EnvironmentalListener and PvpListener. This restructuring allows more efficient management of entity damage and environmental interactions. EnvironmentalListener specifically caters for dangerous situations such as bucket spills and block fires. PvpListener effectively manages PvP related activities including damages, splash potion effects, cloud area effects, and fishing events ensuring a more streamlined control and response for better PvP gameplay.
2024-03-04 18:24:22 +01:00
YouHaveTrouble 7d8d27b1ef Replace PlayerDamageListener with EnvironmentalListener and PvpListener
Removed PlayerDamageListener and introduced two new listeners, EnvironmentalListener and PvpListener to manage entity damage. EnvironmentalListener prevents dangerous bucket dumps and block ignitions. PvpListener handles entity damages, potion splash events, area effect cloud applications and fishing events, all with distinct conditions and responses for better PvP management.
2024-03-03 14:52:49 +01:00
YouHaveTrouble 096599081b Improve exception handling and PvP process in DatabaseSQLite and PlayerManager
Refactored exception handling in DatabaseSQLite to use logger instead of printStackTrace() for better error tracking. Streamlined player PvP process in PlayerManager with clear conditions and appropriate responses. Enhancements in other classes were also made to ensure smooth execution and maintain code standards.
2024-03-02 16:57:32 +01:00
YouHaveTrouble 7b155d0b3e Add UtilListener to track player interactions with entities
The UtilListener class has been added to the project. It provides various event handlers which tag entities (such as ExplosiveMinecart, TNTPrimed, EnderCrystal) with the UUID of the player who either placed, nudged, primed or hit the entity. Changes have also been made to the Target class, adding methods for getting and assigning a player source ID for entities.
2024-03-02 00:40:35 +01:00
YouHaveTrouble 58a4a9f25d combat tracking is working again! 2024-02-28 20:09:56 +01:00
YouHaveTrouble 3c7904786e Implement SQL database and refactor onEnable method
In this commit, an SQLite database is set up in the onEnable method of the PreventStabby class, which will be used to store plugin data. To facilitate this, java.io.File is being imported. By doing this, we ensure that the database file exists and is connected to as soon as the plugin is enabled.
2024-02-24 19:36:55 +01:00
YouHaveTrouble 1aeb245666 Refactor damage source checking and restructure player management
The source of damage detection for PvP interactions has been updated to improve accuracy and flexibility. A 'Target' sub-class has been implemented in the PlayerManager class, removing the need for a separate DamageCheck class. The PlayerManager class was also moved to the 'data' package. Distribution of feedback messages has been simplified using the new DamageCheckResult class.
2024-02-24 19:23:54 +01:00
YouHaveTrouble b9e2aefc40 Remove several game listeners and utility files
The commit includes the deletion of several listeners and utility files. These were mainly related to handling specific game events such as interactions with lava and fireworks, combat commands, and actions related to player pets and mounts. The removal is due to refactoring damage source check system
2024-02-14 20:22:07 +01:00
YouHaveTrouble 8df1fe54e4 Remove redundant SmartCache and refactor related classes
The SmartCache class has been removed, and logic within it has been moved to relevant classes to reduce redundancy. This involved utilizing the PlayerManager for player data, instead of invalidating a separate cache in the now-removed SmartCache. Other classes that interacted with SmartCache, such as API, listeners and PreventStabby, have been updated to use the newly refactored system.
2024-01-11 00:44:58 +01:00
YouHaveTrouble b414f96257 new shared logic to determine attacker and victim 2023-06-23 00:28:44 +02:00
YouHaveTrouble c11c455c53 use util for harmful effects list 2023-06-22 19:06:15 +02:00
YouHaveTrouble d859fd0aaa refactors, code style fixes, rpeventing events from firing when not needed 2023-06-22 18:41:16 +02:00
YouHaveTrouble 3919b0f44b use logger, use try with resources 2023-06-22 16:45:31 +02:00
YouHaveTrouble 0290629d27 relocate into me.youhavetrouble.preventstabby to avoid conflicts 2023-06-22 16:20:39 +02:00
YouHaveTrouble 4590b1d532 only fire PlayerEnterCombatEvent if there are registered listeners for it 2023-06-22 16:02:34 +02:00
YouHaveTrouble 8ae6e9212c actually check for empty string and not for null v1.11.0 2023-06-22 15:36:08 +02:00
YouHaveTrouble fec1dd2ab6 bump version 2023-06-22 15:32:09 +02:00
YouHaveTrouble fba2f03aab don't send messages or action bars if the message content is empty 2023-06-22 15:28:41 +02:00
YouHaveTrouble e30437694c bump version v1.10.2 2023-05-23 00:09:14 +02:00
YouHaveTrouble 8fcf34e310 more fixes for #15 2023-05-20 12:06:16 +02:00
YouHaveTrouble aac1f99374 potential fix for #15 2023-05-20 00:09:02 +02:00
YouHaveTrouble 7f1da79444 bump version v1.10.1 2023-05-03 21:49:15 +02:00
YouHaveTrouble 244ceb4dcc don't send the message if tempting was cancelled 2023-05-03 21:29:07 +02:00
YouHaveTrouble ac1cafe0d9 tempting horses should not cause player to enter combat 2023-05-03 21:26:38 +02:00
YouHaveTrouble b3ce1913fd add placeholder for forced pvp state v1.10.0 2023-05-03 19:18:02 +02:00
YouHaveTrouble 9a707b34a3 bump version v1.9.0 2023-03-26 03:17:46 +02:00
YouHaveTrouble d52648b4ff Merge pull request #13 from YouHaveTrouble/api-changes
Api changes + worldguard flag fix for 1.19.4
2023-03-26 03:15:42 +02:00
YouHaveTrouble 7d2c41646e make worldguard hook register on load 2023-03-26 03:09:07 +02:00
YouHaveTrouble 61908b8fab more api changes and javadocs v1.9.0-pre1 2022-12-31 17:09:20 +01:00
YouHaveTrouble 5abf99cd6c semi-major api changes, javadocs 2022-12-31 16:44:50 +01:00
YouHaveTrouble 3c014304ba implement PlayerTogglePvpEvent 2022-12-31 15:58:06 +01:00
YouHaveTrouble b361681600 bump version v1.8.0 2022-12-31 15:03:15 +01:00
YouHaveTrouble 7ada9eab29 permission for help command 2022-12-31 15:03:09 +01:00
YouHaveTrouble 78504ee097 command without arguments now acts as toggle subcommand 2022-12-31 14:43:44 +01:00
YouHaveTrouble 7da6ff0ac9 placeholder for pvp state and offline player fallbacks to not cause sync db calls 2022-12-31 13:46:01 +01:00
YouHaveTrouble c83888837b fix dependency issues on older server versions v1.7.2 2022-12-04 22:26:45 +01:00
YouHaveTrouble 4052afe4d3 version bump v1.7.1 2022-08-07 12:13:15 +02:00
YouHaveTrouble 93efa37e77 flip the conditional 2022-08-07 11:59:22 +02:00
YouHaveTrouble 44a5c6d800 bump version v1.7.0 2022-07-19 17:36:14 +02:00
YouHaveTrouble 2ee577a08c setting to allow players being pulled with fishing rods while having pvp off 2022-07-19 17:35:04 +02:00
YouHaveTrouble f5d38eefc3 update readme 2022-06-17 23:35:43 +02:00
YouHaveTrouble e5b566db67 fix javadoc 2022-06-17 22:56:31 +02:00
YouHaveTrouble 9b18c435f6 implement pvp state override command and api v1.6.0 2022-06-17 21:12:55 +02:00
YouHaveTrouble b99c14b631 going on an adventure 2022-06-16 23:52:30 +02:00
YouHaveTrouble 6fd3e4b671 use enum for permissions 2022-05-14 12:28:50 +02:00
YouHaveTrouble 0ff0177f0b Merge remote-tracking branch 'origin/master' 2022-05-14 11:53:40 +02:00
YouHaveTrouble 5a36ba7748 use internal method for message sending, replace some try/catch with null checks 2022-05-14 11:53:31 +02:00
YouHaveTrouble 388e3c74a5 Create LICENSE 2022-05-03 19:22:37 +02:00
YouHaveTrouble 4088a6dd5b fix npe when new pet target is null v1.5.1 2022-05-02 22:57:20 +02:00
YouHaveTrouble a8e606dab5 fix a few bugs v1.5 2022-04-15 17:31:26 +02:00