Skip to content

Commit d480ae5

Browse files
committed
Merge pull request MinecraftForge#2378 from blay09/bugfix/slotdrop
Fix items being dropped through slots outside GUI boundaries
2 parents bce7c6d + 30ac80f commit d480ae5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

patches/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java.patch

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,28 @@
3030
this.func_175175_a(i, j, textureatlassprite, 16, 16);
3131
GlStateManager.func_179145_e();
3232
flag1 = true;
33-
@@ -463,6 +465,7 @@
33+
@@ -326,6 +328,7 @@
34+
int j = this.field_147003_i;
35+
int k = this.field_147009_r;
36+
boolean flag1 = p_73864_1_ < j || p_73864_2_ < k || p_73864_1_ >= j + this.field_146999_f || p_73864_2_ >= k + this.field_147000_g;
37+
+ if (slot != null) flag1 = false; // Forge, prevent dropping of items through slots outside of GUI boundaries
38+
int l = -1;
39+
40+
if (slot != null)
41+
@@ -463,10 +466,12 @@
3442

3543
protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_)
3644
{
3745
+ super.func_146286_b(p_146286_1_, p_146286_2_, p_146286_3_); //Forge, Call parent to release buttons
3846
Slot slot = this.func_146975_c(p_146286_1_, p_146286_2_);
3947
int i = this.field_147003_i;
4048
int j = this.field_147009_r;
41-
@@ -685,4 +688,16 @@
49+
boolean flag = p_146286_1_ < i || p_146286_2_ < j || p_146286_1_ >= i + this.field_146999_f || p_146286_2_ >= j + this.field_147000_g;
50+
+ if (slot != null) flag = false; // Forge, prevent dropping of items through slots outside of GUI boundaries
51+
int k = -1;
52+
53+
if (slot != null)
54+
@@ -685,4 +690,16 @@
4255
this.field_146297_k.field_71439_g.func_71053_j();
4356
}
4457
}

0 commit comments

Comments
 (0)