ForgePatch/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch

31 lines
1.6 KiB
Diff

--- a/net/minecraft/advancements/PlayerAdvancements.java
+++ b/net/minecraft/advancements/PlayerAdvancements.java
@@ -159,6 +159,10 @@
}
this.func_240920_c_(p_240921_1_);
+
+ if (net.minecraftforge.common.ForgeConfig.SERVER.fixAdvancementLoading.get())
+ net.minecraftforge.common.AdvancementLoadFix.loadVisibility(this, this.field_192759_g, this.field_192760_h, this.field_192758_f, this.field_192761_i, this::func_192738_c);
+ else
this.func_192752_d();
this.func_240919_b_(p_240921_1_);
}
@@ -192,6 +196,8 @@
}
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
+ // Forge: don't grant advancements for fake players
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
boolean flag = false;
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
boolean flag1 = advancementprogress.func_192105_a();
@@ -204,6 +210,7 @@
if (p_192750_1_.func_192068_c() != null && p_192750_1_.func_192068_c().func_193220_i() && this.field_192762_j.field_70170_p.func_82736_K().func_223586_b(GameRules.field_223620_w)) {
this.field_240917_e_.func_232641_a_(new TranslationTextComponent("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()), ChatType.SYSTEM, Util.field_240973_b_);
}
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
}
}