Skip to content

Conversation

@PikachuGabe
Copy link

@PikachuGabe PikachuGabe commented Dec 23, 2024

For the sake of compatibility, I have edited how radiation works to allow armor resistance to be done using a tag instead of an item ID. Acid behaves the same and radiation still functions the same. The tag is applied to the hazmat suit by default. Acid does not have a resistance tag because I couldn't figure out where the code that gives the hazmat suit resistance is.

When this gets merged, feel free to revert the change to the build.gradle file. I did that since I made an upload to CF, which I will archive if this gets merged, and if I didn't change the name, it would've broken some addons.

@VoidLeech
Copy link

Acid is here:

hurtSound = entity.hurt(ACDamageTypes.causeAcidDamage(level.registryAccess()), dmgMultiplier * (float) (armor ? 0.01D : 1.0D) + golemAddition);

@PikachuGabe
Copy link
Author

Thank you, line 62 was what I was looking for. That's where the check for the hazmat armor is.

@PikachuGabe PikachuGabe changed the title Rad resistance tag Rad & acid resistance tags Dec 25, 2024
@PikachuGabe
Copy link
Author

I ran some tests on the new way the radiation and acid protection is handled in these commits and there are no issues I can find. Applying the tags with KubeJS showed no issues with applying the resistances. Removing the tags showed no issues properly removing the resistances. Items, blocks, fluids and mobs do not change their behavior as a result of this.

Updates naming of tags and shit to make more sense.
@PikachuGabe
Copy link
Author

There, that should be better. I made sure to search through the project to double check that nothing was using an old variable name so the changes don't break stuff.

@PikachuGabe
Copy link
Author

I don't know how to draft PRs but its almost 3 am and i do not have the brain power to figure out how this weird properties system works and how to convert it to using tags or something else that anyone can edit.

gotta remember what they mean, after all
hopefully i actually use these
hopefully this works, i don't usually contain tags inside a tag
I don't know if I need to create this tag since nothing uses it, but the registry is black magic to me so better safe than sorry.
god interpreting these into radiation values is going to be a pain probably...
Might be better to reference the block tag instead of each block, but IMO the more configurability, the better.
@PikachuGabe
Copy link
Author

All that's left to allow giving blocks and items radioactivity through tags is RadioactiveBlockItem, RadioactiveOnDestroyedBlockItem and RadioactiveItem. I don't know how they work yet, so that might take a while.

@PikachuGabe
Copy link
Author

All that's left to implement is the functionality of RadioactiveOnDestroyedBlockItem using tags. Unfortunately I need to do something different from the other two since my idea, which is attached, didn't work.
BlockMixin.txt
It isn't valid for injecting due to using different parameters than what it's injecting into, and using the proper parameters breaks the rest of the code.

That change was only needed for my curseforge upload. Now that this is complete I can revert it for when this is merged into Alex's Caves.
@PikachuGabe
Copy link
Author

All that's left to implement is the functionality of RadioactiveOnDestroyedBlockItem using tags. Unfortunately I need to do something different from the other two since my idea, which is attached, didn't work. BlockMixin.txt It isn't valid for injecting due to using different parameters than what it's injecting into, and using the proper parameters breaks the rest of the code.

It looks like I got this to work but I honestly have no clue because I'm not sure how it works originally.

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