Fix #2717 Pick block hotkey not working in inventories

This commit is contained in:
mezz 2016-04-05 18:25:25 -07:00
parent b9d18a263c
commit 7587ca7c71
2 changed files with 13 additions and 5 deletions

View file

@ -35,7 +35,7 @@
{ {
super.func_73864_a(p_73864_1_, p_73864_2_, p_73864_3_); super.func_73864_a(p_73864_1_, p_73864_2_, p_73864_3_);
- boolean flag = p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100; - boolean flag = p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100;
+ boolean flag = this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ + 100); + boolean flag = this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ - 100);
Slot slot = this.func_146975_c(p_73864_1_, p_73864_2_); Slot slot = this.func_146975_c(p_73864_1_, p_73864_2_);
long i = Minecraft.func_71386_F(); long i = Minecraft.func_71386_F();
this.field_146993_M = this.field_146998_K == slot && i - this.field_146997_J < 250L && this.field_146992_L == p_73864_3_; this.field_146993_M = this.field_146998_K == slot && i - this.field_146997_J < 250L && this.field_146992_L == p_73864_3_;
@ -52,7 +52,7 @@
if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o() == null) if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o() == null)
{ {
- if (p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100) - if (p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100)
+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ + 100)) + if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ - 100))
{ {
this.func_184098_a(slot, l, p_73864_3_, ClickType.CLONE); this.func_184098_a(slot, l, p_73864_3_, ClickType.CLONE);
} }
@ -61,7 +61,7 @@
this.field_146987_F = 1; this.field_146987_F = 1;
} }
- else if (p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100) - else if (p_73864_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100)
+ else if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ + 100)) + else if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_73864_3_ - 100))
{ {
this.field_146987_F = 2; this.field_146987_F = 2;
} }
@ -78,6 +78,15 @@
int k = -1; int k = -1;
if (slot != null) if (slot != null)
@@ -575,7 +580,7 @@
}
else if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o() != null)
{
- if (p_146286_3_ == this.field_146297_k.field_71474_y.field_74322_I.func_151463_i() + 100)
+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(p_146286_3_ - 100))
{
this.func_184098_a(slot, k, p_146286_3_, ClickType.CLONE);
}
@@ -627,7 +632,7 @@ @@ -627,7 +632,7 @@
protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException

View file

@ -42,7 +42,7 @@
} }
for (SoundCategory soundcategory : SoundCategory.values()) for (SoundCategory soundcategory : SoundCategory.values())
@@ -1184,4 +1189,25 @@ @@ -1184,4 +1189,24 @@
return p_148264_1_; return p_148264_1_;
} }
} }
@ -58,7 +58,6 @@
+ field_74311_E.setKeyConflictContext(inGame); + field_74311_E.setKeyConflictContext(inGame);
+ field_151444_V.setKeyConflictContext(inGame); + field_151444_V.setKeyConflictContext(inGame);
+ field_74312_F.setKeyConflictContext(inGame); + field_74312_F.setKeyConflictContext(inGame);
+ field_74322_I.setKeyConflictContext(inGame);
+ field_74310_D.setKeyConflictContext(inGame); + field_74310_D.setKeyConflictContext(inGame);
+ field_74321_H.setKeyConflictContext(inGame); + field_74321_H.setKeyConflictContext(inGame);
+ field_74323_J.setKeyConflictContext(inGame); + field_74323_J.setKeyConflictContext(inGame);