Skip to content

Commit

Permalink
update to 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Nov 18, 2024
1 parent b6a7dd7 commit 759296d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean> 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<Boolean> cir) {
summonHitDisplay(source, amount);
this.updateHealthDisplay();
}
Expand All @@ -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("")));
Expand Down

0 comments on commit 759296d

Please sign in to comment.