Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-264886

Geode features ignore the invalid_blocks field

XMLWordPrintable

    • Confirmed
    • World generation
    • Normal
    • Platform

      The bug

      Geode features do not use the block tag from the invalid_blocks field, and instead always use the #minecraft:geode_invalid_blocks tag.

      How to reproduce

      Create a new world using the attached data pack. The data pack adds #minecraft:base_stone_overworld to #geode_invalid_blocks, but configures geodes to use an empty block tag (instead of #minecraft:geode_invalid_blocks) for its list of invalid blocks.

      Expected behavior

      Geodes should be generated, as they are configured by the data pack to use an empty block tag as their invalid block list.

      Observed behavior

      Geodes are not generated, since #geode_invalid_blocks (modified by the data pack to include stone, deepslate, etc.) is still being used (instead of the provided empty block tag).

      Code analysis

      1.20.1 with MCP-Reborn

      net.minecraft.world.level.levelgen.feature.GeodeFeature.place

      for(int i1 = 0; i1 < k; ++i1) {
         int j1 = geodeconfiguration.outerWallDistance.sample(randomsource);
         int k1 = geodeconfiguration.outerWallDistance.sample(randomsource);
         int l1 = geodeconfiguration.outerWallDistance.sample(randomsource);
         BlockPos blockpos1 = blockpos.offset(j1, k1, l1);
         BlockState blockstate = worldgenlevel.getBlockState(blockpos1);
         if (blockstate.isAir() || blockstate.is({*}BlockTags.GEODE_INVALID_BLOCKS{*})) {
           ++l;
           if (l > geodeconfiguration.invalidBlocksThreshold) {
             return false;
           }
         }
         list.add(Pair.of(blockpos1, geodeconfiguration.pointOffset.sample(randomsource)));
      }
      

      Changing BlockTags.GEODE_INVALID_BLOCKS to geodeconfiguration.geodeBlockSettings.invalidBlocks should fix the issue.

            Unassigned Unassigned
            LegoEmmetMC Apollo
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: