This repository was archived by the owner on Nov 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +68
-21
lines changed
src/main/java/io/github/axolotlclient/api/chat
src/main/java/io/github/axolotlclient/api/chat
src/main/java/io/github/axolotlclient/api/chat
src/main/java/io/github/axolotlclient/api Expand file tree Collapse file tree 14 files changed +68
-21
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ tasks.runClient {
7575 classpath(sourceSets.getByName(" test" ).runtimeClasspath)
7676}
7777
78+ tasks.withType(JavaCompile ::class ).configureEach {
79+ options.encoding = " UTF-8"
80+
81+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_18 )) {
82+ options.release = 17
83+ }
84+ }
85+
7886java {
7987 sourceCompatibility = JavaVersion .VERSION_17
8088 targetCompatibility = JavaVersion .VERSION_17
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ private void addMessage(ChatMessage message) {
101101 boolean scrollToBottom = getScrollAmount () == getMaxScroll ();
102102
103103 if (!messages .isEmpty ()) {
104- ChatMessage prev = messages .getLast ( );
104+ ChatMessage prev = messages .get ( messages . size ()- 1 );
105105 if (!(prev .sender ().equals (message .sender ()) && prev .senderDisplayName ().equals (message .senderDisplayName ()))) {
106106 addEntry (new NameChatLine (message ));
107107 } else {
@@ -127,7 +127,7 @@ private void addMessage(ChatMessage message) {
127127 private void loadMessages () {
128128 long before ;
129129 if (!messages .isEmpty ()) {
130- before = messages .getFirst ( ).timestamp ().getEpochSecond ();
130+ before = messages .get ( 0 ).timestamp ().getEpochSecond ();
131131 } else {
132132 before = Instant .now ().getEpochSecond ();
133133 }
Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ tasks.processResources {
8181 }
8282}
8383
84+ tasks.withType(JavaCompile ::class ).configureEach {
85+ options.encoding = " UTF-8"
86+
87+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_18 )) {
88+ options.release = 17
89+ }
90+ }
91+
8492java {
8593 sourceCompatibility = JavaVersion .VERSION_17
8694 targetCompatibility = JavaVersion .VERSION_17
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ private void addMessage(ChatMessage message) {
9191 boolean scrollToBottom = getScrollAmount () == getMaxScroll ();
9292
9393 if (!messages .isEmpty ()) {
94- ChatMessage prev = messages .getLast ( );
94+ ChatMessage prev = messages .get ( messages . size ()- 1 );
9595 if (!(prev .sender ().equals (message .sender ()) && prev .senderDisplayName ().equals (message .senderDisplayName ()))) {
9696 addEntry (new NameChatLine (message ));
9797 } else {
@@ -117,7 +117,7 @@ private void addMessage(ChatMessage message) {
117117 private void loadMessages () {
118118 long before ;
119119 if (!messages .isEmpty ()) {
120- before = messages .getFirst ( ).timestamp ().getEpochSecond ();
120+ before = messages .get ( 0 ).timestamp ().getEpochSecond ();
121121 } else {
122122 before = Instant .now ().getEpochSecond ();
123123 }
Original file line number Diff line number Diff line change @@ -95,6 +95,14 @@ tasks.processResources {
9595 }
9696}
9797
98+ tasks.withType(JavaCompile ::class ).configureEach {
99+ options.encoding = " UTF-8"
100+
101+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_22 )) {
102+ options.release = 21
103+ }
104+ }
105+
98106java {
99107 sourceCompatibility = JavaVersion .VERSION_21
100108 targetCompatibility = JavaVersion .VERSION_21
Original file line number Diff line number Diff line change @@ -85,6 +85,17 @@ tasks.processResources {
8585 }
8686}
8787
88+ tasks.withType(JavaCompile ::class ).configureEach {
89+ // Ensure that the encoding is set to UTF-8, no matter what the system default is
90+ // this fixes some edge cases with special characters not displaying correctly
91+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
92+ options.encoding = " UTF-8"
93+
94+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_22 )) {
95+ options.release = 21
96+ }
97+ }
98+
8899java {
89100 sourceCompatibility = JavaVersion .VERSION_21
90101 targetCompatibility = JavaVersion .VERSION_21
Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ tasks.runClient {
9898 classpath(sourceSets.getByName(" test" ).runtimeClasspath)
9999}
100100
101+ tasks.withType(JavaCompile ::class ).configureEach {
102+ options.encoding = " UTF-8"
103+
104+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_18 )) {
105+ options.release = 17
106+ }
107+ }
108+
101109java {
102110 sourceCompatibility = JavaVersion .VERSION_17
103111 targetCompatibility = JavaVersion .VERSION_17
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ private void addMessage(ChatMessage message) {
101101 boolean scrollToBottom = getScrollAmount () == getMaxScroll ();
102102
103103 if (!messages .isEmpty ()) {
104- ChatMessage prev = messages .getLast ( );
104+ ChatMessage prev = messages .get ( messages . size ()- 1 );
105105 if (!(prev .sender ().equals (message .sender ()) && prev .senderDisplayName ().equals (message .senderDisplayName ()))) {
106106 entries .add (new NameChatLine (message ));
107107 } else {
@@ -127,7 +127,7 @@ private void addMessage(ChatMessage message) {
127127 private void loadMessages () {
128128 long before ;
129129 if (!messages .isEmpty ()) {
130- before = messages .getFirst ( ).timestamp ().getEpochSecond ();
130+ before = messages .get ( 0 ).timestamp ().getEpochSecond ();
131131 } else {
132132 before = Instant .now ().getEpochSecond ();
133133 }
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ subprojects {
7878 }
7979 val oldName = old.fileName.toString()
8080 val oldVer = oldName.substring(0 , oldName.indexOf(" +" ))
81- val mcVer = oldName.substring(oldName.indexOf(" +" )+ 1 , oldName.length- 4 )
81+ val mcVer = oldName.substring(oldName.indexOf(" +" )+ 1 , oldName.length- 4 ).removeSuffix( " -sources " )
8282 if (! project.version.toString().contains(mcVer)) {
8383 return @forEach
8484 }
Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ tasks.processResources {
6262 }
6363}
6464
65+ tasks.withType(JavaCompile ::class ).configureEach {
66+ options.encoding = " UTF-8"
67+
68+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_18 )) {
69+ options.release = 17
70+ }
71+ }
72+
6573tasks.withType(AbstractArchiveTask ::class ).configureEach {
6674 isPreserveFileTimestamps = false
6775 isReproducibleFileOrder = true
You can’t perform that action at this time.
0 commit comments