Skip to content

Commit e077170

Browse files
committed
Update to 1.21.5
1 parent 6ad1164 commit e077170

7 files changed

Lines changed: 27 additions & 25 deletions

File tree

build.gradle

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

@@ -23,7 +23,7 @@ repositories {
2323
url = "https://maven.terraformersmc.com/"
2424
}
2525
// ClothConfig
26-
maven { url "https://maven.shedaniel.me/" }
26+
maven { url = "https://maven.shedaniel.me/" }
2727
}
2828

2929
loom {
@@ -35,7 +35,6 @@ loom {
3535
sourceSet sourceSets.client
3636
}
3737
}
38-
3938
}
4039

4140
fabricApi {
@@ -60,10 +59,11 @@ dependencies {
6059
}
6160

6261
processResources {
63-
inputs.property "version", project.version
62+
def projectVersion = project.version
63+
inputs.property "version", projectVersion
6464

6565
filesMatching("fabric.mod.json") {
66-
expand "version": project.version
66+
expand "version": projectVersion
6767
}
6868
}
6969

@@ -82,8 +82,9 @@ java {
8282
}
8383

8484
jar {
85+
def archivesBaseName = project.base.archivesName
8586
from("LICENSE") {
86-
rename { "${it}_${project.base.archivesName.get()}" }
87+
rename { "${it}_${archivesBaseName.get()}" }
8788
}
8889
}
8990

gradle.properties

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

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.4
8-
yarn_mappings=1.21.4+build.8
7+
minecraft_version=1.21.5
8+
yarn_mappings=1.21.5+build.1
99
loader_version=0.16.10
1010

1111
# Mod Properties
12-
mod_version=1.1.2
12+
mod_version=1.2.0
1313
maven_group=com.scnamelink
1414
archives_base_name=sc-name-link
1515

1616
# Dependencies
17-
fabric_version=0.115.1+1.21.4
18-
modmenu_version=11.0.2
19-
clothconfig_version=16.0.141
17+
fabric_version=0.119.5+1.21.5
18+
modmenu_version=13.0.3
19+
clothconfig_version=18.0.145

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.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/client/java/golden/scnamelink/NameLinkAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static List<DisplayMapping> getMappings(String source) {
9494
* @throws URISyntaxException If the API URL is incorrectly formatted.
9595
*/
9696
private static String loadJsonFromUrl(String source) throws IOException, URISyntaxException {
97-
StringBuilder result = new StringBuilder(50000);
97+
StringBuilder result = new StringBuilder();
9898
URL url = new URI(source).toURL();
9999
int retries = 0;
100100

@@ -206,6 +206,7 @@ private static Type getDisplayMappingListType() {
206206
* - {@code "Success":} Data was successfully fetched from the API.<br>
207207
* - {@code "Fallback"}: Data was loaded from the cache.<br>
208208
* - {@code "Failure"}: Both API and cache loading failed.<br>
209+
* - {@code "Disabled"}: The mod is disabled in the configuration.
209210
*
210211
* @return The current status as a string.
211212
*/

src/client/java/golden/scnamelink/SpooncraftNameLinkClient.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,13 @@ public static Text getStyledChat(Text message, boolean replaceName, boolean repl
150150

151151
HoverEvent event = style.getHoverEvent();
152152
if (event != null) {
153-
HoverEvent.EntityContent value = event.getValue(HoverEvent.Action.SHOW_ENTITY);
154-
if (value != null && value.name.isPresent()) {
155-
newText = (MutableText) getStyledName(newText, value.uuid, String.valueOf(value.name), replaceName, replaceColour);
153+
154+
if (event.getAction() == HoverEvent.Action.SHOW_ENTITY) {
155+
HoverEvent.EntityContent entity = ((HoverEvent.ShowEntity) event).entity();
156+
157+
newText = (MutableText) getStyledName(newText, entity.uuid,
158+
String.valueOf(entity.name),
159+
replaceName, replaceColour);
156160
newText.setStyle(newText.getStyle().withHoverEvent(event));
157161
}
158162
}

src/client/java/golden/scnamelink/mixin/client/HoverEventMixin.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import java.util.ArrayList;
1717
import java.util.List;
18-
import java.util.Objects;
1918
import java.util.Optional;
2019
import java.util.UUID;
2120

@@ -34,14 +33,11 @@ public abstract class HoverEventMixin {
3433
@Nullable
3534
private List<Text> tooltip;
3635

37-
@Inject (method = "asTooltip", at = @At ("HEAD"))
36+
@Inject (method = "asTooltip()Ljava/util/List;", at = @At ("HEAD"))
3837
public @Nullable List<Text> asTooltip(CallbackInfoReturnable<List<Text>> cir) {
3938
if (this.tooltip == null) {
4039
this.tooltip = new ArrayList<>();
41-
Optional<Text> var10000 = this.name;
42-
List<Text> var10001 = this.tooltip;
43-
Objects.requireNonNull(var10001);
44-
var10000.ifPresent(var10001::add);
40+
this.name.ifPresent(this.tooltip::add);
4541
this.tooltip.add(Text.translatable("gui.entity_tooltip.type",
4642
this.entityType.getName()));
4743
if (this.entityType == EntityType.PLAYER && this.name.isPresent()) {

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"schemaVersion": 1,
33
"id": "sc-name-link",
44
"version": "${version}",
5-
"name": "Spooncraft Name Link",
6-
"description": "Links nicknames and name colours with the Mumbo Jumbo Discord server.",
5+
"name": "SCNicknamer",
6+
"description": "Lightweight client-side nickname mod.",
77
"authors": [
88
"GoldenRedstone"
99
],

0 commit comments

Comments
 (0)