@@ -65,6 +65,9 @@ public class GuiCreativeInventory extends GuiBasicInventory
65
65
private static int tabPage = 0 ;
66
66
private int maxPages = 0 ;
67
67
68
+ protected GuiButton buttonPrevPage ;
69
+ protected GuiButton buttonNextPage ;
70
+
68
71
// PIAPI
69
72
70
73
public static int windowWidth = 195 ;
@@ -127,6 +130,9 @@ public void updateScreen()
127
130
{
128
131
this .mc .displayGuiScreen (new GuiSurvivalInventory (this .player , (ContainerInventory ) this .player .inventoryContainer ));
129
132
}
133
+
134
+ this .buttonPrevPage .enabled = tabPage > 0 ;
135
+ this .buttonNextPage .enabled = tabPage < this .maxPages ;
130
136
}
131
137
132
138
@ Override
@@ -157,8 +163,8 @@ public void initGui()
157
163
int tabCount = CreativeTabs .creativeTabArray .length ;
158
164
if (tabCount > 12 )
159
165
{
160
- this .buttonList .add (new GuiButton (101 , this .guiLeft , this .guiTop - 50 , 20 , 20 , "<" ));
161
- this .buttonList .add (new GuiButton (102 , this .guiLeft + this .xSize - 20 , this .guiTop - 50 , 20 , 20 , ">" ));
166
+ this .buttonList .add (this . buttonPrevPage = new GuiButton (0 , this .guiLeft , this .guiTop - 50 , 20 , 20 , "<" ));
167
+ this .buttonList .add (this . buttonNextPage = new GuiButton (1 , this .guiLeft + this .xSize - 20 , this .guiTop - 50 , 20 , 20 , ">" ));
162
168
this .maxPages = (tabCount - 12 ) / 10 + 1 ;
163
169
}
164
170
}
@@ -397,7 +403,8 @@ public void drawScreen(int mouseX, int mouseY, float partialTickTime)
397
403
{
398
404
s = "Clear Inventory" ;
399
405
}
400
- else {
406
+ else
407
+ {
401
408
s = I18n .getString ("inventory.binSlot" );
402
409
}
403
410
this .drawCreativeTabHoveringText (s , mouseX , mouseY );
@@ -645,7 +652,7 @@ protected void renderToolTip(ItemStack stack, int x, int y)
645
652
list .set (0 , stack .getRarity ().rarityColor + list .get (0 ));
646
653
for (int k = 1 ; k < list .size (); ++k )
647
654
{
648
- list .set (k , EnumChatFormatting .GRAY + list .get (k ));
655
+ list .set (k , EnumChatFormatting .GRAY + list .get (k ));
649
656
}
650
657
651
658
FontRenderer font = stack .getItem ().getFontRenderer (stack );
@@ -1024,24 +1031,13 @@ public void actionPerformed(GuiButton button)
1024
1031
1025
1032
if (button .id == 0 )
1026
1033
{
1027
- this .mc .displayGuiScreen (new GuiAchievements (this , this .mc .thePlayer .getStatFileWriter ()));
1034
+ if (tabPage > 0 )
1035
+ tabPage --;
1028
1036
}
1029
-
1030
- if (button .id == 1 )
1037
+ else if (button .id == 1 )
1031
1038
{
1032
- this .mc .displayGuiScreen (new GuiStats (this , this .mc .thePlayer .getStatFileWriter ()));
1033
- }
1034
-
1035
- if (button .id == 101 )
1036
- {
1037
- tabPage = Math .max (tabPage - 1 , 0 );
1038
- }
1039
- else
1040
- {
1041
- if (button .id == 102 )
1042
- {
1043
- tabPage = Math .min (tabPage + 1 , this .maxPages );
1044
- }
1039
+ if (tabPage < this .maxPages )
1040
+ tabPage ++;
1045
1041
}
1046
1042
}
1047
1043
0 commit comments