Skip to content

Commit

Permalink
hopefully make oil lake exclusion work again
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Jun 23, 2024
1 parent d5b9c66 commit d56b02e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import me.desht.pneumaticcraft.common.config.ConfigHelper;
import me.desht.pneumaticcraft.common.registry.ModPlacementModifierTypes;
import me.desht.pneumaticcraft.common.util.WildcardedRLMatcher;
import me.desht.pneumaticcraft.mixin.accessors.WorldGenRegionAccess;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
Expand Down Expand Up @@ -41,10 +40,10 @@ protected boolean shouldPlace(PlacementContext context, RandomSource rand, Block
// don't allow oil lakes to generate within any structure feature in pneumaticcraft:no_oil_lakes tag
if (context.getLevel() instanceof WorldGenRegion region) {
SectionPos sectionPos = SectionPos.of(origin);
ChunkAccess chunkAccess = context.getLevel().getChunk(origin);
ChunkAccess chunkAccess = region.getChunk(origin);

Registry<Structure> reg = context.getLevel().registryAccess().registryOrThrow(Registries.STRUCTURE);
StructureManager sfManager = ((WorldGenRegionAccess)region).getStructureManager();
Registry<Structure> reg = region.registryAccess().registryOrThrow(Registries.STRUCTURE);
StructureManager sfManager = region.getLevel().structureManager().forWorldGenRegion(region);

for (Holder<Structure> structureHolder : reg.getOrCreateTag(PneumaticCraftTags.Structures.NO_OIL_LAKES)) {
StructureStart startForFeature = sfManager.getStartForStructure(sectionPos, structureHolder.value(), chunkAccess);
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/mixins.pneumaticcraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"accessors.ShulkerAccess",
"accessors.StructureTemplatePoolAccess",
"accessors.WitchAccess",
"accessors.WorldGenRegionAccess",
"coremods.BaseSpawnerMixin",
"coremods.LivingEntityMixin"
],
Expand Down

0 comments on commit d56b02e

Please sign in to comment.