-
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?
Changes from 4 commits
c40c4af
f77c890
e9d68cf
64db89d
a54d951
65b6eb2
d0fd19b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package com.github.alexmodguy.alexscaves.server.item; | ||
|
||
import com.github.alexmodguy.alexscaves.AlexsCaves; | ||
import com.github.alexmodguy.alexscaves.server.misc.ACTagRegistry; | ||
import com.github.alexmodguy.alexscaves.client.particle.ACParticleRegistry; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.EquipmentSlot; | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This should be renamed to be specific to radiation. |
||
int i = 0; | ||
if (entity.getItemBySlot(EquipmentSlot.HEAD).is(ACItemRegistry.HAZMAT_MASK.get())) { | ||
if (entity.getItemBySlot(EquipmentSlot.HEAD).is(ACTagRegistry.HAZMAT_PROT)) { | ||
i++; | ||
} | ||
if (entity.getItemBySlot(EquipmentSlot.CHEST).is(ACItemRegistry.HAZMAT_CHESTPLATE.get())) { | ||
if (entity.getItemBySlot(EquipmentSlot.CHEST).is(ACTagRegistry.HAZMAT_PROT)) { | ||
i++; | ||
} | ||
if (entity.getItemBySlot(EquipmentSlot.LEGS).is(ACItemRegistry.HAZMAT_LEGGINGS.get())) { | ||
if (entity.getItemBySlot(EquipmentSlot.LEGS).is(ACTagRegistry.HAZMAT_PROT)) { | ||
i++; | ||
} | ||
if (entity.getItemBySlot(EquipmentSlot.FEET).is(ACItemRegistry.HAZMAT_BOOTS.get())) { | ||
if (entity.getItemBySlot(EquipmentSlot.FEET).is(ACTagRegistry.HAZMAT_PROT)) { | ||
i++; | ||
} | ||
return i; | ||
} | ||
|
||
public static int getAcidAmount(LivingEntity entity) { | ||
int i = 0; | ||
if (entity.getItemBySlot(EquipmentSlot.HEAD).is(ACTagRegistry.ACID_PROT)) { | ||
i++; | ||
} | ||
if (entity.getItemBySlot(EquipmentSlot.CHEST).is(ACTagRegistry.ACID_PROT)) { | ||
i++; | ||
} | ||
if (entity.getItemBySlot(EquipmentSlot.LEGS).is(ACTagRegistry.ACID_PROT)) { | ||
i++; | ||
} | ||
if (entity.getItemBySlot(EquipmentSlot.FEET).is(ACTagRegistry.ACID_PROT)) { | ||
i++; | ||
} | ||
return i; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
public static final TagKey<Item> ACID_PROT = registerItemTag("acid_prot"); | ||
|
||
private static TagKey<EntityType<?>> registerEntityTag(String name) { | ||
return TagKey.create(Registries.ENTITY_TYPE, new ResourceLocation(AlexsCaves.MODID, name)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"values": [ | ||
"alexscaves:hazmat_mask", | ||
"alexscaves:hazmat_chestplate", | ||
"alexscaves:hazmat_leggings", | ||
"alexscaves:hazmat_boots" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"values": [ | ||
"alexscaves:hazmat_mask", | ||
"alexscaves:hazmat_chestplate", | ||
"alexscaves:hazmat_leggings", | ||
"alexscaves:hazmat_boots" | ||
] | ||
} |
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