Skip to content

Commit f9fcff7

Browse files
Merge pull request #17 from eclipseisoffline/snapshots
Update to Minecraft 26.1
2 parents afd9ed3 + a2b0458 commit f9fcff7

60 files changed

Lines changed: 1401 additions & 1158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
- Update to 1.21.11.
1+
- Update to Minecraft 26.1.
2+
- Add `text_opacity` and `background_color` options for the `display_above_player` config option. Old config files are automatically updated to include them.
3+
- Port to NeoForge.
4+
5+
**Please make sure to properly back up your world when updating! Minecraft 26.1 changes the structure of Minecraft worlds a lot, and while this mod has adjusted for that, I cannot guarantee that no data loss will happen!**

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
[![Discord Badge](https://img.shields.io/badge/chat-discord-%235865f2)](https://discord.gg/CNNkyWRkqm)
77
[![Github Badge](https://img.shields.io/badge/github-customname-white?logo=github)](https://github.com/eclipseisoffline/customname)
88
![GitHub License](https://img.shields.io/github/license/eclipseisoffline/customname)
9+
![Available for Fabric](https://img.shields.io/badge/available_for-fabric-_?color=%23dbd0b4)
10+
![Available for NeoForge](https://img.shields.io/badge/available_for-NeoForge-_?color=%23e58c53)
911

1012
This mod adds a `/name`, a `/itemname` and a `/itemlore` command to Minecraft, which players can use to set a prefix, suffix, or nickname,
1113
or give their items colourful names and lore. Mostly designed to be used in small, private servers, although through the
@@ -31,23 +33,26 @@ For support and/or any questions you may have, feel free to join [my discord](ht
3133

3234
| Minecraft Version | Status |
3335
|-------------------|--------------|
34-
| 1.21.11 | ✅ Current |
36+
| 26.1 | ✅ Current |
37+
| 1.21.11 | ✔️ Available |
3538
| 1.21.9+10 | ✔️ Available |
3639
| 1.21.6+7+8 | ✔️ Available |
3740
| 1.21.5 | ✔️ Available |
3841
| 1.21.4 | ✔️ Available |
3942
| 1.21.2+3 | ✔️ Available |
40-
| 1.21+1 | ✅ Current |
43+
| 1.21+1 | ✔️ Available |
4144
| 1.20.5+6 | ✔️ Available |
4245
| 1.20.4 | ✔️ Available |
4346
| 1.20.1 | ✔️ Available |
4447
| 1.19.4 | ✔️ Available |
4548
| 1.19.2 | ✔️ Available |
4649

47-
I try to keep support up for the latest major and latest minor release of Minecraft. Updates to newer Minecraft
50+
I try to keep support up for the latest drop of Minecraft. Updates to newer Minecraft
4851
versions may be delayed from time to time, as I do not always have the time to immediately update my mods.
4952

50-
Unsupported versions are still available to download, but they won't receive new features or bugfixes.
53+
Unsupported versions are/ still available to download, but they won't receive new features or bugfixes.
54+
55+
NeoForge ports are available for Minecraft 26.1 onwards.
5156

5257
## Usage
5358

@@ -96,7 +101,11 @@ By default, the configuration file looks like this:
96101
"blacklisted_names": [],
97102
"max_name_length": 16,
98103
"operators_bypass_restrictions": false,
99-
"display_above_player": false,
104+
"display_above_player": {
105+
"enabled": false,
106+
"text_opacity": 255,
107+
"background_color": "#40000000"
108+
},
100109
"name_groups": {
101110
"prefix": {},
102111
"nickname": {},
@@ -110,7 +119,9 @@ By default, the configuration file looks like this:
110119
- `blacklisted_names` is a list of regexes that are blacklisted. When a prefix, suffix or nickname matches one of these regexes, they won't be able to be used.
111120
- `max_name_length` controls how long a player prefix/nickname/suffix can be, which can be 32 at most.
112121
- `operators_bypass_restrictions` can be used to disable name restrictions for operators. When this is enabled, operators and people with the permission `customname.bypass_restrictions` can use spaces in nicknames, bypass the max length restriction, and more.
113-
- `display_above_player` controls whether the player's custom name should display above their head in game. This is currently not compatible with hiding name tags using teams.
122+
- `display_above_player` controls whether the player's custom name should display above their head in game. This is currently not compatible with hiding name tags using teams. The appearance can be further configured using the following options:
123+
- `text_opacity`: controls the opacity of the text. `255` is fully visible, `0` is transparent.
124+
- `background_color`: the HEX-background colour of the name. This is in ARGB format, so the first 2 digits indicate the alpha value.
114125
- `name_groups` can be used to create name groups for each name type. Name groups consist of a list of names, which follow the same format used in name commands. You can assign players to one or more name groups by giving them permissions to the respective groups. They will then be able to use names listed in those groups.
115126

116127
For example, consider this name groups config:
@@ -123,14 +134,14 @@ For example, consider this name groups config:
123134
"&f&l[&9VIP&f&l]",
124135
"&f&l[&aVIP&f&l]",
125136
"&f&l[&bVIP&f&l]",
126-
"&f&l[&cVIP&f&l]",
137+
"&f&l[&cVIP&f&l]"
127138
],
128139
"legendary": [
129140
"&f&l[&7Legendary&f&l]",
130141
"&f&l[&9Legendary&f&l]",
131142
"&f&l[&aLegendary&f&l]",
132143
"&f&l[&bLegendary&f&l]",
133-
"&f&l[&cLegendary&f&l]",
144+
"&f&l[&cLegendary&f&l]"
134145
]
135146
},
136147
"nickname": {},

build.gradle

Lines changed: 0 additions & 123 deletions
This file was deleted.

build.gradle.kts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import me.modmuss50.mpp.ReleaseType
2+
3+
plugins {
4+
alias(libs.plugins.multimod)
5+
}
6+
7+
group = properties["maven_group"] as String
8+
version = properties["version"] as String
9+
10+
multimod {
11+
id = properties["mod_id"] as String
12+
name = properties["mod_name"] as String
13+
description = properties["mod_description"] as String
14+
15+
archivesBaseName = properties["archives_base_name"] as String
16+
17+
settings {
18+
repositories {
19+
maven {
20+
name = "eclipseisoffline"
21+
url = uri("https://maven.eclipseisoffline.xyz/releases")
22+
}
23+
}
24+
}
25+
26+
minecraft {
27+
minecraft = libs.minecraft
28+
supported(libs.versions.minecraft.release)
29+
}
30+
31+
fabricApi = libs.fabric.api
32+
neoForgeVersion = libs.versions.neoforge
33+
34+
sharedDependencies {
35+
multiModInclude(multiModImplementation(libs.commonpermissionsapi))
36+
multiModInclude(multiModImplementation(libs.filefixutils))
37+
}
38+
39+
modPublishing {
40+
base {
41+
changelog = file("CHANGELOG.md").readText()
42+
type = ReleaseType.of(properties["release_type"] as String)
43+
}
44+
45+
modrinth {
46+
accessToken = providers.gradleProperty("MODRINTH_API_TOKEN")
47+
projectId = properties["modrinth_project_id"] as String
48+
minecraftVersions.addAll(libs.versions.minecraft.release.get().split(","))
49+
}
50+
51+
github {
52+
accessToken = providers.gradleProperty("GITHUB_API_PUBLISH_TOKEN")
53+
repository = properties["github_repository"] as String
54+
commitish = properties["git_branch"] as String
55+
}
56+
}
57+
58+
publishing {
59+
maven {
60+
name = "eclipseisoffline"
61+
url = uri("https://maven.eclipseisoffline.xyz/releases")
62+
credentials(PasswordCredentials::class)
63+
}
64+
}
65+
}

common/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
alias(libs.plugins.multimod)
3+
}
4+
5+
dependencies {
6+
compileOnlyApi(libs.luckperms)
7+
}
8+
9+
multimod.common()
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package xyz.eclipseisoffline.eclipsescustomname;
2+
3+
import com.mojang.brigadier.CommandDispatcher;
4+
5+
import net.minecraft.commands.CommandSourceStack;
6+
import net.minecraft.resources.Identifier;
7+
import org.jspecify.annotations.Nullable;
8+
import org.slf4j.Logger;
9+
import org.slf4j.LoggerFactory;
10+
11+
import java.nio.file.Path;
12+
import java.util.function.Consumer;
13+
14+
public abstract class CustomName {
15+
public static final String MOD_ID = "eclipsescustomname";
16+
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
17+
18+
private static boolean initialized = false;
19+
@Nullable
20+
private static CustomNameConfig config = null;
21+
22+
public void initialize() {
23+
if (initialized) {
24+
throw new IllegalStateException("Tried to initialise Custom Names twice!");
25+
}
26+
initialized = true;
27+
28+
LOGGER.info("Custom Names {} initialising", getVersion());
29+
CustomNamePermissions.bootstrap();
30+
LOGGER.info("Reading config");
31+
config = CustomNameConfig.readOrCreate(getConfigDir());
32+
33+
registerCommands(CustomNameCommands::register);
34+
}
35+
36+
protected abstract String getVersion();
37+
38+
protected abstract Path getConfigDir();
39+
40+
protected abstract void registerCommands(Consumer<CommandDispatcher<CommandSourceStack>> registerer);
41+
42+
public static CustomNameConfig getConfig() {
43+
if (config == null) {
44+
throw new NullPointerException("CustomNameConfig was accessed before it was initialized!");
45+
}
46+
return config;
47+
}
48+
49+
public static Identifier getModdedIdentifier(String path) {
50+
return Identifier.fromNamespaceAndPath(CustomName.MOD_ID, path);
51+
}
52+
}

0 commit comments

Comments
 (0)