Skip to content

Commit 6888693

Browse files
committed
1.21.9 reset
1 parent 82598c8 commit 6888693

File tree

10 files changed

+72
-72
lines changed

10 files changed

+72
-72
lines changed

src/main/java/io/github/jumperonjava/customcursor/CursorEditScreen.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.mojang.blaze3d.systems.RenderSystem;
44
import io.github.jumperonjava.customcursor.util.*;
55
//? if >= 1.21.6
6-
import net.minecraft.client.gl.RenderPipelines;
6+
/*import net.minecraft.client.gl.RenderPipelines;*/
77
import net.minecraft.client.gui.DrawContext;
88
import net.minecraft.client.gui.cursor.Cursor;
99
import net.minecraft.client.gui.cursor.StandardCursors;
@@ -156,12 +156,12 @@ private void confirm(ButtonWidget buttonWidget) {
156156

157157

158158
//? if <= 1.20.1 {
159-
/*@Override
159+
@Override
160160
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
161161
renderBackground(context);
162162
super.render(context, mouseX, mouseY, delta);
163163
}
164-
*///?}
164+
//?}
165165

166166
private void renderPreview(DrawContext context, int mouseX, int mouseY, float delta){
167167
VersionFunctions.drawTexture(context, this.targetCursor.identifier, previewPosX, previewPosY, 0, 0, previewSize, previewSize, previewSize, previewSize);
@@ -211,7 +211,7 @@ private void renderCheckerboard(DrawContext context, int mouseX, int mouseY, flo
211211

212212
//? if < 1.21.6 {
213213

214-
/*context.getMatrices().push();
214+
context.getMatrices().push();
215215
context.getMatrices().translate(
216216
(previewPosX + MathHelper.floorMod(bgx, cellsize) - cellsize),
217217
(previewPosY + MathHelper.floorMod(bgy, cellsize) - cellsize),
@@ -228,10 +228,10 @@ private void renderCheckerboard(DrawContext context, int mouseX, int mouseY, flo
228228

229229
context.getMatrices().pop();
230230
context.disableScissor();
231-
*///?} else {
231+
//?} else {
232232

233233

234-
context.getMatrices().pushMatrix();
234+
/*context.getMatrices().pushMatrix();
235235
context.getMatrices().translate(
236236
(previewPosX + MathHelper.floorMod(bgx, cellsize) - cellsize),
237237
(previewPosY + MathHelper.floorMod(bgy, cellsize) - cellsize));
@@ -250,7 +250,7 @@ private void renderCheckerboard(DrawContext context, int mouseX, int mouseY, flo
250250
context.getMatrices().popMatrix();
251251
context.disableScissor();
252252
253-
//?}
253+
*///?}
254254
}
255255

256256
public static CursorEditScreen createCursorEditScreen(Screen parent) {

src/main/java/io/github/jumperonjava/customcursor/CursorRenderer.java

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

33
import net.minecraft.client.MinecraftClient;
44
//? if >= 1.21.6 {
5-
import net.minecraft.client.gl.RenderPipelines;
6-
//?} else {
7-
/*import com.mojang.blaze3d.systems.RenderSystem;
8-
*///?}
5+
/*import net.minecraft.client.gl.RenderPipelines;
6+
*///?} else {
7+
import com.mojang.blaze3d.systems.RenderSystem;
8+
//?}
99
import net.minecraft.client.gui.DrawContext;
1010
import net.minecraft.client.render.RenderLayer;
1111
import org.lwjgl.glfw.GLFW;
@@ -22,7 +22,7 @@ public static void render(DrawContext context, int mouseX, int mouseY, float don
2222
}
2323
var scale = MinecraftClient.getInstance().getWindow().getScaleFactor();
2424
//? if < 1.21.5
25-
/*RenderSystem.depthFunc(GL11.GL_ALWAYS);*/
25+
RenderSystem.depthFunc(GL11.GL_ALWAYS);
2626
var identifier = config.identifier;
2727
var x = (int) Math.round(mouseX - config.size * config.x / scale);
2828
var y = (int) Math.round(mouseY - config.size * config.y / scale);
@@ -33,15 +33,15 @@ public static void render(DrawContext context, int mouseX, int mouseY, float don
3333
var textureWidth = (int) (config.size / scale);
3434
var textureHeight = (int) (config.size / scale);
3535
//? if < 1.21.3 {
36-
/*context.drawTexture(identifier,x,y,u,v,width,height,textureWidth,textureHeight);
37-
*///?} else if < 1.21.6 {
36+
context.drawTexture(identifier,x,y,u,v,width,height,textureWidth,textureHeight);
37+
//?} else if < 1.21.6 {
3838
/*context.drawTexture(RenderLayer::getGuiTexturedOverlay, identifier, x, y, u, v, width, height, textureWidth, textureHeight);
3939
*///?} else {
40-
context.drawTexture(RenderPipelines.GUI_TEXTURED, identifier, x, y, u, v, width, height, textureWidth, textureHeight);
40+
/*context.drawTexture(RenderPipelines.GUI_TEXTURED, identifier, x, y, u, v, width, height, textureWidth, textureHeight);
4141
42-
//?}
42+
*///?}
4343
//? if < 1.21.5
44-
/*RenderSystem.depthFunc(GL11.GL_LEQUAL);*/
44+
RenderSystem.depthFunc(GL11.GL_LEQUAL);
4545

4646
//for debugging
4747
//context.drawTexture(new Identifier("customcursor","textures/gui/pointer.png"), (int) (mouseX-4), (int) (mouseY-4),0,0,8,8,8,8);

src/main/java/io/github/jumperonjava/customcursor/mixin/CobblemonFix.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public class CobblemonFix {
2121

2222
@Inject(method = "render", at = @At("HEAD"))
2323
//? if < 1.21 {
24-
/*void lock(DrawContext context, float tickDelta, CallbackInfo ci){
25-
*///?} else {
26-
void lock(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
27-
//?}
24+
void lock(DrawContext context, float tickDelta, CallbackInfo ci){
25+
//?} else {
26+
/*void lock(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) {
27+
*///?}
2828
if (client.currentScreen == null) {
2929
if (locked)
3030
return;

src/main/java/io/github/jumperonjava/customcursor/mixin/GameRendererMixin.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public class GameRendererMixin {
2828

2929

3030
//? if = 1.20.1 {
31-
/*@Inject(method = "render",at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V",ordinal = 1),locals = LocalCapture.CAPTURE_FAILHARD)
31+
@Inject(method = "render",at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;push(Ljava/lang/String;)V",ordinal = 1),locals = LocalCapture.CAPTURE_FAILHARD)
3232
void renderCursor(float tickDelta, long startTime, boolean tick, CallbackInfo ci, int i, int j, Window window, Matrix4f matrix4f, MatrixStack matrixStack, DrawContext drawContext){
3333
CursorRenderer.render(drawContext,i,j,tickDelta);
3434
}
35-
*///?} elif = 1.20.4 {
35+
//?} elif = 1.20.4 {
3636
/*@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;draw()V", shift = At.Shift.BEFORE))
3737
void renderCursor(float tickDelta, long startTime, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local DrawContext drawContext){
3838
CursorRenderer.render(drawContext,i,j,tickDelta);
@@ -50,17 +50,17 @@ void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci,
5050
}
5151
*///?} else {
5252

53-
//? if fabric {
53+
/*//? if fabric {
5454
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;renderWithTooltip(Lnet/minecraft/client/gui/DrawContext;IIF)V", shift = At.Shift.AFTER))
5555
void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local DrawContext drawContext){
5656
CursorRenderer.render(drawContext,i,j,0);
5757
}
5858
//?} else if neoforge {
59-
/*@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/neoforged/neoforge/client/ClientHooks;drawScreen(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/client/gui/DrawContext;IIF)V", shift = At.Shift.AFTER))
59+
/^@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/neoforged/neoforge/client/ClientHooks;drawScreen(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/client/gui/DrawContext;IIF)V", shift = At.Shift.AFTER))
6060
void renderCursor(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int i, @Local(ordinal = 1) int j, @Local DrawContext drawContext){
6161
CursorRenderer.render(drawContext,i,j,0);
6262
}
63-
*///?}
63+
^///?}
6464
65-
//?}
65+
*///?}
6666
}

src/main/java/io/github/jumperonjava/customcursor/mixin/MouseOptionsScreenMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected MouseOptionsScreenMixin() {
2727
}
2828

2929
//? if < 1.21 {
30-
/*@Inject(method = "init",at = @At("HEAD"),locals = LocalCapture.CAPTURE_FAILHARD)
30+
@Inject(method = "init",at = @At("HEAD"),locals = LocalCapture.CAPTURE_FAILHARD)
3131
void inject(CallbackInfo ci){
3232
int k = this.height / 6 - 12 + 24 * 3;
3333
var cursorEditScreenButton = new ButtonWidget.Builder(Text.translatable("customcursor.openbutton"),(buttonWidget)->{
@@ -52,8 +52,8 @@ void inject(CallbackInfo ci){
5252
int injected(int k){
5353
return k+24;
5454
}
55-
*///?} else {
56-
@Inject(method = "addOptions", at = @At("TAIL"))
55+
//?} else {
56+
/*@Inject(method = "addOptions", at = @At("TAIL"))
5757
public void addOptions(CallbackInfo ci) {
5858
this.body.addWidgetEntry
5959
(
@@ -63,5 +63,5 @@ public void addOptions(CallbackInfo ci) {
6363
(buttonWidget) -> client.setScreen(CursorEditScreen.createCursorEditScreen(this))).dimensions(0,0,0,0).build()
6464
);
6565
}
66-
//?}
66+
*///?}
6767
}

src/main/java/io/github/jumperonjava/customcursor/util/FolderTextureAskList.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ private void refreshListByFilter(String s) {
108108
lastFilter = s;
109109
list.children().clear();
110110
//? if < 1.21.4 {
111-
/*list.setScrollAmount(0);
112-
*///?} else {
113-
list.setScrollY(0);
114-
//?}
111+
list.setScrollAmount(0);
112+
//?} else {
113+
/*list.setScrollY(0);
114+
*///?}
115115
for (var key : textures) {
116116
extracted(s, key);
117117
}
@@ -130,12 +130,12 @@ private void extracted(String s, Identifier key) {
130130
}
131131

132132
//? if <= 1.20.1 {
133-
/*@Override
133+
@Override
134134
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
135135
renderBackground(context);
136136
super.render(context, mouseX, mouseY, delta);
137137
}
138-
*///?}
138+
//?}
139139

140140
public void success(Identifier ret) {
141141
onSuccess.accept(ret);

src/main/java/io/github/jumperonjava/customcursor/util/ScrollListWidget.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
public class ScrollListWidget extends AlwaysSelectedEntryListWidget<ScrollListWidget.ScrollListEntry> {
2222
public ScrollListWidget(MinecraftClient client, int width, int height, int x, int y, int itemHeight) {
2323
//? if < 1.20.4 {
24-
/*super(client,width,height,y,height,itemHeight);
25-
*///?} else {
26-
super(client,width,height,y,itemHeight);
27-
//?}
24+
super(client,width,height,y,height,itemHeight);
25+
//?} else {
26+
/*super(client,width,height,y,itemHeight);
27+
*///?}
2828

2929
//? if < 1.20.4
30-
/*setLeftPos(x);*/
30+
setLeftPos(x);
3131
}
3232
@Override
3333
public int getRowWidth() {
@@ -37,28 +37,28 @@ public int addEntry(ScrollListEntry entry){
3737
return super.addEntry(entry);
3838
}
3939
//? if < 1.20.4 {
40-
/*@Override
40+
@Override
4141
protected int getScrollbarPositionX() {
4242
return width-6;
4343
}
44-
*///?}
44+
//?}
4545

4646

4747
//? if < 1.20.4 {
48-
/*@Override
48+
@Override
4949
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
5050
context.enableScissor(left,top,left+width,top+height-1);
5151
super.render(context, mouseX, mouseY, delta);
5252
context.disableScissor();
5353
}
54-
*///?} else {
55-
@Override
54+
//?} else {
55+
/*@Override
5656
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
5757
context.enableScissor(getX(),getY(),getX()+width,getBottom());
5858
super.renderWidget(context, mouseX, mouseY, delta);
5959
context.disableScissor();
6060
}
61-
//?}
61+
*///?}
6262

6363

6464
public static class ScrollListEntry extends Entry<ScrollListEntry> {
@@ -70,7 +70,7 @@ public ScrollListEntry(Identifier key, Runnable onClick) {
7070
this.event = onClick;
7171
}
7272
//? if <= 1.21.8 {
73-
/*@Override
73+
@Override
7474
public void render(DrawContext context,
7575
int index,
7676
int y, int x,
@@ -79,13 +79,13 @@ public void render(DrawContext context,
7979
int mouseX, int mouseY,
8080
boolean hovered,
8181
float delta) {
82-
*/ //?} else {
83-
public void render(DrawContext context, int mouseX, int mouseY, boolean hovered, float deltaTicks) {
82+
//?} else {
83+
/*public void render(DrawContext context, int mouseX, int mouseY, boolean hovered, float deltaTicks) {
8484
var x = this.getX();
8585
var y = this.getY();
8686
var entryHeight = this.getContentHeight();
8787
88-
//?}
88+
*///?}
8989
TextureWidget.render(context,key,x,y,entryHeight,entryHeight);
9090
context.drawText(MinecraftClient.getInstance().textRenderer,key.toString(),x+entryHeight+5,y+entryHeight/2-5,0xFFFFFFFF,true);
9191
}
@@ -96,7 +96,7 @@ public Text getNarration() {
9696
}
9797

9898
//? if <= 1.21.8 {
99-
/*@Override
99+
@Override
100100
public boolean mouseClicked(double mouseX, double mouseY, int button) {
101101
var b = super.mouseClicked(mouseX, mouseY, button);
102102
if(isMouseOver(mouseX, mouseY)){
@@ -105,8 +105,8 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
105105
}
106106
else return b;
107107
}
108-
*///?} else {
109-
@Override
108+
//?} else {
109+
/*@Override
110110
public boolean mouseClicked(Click click, boolean doubled) {
111111
var b = super.mouseClicked(click,doubled);
112112
if(isMouseOver(click.x(),click.y())){
@@ -115,6 +115,6 @@ public boolean mouseClicked(Click click, boolean doubled) {
115115
}
116116
else return b;
117117
}
118-
//?}
118+
*///?}
119119
}
120120
}

src/main/java/io/github/jumperonjava/customcursor/util/TextureFolder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ private void reregisterTextures(Runnable onFinishedCallback, List<Path> toRegist
7272
// Move the RenderSystem.recordRenderCall out of the forEach loop
7373

7474
//? if < 1.21.5
75-
/*RenderSystem.recordRenderCall(() -> {*/
75+
RenderSystem.recordRenderCall(() -> {
7676
ONLY_RENDERTHREAD_register(onFinishedCallback, toRegister);
7777
//? if < 1.21.5
78-
/*});*/
78+
});
7979
}
8080

8181
private void ONLY_RENDERTHREAD_register(Runnable onFinishedCallback, List<Path> toRegister) {
@@ -97,10 +97,10 @@ private void ONLY_RENDERTHREAD_register(Runnable onFinishedCallback, List<Path>
9797
});
9898
textureMap.forEach((identifier, nativeImage) -> {
9999
//? if < 1.21.5 {
100-
/*var texture = new NativeImageBackedTexture(nativeImage);
101-
*///?} else {
102-
var texture = new NativeImageBackedTexture(identifier::toString,nativeImage);
103-
//?}
100+
var texture = new NativeImageBackedTexture(nativeImage);
101+
//?} else {
102+
/*var texture = new NativeImageBackedTexture(identifier::toString,nativeImage);
103+
*///?}
104104
tman.registerTexture(identifier, texture);
105105
textures.add(identifier);
106106
});
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.jumperonjava.customcursor.util;
22

33
//? if >= 1.21.6
4-
import net.minecraft.client.gl.RenderPipelines;
4+
/*import net.minecraft.client.gl.RenderPipelines;*/
55
import net.minecraft.client.gui.DrawContext;
66
import net.minecraft.client.render.RenderLayer;
77
import net.minecraft.util.Identifier;
@@ -10,20 +10,20 @@
1010
public class VersionFunctions {
1111
public static void drawTexture(DrawContext context, Identifier identifier, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight) {
1212
//? if < 1.21.3 {
13-
/*context.drawTexture(identifier,x,y,u,v,width,height,textureWidth,textureHeight);
14-
*///?} else if < 1.21.6 {
13+
context.drawTexture(identifier,x,y,u,v,width,height,textureWidth,textureHeight);
14+
//?} else if < 1.21.6 {
1515
/*context.drawTexture(RenderLayer::getGuiTextured,identifier,x,y,u,v,width,height,textureWidth,textureHeight);
1616
*///?} else {
17-
context.drawTexture(RenderPipelines.GUI_TEXTURED,identifier,x,y,u,v,width,height,textureWidth,textureHeight);
17+
/*context.drawTexture(RenderPipelines.GUI_TEXTURED,identifier,x,y,u,v,width,height,textureWidth,textureHeight);
1818
19-
//?}
19+
*///?}
2020

2121
}
2222

2323

2424
//? if < 1.21.3 {
25-
/*public static ColorHelper.Argb ColorHelper = new ColorHelper.Argb();
26-
*///?} else {
27-
public static ColorHelper ColorHelper = new ColorHelper();
28-
//?}
25+
public static ColorHelper.Argb ColorHelper = new ColorHelper.Argb();
26+
//?} else {
27+
/*public static ColorHelper ColorHelper = new ColorHelper();
28+
*///?}
2929
}

stonecutter.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
66
id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false
77
}
8-
stonecutter active "1.21.9-rc1-fabric" /* [SC] DO NOT EDIT */
8+
stonecutter active "1.20.1-fabric" /* [SC] DO NOT EDIT */
99
stonecutter.automaticPlatformConstants = true
1010

1111
// Builds every version into `build/libs/{mod.version}/{loader}`

0 commit comments

Comments
 (0)