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

22 lines
1.0 KiB
Diff

--- ../src-base/minecraft/net/minecraft/advancements/PlayerAdvancements.java
+++ ../src-work/minecraft/net/minecraft/advancements/PlayerAdvancements.java
@@ -196,6 +196,9 @@
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();
@@ -214,6 +217,8 @@
{
this.field_192756_d.func_184103_al().func_148539_a(new TextComponentTranslation("chat.type.advancement." + p_192750_1_.func_192068_c().func_192291_d().func_192307_a(), new Object[] {this.field_192762_j.func_145748_c_(), p_192750_1_.func_193123_j()}));
}
+
+ net.minecraftforge.common.ForgeHooks.onAdvancement(this.field_192762_j, p_192750_1_);
}
}