Skip to content

Conversation

@Rassup
Copy link
Contributor

@Rassup Rassup commented Dec 24, 2025

UPDATE TO #113

Fixed bug where shock module damaged authorised players despite biometric
authorisation. Refactored force field damage system to prevent redundant
damage (instant death + shock simultaneously) and provide granular control.

Changes:

  • MFFSConfig.java: Split damage config into two separate options:

    • disableForceFieldInstantDeathForAuthorizedPlayers (renamed from disableForceFieldDamageForAuthorizedPlayers)
    • disableShockModuleDamageForAuthorizedPlayers (new)
  • ForceFieldBlockImpl.java: Fixed boolean logic bug where authorised players incorrectly took instant death damage

  • ShockModule.java: Added biometric authorisation checks and config support. Shock damage now only applies when instant death is disabled (acts as alternative damage). Authorised players can disable shock damage via config. Unauthorised players/mobs always take shock damage when instant death disabled.

Behavior: Instant death and shock damage are now mutually exclusive. When
instant death is enabled, only instant death applies. When disabled, shock
module provides alternative damage that authorised players can optionally disable.

… configs

  Fixed bug where shock module damaged authorised players despite biometric
  authorisation. Refactored force field damage system to prevent redundant
  damage (instant death + shock simultaneously) and provide granular control.

  Changes:
  - MFFSConfig.java: Split damage config into two separate options:
    - disableForceFieldInstantDeathForAuthorizedPlayers (renamed from disableForceFieldDamageForAuthorizedPlayers)
    - disableShockModuleDamageForAuthorizedPlayers (new)

  - ForceFieldBlockImpl.java: Fixed boolean logic bug where authorised players
    incorrectly took instant death damage

  - ShockModule.java: Added biometric authorisation checks and config support.
    Shock damage now only applies when instant death is disabled (acts as
    alternative damage). Authorised players can disable shock damage via config.
    Unauthorised players/mobs always take shock damage when instant death disabled.

  Behavior: Instant death and shock damage are now mutually exclusive. When
  instant death is enabled, only instant death applies. When disabled, shock
  module provides alternative damage that authorised players can optionally disable.
@Su5eD
Copy link
Member

Su5eD commented Dec 24, 2025

Do we ever want authorized players taking shock module damage? Since the purpose of the shock module is to keep intruders out.

ForceFieldBlockImpl.java: Fixed boolean logic bug where authorised players incorrectly took instant death damage

Also is there a reproduction for the bug this fixes? I tested field damage on authorized players while testing the previous PR and did not run into any issues

@Rassup
Copy link
Contributor Author

Rassup commented Dec 25, 2025

My logic for taking shock damage when authorised was based on immersion and optionality. For example, would you "take down the shield" to leave your base? Thus if you forget there is a damage penalty but can still walk through but at a consequence or needed to run through being chased for example. I have mine on a daylight sensor so it's up during the night - allows me to consequently take damage and get through but not instantly die as per previous versions.

Ultimately "Have shields YOUR way" 😸


ForceFieldBlockImpl.java change was based on the logic with the default config;

For an authorised player who was: Not creative, Not sneaking, default config = TRUE && TRUE && TRUE = TRUE

So It then followed that;

!(is player) = FALSE
(!creative && !authorized) = TRUE && FALSE = FALSE
(!sneaking && !walkthrough && !disableDamage) = TRUE && TRUE && TRUE = TRUE

Result: FALSE || FALSE || TRUE = TRUE (Damage applied).

So it happens when you have default config and are still required to sneak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants