Skip to content

Commit 2961c0e

Browse files
committed
26.1 only.
1 parent 0b0b8e6 commit 2961c0e

67 files changed

Lines changed: 663 additions & 2436 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modstitch.ct

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@ accessWidener v1 named
22

33
extendable method net/minecraft/client/gui/components/AbstractSelectionList children ()Ljava/util/List;
44
extendable method net/minecraft/client/gui/components/AbstractSelectionList getEntryAtPosition (DD)Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry;
5-
accessible class net/minecraft/client/gui/components/AbstractSelectionList$Entry
65
accessible method net/minecraft/client/gui/components/tabs/TabNavigationBar <init> (ILnet/minecraft/client/gui/components/tabs/TabManager;Ljava/lang/Iterable;)V
76
accessible method net/minecraft/client/gui/components/Tooltip <init> (Lnet/minecraft/network/chat/Component;Lnet/minecraft/network/chat/Component;)V
8-
9-
# CompositeStateBuilders got protected in 1.21.5. You need them for creating `RenderType`s.
10-
accessible method net/minecraft/client/renderer/RenderType$CompositeState$CompositeStateBuilder setTextureState (Lnet/minecraft/client/renderer/RenderStateShard$EmptyTextureStateShard;)Lnet/minecraft/client/renderer/RenderType$CompositeState$CompositeStateBuilder;
11-
accessible method net/minecraft/client/renderer/RenderType$CompositeState$CompositeStateBuilder createCompositeState (Z)Lnet/minecraft/client/renderer/RenderType$CompositeState;
12-
13-
accessible class net/minecraft/client/gui/GuiGraphics$ScissorStack
14-
accessible method net/minecraft/client/gui/GuiGraphics$ScissorStack peek ()Lnet/minecraft/client/gui/navigation/ScreenRectangle;
7+
accessible class net/minecraft/client/gui/components/AbstractSelectionList$Entry
8+
accessible class net/minecraft/client/gui/GuiGraphicsExtractor$ScissorStack
9+
accessible method net/minecraft/client/gui/GuiGraphicsExtractor$ScissorStack peek ()Lnet/minecraft/client/gui/navigation/ScreenRectangle;

settings.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ stonecutter {
2323
}
2424
}
2525

26-
mc("26.1.0", loaders = listOf("fabric"))
27-
mc("1.21.11", loaders = listOf("fabric", "neoforge"))
28-
mc("1.21.10", loaders = listOf("fabric", "neoforge"))
29-
mc("1.21.6", loaders = listOf("fabric", "neoforge"))
30-
mc("1.21.5", loaders = listOf("fabric", "neoforge"))
31-
mc("1.21.4", loaders = listOf("fabric", "neoforge"))
32-
mc("1.21.3", loaders = listOf("fabric", "neoforge"))
33-
mc("1.21.1", loaders = listOf("fabric", "neoforge"))
26+
mc("26.1", loaders = listOf("fabric"))
3427
}
3528
}
3629
rootProject.name = "YetAnotherConfigLib"

src/main/java/dev/isxander/yacl3/gui/AbstractWidget.java

Lines changed: 15 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22

33
import dev.isxander.yacl3.api.utils.Dimension;
44
import dev.isxander.yacl3.gui.render.ColorGradientRenderState;
5-
import dev.isxander.yacl3.gui.utils.YACLRenderHelper;
5+
import dev.isxander.yacl3.gui.utils.GuiUtils;
66
import net.minecraft.client.Minecraft;
77
import net.minecraft.client.gui.Font;
8-
import net.minecraft.client.gui.GuiGraphics;
8+
import net.minecraft.client.gui.GuiGraphicsExtractor;
99
import net.minecraft.client.gui.components.Renderable;
1010
import net.minecraft.client.gui.components.events.GuiEventListener;
1111
import net.minecraft.client.gui.narration.NarratableEntry;
1212
import net.minecraft.client.gui.narration.NarrationElementOutput;
13+
import net.minecraft.client.input.CharacterEvent;
14+
import net.minecraft.client.input.KeyEvent;
15+
import net.minecraft.client.input.MouseButtonEvent;
16+
import net.minecraft.client.renderer.RenderPipelines;
1317
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
1418
import net.minecraft.sounds.SoundEvents;
1519

1620
import java.awt.Color;
1721

18-
//? if >=1.21.9 {
19-
import net.minecraft.client.input.CharacterEvent;
20-
import net.minecraft.client.input.KeyEvent;
21-
import net.minecraft.client.input.MouseButtonEvent;
22-
//?}
23-
2422
public abstract class AbstractWidget implements GuiEventListener, Renderable, NarratableEntry {
2523
protected final Minecraft client = Minecraft.getInstance();
2624
protected final Font textRenderer = client.font;
@@ -68,7 +66,7 @@ public void updateNarration(NarrationElementOutput builder) {
6866

6967
}
7068

71-
protected void drawButtonRect(GuiGraphics graphics, int x1, int y1, int x2, int y2, boolean hovered, boolean enabled) {
69+
protected void drawButtonRect(GuiGraphicsExtractor graphics, int x1, int y1, int x2, int y2, boolean hovered, boolean enabled) {
7270
if (x1 > x2) {
7371
int xx1 = x1;
7472
x1 = x2;
@@ -82,17 +80,22 @@ protected void drawButtonRect(GuiGraphics graphics, int x1, int y1, int x2, int
8280
int width = x2 - x1;
8381
int height = y2 - y1;
8482

85-
YACLRenderHelper.renderButtonTexture(graphics, x1, y1, width, height, enabled, hovered);
83+
graphics.blitSprite(
84+
RenderPipelines.GUI_TEXTURED,
85+
GuiUtils.BUTTON_SPRITES.get(enabled, hovered),
86+
x1, y1,
87+
width, height
88+
);
8689
}
8790

88-
protected void drawOutline(GuiGraphics graphics, int x1, int y1, int x2, int y2, int width, int color) {
91+
protected void drawOutline(GuiGraphicsExtractor graphics, int x1, int y1, int x2, int y2, int width, int color) {
8992
graphics.fill(x1, y1, x2, y1 + width, color);
9093
graphics.fill(x2, y1, x2 - width, y2, color);
9194
graphics.fill(x1, y2, x2, y2 - width, color);
9295
graphics.fill(x1, y1, x1 + width, y2, color);
9396
}
9497

95-
protected void drawRainbowGradient(GuiGraphics graphics, int x1, int y1, int x2, int y2) {
98+
protected void drawRainbowGradient(GuiGraphicsExtractor graphics, int x1, int y1, int x2, int y2) {
9699
//Draws a rainbow gradient, left to right
97100
int[] colors = new int[] {0xFFFF0000, 0xFFFFFF00, 0xFF00FF00, 0xFF00FFFF, 0xFF0000FF, 0xFFFF00FF, 0xFFFF0000}; //all the colors in the gradient
98101
int width = x2 - x1;
@@ -125,95 +128,4 @@ protected int multiplyColor(int hex, float amount) {
125128
public void playDownSound() {
126129
Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
127130
}
128-
129-
//? if >=1.21.9 {
130-
@Override
131-
public boolean mouseClicked(MouseButtonEvent mouseButtonEvent, boolean doubleClick) {
132-
return this.onMouseClicked(mouseButtonEvent.x(), mouseButtonEvent.y(), mouseButtonEvent.button());
133-
}
134-
//?} else {
135-
/*@Override
136-
public boolean mouseClicked(double mouseX, double mouseY, int button) {
137-
return this.onMouseClicked(mouseX, mouseY, button);
138-
}
139-
*///?}
140-
public boolean onMouseClicked(double mouseX, double mouseY, int button) {
141-
return false;
142-
}
143-
144-
//? if >=1.21.9 {
145-
@Override
146-
public boolean mouseReleased(MouseButtonEvent mouseButtonEvent) {
147-
return this.onMouseReleased(mouseButtonEvent.x(), mouseButtonEvent.y(), mouseButtonEvent.button());
148-
}
149-
//?} else {
150-
/*@Override
151-
public boolean mouseReleased(double mouseX, double mouseY, int button) {
152-
return this.onMouseReleased(mouseX, mouseY, button);
153-
}
154-
*///?}
155-
public boolean onMouseReleased(double mouseX, double mouseY, int button) {
156-
return false;
157-
}
158-
159-
//? if >=1.21.9 {
160-
@Override
161-
public boolean mouseDragged(MouseButtonEvent mouseButtonEvent, double dx, double dy) {
162-
return this.onMouseDragged(mouseButtonEvent.x(), mouseButtonEvent.y(), mouseButtonEvent.button(), dx, dy);
163-
}
164-
//?} else {
165-
/*@Override
166-
public boolean mouseDragged(double mouseX, double mouseY, int button, double dx, double dy) {
167-
return this.onMouseDragged(mouseX, mouseY, button, dx, dy);
168-
}
169-
*///?}
170-
public boolean onMouseDragged(double mouseX, double mouseY, int button, double dx, double dy) {
171-
return false;
172-
}
173-
174-
//? if >=1.21.9 {
175-
@Override
176-
public boolean keyPressed(KeyEvent keyEvent) {
177-
return this.onKeyPressed(keyEvent.key(), keyEvent.scancode(), keyEvent.modifiers());
178-
}
179-
//?} else {
180-
/*@Override
181-
public boolean keyPressed(int keycode, int scancode, int modifiers) {
182-
return this.onKeyPressed(keycode, scancode, modifiers);
183-
}
184-
*///?}
185-
public boolean onKeyPressed(int key, int scancode, int modifiers) {
186-
return false;
187-
}
188-
189-
//? if >=1.21.9 {
190-
@Override
191-
public boolean keyReleased(KeyEvent keyEvent) {
192-
return this.onKeyReleased(keyEvent.key(), keyEvent.scancode(), keyEvent.modifiers());
193-
}
194-
//?} else {
195-
/*@Override
196-
public boolean keyReleased(int keycode, int scancode, int modifiers) {
197-
return this.onKeyReleased(keycode, scancode, modifiers);
198-
}
199-
*///?}
200-
public boolean onKeyReleased(int key, int scancode, int modifiers) {
201-
return false;
202-
}
203-
204-
//? if >=1.21.9 {
205-
@Override
206-
public boolean charTyped(CharacterEvent characterEvent) {
207-
return this.onCharTyped((char) characterEvent.codepoint(), characterEvent.codepointAsString(), characterEvent.modifiers());
208-
}
209-
//?} else {
210-
/*@Override
211-
public boolean charTyped(char codePoint, int modifiers) {
212-
return this.onCharTyped(codePoint, Character.toString(codePoint), modifiers);
213-
}
214-
*///?}
215-
public boolean onCharTyped(char ch, String cpStr, int modifiers) {
216-
return false;
217-
}
218-
219131
}

0 commit comments

Comments
 (0)