Skip to content

Commit

Permalink
Updated to 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Oct 27, 2024
1 parent 66b4878 commit 3ebfad5
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ public void addDebugInfo(List<String> debugLines, BlockPos pos, Climate.Sampler
int qx = QuartPos.fromBlock(pos.getX());
int qz = QuartPos.fromBlock(pos.getZ());
IExtendedParameterList<Holder<Biome>> extension = (IExtendedParameterList<Holder<Biome>>) this.parameters();
debugLines.add("Region: " + extension.getRegion(extension.getUniqueness(qx, 0, qz)).getName().toString());
if (extension.isInitialized()) debugLines.add("Region: " + extension.getRegion(extension.getUniqueness(qx, 0, qz)).getName().toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void initializeForTerraBlender(RegistryAccess registryAccess, RegionType
this.uniqueness = LayeredNoiseUtil.uniqueness(registryAccess, regionType, seed);
this.uniqueTrees = new SearchTreeEntry[Regions.getCount(regionType)];

Registry<Biome> biomeRegistry = registryAccess.registryOrThrow(Registries.BIOME);
Registry<Biome> biomeRegistry = registryAccess.lookupOrThrow(Registries.BIOME);

for (Region region : Regions.get(regionType))
{
Expand All @@ -76,10 +76,10 @@ public void initializeForTerraBlender(RegistryAccess registryAccess, RegionType
}
else
{
List<Pair<Climate.ParameterPoint, Holder<Biome>>> pairs = new ArrayList<>();
List<Pair<Climate.ParameterPoint, Holder.Reference<Biome>>> pairs = new ArrayList<>();
region.addBiomes(biomeRegistry, pair -> {
if (biomeRegistry.getHolder(pair.getSecond()).isPresent())
pairs.add(pair.mapSecond(biomeRegistry::getHolderOrThrow));
if (biomeRegistry.containsKey(pair.getSecond()))
pairs.add(pair.mapSecond(biomeRegistry::getOrThrow));
});

// We can't create an RTree if there are no values present.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class MixinTheEndBiomeSource implements IExtendedTheEndBiomeSource
@Override
public void initializeForTerraBlender(RegistryAccess registryAccess, long seed)
{
this.biomeRegistry = registryAccess.registryOrThrow(Registries.BIOME);
this.biomeRegistry = registryAccess.lookupOrThrow(Registries.BIOME);

var highlands = EndBiomeRegistry.getHighlandsBiomes();
var midlands = EndBiomeRegistry.getMidlandsBiomes();
Expand All @@ -93,7 +93,7 @@ public void initializeForTerraBlender(RegistryAccess registryAccess, long seed)
throw new RuntimeException("Biome " + key + " has not been registered!");
});

this.tbPossibleBiomes = allBiomes.stream().map(biomeRegistry::getHolderOrThrow).collect(Collectors.toSet());
this.tbPossibleBiomes = allBiomes.stream().map(biomeRegistry::getOrThrow).collect(Collectors.toSet());
this.highlandsArea = LayeredNoiseUtil.biomeArea(registryAccess, seed, TerraBlender.CONFIG.endHighlandsBiomeSize, highlands);
this.midlandsArea = LayeredNoiseUtil.biomeArea(registryAccess, seed, TerraBlender.CONFIG.endMidlandsBiomeSize, midlands);
this.edgeArea = LayeredNoiseUtil.biomeArea(registryAccess, seed, TerraBlender.CONFIG.endEdgeBiomeSize, edge);
Expand Down Expand Up @@ -154,6 +154,6 @@ else if (heightNoise >= -0.0625)
@Unique
private Holder<Biome> getBiomeHolder(int id)
{
return this.biomeRegistry.getHolder(id).orElseThrow();
return this.biomeRegistry.get(id).orElseThrow();
}
}
8 changes: 4 additions & 4 deletions Common/src/main/java/terrablender/util/LevelUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class LevelUtils
public static void initializeOnServerStart(MinecraftServer server)
{
RegistryAccess registryAccess = server.registryAccess();
Registry<LevelStem> levelStemRegistry = registryAccess.registryOrThrow(Registries.LEVEL_STEM);
Registry<LevelStem> levelStemRegistry = registryAccess.lookupOrThrow(Registries.LEVEL_STEM);
long seed = server.getWorldData().worldGenOptions().seed();

for (Map.Entry<ResourceKey<LevelStem>, LevelStem> entry : levelStemRegistry.entrySet())
Expand Down Expand Up @@ -112,11 +112,11 @@ public static void initializeBiomes(RegistryAccess registryAccess, Holder<Dimens
parametersEx.initializeForTerraBlender(registryAccess, regionType, seed);

// Append modded biomes to the biome source biome list
Registry<Biome> biomeRegistry = registryAccess.registryOrThrow(Registries.BIOME);
Registry<Biome> biomeRegistry = registryAccess.lookupOrThrow(Registries.BIOME);
ImmutableList.Builder<Holder<Biome>> builder = ImmutableList.builder();
Regions.get(regionType).forEach(region -> region.addBiomes(biomeRegistry, pair -> {
if (biomeRegistry.getHolder(pair.getSecond()).isPresent())
builder.add(biomeRegistry.getHolderOrThrow(pair.getSecond()));
if (biomeRegistry.containsKey(pair.getSecond()))
builder.add(biomeRegistry.getOrThrow(pair.getSecond()));
}));
biomeSourceEx.appendDeferredBiomesList(builder.build());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class BiomeInitialLayer extends WeightedRandomLayer<WeightedEntry.Wrapper
public BiomeInitialLayer(RegistryAccess registryAccess, List<WeightedEntry.Wrapper<ResourceKey<Biome>>> entries)
{
super(entries);
this.biomeRegistry = registryAccess.registryOrThrow(Registries.BIOME);
this.biomeRegistry = registryAccess.lookupOrThrow(Registries.BIOME);
}

@Override
Expand All @@ -41,6 +41,6 @@ private int resolveId(ResourceKey<Biome> key)
if (!this.biomeRegistry.containsKey(key))
throw new RuntimeException("Attempted to resolve id for unregistered biome " + key);

return this.biomeRegistry.getId(this.biomeRegistry.get(key));
return this.biomeRegistry.getId(this.biomeRegistry.get(key).get().value());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected int getEntryIndex(WeightedEntry.Wrapper<Region> entry)

private static List<WeightedEntry.Wrapper<Region>> createEntries(RegistryAccess registryAccess, RegionType regionType)
{
Registry<Biome> biomeRegistry = registryAccess.registryOrThrow(Registries.BIOME);
Registry<Biome> biomeRegistry = registryAccess.lookupOrThrow(Registries.BIOME);
return Regions.get(regionType).stream().filter(region -> {
AtomicBoolean biomesAdded = new AtomicBoolean(false);
region.addBiomes(biomeRegistry, pair -> biomesAdded.set(true));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"carvers": {},
"carvers": [],
"downfall": 0.5,
"effects": {
"fog_color": 12638463,
Expand Down
2 changes: 1 addition & 1 deletion Fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "1.6-SNAPSHOT"
id "fabric-loom" version "1.8-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ group=com.github.glitchfiend
release_channel=beta

# Common
minecraft_version=1.21.1
minecraft_version=1.21.3
common_runs_enabled=false
common_client_run_name=Common Client
common_server_run_name=Common Server

# Forge
forge_version=52.0.8
forge_version=53.0.2

# NeoForge
neoforge_version=21.1.23
neoforge_version=21.3.3-beta

# Fabric
fabric_version=0.102.1+1.21.1
fabric_loader_version=0.16.2
fabric_version=0.107.0+1.21.3
fabric_loader_version=0.16.8

# Mod options
mod_name=TerraBlender
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 3ebfad5

Please sign in to comment.