From 759296db524a9d7a4f3a38e8401b24efb48f99ad Mon Sep 17 00:00:00 2001 From: PinkGoosik Date: Mon, 18 Nov 2024 17:33:34 +0500 Subject: [PATCH] update to 1.21.3 --- gradle.properties | 14 +++++++------- .../mixin/LivingEntityMixin.java | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gradle.properties b/gradle.properties index 00473e0..a4f8b3a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,20 +3,20 @@ org.gradle.jvmargs = -Xmx2G org.gradle.parallel = true # Mod Properties -mod_version = 0.3.1+1.21 +mod_version = 0.3.1+1.21.3 maven_group = ru.pinkgoosik archives_base_name = entity-health-display -minecraft_version_range = >=1.21 <1.21.2 +minecraft_version_range = >=1.21.3 <1.22 modrinth_id = 84H12Z4u # Dependencies | Check these on https://fabricmc.net/develop -minecraft_version = 1.21.1 -yarn_mappings = 1.21.1+build.3 +minecraft_version = 1.21.3 +yarn_mappings = 1.21.3+build.2 fabric_loader = 0.16.9 -fabric_api = 0.108.0+1.21.1 +fabric_api = 0.108.0+1.21.3 # https://github.com/Patbox/TextPlaceholderAPI/releases -placeholder_api = 2.4.1+1.21 +placeholder_api = 2.5.0+1.21.2 # https://github.com/Patbox/polymer/releases -polymer_version = 0.9.18+1.21.1 +polymer_version = 0.10.2+1.21.3 diff --git a/src/main/java/pinkgoosik/entityhealthdisplay/mixin/LivingEntityMixin.java b/src/main/java/pinkgoosik/entityhealthdisplay/mixin/LivingEntityMixin.java index b79d03f..6ffc7fc 100644 --- a/src/main/java/pinkgoosik/entityhealthdisplay/mixin/LivingEntityMixin.java +++ b/src/main/java/pinkgoosik/entityhealthdisplay/mixin/LivingEntityMixin.java @@ -35,8 +35,8 @@ public LivingEntityMixin(EntityType type, World world) { super(type, world); } - @Inject(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;applyDamage(Lnet/minecraft/entity/damage/DamageSource;F)V", shift = At.Shift.AFTER)) - void damage(DamageSource source, float amount, CallbackInfoReturnable cir) { + @Inject(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;applyDamage(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/damage/DamageSource;F)V", shift = At.Shift.AFTER)) + void damage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable cir) { summonHitDisplay(source, amount); this.updateHealthDisplay(); } @@ -50,7 +50,7 @@ void summonHitDisplay(DamageSource source, float amount) { LivingEntity entity = LivingEntity.class.cast(this); if (getWorld() instanceof ServerWorld world && HealthDisplayEvents.SHOULD_DISPLAY_HEALTH.invoker().shouldDisplay(entity, world)) { if (source.getAttacker() instanceof ServerPlayerEntity player) { - if (source.getType().equals(world.getRegistryManager().get(RegistryKeys.DAMAGE_TYPE).get(DamageTypes.ARROW))) { + if (source.getType().equals(world.getRegistryManager().getOrThrow(RegistryKeys.DAMAGE_TYPE).get(DamageTypes.ARROW))) { Text text = HealthDisplayEvents.FORMAT_HIT_DISPLAY.invoker().getText(entity, world, source, amount); if (!text.getString().isBlank()) { player.networkHandler.sendPacket(new TitleS2CPacket(Text.of("")));