mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 05:16:55 +00:00
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.
This commit is contained in:
@@ -66,6 +66,7 @@ public class PlayerManager {
|
||||
continue;
|
||||
}
|
||||
// entering combat logic
|
||||
if (plugin.getConfigCache().combat_time <= 0) return; // disable combat entering when combat time is <0
|
||||
if (!playerData.getLastCombatCheckState() && playerData.isInCombat()) {
|
||||
PlayerEnterCombatEvent enterCombatEvent = null;
|
||||
if (PlayerEnterCombatEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user