Skip to content

Commit 302bd61

Browse files
committed
support for 1.20.5/1.20.6
1 parent 19dbaa3 commit 302bd61

File tree

13 files changed

+58
-25
lines changed

13 files changed

+58
-25
lines changed

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.2-SNAPSHOT'
2+
id 'fabric-loom' version '1.6-SNAPSHOT'
33
id 'maven-publish'
44
}
55

@@ -43,7 +43,8 @@ processResources {
4343

4444
tasks.withType(JavaCompile).configureEach {
4545
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
46-
it.options.release = 17
46+
// The new Minecraft 1.20.5 upwards uses Java 21
47+
it.options.release = 21
4748
}
4849

4950
java {
@@ -52,8 +53,8 @@ java {
5253
// If you remove this line, sources will not be generated.
5354
withSourcesJar()
5455

55-
sourceCompatibility = JavaVersion.VERSION_17
56-
targetCompatibility = JavaVersion.VERSION_17
56+
sourceCompatibility = JavaVersion.VERSION_21
57+
targetCompatibility = JavaVersion.VERSION_21
5758
}
5859

5960
jar {

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.20.4
8-
yarn_mappings=1.20.4+build.3
9-
loader_version=0.15.3
7+
minecraft_version=1.20.6
8+
yarn_mappings=1.20.6+build.1
9+
loader_version=0.15.10
1010

1111
# Mod Properties
12-
mod_version = 1.6.0-1.20.4
12+
mod_version = 1.6.1-1.20.6
1313
maven_group = one.pouekdev
1414
archives_base_name = coordinatelist
1515

1616
# Dependencies
17-
fabric_version=0.92.0+1.20.4
18-
midnightlib_version=1.5.3-fabric
17+
fabric_version=0.97.8+1.20.6
18+
midnightlib_version=1.5.4-fabric
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.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/main/java/one/pouekdev/coordinatelist/CListClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ public void onInitializeClient() {
155155
positionMatrix = matrixStack.peek().getPositionMatrix();
156156
float h = (float) (-textWidth/2);
157157
VertexConsumerProvider.Immediate v = VertexConsumerProvider.immediate(tessellator.getBuffer());
158+
if(CListConfig.waypoint_text_background) {
159+
textRenderer.draw(labelText, h,0,0x00000000,false,positionMatrix,v, TextRenderer.TextLayerType.NORMAL,0x90000000,LightmapTextureManager.MAX_LIGHT_COORDINATE);
160+
}
158161
// This fixes text flickering
159-
textRenderer.draw(labelText, h,0,0x00000000,false,positionMatrix,v, TextRenderer.TextLayerType.NORMAL,0x90000000,LightmapTextureManager.MAX_LIGHT_COORDINATE);
160162
matrixStack.translate(0,0,-0.03f);
161163
positionMatrix = matrixStack.peek().getPositionMatrix();
162164
textRenderer.draw(labelText, h,0,0xFFFFFF,false,positionMatrix,v, TextRenderer.TextLayerType.NORMAL,0x00000000,LightmapTextureManager.MAX_LIGHT_COORDINATE);

src/main/java/one/pouekdev/coordinatelist/CListConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ public class CListConfig extends MidnightConfig {
77
@Entry(min=0) public static int render_distance = 0;
88
@Entry public static boolean waypoints_toggled = true;
99
@Entry public static boolean can_place_deathpoints = true;
10+
@Entry public static boolean waypoint_text_background = true;
1011
}

src/main/java/one/pouekdev/coordinatelist/CListWaypointColor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ public class CListWaypointColor {
99
g = green;
1010
b = blue;
1111
}
12+
public void setRGB(float red, float green, float blue){
13+
r = red;
14+
g = green;
15+
b = blue;
16+
}
1217
public int rgbToHex(){
1318
int red = (int) (r * 255);
1419
int green = (int) (g * 255);

src/main/java/one/pouekdev/coordinatelist/CListWaypointConfig.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
package one.pouekdev.coordinatelist;
22

3+
import com.mojang.blaze3d.systems.RenderSystem;
34
import net.minecraft.client.gui.DrawContext;
45
import net.minecraft.client.gui.screen.Screen;
56
import net.minecraft.client.gui.widget.ButtonWidget;
67
import net.minecraft.client.gui.widget.GridWidget;
78
import net.minecraft.client.gui.widget.SimplePositioningWidget;
89
import net.minecraft.client.gui.widget.TextFieldWidget;
910
import net.minecraft.text.Text;
11+
import net.minecraft.util.Identifier;
1012
import org.lwjgl.glfw.GLFW;
1113

1214
public class CListWaypointConfig extends Screen {
1315
public int id;
16+
public boolean render_color_picker = false;
1417
public CListWaypoint waypoint;
1518
public TextFieldWidget waypoint_name;
1619
public TextFieldWidget waypoint_color;
@@ -58,6 +61,24 @@ protected void init(){
5861
addDrawableChild(this.y);
5962
addDrawableChild(this.z);
6063
}
64+
public static class SpriteButton extends ButtonWidget {
65+
public int x_pos;
66+
public int y_pos;
67+
public SpriteButton(int x, int y, int width, int height, PressAction onPress) {
68+
super(x, y, width, height, Text.literal(""), onPress,null);
69+
this.x_pos = x;
70+
this.y_pos = y;
71+
}
72+
@Override
73+
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
74+
Identifier icon;
75+
icon = new Identifier("coordinatelist", "icon/change");
76+
RenderSystem.enableBlend();
77+
RenderSystem.defaultBlendFunc();
78+
context.drawGuiTexture(icon, x_pos, y_pos, width, height);
79+
RenderSystem.disableBlend();
80+
}
81+
}
6182
@Override
6283
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
6384
this.waypoint_name.setX((this.width-150)/2);
@@ -77,8 +98,12 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {
7798
int top = centerY - SQUARE_SIZE / 2;
7899
int right = centerX + SQUARE_SIZE / 2;
79100
int bottom = centerY + SQUARE_SIZE / 2;
101+
//SpriteButton change_color = new SpriteButton((this.width-50)/2+38,(this.height-20)/2-15,12,12,button -> {
102+
// render_color_picker = !render_color_picker;
103+
//});
80104
super.render(context, mouseX, mouseY, delta);
81105
context.fill(left, top, right, bottom, CListClient.variables.colors.get(id).rgbToHex());
106+
//change_color.renderWidget(context,mouseX,mouseY,delta);
82107
}
83108
@Override
84109
public boolean charTyped(char chr, int keyCode) {

src/main/java/one/pouekdev/coordinatelist/CListWaypointScreen.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ protected void init() {
5656
gridWidgetBottom.forEachChild(this::addDrawableChild);
5757
}
5858
@Override
59-
public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) {
60-
renderBackgroundTexture(context);
61-
}
62-
@Override
6359
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
6460
super.render(context, mouseX, mouseY, delta);
6561
//list.render(context, mouseX, mouseY, delta);

src/main/java/one/pouekdev/coordinatelist/mixin/CListChatGrabber.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package one.pouekdev.coordinatelist.mixin;
22

33
import net.minecraft.client.gui.hud.ChatHud;
4+
import net.minecraft.client.gui.hud.ChatHudLine;
45
import net.minecraft.client.gui.hud.MessageIndicator;
56
import net.minecraft.text.ClickEvent;
67
import net.minecraft.text.Text;
@@ -21,11 +22,11 @@
2122
@Mixin(ChatHud.class)
2223
public abstract class CListChatGrabber {
2324
@Inject(method = "logChatMessage", at = @At("RETURN"))
24-
private void getCoordsFromChat(Text message, @Nullable MessageIndicator indicator, CallbackInfo ci) {
25+
private void getCoordsFromChat(ChatHudLine message, CallbackInfo ci) {
2526
List<String> numbersList = Lists.newArrayList();
2627
String player;
2728
try{
28-
String content = message.getString().replaceAll("\r", "\\\\r").replaceAll("\n", "\\\\n");
29+
String content = message.content().getString().replaceAll("\r", "\\\\r").replaceAll("\n", "\\\\n");
2930
player = StringUtils.substringBetween(content, "<", ">");
3031
content = content.replace("<","").replace(">","").replace(player,"");
3132
numbersList = CListClient.findNumbersInString(content);

src/main/resources/assets/coordinatelist/lang/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"coordinatelist.midnightconfig.render_distance": "The distance to which the waypoint is visible (0 means no limit)",
99
"coordinatelist.midnightconfig.waypoints_toggled": "Show waypoints",
1010
"coordinatelist.midnightconfig.can_place_deathpoints": "Create waypoints on death",
11+
"coordinatelist.midnightconfig.waypoint_text_background": "Show background behind the waypoint name",
1112
"modmenu.summaryTranslation.coordinatelist": "A simple minimalistic fabric mod for saving your coordinates.",
1213
"modmenu.descriptionTranslation.coordinatelist": "Coordinate List (CList for short) is a simple minimalistic fabric mod for saving your coordinates. No minimaps. Just a list with in-game waypoints.",
1314
"waypoint.last.death": "Last death",

0 commit comments

Comments
 (0)