Skip to content

Instantly share code, notes, and snippets.

@Lemonszz
Created January 27, 2021 22:50
Show Gist options
  • Save Lemonszz/f39eeea3a85b68db7661668eb5f9200d to your computer and use it in GitHub Desktop.
Save Lemonszz/f39eeea3a85b68db7661668eb5f9200d to your computer and use it in GitHub Desktop.
@Mixin(LakeFeature.class)
public abstract class LakeFeatureMixin
{
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/StructureWorldAccess;getStructures(Lnet/minecraft/util/math/ChunkSectionPos;Lnet/minecraft/world/gen/feature/StructureFeature;)Ljava/util/stream/Stream;"), method = "generate", cancellable = true)
private void generate(StructureWorldAccess world, ChunkGenerator generator, Random random, BlockPos blockPos, SingleStateFeatureConfig cfg, CallbackInfoReturnable<Boolean> cbi)
{
if(world.getStructures(ChunkSectionPos.from(blockPos), BMStructures.GHOST_TOWN).findAny().isPresent() || world.getStructures(ChunkSectionPos.from(blockPos), BMStructures.MANSION).findAny().isPresent())
{
cbi.setReturnValue(false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment