From 96880271ab7b4bc7acb418ab8b484df65d0b74bb Mon Sep 17 00:00:00 2001 From: Mgazul Date: Mon, 11 Sep 2023 21:45:26 +0800 Subject: [PATCH] Fix the_vault mod compatibility --- .../minecraft/entity/LivingEntity.java.patch | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch b/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch index 87d4340cf2..36e570206e 100644 --- a/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/LivingEntity.java.patch @@ -867,7 +867,7 @@ this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F); } -@@ -1404,20 +_,27 @@ +@@ -1404,15 +_,21 @@ protected void func_184590_k(float p_184590_1_) { } @@ -891,13 +891,29 @@ protected float func_70672_c(DamageSource p_70672_1_, float p_70672_2_) { if (p_70672_1_.func_151517_h()) { return p_70672_2_; - } else { -- if (this.func_70644_a(Effects.field_76429_m) && p_70672_1_ != DamageSource.field_76380_i) { -+ // CraftBukkit - Moved to damageEntity0(DamageSource, float) -+ if (false && this.func_70644_a(Effects.field_76429_m) && p_70672_1_ != DamageSource.field_76380_i) { - int i = (this.func_70660_b(Effects.field_76429_m).func_76458_c() + 1) * 5; +@@ -1422,15 +_,18 @@ int j = 25 - i; float f = p_70672_2_ * (float)j; + float f1 = p_70672_2_; +- p_70672_2_ = Math.max(f / 25.0F, 0.0F); ++ float mixin = Math.max(f / 25.0F, 0.0F); ++ // CraftBukkit - Moved to damageEntity0(DamageSource, float) ++ /* + float f2 = f1 - p_70672_2_; + if (f2 > 0.0F && f2 < 3.4028235E37F) { + if (this instanceof ServerPlayerEntity) { +- ((ServerPlayerEntity)this).func_195067_a(Stats.field_212739_K, Math.round(f2 * 10.0F)); +- } else if (p_70672_1_.func_76346_g() instanceof ServerPlayerEntity) { +- ((ServerPlayerEntity)p_70672_1_.func_76346_g()).func_195067_a(Stats.field_212736_G, Math.round(f2 * 10.0F)); ++ ((ServerPlayerEntity)this).awardStat(Stats.DAMAGE_RESISTED, Math.round(f2 * 10.0F)); ++ } else if (p_70672_1_.getEntity() instanceof ServerPlayerEntity) { ++ ((ServerPlayerEntity)p_70672_1_.getEntity()).awardStat(Stats.DAMAGE_DEALT_RESISTED, Math.round(f2 * 10.0F)); + } + } ++ */ + } + + if (p_70672_2_ <= 0.0F) { @@ -1447,23 +_,140 @@ }