Skip to content

Commit

Permalink
Helmets help in hail, and Alembic compat
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Jan 26, 2024
1 parent 08e852f commit f703767
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class Constants {
public static final TagKey<Block> SAFE_WITH_HAIL = TagKey.create(Registries.BLOCK, id("safe_with_hail"));
public static final TagKey<Block> SNOW_PASSTHROUGH = TagKey.create(Registries.BLOCK, id("snow_passthrough"));
public static final TagKey<EntityType<?>> DAMAGED_BY_HAIL = TagKey.create(Registries.ENTITY_TYPE, id("damaged_by_hail"));
public static final TagKey<EntityType<?>> IMMUNE_TO_HAIL = TagKey.create(Registries.ENTITY_TYPE, id("damaged_by_hail"));
public static final TagKey<EntityType<?>> IMMUNE_TO_HAIL = TagKey.create(Registries.ENTITY_TYPE, id("immune_to_hail"));

public static final ResourceKey<DamageType> HAIL_DAMAGE_TYPE = ResourceKey.create(Registries.DAMAGE_TYPE, id("hail"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import dev.lukebemish.tempest.impl.data.WeatherCategory;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.tags.EntityTypeTags;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
Expand Down Expand Up @@ -80,9 +81,9 @@ public abstract class LivingEntityMixin extends Entity {
if (!this.level().isClientSide()) {
if ((this.tickCount & 8) == 0 && status != null && status.category == WeatherCategory.HAIL) {
var source = new DamageSource(this.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(Constants.HAIL_DAMAGE_TYPE));
if (this.getType().is(Constants.DAMAGED_BY_HAIL)) {
if (this.getType().is(Constants.DAMAGED_BY_HAIL) || this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES)) {
this.hurt(source, status.intensity / 3);
} else if (!this.getType().is(Constants.IMMUNE_TO_HAIL)) {
} else if (!this.getType().is(Constants.IMMUNE_TO_HAIL) && !this.getType().is(EntityTypeTags.FREEZE_IMMUNE_ENTITY_TYPES)) {
this.hurt(source, 0);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"tempest:hail"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"tempest:hail"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"tempest:hail"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"tempest:hail"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"priority": 1,
"source_overrides": {
"tempest:hail": {
"physical_damage": 0.80,
"true_damage": 0.20
}
}
}

0 comments on commit f703767

Please sign in to comment.