From 5d69293ec0463bb411c576bc3935d9bd2d2017fd Mon Sep 17 00:00:00 2001 From: doctor4t <25477005+doctor4t@users.noreply.github.com> Date: Mon, 23 May 2022 16:18:06 +0200 Subject: [PATCH] Fix hellfork and soulfork putting the user on fire even when blocked --- CHANGELOG.md | 4 ++++ gradle.properties | 2 +- .../impaled/common/entity/HellforkEntity.java | 10 +++++++--- .../impaled/common/entity/SoulforkEntity.java | 8 +++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8efe6bb..17f4767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Impaled - Changelog: +### Impaled 1.1.3 - 1.18.2 +- Fixed Hellfork and Soulforks setting targets on fire even if their shield were up +- Hellforks and Soulforks will now set targets on fire for 8 seconds instead of a random time between 4 and 8 seconds + ### Impaled 1.1.2 - 1.18.2 - Reduced mining fatigue given by the channeling elder trident to 10s diff --git a/gradle.properties b/gradle.properties index 63ca78b..f444c09 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ loader_version=0.13.3 fabric_version=0.48.0+1.18.2 # Mod Properties -mod_version = 1.1.2 +mod_version = 1.1.3 maven_group = io.github.ladysnake archives_base_name = impaled diff --git a/src/main/java/ladysnake/impaled/common/entity/HellforkEntity.java b/src/main/java/ladysnake/impaled/common/entity/HellforkEntity.java index 66afc27..2db680b 100644 --- a/src/main/java/ladysnake/impaled/common/entity/HellforkEntity.java +++ b/src/main/java/ladysnake/impaled/common/entity/HellforkEntity.java @@ -1,9 +1,13 @@ package ladysnake.impaled.common.entity; import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; import net.minecraft.particle.ParticleTypes; +import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; +import net.minecraft.util.hit.HitResult; import net.minecraft.world.World; +import net.minecraft.world.event.GameEvent; public class HellforkEntity extends ImpaledTridentEntity { public HellforkEntity(EntityType entityType, World world) { @@ -11,9 +15,9 @@ public HellforkEntity(EntityType entityType, World wor } @Override - protected void onEntityHit(EntityHitResult entityHitResult) { - super.onEntityHit(entityHitResult); - entityHitResult.getEntity().setOnFireFor(4 + this.world.getRandom().nextInt(4)); + protected void onHit(LivingEntity target) { + super.onHit(target); + target.setOnFireFor(8); } @Override diff --git a/src/main/java/ladysnake/impaled/common/entity/SoulforkEntity.java b/src/main/java/ladysnake/impaled/common/entity/SoulforkEntity.java index bd492d6..2277fd1 100644 --- a/src/main/java/ladysnake/impaled/common/entity/SoulforkEntity.java +++ b/src/main/java/ladysnake/impaled/common/entity/SoulforkEntity.java @@ -1,8 +1,10 @@ package ladysnake.impaled.common.entity; import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; import net.minecraft.particle.ParticleTypes; import net.minecraft.util.hit.EntityHitResult; +import net.minecraft.util.hit.HitResult; import net.minecraft.world.World; public class SoulforkEntity extends ImpaledTridentEntity { @@ -11,9 +13,9 @@ public SoulforkEntity(EntityType entityType, World wor } @Override - protected void onEntityHit(EntityHitResult entityHitResult) { - super.onEntityHit(entityHitResult); - entityHitResult.getEntity().setOnFireFor(4 + this.world.getRandom().nextInt(4)); + protected void onHit(LivingEntity target) { + super.onHit(target); + target.setOnFireFor(8); } @Override