Skip to content

Commit 0923112

Browse files
committed
Update to 1.21.11
1 parent f91cd6d commit 0923112

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.11-SNAPSHOT'
2+
id 'fabric-loom' version '1.14-SNAPSHOT'
33
id 'maven-publish'
44
}
55

gradle.properties

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

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.9
8-
curseforge_minecraft_version=1.21.9
9-
loader_version=0.17.2
7+
minecraft_version=1.21.11-rc2
8+
curseforge_minecraft_version=1.21.11-snapshot
9+
loader_version=0.18.1
1010

1111
# Mod Properties
1212
mod_version=1.0.1
1313
maven_group=seedguard
1414
archives_base_name=seedguard
1515

1616
# Testmod dependencies
17-
fabric_version=0.133.14+1.21.9
17+
fabric_version=0.139.4+1.21.11
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-9.1.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/main/java/me/drex/seedguard/SeedManager.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import it.unimi.dsi.fastutil.objects.*;
1212
import net.minecraft.core.Holder;
1313
import net.minecraft.core.registries.Registries;
14+
import net.minecraft.resources.Identifier;
1415
import net.minecraft.resources.RegistryOps;
15-
import net.minecraft.resources.ResourceLocation;
1616
import net.minecraft.server.MinecraftServer;
1717
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
1818
import net.minecraft.world.level.levelgen.structure.StructureSet;
@@ -34,7 +34,7 @@ public class SeedManager {
3434

3535
private static final Codec<Map<Holder<StructureSet>, Integer>> STRUCTURE_SEEDS_MAP_CODEC = Codec.unboundedMap(StructureSet.CODEC, Codec.INT);
3636
private static final Codec<Map<Holder<ConfiguredFeature<?, ?>>, Long>> FEATURE_SEEDS_MAP_CODEC = Codec.unboundedMap(ConfiguredFeature.CODEC, Codec.LONG);
37-
private static final Codec<Map<ResourceLocation, Long>> SURFACE_RULE_SEEDS_MAP_CODEC = Codec.unboundedMap(ResourceLocation.CODEC, Codec.LONG);
37+
private static final Codec<Map<Identifier, Long>> SURFACE_RULE_SEEDS_MAP_CODEC = Codec.unboundedMap(Identifier.CODEC, Codec.LONG);
3838
private static final String STRUCTURE_SEEDS_FILE = "structure-seeds.json";
3939
private static final String FEATURE_SEEDS_FILE = "feature-seeds.json";
4040
private static final String SURFACE_RULE_SEEDS_FILE = "surface-rule-seeds.json";
@@ -46,7 +46,7 @@ public class SeedManager {
4646
private static final SecureRandom random = new SecureRandom();
4747
private static final Reference2IntMap<Holder<StructureSet>> structureSeeds = new Reference2IntOpenHashMap<>();
4848
private static final Reference2LongMap<Holder<ConfiguredFeature<?, ?>>> featureSeeds = new Reference2LongOpenHashMap<>();
49-
private static final Object2LongMap<ResourceLocation> surfaceRuleSeeds = new Object2LongOpenHashMap<>();
49+
private static final Object2LongMap<Identifier> surfaceRuleSeeds = new Object2LongOpenHashMap<>();
5050
public static final Logger LOGGER = LoggerFactory.getLogger("SeedManager");
5151

5252
public static void load(MinecraftServer server) {
@@ -64,7 +64,7 @@ public static void load(MinecraftServer server) {
6464
featureSeeds.computeIfAbsent(holder, ignored -> random.nextLong());
6565
});
6666
for (String vanillaSurfaceRule : VANILLA_SURFACE_RULES) {
67-
surfaceRuleSeeds.computeIfAbsent(ResourceLocation.parse(vanillaSurfaceRule), ignored -> random.nextLong());
67+
surfaceRuleSeeds.computeIfAbsent(Identifier.parse(vanillaSurfaceRule), ignored -> random.nextLong());
6868
}
6969
save(server);
7070
}
@@ -92,9 +92,9 @@ public static long getFeatureSeed(Holder<ConfiguredFeature<?, ?>> holder) {
9292
return featureSeeds.getLong(holder);
9393
}
9494

95-
public static Optional<Long> getSurfaceRuleSeed(ResourceLocation resourceLocation) {
96-
if (surfaceRuleSeeds.containsKey(resourceLocation)) {
97-
return Optional.of(surfaceRuleSeeds.getLong(resourceLocation));
95+
public static Optional<Long> getSurfaceRuleSeed(Identifier identifier) {
96+
if (surfaceRuleSeeds.containsKey(identifier)) {
97+
return Optional.of(surfaceRuleSeeds.getLong(identifier));
9898
}
9999
return Optional.empty();
100100
}

src/main/java/me/drex/seedguard/mixin/RandomStateMixin.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
44
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
55
import me.drex.seedguard.SeedManager;
6-
import net.minecraft.resources.ResourceLocation;
6+
import net.minecraft.resources.Identifier;
77
import net.minecraft.util.RandomSource;
88
import net.minecraft.world.level.levelgen.PositionalRandomFactory;
99
import net.minecraft.world.level.levelgen.RandomState;
@@ -23,13 +23,13 @@ public abstract class RandomStateMixin {
2323
method = "method_41561",
2424
at = @At(
2525
value = "INVOKE",
26-
target = "Lnet/minecraft/world/level/levelgen/PositionalRandomFactory;fromHashOf(Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/util/RandomSource;"
26+
target = "Lnet/minecraft/world/level/levelgen/PositionalRandomFactory;fromHashOf(Lnet/minecraft/resources/Identifier;)Lnet/minecraft/util/RandomSource;"
2727
)
2828
)
29-
public RandomSource modifyResourceLocationDependentRandom(PositionalRandomFactory instance, ResourceLocation resourceLocation, Operation<RandomSource> original) {
30-
return SeedManager.getSurfaceRuleSeed(resourceLocation)
29+
public RandomSource modifyIdentifierDependentRandom(PositionalRandomFactory instance, Identifier identifier, Operation<RandomSource> original) {
30+
return SeedManager.getSurfaceRuleSeed(identifier)
3131
.map(seed -> this.random.fromSeed(seed))
32-
.orElseGet(() -> original.call(instance, resourceLocation));
32+
.orElseGet(() -> original.call(instance, identifier));
3333
}
3434

3535
}

0 commit comments

Comments
 (0)