Skip to content

Commit 7adb881

Browse files
committed
Update to 1.21.6
Colour locator bar icons
1 parent 91e8c4e commit 7adb881

File tree

14 files changed

+111
-49
lines changed

14 files changed

+111
-49
lines changed

gradle.properties

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

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.5
8-
yarn_mappings=1.21.5+build.1
7+
minecraft_version=1.21.6
8+
yarn_mappings=1.21.6+build.1
99
loader_version=0.16.14
1010
loom_version=1.10-SNAPSHOT
1111

1212
# Mod Properties
13-
mod_version=1.2.1
14-
maven_group=golden.scnamelink
15-
archives_base_name=sc-name-link
13+
mod_version=1.3.0
14+
maven_group=golden.scnicknamer
15+
archives_base_name=scnicknamer
1616

1717
# Dependencies
18-
fabric_version=0.127.0+1.21.5
19-
modmenu_version=13.0.3
20-
clothconfig_version=18.0.145
18+
fabric_version=0.127.1+1.21.6
19+
modmenu_version=15.0.0-beta.3
20+
clothconfig_version=19.0.147

src/client/java/golden/scnamelink/config/SCNameLinkConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@ public class SCNameLinkConfig implements ConfigData {
3030
public boolean replacechat = false;
3131
// Whether to colour names in the chat using the colour from discord.
3232
public boolean colourchat = true;
33+
34+
// Whether to colour the icons in the locator bar.
35+
public boolean locatorbar = true;
3336
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package golden.scnamelink.mixin.client;
2+
3+
import com.mojang.datafixers.util.Either;
4+
import golden.scnamelink.DisplayMapping;
5+
import golden.scnamelink.SpooncraftNameLinkClient;
6+
import golden.scnamelink.config.SCNameLinkConfig;
7+
import me.shedaniel.autoconfig.AutoConfig;
8+
import net.minecraft.util.math.ColorHelper;
9+
import net.minecraft.world.waypoint.TrackedWaypoint;
10+
import net.minecraft.world.waypoint.Waypoint;
11+
import org.spongepowered.asm.mixin.*;
12+
import org.spongepowered.asm.mixin.injection.At;
13+
import org.spongepowered.asm.mixin.injection.Inject;
14+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15+
16+
import java.util.UUID;
17+
18+
@Mixin (TrackedWaypoint.class)
19+
public class TrackedWaypointMixin {
20+
@Unique
21+
SCNameLinkConfig CONFIG = AutoConfig.getConfigHolder(SCNameLinkConfig.class).getConfig();
22+
@Shadow
23+
@Final
24+
protected Either<UUID, String> source;
25+
@Shadow
26+
@Final
27+
private Waypoint.Config config;
28+
29+
@Inject (method = "getConfig", at = @At ("RETURN"), cancellable = true)
30+
private void onGetConfig(CallbackInfoReturnable<Waypoint.Config> cir) {
31+
Waypoint.Config config = this.config;
32+
33+
if (!CONFIG.enableMod || !CONFIG.locatorbar) {
34+
return;
35+
}
36+
UUID uuid = source.left().orElse(null);
37+
if (uuid == null) {
38+
return;
39+
}
40+
DisplayMapping mapping = SpooncraftNameLinkClient.getMapping(uuid, null);
41+
if (mapping == null) {
42+
return;
43+
}
44+
int k = ColorHelper.withAlpha(255, Integer.parseInt(mapping.colour, 16));
45+
config.color = java.util.Optional.of(k);
46+
47+
cir.setReturnValue(config);
48+
}
49+
}

src/client/resources/sc-name-link.client.mixins.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
"client": [
66
"ChatHudMixin",
77
"ClientPlayNetworkHandlerMixin",
8+
"HoverEventMixin",
89
"PlayerEntityRendererMixin",
910
"PlayerListEntryMixin",
10-
"HoverEventMixin"
11+
"TrackedWaypointMixin"
1112
],
1213
"injectors": {
1314
"defaultRequire": 1

src/main/resources/assets/sc-name-link/lang/en_au.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"text.autoconfig.scnamelink.option.colournametag": "Colour player nametags",
99
"text.autoconfig.scnamelink.option.replacechat": "Nicknames in chat",
1010
"text.autoconfig.scnamelink.option.colourchat": "Colour names in chat",
11-
"text.scnamelink.status.disabled": "SpooncraftNameLink is disabled.",
12-
"text.scnamelink.status.working": "SpooncraftNameLink has not finished setting up yet.",
13-
"text.scnamelink.status.fallback": "SpooncraftNameLink could not reach the server. Using cached fallback.",
14-
"text.scnamelink.status.failure": "SpooncraftNameLink could not reach the server or find a fallback.",
11+
"text.autoconfig.scnamelink.option.locatorbar": "Colour icons in the locator bar",
12+
"text.scnamelink.status.disabled": "SCNicknamer is disabled.",
13+
"text.scnamelink.status.working": "SCNicknamer has not finished setting up yet.",
14+
"text.scnamelink.status.fallback": "SCNicknamer could not reach the server. Using cached fallback.",
15+
"text.scnamelink.status.failure": "SCNicknamer could not reach the server or find a fallback.",
1516
"text.scnamelink.status.success": "Loaded mappings from the server.",
1617
"text.autoconfig.scnamelink.option.enableMod.@Tooltip": "Game should be restarted after enabling.",
17-
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank if unknown.",
18+
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank for Spooncraft.",
1819
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "Game should be restarted after changing.",
1920
"gui.scnamelink.hover_nickname": "Nickname: %s"
2021
}

src/main/resources/assets/sc-name-link/lang/en_ca.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"text.autoconfig.scnamelink.option.colournametag": "Colour player nametags",
99
"text.autoconfig.scnamelink.option.replacechat": "Nicknames in chat",
1010
"text.autoconfig.scnamelink.option.colourchat": "Colour names in chat",
11-
"text.scnamelink.status.disabled": "SpooncraftNameLink is disabled.",
12-
"text.scnamelink.status.working": "SpooncraftNameLink has not finished setting up yet.",
13-
"text.scnamelink.status.fallback": "SpooncraftNameLink could not reach the server. Using cached fallback.",
14-
"text.scnamelink.status.failure": "SpooncraftNameLink could not reach the server or find a fallback.",
11+
"text.autoconfig.scnamelink.option.locatorbar": "Colour icons in the locator bar",
12+
"text.scnamelink.status.disabled": "SCNicknamer is disabled.",
13+
"text.scnamelink.status.working": "SCNicknamer has not finished setting up yet.",
14+
"text.scnamelink.status.fallback": "SCNicknamer could not reach the server. Using cached fallback.",
15+
"text.scnamelink.status.failure": "SCNicknamer could not reach the server or find a fallback.",
1516
"text.scnamelink.status.success": "Loaded mappings from the server.",
1617
"text.autoconfig.scnamelink.option.enableMod.@Tooltip": "Game should be restarted after enabling.",
17-
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank if unknown.",
18+
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank for Spooncraft.",
1819
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "Game should be restarted after changing.",
1920
"gui.scnamelink.hover_nickname": "Nickname: %s"
2021
}

src/main/resources/assets/sc-name-link/lang/en_gb.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"text.autoconfig.scnamelink.option.colournametag": "Colour player nametags",
99
"text.autoconfig.scnamelink.option.replacechat": "Nicknames in chat",
1010
"text.autoconfig.scnamelink.option.colourchat": "Colour names in chat",
11-
"text.scnamelink.status.disabled": "SpooncraftNameLink is disabled.",
12-
"text.scnamelink.status.working": "SpooncraftNameLink has not finished setting up yet.",
13-
"text.scnamelink.status.fallback": "SpooncraftNameLink could not reach the server. Using cached fallback.",
14-
"text.scnamelink.status.failure": "SpooncraftNameLink could not reach the server or find a fallback.",
11+
"text.autoconfig.scnamelink.option.locatorbar": "Colour icons in the locator bar",
12+
"text.scnamelink.status.disabled": "SCNicknamer is disabled.",
13+
"text.scnamelink.status.working": "SCNicknamer has not finished setting up yet.",
14+
"text.scnamelink.status.fallback": "SCNicknamer could not reach the server. Using cached fallback.",
15+
"text.scnamelink.status.failure": "SCNicknamer could not reach the server or find a fallback.",
1516
"text.scnamelink.status.success": "Loaded mappings from the server.",
1617
"text.autoconfig.scnamelink.option.enableMod.@Tooltip": "Game should be restarted after enabling.",
17-
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank if unknown.",
18+
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank for Spooncraft.",
1819
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "Game should be restarted after changing.",
1920
"gui.scnamelink.hover_nickname": "Nickname: %s"
2021
}

src/main/resources/assets/sc-name-link/lang/en_nz.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"text.autoconfig.scnamelink.option.colournametag": "Colour player nametags",
99
"text.autoconfig.scnamelink.option.replacechat": "Nicknames in chat",
1010
"text.autoconfig.scnamelink.option.colourchat": "Colour names in chat",
11-
"text.scnamelink.status.disabled": "SpooncraftNameLink is disabled.",
12-
"text.scnamelink.status.working": "SpooncraftNameLink has not finished setting up yet.",
13-
"text.scnamelink.status.fallback": "SpooncraftNameLink could not reach the server. Using cached fallback.",
14-
"text.scnamelink.status.failure": "SpooncraftNameLink could not reach the server or find a fallback.",
11+
"text.autoconfig.scnamelink.option.locatorbar": "Colour icons in the locator bar",
12+
"text.scnamelink.status.disabled": "SCNicknamer is disabled.",
13+
"text.scnamelink.status.working": "SCNicknamer has not finished setting up yet.",
14+
"text.scnamelink.status.fallback": "SCNicknamer could not reach the server. Using cached fallback.",
15+
"text.scnamelink.status.failure": "SCNicknamer could not reach the server or find a fallback.",
1516
"text.scnamelink.status.success": "Loaded mappings from the server.",
1617
"text.autoconfig.scnamelink.option.enableMod.@Tooltip": "Game should be restarted after enabling.",
17-
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank if unknown.",
18+
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave blank for Spooncraft.",
1819
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "Game should be restarted after changing.",
1920
"gui.scnamelink.hover_nickname": "Nickname: %s"
2021
}

src/main/resources/assets/sc-name-link/lang/en_pt.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"text.autoconfig.scnamelink.option.colournametag": "Colour the Name Banners o' the Crew",
99
"text.autoconfig.scnamelink.option.replacechat": "Nicknames in the Pirate Chatter",
1010
"text.autoconfig.scnamelink.option.colourchat": "Colour Names in the Pirate Chatter",
11-
"text.scnamelink.status.disabled": "SpooncraftNameLink be struck down n’ disabled.",
12-
"text.scnamelink.status.working": "SpooncraftNameLink be still settin' sail fer setup.",
13-
"text.scnamelink.status.fallback": "SpooncraftNameLink failed to reach the server. Usin’ cached fallback charts.",
14-
"text.scnamelink.status.failure": "SpooncraftNameLink be lost at sea — no server or fallback to be found!",
11+
"text.autoconfig.scnamelink.option.locatorbar": "Colour Dots in the Locator bar",
12+
"text.scnamelink.status.disabled": "SCNicknamer be struck down n’ disabled.",
13+
"text.scnamelink.status.working": "SCNicknamer be still settin' sail fer setup.",
14+
"text.scnamelink.status.fallback": "SCNicknamer failed to reach the server. Usin’ cached fallback charts.",
15+
"text.scnamelink.status.failure": "SCNicknamer be lost at sea — no server or fallback to be found!",
1516
"text.scnamelink.status.success": "Mappings loaded from the server’s hoard.",
1617
"text.autoconfig.scnamelink.option.enableMod.@Tooltip": "Restart the game after hoistin’ this option.",
1718
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "Leave this map blank if ye don’t know the way.",
18-
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "Restart the voyage game after chartin’ a new map.",
19+
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "Restart the game after chartin’ a new map.",
1920
"gui.scnamelink.hover_nickname": "Nickname: %s"
2021
}

src/main/resources/assets/sc-name-link/lang/en_ud.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
"text.autoconfig.scnamelink.option.colournametag": "sᵷɐʇǝɯɐu ɹǝʎɐꞁd ɹnoꞁoƆ",
99
"text.autoconfig.scnamelink.option.replacechat": "ʇɐɥɔ uᴉ sǝɯɐuʞɔᴉN",
1010
"text.autoconfig.scnamelink.option.colourchat": "ʇɐɥɔ uᴉ sǝɯɐu ɹnoꞁoƆ",
11-
"text.scnamelink.status.disabled": "˙pǝꞁqɐsᴉp sᴉ ʞuᴉꞀǝɯɐNʇɟɐɹɔuoodS",
12-
"text.scnamelink.status.working": "˙ʇǝʎ dn ᵷuᴉʇʇǝs pǝɥsᴉuᴉɟ ʇou sɐɥ ʞuᴉꞀǝɯɐNʇɟɐɹɔuoodS",
13-
"text.scnamelink.status.fallback": "˙ʞɔɐqꞁꞁɐɟ pǝɥɔɐɔ ᵷuᴉs∩ ˙ɹǝʌɹǝs ǝɥʇ ɥɔɐǝɹ ʇou pꞁnoɔ ʞuᴉꞀǝɯɐNʇɟɐɹɔuoodS",
14-
"text.scnamelink.status.failure": "˙ʞɔɐqꞁꞁɐɟ ɐ puᴉɟ ɹo ɹǝʌɹǝs ǝɥʇ ɥɔɐǝɹ ʇou pꞁnoɔ ʞuᴉꞀǝɯɐNʇɟɐɹɔuoodS",
11+
"text.autoconfig.scnamelink.option.locatorbar": "ɹɐq ɹoʇɐɔoꞁ ǝɥʇ uᴉ suoɔᴉ ɹnoꞁoƆ",
12+
"text.scnamelink.status.disabled": "˙pǝꞁqɐsᴉp sᴉ ɹǝɯɐuʞɔᴉNƆS",
13+
"text.scnamelink.status.working": "˙ʇǝʎ dn ᵷuᴉʇʇǝs pǝɥsᴉuᴉɟ ʇou sɐɥ ɹǝɯɐuʞɔᴉNƆS",
14+
"text.scnamelink.status.fallback": "˙ʞɔɐqꞁꞁɐɟ pǝɥɔɐɔ ᵷuᴉs∩ ˙ɹǝʌɹǝs ǝɥʇ ɥɔɐǝɹ ʇou pꞁnoɔ ɹǝɯɐuʞɔᴉNƆS",
15+
"text.scnamelink.status.failure": "˙ʞɔɐqꞁꞁɐɟ ɐ puᴉɟ ɹo ɹǝʌɹǝs ǝɥʇ ɥɔɐǝɹ ʇou pꞁnoɔ ɹǝɯɐuʞɔᴉNƆS",
1516
"text.scnamelink.status.success": "˙ɹǝʌɹǝs ǝɥʇ ɯoɹɟ sᵷuᴉddɐɯ pǝpɐoꞀ",
1617
"text.autoconfig.scnamelink.option.enableMod.@Tooltip": "˙ᵷuᴉꞁqɐuǝ ɹǝʇɟɐ pǝʇɹɐʇsǝɹ ǝq pꞁnoɥs ǝɯɐ⅁",
17-
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "˙uʍouʞun ɟᴉ ʞuɐꞁq ǝʌɐǝꞀ",
18+
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[0]": "˙ʇɟɐɹɔuoodS ɹoɟ ʞuɐꞁq ǝʌɐǝꞀ",
1819
"text.autoconfig.scnamelink.option.apiLink.@Tooltip[1]": "˙ᵷuᴉᵷuɐɥɔ ɹǝʇɟɐ pǝʇɹɐʇsǝɹ ǝq pꞁnoɥs ǝɯɐ⅁",
1920
"gui.scnamelink.hover_nickname": "s% :ǝɯɐuʞɔᴉN"
2021
}

0 commit comments

Comments
 (0)