55
66package meteordevelopment .meteorclient .gui .renderer ;
77
8+ import it .unimi .dsi .fastutil .Stack ;
9+ import it .unimi .dsi .fastutil .objects .ObjectArrayList ;
810import meteordevelopment .meteorclient .MeteorClient ;
911import meteordevelopment .meteorclient .gui .GuiTheme ;
1012import meteordevelopment .meteorclient .gui .renderer .operations .TextOperation ;
2224import net .minecraft .util .Identifier ;
2325import net .minecraft .util .math .MathHelper ;
2426
25- import java .util .ArrayList ;
2627import java .util .List ;
27- import java .util .Stack ;
2828
2929import static meteordevelopment .meteorclient .MeteorClient .mc ;
3030import static meteordevelopment .meteorclient .utils .Utils .getWindowHeight ;
@@ -49,12 +49,12 @@ public class GuiRenderer {
4949 private final Renderer2D rTex = new Renderer2D (true );
5050
5151 private final Pool <Scissor > scissorPool = new Pool <>(Scissor ::new );
52- private final Stack <Scissor > scissorStack = new Stack <>();
52+ private final Stack <Scissor > scissorStack = new ObjectArrayList <>();
5353
5454 private final Pool <TextOperation > textPool = new Pool <>(TextOperation ::new );
55- private final List <TextOperation > texts = new ArrayList <>();
55+ private final List <TextOperation > texts = new ObjectArrayList <>();
5656
57- private final List <Runnable > postTasks = new ArrayList <>();
57+ private final List <Runnable > postTasks = new ObjectArrayList <>();
5858
5959 public String tooltip , lastTooltip ;
6060 public WWidget tooltipWidget ;
@@ -141,7 +141,7 @@ public void endRender(Scissor scissor) {
141141
142142 public void scissorStart (double x , double y , double width , double height ) {
143143 if (!scissorStack .isEmpty ()) {
144- Scissor parent = scissorStack .peek ();
144+ Scissor parent = scissorStack .top ();
145145
146146 if (x < parent .x ) x = parent .x ;
147147 else if (x + width > parent .x + parent .width ) width -= (x + width ) - (parent .x + parent .width );
@@ -253,7 +253,7 @@ public void texture(double x, double y, double width, double height, double rota
253253 }
254254
255255 public void post (Runnable task ) {
256- scissorStack .peek ().postTasks .add (task );
256+ scissorStack .top ().postTasks .add (task );
257257 }
258258
259259 public void item (ItemStack itemStack , int x , int y , float scale , boolean overlay ) {
0 commit comments