Fix misaligned patch causing LivingEquipmentChangeEvent to never be posted.

This commit is contained in:
David Quintana 2020-07-08 11:01:46 +02:00
parent fc3fa13bf3
commit 2a2306d6e1
2 changed files with 17 additions and 20 deletions

View file

@ -28,11 +28,9 @@
RenderType rendertype = RenderTypeLookup.func_239219_a_(p_229111_1_, flag1);
IVertexBuilder ivertexbuilder;
if (p_229111_1_.func_77973_b() == Items.field_151111_aL && p_229111_1_.func_77962_s()) {
@@ -129,10 +130,10 @@
} else {
ivertexbuilder = func_229113_a_(p_229111_5_, rendertype, true, p_229111_1_.func_77962_s());
@@ -131,8 +132,9 @@
}
-
this.func_229114_a_(p_229111_8_, p_229111_1_, p_229111_6_, p_229111_7_, p_229111_4_, ivertexbuilder);
+ }
} else {
@ -41,7 +39,7 @@
}
p_229111_4_.func_227865_b_();
@@ -172,7 +173,7 @@
@@ -172,7 +174,7 @@
float f = (float)(i >> 16 & 255) / 255.0F;
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
@ -50,7 +48,7 @@
}
}
@@ -263,6 +264,7 @@
@@ -263,6 +265,7 @@
crashreportcategory.func_189529_a("Item Type", () -> {
return String.valueOf((Object)p_239387_2_.func_77973_b());
});
@ -58,7 +56,7 @@
crashreportcategory.func_189529_a("Item Damage", () -> {
return String.valueOf(p_239387_2_.func_77952_i());
});
@@ -294,18 +296,16 @@
@@ -294,18 +297,16 @@
irendertypebuffer$impl.func_228461_a_();
}
@ -81,7 +79,7 @@
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
RenderSystem.enableBlend();
@@ -343,4 +343,9 @@
@@ -343,4 +344,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175059_m.func_178085_b();
}

View file

@ -352,16 +352,15 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -2230,6 +2264,8 @@
@@ -2230,6 +2264,7 @@
ItemStack itemstack1 = this.func_184582_a(equipmentslottype);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
+ if (!itemstack1.equals(itemstack1, true))
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent(this, equipmentslottype, itemstack, itemstack1));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent(this, equipmentslottype, itemstack, itemstack1));
if (map == null) {
map = Maps.newEnumMap(EquipmentSlotType.class);
}
@@ -2658,8 +2694,16 @@
@@ -2658,8 +2693,16 @@
private void func_184608_ct() {
if (this.func_184587_cr()) {
@ -380,7 +379,7 @@
this.field_184627_bm.func_222121_b(this.field_70170_p, this, this.func_184605_cv());
if (this.func_226299_p_()) {
this.func_226293_b_(this.field_184627_bm, 5);
@@ -2707,8 +2751,10 @@
@@ -2707,8 +2750,10 @@
public void func_184598_c(Hand p_184598_1_) {
ItemStack itemstack = this.func_184586_b(p_184598_1_);
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
@ -392,7 +391,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_204802_c(1, true);
this.func_204802_c(2, p_184598_1_ == Hand.OFF_HAND);
@@ -2768,6 +2814,9 @@
@@ -2768,6 +2813,9 @@
vector3d1 = vector3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vector3d1 = vector3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vector3d1 = vector3d1.func_72441_c(this.func_226277_ct_(), this.func_226280_cw_(), this.func_226281_cx_());
@ -402,7 +401,7 @@
this.field_70170_p.func_195594_a(new ItemParticleData(ParticleTypes.field_197591_B, p_195062_1_), vector3d1.field_72450_a, vector3d1.field_72448_b, vector3d1.field_72449_c, vector3d.field_72450_a, vector3d.field_72448_b + 0.05D, vector3d.field_72449_c);
}
@@ -2779,7 +2828,9 @@
@@ -2779,7 +2827,9 @@
} else {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_226293_b_(this.field_184627_bm, 16);
@ -413,7 +412,7 @@
this.func_184602_cy();
}
@@ -2800,7 +2851,11 @@
@@ -2800,7 +2850,11 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@ -425,7 +424,7 @@
if (this.field_184627_bm.func_222122_m()) {
this.func_184608_ct();
}
@@ -2949,8 +3004,8 @@
@@ -2949,8 +3003,8 @@
}
BlockState blockstate = this.field_70170_p.func_180495_p(p_213342_1_);
@ -436,7 +435,7 @@
}
this.func_213301_b(Pose.SLEEPING);
@@ -2966,15 +3021,15 @@
@@ -2966,15 +3020,15 @@
private boolean func_213359_p() {
return this.func_213374_dv().map((p_241350_1_) -> {
@ -455,7 +454,7 @@
Vector3d vector3d1 = BedBlock.func_220172_a(this.func_200600_R(), this.field_70170_p, p_241348_1_, 0).orElseGet(() -> {
BlockPos blockpos = p_241348_1_.func_177984_a();
return new Vector3d((double)blockpos.func_177958_n() + 0.5D, (double)blockpos.func_177956_o() + 0.1D, (double)blockpos.func_177952_p() + 0.5D);
@@ -2993,7 +3048,9 @@
@@ -2993,7 +3047,9 @@
@OnlyIn(Dist.CLIENT)
public Direction func_213376_dz() {
BlockPos blockpos = this.func_213374_dv().orElse((BlockPos)null);
@ -466,7 +465,7 @@
}
public boolean func_70094_T() {
@@ -3062,4 +3119,58 @@
@@ -3062,4 +3118,58 @@
public void func_213334_d(Hand p_213334_1_) {
this.func_213361_c(p_213334_1_ == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND);
}