Skip to content

Commit 5e1e9c9

Browse files
committed
update to 1.21.9
1 parent ecf928c commit 5e1e9c9

File tree

5 files changed

+51
-66
lines changed

5 files changed

+51
-66
lines changed

build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id 'fabric-loom' version '1.10-SNAPSHOT'
2+
id 'fabric-loom' version '1.11-SNAPSHOT'
33
id 'maven-publish'
4-
id 'io.freefair.lombok' version '8.13'
4+
id 'io.freefair.lombok' version '9.0.+'
55
id 'com.modrinth.minotaur' version '2.+'
66
}
77

@@ -41,11 +41,10 @@ dependencies {
4141
// Fabric API. This is technically optional, but you probably want it anyway.
4242
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
4343

44-
modImplementation(include("io.github.axolotlclient:AxolotlClient-config:3.0.9+1.21.6"))
45-
modImplementation("io.github.axolotlclient.AxolotlClient-config:AxolotlClientConfig-common:3.0.9")
44+
modImplementation(include("io.github.axolotlclient:AxolotlClient-config:3.0.20+1.21.9"))
45+
modImplementation("io.github.axolotlclient.AxolotlClient-config:AxolotlClientConfig-common:3.0.20")
4646

47-
//modLocalRuntime("com.terraformersmc:modmenu:14.0.0-rc.2")
48-
47+
modLocalRuntime("com.terraformersmc:modmenu:16.0.0-rc.1")
4948
}
5049

5150
processResources {

gradle.properties

Lines changed: 5 additions & 5 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.21.6
8-
parchment_minecraft=1.21.5
9-
parchment=2025.06.15
10-
loader_version=0.16.14
7+
minecraft_version=1.21.9
8+
parchment_minecraft=1.21.8
9+
parchment=2025.07.18
10+
loader_version=0.17.2
1111

1212
# Mod Properties
1313
mod_version=1.1.1
1414
maven_group=io.github.moehreag
1515
archives_base_name=random-world-names
1616

1717
# Dependencies
18-
fabric_version=0.127.0+1.21.6
18+
fabric_version=0.134.0+1.21.9

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

src/main/java/io/github/moehreag/randomworldnames/RandomWorldNames.java

Lines changed: 39 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.util.List;
99
import java.util.Objects;
1010
import java.util.concurrent.CompletableFuture;
11-
import java.util.concurrent.Executor;
1211
import java.util.concurrent.TimeoutException;
1312
import java.util.concurrent.atomic.AtomicBoolean;
1413
import java.util.function.Function;
@@ -24,13 +23,11 @@
2423
import io.github.axolotlclient.AxolotlClientConfig.impl.options.StringOption;
2524
import lombok.Getter;
2625
import net.fabricmc.api.ClientModInitializer;
27-
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
28-
import net.fabricmc.fabric.api.resource.SimpleResourceReloadListener;
26+
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
2927
import net.fabricmc.loader.api.FabricLoader;
3028
import net.minecraft.client.Minecraft;
3129
import net.minecraft.resources.ResourceLocation;
3230
import net.minecraft.server.packs.PackType;
33-
import net.minecraft.server.packs.resources.ResourceManager;
3431
import net.minecraft.util.RandomSource;
3532
import org.apache.commons.lang3.ArrayUtils;
3633
import org.apache.commons.lang3.StringUtils;
@@ -69,53 +66,42 @@ public void onInitializeClient() {
6966
var configManager = new JsonConfigManager(FabricLoader.getInstance().getConfigDir().resolve(MODID + ".json"), category);
7067
AxolotlClientConfig.getInstance().register(configManager);
7168
configManager.load();
72-
ResourceManagerHelper.get(PackType.CLIENT_RESOURCES)
73-
.registerReloadListener(new SimpleResourceReloadListener<List<String>>() {
74-
@Override
75-
public ResourceLocation getFabricId() {
76-
return rl("name-reloader");
77-
}
78-
79-
@Override
80-
public CompletableFuture<List<String>> load(ResourceManager resourceManager, Executor executor) {
81-
return CompletableFuture.supplyAsync(() -> {
82-
var blacklist = resourceManager.getResourceStack(BLACKLIST_LOCATION)
83-
.stream().map(resource -> {
84-
try {
85-
return GSON.fromJson(resource.openAsReader(), String[].class);
86-
} catch (IOException e) {
87-
log.warn("Failed to load world names from {}: ", resource.sourcePackId(), e);
88-
return null;
89-
}
90-
}).filter(Objects::nonNull)
91-
.flatMap(Arrays::stream)
92-
.toList();
93-
return resourceManager.getResourceStack(NAME_LOCATION)
94-
.stream().map(resource -> {
95-
if (blacklist.contains(resource.sourcePackId())) {
96-
log.info("Skipping names from blacklisted pack: {}", resource.sourcePackId());
97-
return null;
98-
}
99-
try {
100-
return GSON.fromJson(resource.openAsReader(), String[].class);
101-
} catch (IOException e) {
102-
log.warn("Failed to load world names from {}: ", resource.sourcePackId(), e);
103-
return null;
104-
}
105-
}).filter(Objects::nonNull)
106-
.flatMap(Arrays::stream)
107-
.toList();
108-
}, executor);
109-
}
110-
111-
@Override
112-
public CompletableFuture<Void> apply(List<String> o, ResourceManager resourceManager, Executor executor) {
113-
return CompletableFuture.runAsync(() -> {
114-
worldNames.clear();
115-
worldNames.addAll(o);
116-
log.info("Loaded {} names for random world names!", o.size());
117-
}, executor);
118-
}
69+
ResourceLoader.get(PackType.CLIENT_RESOURCES).registerReloader(rl("name-reloader"),
70+
(sharedState, executor, preparationBarrier, executor2) -> {
71+
var resourceManager = sharedState.resourceManager();
72+
return CompletableFuture.supplyAsync(() -> {
73+
var blacklist = resourceManager.getResourceStack(BLACKLIST_LOCATION)
74+
.stream().map(resource -> {
75+
try {
76+
return GSON.fromJson(resource.openAsReader(), String[].class);
77+
} catch (IOException e) {
78+
log.warn("Failed to load world names from {}: ", resource.sourcePackId(), e);
79+
return null;
80+
}
81+
}).filter(Objects::nonNull)
82+
.flatMap(Arrays::stream)
83+
.toList();
84+
return resourceManager.getResourceStack(NAME_LOCATION)
85+
.stream().map(resource -> {
86+
if (blacklist.contains(resource.sourcePackId())) {
87+
log.info("Skipping names from blacklisted pack: {}", resource.sourcePackId());
88+
return null;
89+
}
90+
try {
91+
return GSON.fromJson(resource.openAsReader(), String[].class);
92+
} catch (IOException e) {
93+
log.warn("Failed to load world names from {}: ", resource.sourcePackId(), e);
94+
return null;
95+
}
96+
}).filter(Objects::nonNull)
97+
.flatMap(Arrays::stream)
98+
.toList();
99+
}, executor).thenCompose(preparationBarrier::wait)
100+
.thenAcceptAsync(o -> {
101+
worldNames.clear();
102+
worldNames.addAll(o);
103+
log.info("Loaded {} names for random world names!", o.size());
104+
}, executor2);
119105
});
120106
}
121107

@@ -146,12 +132,12 @@ private String generateRandomName() throws TimeoutException, LimitExceededExcept
146132
}
147133
CompletableFuture.runAsync(() -> {
148134
try {
149-
Thread.sleep(timeout.get()*1000);
135+
Thread.sleep(timeout.get() * 1000);
150136
} catch (InterruptedException ignored) {
151137
}
152138
timeoutReached.set(true);
153139
});
154-
double maxCombinations = Math.pow(nameLength.get(), limit+1);
140+
double maxCombinations = Math.pow(nameLength.get(), limit + 1);
155141
for (int total = 0; total < maxCombinations; total++) {
156142
if (timeoutReached.get()) {
157143
throw new TimeoutException("Generation timeout reached.");

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
"depends": {
2727
"fabricloader": ">=0.14.3",
28-
"minecraft": ">=1.21.2",
28+
"minecraft": ">=1.21.7",
2929
"java": ">=21",
3030
"fabric-api": "*"
3131
},

0 commit comments

Comments
 (0)