Skip to content

Fix medical conditions' effects not working#4066

Open
screret wants to merge 73 commits intoGregTechCEu:1.20.1from
screret:sc/fix-medical-conditions
Open

Fix medical conditions' effects not working#4066
screret wants to merge 73 commits intoGregTechCEu:1.20.1from
screret:sc/fix-medical-conditions

Conversation

@screret
Copy link
Contributor

@screret screret commented Oct 12, 2025

What

  • Fixed medical conditions caused by holding hazardous materials (e.g. cancer from uranium) not updating correctly.
  • Added some much needed documentation to the system and made the /medical_condition query command's output nicer to read.
  • Rebalanced the medical conditions so their symptoms take longer to apply and aren't as drastic

I also chose to remove berylliosis and silicosis entirely, as they didn't actually do much and were just annoying to have around.

Implementation Details

  • MADE MEDICAL CONDITIONS USE AN ACTUAL REGISTRY INSTEAD OF A MAP
    • this shouldn't affect anyone too much, as I don't know anyone who actually used the system
  • Fixed invulnerability/hitstun/etc. breaking the death symptom
  • Fixed high levels of resistance being able to block medical condition damage (like death.)
  • Fixed the player's max health not updating until they take damage
  • Fixed the player's max breath (the air bubbles) not updating at all
  • Made the hazardous item tracker respect the held items' stack sizes and material amounts where they previvously didn't.
  • Renamed some methods' parameters to make more sense and added clarifying comments to them & others
  • Added separate lang keys for conditions affecting a player so the output of /medical_condition query makes sense. It now display something like this (1) instead of the previous (2)

new display

Player Dev has
Cancer for 10 minutes 5 seconds

old display

Player Dev has these medical conditions:
Condition Carcinogenic: 10 minutes 5 seconds

Outcome

  • Players' health and air is actually displayed as going down
  • Players get the intermediate symptoms instead of, say, randomly dying from cancer
  • People won't get blinded by methanol the instant they touch it
  • Cancer now takes much longer to do anything drastic, and after that, the effects take longer to reach their full potential

How Was This Tested

I wrote actual tests for a feature! (for once, lol)

I also tested this in game quite extensively, mostly by running /medical_condition apply @s gtceu:carcinogen <amount> over and over with different numbers in the 1-36000 range and observing what attributes changed & by how much with /attribute @s <attribute id> get.
I also tested some other conditions such as arsenicosis and CO poisoning, they also worked correctly.

Same was done for holding items by having a stack plutonium blocks in my inventory and tracking the cancer point gain with /medical_condition query and current symptoms with /medical_condition query symptoms.

Additional Information

Balance people should look over the tweaks at least a bit

Potential Compatibility Issues

The change to a "real" registry could make some people have issues but, as already mentioned, I don't know anyone who used the system.

screret added 25 commits October 2, 2025 16:05
most uses required the concrete class anyway
@screret screret requested a review from a team as a code owner October 12, 2025 15:38
jurrejelle
jurrejelle previously approved these changes Feb 8, 2026
@jurrejelle jurrejelle added type: refactor Suggestion to refactor a section of code Release: API - X.0.0 Major Breaking Refactors that MUST be in a API-Breaking Release labels Feb 8, 2026
@jurrejelle
Copy link
Contributor

declared 8.0.0

@screret screret changed the base branch from 1.20.1 to 1.20.1-v8.0.0 February 14, 2026 11:47
@screret screret changed the base branch from 1.20.1-v8.0.0 to 1.20.1 February 14, 2026 11:48
@screret screret dismissed jurrejelle’s stale review February 14, 2026 11:48

The base branch was changed.

@screret
Copy link
Contributor Author

screret commented Feb 14, 2026

I switched the base branch to 1.20.1-v8.0.0 because of the retarget and then discovered that the pipe model rework hasn't been merged to that, so I undid the base branch change.
Turns out doing that dismisses all reviews.

…tead of global game time

(spreads out the updating over multiple ticks instead of everything happening on the dot)
…eed if underwater with an aqua affinity helmet
…solute minimum threshold as it made the code a lot more convoluted
…s static factory methods instead so what they're for is slightly clearer
# Conflicts:
#	src/main/java/com/gregtechceu/gtceu/api/capability/GTCapabilityHelper.java
#	src/main/java/com/gregtechceu/gtceu/api/capability/forge/GTCapability.java
#	src/test/java/com/gregtechceu/gtceu/gametest/util/TestUtils.java
# Conflicts:
#	src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/properties/HazardProperty.java
#	src/main/java/com/gregtechceu/gtceu/common/CommonEventListener.java
#	src/main/java/com/gregtechceu/gtceu/common/machine/electric/AirScrubberMachine.java
#	src/test/java/com/gregtechceu/gtceu/gametest/util/TestUtils.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Release: API - X.0.0 Major Breaking Refactors that MUST be in a API-Breaking Release type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants