Skip to content

Commit e79e044

Browse files
committed
Updated Fabric to 1.21.10, reworked ProgresoPluginsScreen
1 parent 4eb37d7 commit e79e044

File tree

29 files changed

+214
-268
lines changed

29 files changed

+214
-268
lines changed

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ org.gradle.caching=true
55

66
# kotlin
77
kotlin.code.style=official
8-
kotlinVersion=2.0.20
8+
kotlinVersion=2.2.20
99

1010
# progreso
1111
progresoVersion=0.3.1
1212

1313
# fabric
1414
fabric.loom.multiProjectOptimisation=true
15-
minecraftVersion=1.21.8
16-
fabricVersion=0.131.0+1.21.8
15+
minecraftVersion=1.21.10
16+
fabricVersion=0.135.0+1.21.10
1717
fabricLoomVersion=1.11-SNAPSHOT
18-
yarnMappings=1.21.8+build.1
19-
loaderVersion=0.16.14
18+
yarnMappings=1.21.10+build.2
19+
loaderVersion=0.17.3
2020

2121
# other
2222
gsonVersion=2.11.0

progreso-api/src/main/kotlin/org/progreso/api/gui/builders/AbstractElementListBuilder.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ abstract class AbstractElementListBuilder<Context, ElementListWidget, Entry>
77
: AbstractWidgetBuilder<Context, ElementListWidget>() {
88
protected val elementListListeners = ElementListListeners<Context, ElementListWidget, Entry>()
99

10-
var headerHeight = 16
11-
1210
var itemWidth = 0
1311
var itemHeight = 32
1412

15-
var renderHeader = false
16-
1713
protected var children = mutableListOf<Entry>()
14+
protected var childrenInitializers = mutableListOf<ElementListWidget.() -> Entry>()
1815

1916
fun listDimension(x: Int, y: Int, width: Int, height: Int, itemHeight: Int) {
2017
this.x = x
@@ -29,9 +26,8 @@ abstract class AbstractElementListBuilder<Context, ElementListWidget, Entry>
2926
children.add(entry)
3027
}
3128

32-
fun renderHeader(block: ElementListWidget.(Context, Int, Int) -> Unit) {
33-
renderHeader = true
34-
elementListListeners.renderHeader = block
29+
fun addEntry(entry: ElementListWidget.() -> Entry) {
30+
childrenInitializers.add(entry)
3531
}
3632

3733
fun select(block: ElementListWidget.(Entry?) -> Unit) {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.progreso.api.gui.data
22

33
data class ElementListListeners<Context, Widget, Entry>(
4-
var renderHeader: Widget.(Context, Int, Int) -> Unit = { _, _, _ -> },
54
var select: Widget.(Entry?) -> Unit = { _ -> }
65
)

progreso-client/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ group = "org.progreso"
1616
version = progresoVersion
1717

1818
java {
19-
sourceCompatibility = JavaVersion.VERSION_21
20-
targetCompatibility = JavaVersion.VERSION_21
19+
sourceCompatibility = JavaVersion.VERSION_24
20+
targetCompatibility = JavaVersion.VERSION_24
2121
}
2222

2323
base {
@@ -89,7 +89,7 @@ tasks {
8989
}
9090

9191
withType<JavaCompile>().configureEach {
92-
options.release.set(21)
92+
options.release.set(24)
9393
}
9494

9595
shadowJar {

progreso-client/src/main/java/org/progreso/client/mixins/client/MixinKeyboard.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.progreso.client.mixins.client;
22

33
import net.minecraft.client.Keyboard;
4+
import net.minecraft.client.input.CharInput;
5+
import net.minecraft.client.input.KeyInput;
46
import org.progreso.client.Client;
57
import org.progreso.client.events.input.CharEvent;
68
import org.progreso.client.events.input.KeyEvent;
@@ -16,8 +18,8 @@ public abstract class MixinKeyboard {
1618
at = @At("HEAD"),
1719
cancellable = true
1820
)
19-
public void onKeyHook(long window, int key, int scancode, int action, int modifiers, CallbackInfo callbackInfo) {
20-
if (action >= 1 && Client.EVENT_BUS.post(new KeyEvent(key, scancode, action))) {
21+
public void onKeyHook(long window, int action, KeyInput input, CallbackInfo callbackInfo) {
22+
if (action >= 1 && Client.EVENT_BUS.post(new KeyEvent(input.key(), input.scancode(), action))) {
2123
callbackInfo.cancel();
2224
}
2325
}
@@ -27,8 +29,8 @@ public void onKeyHook(long window, int key, int scancode, int action, int modifi
2729
at = @At("HEAD"),
2830
cancellable = true
2931
)
30-
public void onCharHook(long window, int codePoint, int modifiers, CallbackInfo callbackInfo) {
31-
if (Client.EVENT_BUS.post(new CharEvent(codePoint))) {
32+
public void onCharHook(long window, CharInput input, CallbackInfo callbackInfo) {
33+
if (Client.EVENT_BUS.post(new CharEvent(input.codepoint()))) {
3234
callbackInfo.cancel();
3335
}
3436
}

progreso-client/src/main/java/org/progreso/client/mixins/client/MixinMouse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.progreso.client.mixins.client;
22

33
import net.minecraft.client.Mouse;
4+
import net.minecraft.client.input.MouseInput;
45
import org.progreso.client.Client;
56
import org.progreso.client.events.input.MouseEvent;
67
import org.spongepowered.asm.mixin.Mixin;
@@ -15,8 +16,8 @@ public abstract class MixinMouse {
1516
at = @At("HEAD"),
1617
cancellable = true
1718
)
18-
public void onMouseButtonHook(long window, int button, int action, int mods, CallbackInfo callbackInfo) {
19-
if (Client.EVENT_BUS.post(new MouseEvent(button, action))) {
19+
public void onMouseButtonHook(long window, MouseInput input, int action, CallbackInfo callbackInfo) {
20+
if (Client.EVENT_BUS.post(new MouseEvent(input.button(), action))) {
2021
callbackInfo.cancel();
2122
}
2223
}

progreso-client/src/main/java/org/progreso/client/mixins/gui/MixinScreen.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
import net.minecraft.client.MinecraftClient;
44
import net.minecraft.client.gui.screen.Screen;
55
import net.minecraft.text.ClickEvent;
6-
import net.minecraft.text.Style;
76
import org.progreso.api.managers.CommandManager;
87
import org.spongepowered.asm.mixin.Mixin;
98
import org.spongepowered.asm.mixin.injection.At;
109
import org.spongepowered.asm.mixin.injection.Inject;
1110
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1311

1412
@Mixin(Screen.class)
1513
public abstract class MixinScreen {

progreso-client/src/main/java/org/progreso/client/mixins/network/MixinClientPlayerEntity.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
@Mixin(ClientPlayerEntity.class)
2626
public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity {
27-
@Shadow @Final protected MinecraftClient client;
27+
@Shadow
28+
@Final
29+
protected MinecraftClient client;
2830

2931
@Unique
3032
private Screen cachedScreen;
@@ -50,8 +52,7 @@ public void tickHook(CallbackInfo callbackInfo) {
5052
ordinal = 1
5153
)
5254
)
53-
private void afterTickNausea(boolean fromPortalEffect, CallbackInfo ci)
54-
{
55+
private void afterTickNausea(boolean fromPortalEffect, CallbackInfo ci) {
5556
if (cachedScreen != null) {
5657
client.currentScreen = cachedScreen;
5758
cachedScreen = null;

progreso-client/src/main/java/org/progreso/client/mixins/render/MixinGameRenderer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import net.minecraft.entity.LivingEntity;
88
import net.minecraft.util.profiler.Profilers;
99
import org.joml.Matrix4f;
10-
import org.objectweb.asm.Opcodes;
1110
import org.progreso.client.Client;
1211
import org.progreso.client.events.render.Render3DEvent;
1312
import org.progreso.client.modules.render.FullBright;
@@ -45,7 +44,7 @@ private static void getNightVisionStrengthHook(
4544
public void renderWorldHook(
4645
RenderTickCounter tickCounter,
4746
CallbackInfo callbackInfo,
48-
@Local(ordinal = 2) Matrix4f matrix4f2,
47+
@Local(ordinal = 1) Matrix4f matrix4f2,
4948
@Local(ordinal = 1) float tickDelta
5049
) {
5150
Profilers.get().push("progreso_3d_render");

progreso-client/src/main/java/org/progreso/client/mixins/sound/MixinSoundSystem.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.spongepowered.asm.mixin.Mixin;
88
import org.spongepowered.asm.mixin.injection.At;
99
import org.spongepowered.asm.mixin.injection.Inject;
10-
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
1110
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1211

1312
@Mixin(SoundSystem.class)

0 commit comments

Comments
 (0)