Skip to content

Commit 96c47b1

Browse files
MukjepScarletWide-Cat
authored andcommitted
Remove usage of java.util.Stack
1 parent 9ce8727 commit 96c47b1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/java/meteordevelopment/meteorclient/gui/renderer/GuiRenderer.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package meteordevelopment.meteorclient.gui.renderer;
77

8+
import it.unimi.dsi.fastutil.Stack;
9+
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
810
import meteordevelopment.meteorclient.MeteorClient;
911
import meteordevelopment.meteorclient.gui.GuiTheme;
1012
import meteordevelopment.meteorclient.gui.renderer.operations.TextOperation;
@@ -22,9 +24,7 @@
2224
import net.minecraft.util.Identifier;
2325
import net.minecraft.util.math.MathHelper;
2426

25-
import java.util.ArrayList;
2627
import java.util.List;
27-
import java.util.Stack;
2828

2929
import static meteordevelopment.meteorclient.MeteorClient.mc;
3030
import 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

Comments
 (0)