Skip to content

Commit

Permalink
Fix biome degradation crash with envir acc, Closes #1045
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Aug 6, 2024
1 parent 651faa2 commit 92f2f2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/cyclops/evilcraft/RegistryEntries.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraft.core.registries.Registries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.effect.MobEffect;
Expand Down Expand Up @@ -265,7 +266,7 @@ public class RegistryEntries {

public static final DeferredHolder<VillagerProfession, VillagerProfession> VILLAGER_PROFESSION_WEREWOLF = DeferredHolder.create(Registries.VILLAGER_PROFESSION, ResourceLocation.parse("evilcraft:werewolf"));

public static final DeferredHolder<Biome, Biome> BIOME_DEGRADED = DeferredHolder.create(Registries.BIOME, ResourceLocation.parse("evilcraft:degraded"));
public static final ResourceKey<Biome> BIOME_DEGRADED = ResourceKey.create(Registries.BIOME, ResourceLocation.parse("evilcraft:degraded"));

public static final DeferredHolder<Structure, Structure> STRUCTURE_DARK_TEMPLE = DeferredHolder.create(Registries.STRUCTURE, ResourceLocation.parse("evilcraft:dark_temple"));
public static final DeferredHolder<StructureType<?>, StructureType<WorldStructureDarkTemple>> STRUCTURE_TYPE_DARK_TEMPLE = DeferredHolder.create(Registries.STRUCTURE_TYPE, ResourceLocation.parse("evilcraft:dark_temple"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.cyclops.evilcraft.core.degradation.effect;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;
import net.neoforged.neoforge.registries.DeferredHolder;
import org.cyclops.cyclopscore.helper.LocationHelpers;
import org.cyclops.evilcraft.RegistryEntries;
import org.cyclops.evilcraft.api.degradation.IDegradable;
Expand Down Expand Up @@ -57,8 +58,8 @@ public void spreadTo(Level world, BlockPos location) {
}
}

public static DeferredHolder<Biome, Biome> getBiome(Level level) {
return RegistryEntries.BIOME_DEGRADED;
public static Holder.Reference<Biome> getBiome(Level level) {
return level.registryAccess().lookupOrThrow(Registries.BIOME).get(RegistryEntries.BIOME_DEGRADED).get();
}

}

0 comments on commit 92f2f2c

Please sign in to comment.