Skip to content

Commit

Permalink
Changed biome registry casting
Browse files Browse the repository at this point in the history
  • Loading branch information
OakLoaf committed Nov 1, 2024
1 parent 4f33b11 commit 3cd6aea
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.core.Holder.Reference;
import net.minecraft.core.MappedRegistry;
import net.minecraft.core.RegistrationInfo;
import net.minecraft.core.WritableRegistry;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -34,9 +33,9 @@ public class AwfulBukkitHacks {
public static void registerBiomes(ConfigRegistry configRegistry) {
try {
LOGGER.info("Hacking biome registry...");
WritableRegistry<Biome> biomeRegistry = (WritableRegistry<Biome>) RegistryFetcher.biomeRegistry();
MappedRegistry<Biome> biomeRegistry = (MappedRegistry<Biome>) RegistryFetcher.biomeRegistry();

Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry<?>) biomeRegistry, false);
Reflection.MAPPED_REGISTRY.setFrozen(biomeRegistry, false);

configRegistry.forEach(pack -> pack.getRegistry(com.dfsek.terra.api.world.biome.Biome.class).forEach((key, biome) -> {
try {
Expand Down Expand Up @@ -95,7 +94,7 @@ public static void registerBiomes(ConfigRegistry configRegistry) {
() -> LOGGER.error("No such biome: {}", tb))),
() -> LOGGER.error("No vanilla biome: {}", vb)));

((MappedRegistry<Biome>) biomeRegistry).bindAllTagsToEmpty();
biomeRegistry.bindAllTagsToEmpty();
ImmutableMap.copyOf(collect).forEach(biomeRegistry::bindTag);

} catch(SecurityException | IllegalArgumentException exception) {
Expand Down

0 comments on commit 3cd6aea

Please # to comment.