Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rad & acid resistance tags #1470

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

PikachuGabe
Copy link

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.

@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.

@@ -59,15 +59,15 @@ public void entityInside(BlockState blockState, Level level, BlockPos pos, Entit
for (EquipmentSlot slot : EquipmentSlot.values()) {
if (slot.isArmor()) {
ItemStack item = living.getItemBySlot(slot);
if (item != null && item.isDamageableItem() && !(item.getItem() instanceof HazmatArmorItem)) {
if (item != null && item.isDamageableItem() && !(living.getItemBySlot(slot).is(ACTagRegistry.ACID_PROT))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use item instead of calling living.getItemBySlot again

@@ -52,16 +53,33 @@ public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot

public static int getWornAmount(LivingEntity entity) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be renamed to be specific to radiation.

@@ -93,6 +93,8 @@ public class ACTagRegistry {
public static final TagKey<Structure> GINGERBREAD_MEN_WANDER_THROUGH = registerStructureTag("gingerbread_men_wander_through");
public static final TagKey<DamageType> DEEP_ONE_IGNORES = registerDamageTypeTag("deep_one_ignores");
public static final TagKey<Fluid> DOES_NOT_FLOW_INTO_WATERLOGGABLE_BLOCKS = registerFluidTag("does_not_flow_into_waterloggable_blocks");
public static final TagKey<Item> HAZMAT_PROT = registerItemTag("hazmat_prot");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering hazmat is just any hazardous material and you're only using it for radiation, this should have a more specific name than hazmat.
Also I think these tags should have full names such as acid_protective_armor.

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.

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