Skip to content

Commit 0ea76c9

Browse files
committed
1.21.8+
1 parent f22156e commit 0ea76c9

File tree

11 files changed

+67
-15
lines changed

11 files changed

+67
-15
lines changed

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ pluginManagement {
77
}
88

99
plugins {
10-
id("dev.kikugie.stonecutter") version "0.5"
10+
id("dev.kikugie.stonecutter") version "0.7.10"
1111
}
1212

1313
stonecutter {
1414
kotlinController = true
1515
centralScript = "build.gradle.kts"
1616

1717
shared {
18-
versions("1.20.1", "1.20.4", "1.20.6", "1.21.1", "1.21.5")
18+
versions("1.20.1", "1.20.4", "1.20.6", "1.21.1", "1.21.5", "1.21.8", "1.21.10")
1919
}
2020
create(rootProject)
2121
}

src/client/java/net/irisshaders/imgui/ImGuiMC.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.irisshaders.imgui;
22

3-
//? if =1.21.5 {
3+
//? if >=1.21.5 {
44
import com.mojang.blaze3d.opengl.GlConst;
55
import com.mojang.blaze3d.opengl.GlDevice;
66
import com.mojang.blaze3d.opengl.GlStateManager;
@@ -132,7 +132,7 @@ public void afterPollEvents(long l) {
132132
}
133133

134134
public void draw() {
135-
//? if =1.21.5 {
135+
//? if >=1.21.5 {
136136
GlStateManager._glBindFramebuffer(GlConst.GL_FRAMEBUFFER, ((GlTexture) Minecraft.getInstance().getMainRenderTarget().getColorTexture()).getFbo(((GlDevice) RenderSystem.getDevice()).directStateAccess(), null));
137137
//?} else {
138138
/*Minecraft.getInstance().getMainRenderTarget().bindWrite(true);
@@ -144,7 +144,11 @@ public void draw() {
144144

145145
ImGui.updatePlatformWindows();
146146
ImGui.renderPlatformWindowsDefault();
147+
//? if >1.21.8 {
148+
/*GLFW.glfwMakeContextCurrent(Minecraft.getInstance().getWindow().handle());
149+
*///?} else {
147150
GLFW.glfwMakeContextCurrent(Minecraft.getInstance().getWindow().getWindow());
151+
//?}
148152
}
149153

150154
private static boolean isGone;

src/client/java/net/irisshaders/imgui/mixin/DrawMixin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ public class DrawMixin {
1919
private void imgui$newFrame(
2020
boolean bl, CallbackInfo ci
2121
) {
22+
//? if >1.21.8 {
23+
/*ImGuiMC.getInstance().afterPollEvents(this.window.handle());
24+
*///?} else {
2225
ImGuiMC.getInstance().afterPollEvents(this.window.getWindow());
26+
//?}
2327
}
2428

2529
@Inject(method = "runTick", at = @At(value = "INVOKE", target = /*? if >= 1.21.5 {*/"Lcom/mojang/blaze3d/platform/Window;isMinimized()Z"/*?} else {*//*"Lcom/mojang/blaze3d/pipeline/RenderTarget;unbindWrite()V"*//*?}*/))
2630
private void imgui$draw(boolean bl, CallbackInfo ci) {
2731
if (ImGuiMC.startDrawing()) {
28-
ImGui.showDemoWindow();
2932
ImGuiMC.getInstance().draw();
3033
}
3134
}

src/client/java/net/irisshaders/imgui/mixin/KeyboardHandlingMixin.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,28 @@
22

33
import net.irisshaders.imgui.ImGuiMC;
44
import net.minecraft.client.KeyboardHandler;
5+
//? if >1.21.8 {
6+
/*import net.minecraft.client.input.CharacterEvent;
7+
import net.minecraft.client.input.KeyEvent;
8+
*///?}
59
import org.spongepowered.asm.mixin.Mixin;
610
import org.spongepowered.asm.mixin.injection.At;
711
import org.spongepowered.asm.mixin.injection.Inject;
812
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
913

1014
@Mixin(KeyboardHandler.class)
1115
public class KeyboardHandlingMixin {
16+
//? if >1.21.8 {
17+
/*@Inject(method = "keyPress", at = @At("HEAD"))
18+
private void imgui$keyPress(long window, int action, KeyEvent keyEvent, CallbackInfo ci) {
19+
ImGuiMC.getInstance().onKeyPress(window, keyEvent.key(), keyEvent.scancode(), action, keyEvent.modifiers());
20+
}
21+
22+
@Inject(method = "charTyped", at = @At("HEAD"))
23+
private void imgui$charTyped(long l, CharacterEvent characterEvent, CallbackInfo ci) {
24+
ImGuiMC.getInstance().onCharTyped(l, characterEvent.codepoint(), characterEvent.modifiers());
25+
}
26+
*///?} else {
1227
@Inject(method = "keyPress", at = @At("HEAD"))
1328
private void imgui$keyPress(long l, int i, int j, int k, int m, CallbackInfo ci) {
1429
ImGuiMC.getInstance().onKeyPress(l, i, j, k, m);
@@ -18,4 +33,5 @@ public class KeyboardHandlingMixin {
1833
private void imgui$charTyped(long l, int i, int j, CallbackInfo ci) {
1934
ImGuiMC.getInstance().onCharTyped(l, i, j);
2035
}
36+
//?}
2137
}

src/client/java/net/irisshaders/imgui/mixin/MouseHandlingMixin.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import net.irisshaders.imgui.ImGuiMC;
44
import net.minecraft.client.MouseHandler;
5+
//? if >1.21.8 {
6+
/*import net.minecraft.client.input.MouseButtonInfo;
7+
*///?}
58
import org.spongepowered.asm.mixin.Mixin;
69
import org.spongepowered.asm.mixin.injection.At;
710
import org.spongepowered.asm.mixin.injection.Inject;
@@ -19,8 +22,15 @@ public class MouseHandlingMixin {
1922
ImGuiMC.getInstance().onMouseScroll(window, scrollX, scrollY);
2023
}
2124

25+
//? if >1.21.8 {
26+
/*@Inject(method = "onButton", at = @At("HEAD"))
27+
private void imgui$onScroll(long window, MouseButtonInfo button, int action, CallbackInfo ci) {
28+
ImGuiMC.getInstance().onMouseButton(window, button.button(), action, button.modifiers());
29+
}
30+
*///?} else {
2231
@Inject(method = "onPress", at = @At("HEAD"))
2332
private void imgui$onScroll(long window, int button, int action, int mods, CallbackInfo ci) {
2433
ImGuiMC.getInstance().onMouseButton(window, button, action, mods);
2534
}
35+
//?}
2636
}

src/client/java/net/irisshaders/imgui/mixin/RendererInitMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@Mixin(RenderSystem.class)
2121
public class RendererInitMixin {
2222
@Inject(at = @At("RETURN"), method = "initRenderer", remap = false)
23-
//? if = 1.21.5 {
23+
//? if >= 1.21.5 {
2424
private static void imgui$initRenderer(long window, int i, boolean bl, BiFunction<ResourceLocation, ShaderType, String> biFunction, boolean bl2, CallbackInfo ci) {
2525
ImGuiMC.getInstance().onRendererInit(window);
2626
}

src/client/java/net/irisshaders/imgui/window/ImGuiImplGlfw.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,8 @@ protected void updateMonitors() {
10901090

10911091
final float mainPosX = props.monitorX[0];
10921092
final float mainPosY = props.monitorY[0];
1093-
final float mainSizeX = vidMode.width();
1094-
final float mainSizeY = vidMode.height();
1093+
float mainSizeX = vidMode.width();
1094+
float mainSizeY = vidMode.height();
10951095

10961096
float workPosX = 0;
10971097
float workPosY = 0;
@@ -1109,6 +1109,18 @@ protected void updateMonitors() {
11091109
}
11101110
}
11111111

1112+
if (mainSizeX <= 0.1 && workSizeX > 0.1) {
1113+
mainSizeX = workSizeX;
1114+
}
1115+
1116+
if (mainSizeY <= 0.1 && workSizeY > 0.1) {
1117+
mainSizeY = workSizeY;
1118+
}
1119+
1120+
if (mainSizeX < 0.1 || mainSizeY < 0.1) {
1121+
continue;
1122+
}
1123+
11121124
float dpiScale = 0;
11131125

11141126
// Warning: the validity of monitor DPI information on Windows depends on the application DPI awareness settings,

stonecutter.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
plugins {
22
id("dev.kikugie.stonecutter")
3-
id("fabric-loom") version "1.9-SNAPSHOT" apply false
3+
id("fabric-loom") version "1.11-SNAPSHOT" apply false
44
//id("dev.kikugie.j52j") version "1.0.2" apply false // Enables asset processing by writing json5 files
55
//id("me.modmuss50.mod-publish-plugin") version "0.7.+" apply false // Publishes builds to hosting websites
66
}
77
stonecutter active "1.21.5" /* [SC] DO NOT EDIT */
88

9-
// Builds every version into `build/libs/{mod.version}/`
10-
stonecutter registerChiseled tasks.register("chiseledBuild", stonecutter.chiseled) {
11-
group = "project"
12-
ofTask("buildAndCollect")
13-
}
149

1510
/*
1611
// Publishes every version

versions/1.21.10/gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
deps.yarn_build=3
2+
deps.fabric_api=0.110.0+1.21.6
3+
4+
mod.mc_dep=>1.21.8 <=1.22
5+
mod.mc_title=1.21.10
6+
mod.mc_targets=1.21.10

0 commit comments

Comments
 (0)