-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: main
Are you sure you want to change the base?
Conversation
Acid is here: AlexsCaves/src/main/java/com/github/alexmodguy/alexscaves/server/block/AcidBlock.java Line 77 in ed44361
|
Thank you, line 62 was what I was looking for. That's where the check for the hazmat armor is. |
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))) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
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. |
fix AlexModGuy#1464 in upstream
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.