BlockTransformer throws before even getting to user added BlockTransformers

XMLWordPrintable

    • Type: Bug
    • Resolution: Invalid
    • Priority: Major
    • None
    • Affects Version/s: None
    • None
    • Environment:

      Java 21
      Linux

    • 1.21.4 Paper 144
    • Yes

       

       

      Collection<BlockTransformer> blockTransforms = new ArrayList<>();
      if (excludeAir) {
        blockTransforms.add((region, x, y, z, current, state) -> {
          BlockState stateInWorld = state.getWorld();
          if (current.getType().isAir() && !stateInWorld.getType().isAir())
            current.setBlockData(stateInWorld.getBlockData().clone());
          return current;
        });
      } 

      CraftStructureTransformer https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/util/CraftStructureTransformer.java#117

      Will throw even before the added BlockTransformer can execute. When pasting a structure at a location that isn't it's origin copy location, Spigot will throw an error stating that the coordinates are not within the LimitedRegion `IllegalArgumentException: Coordinates -20, 65, 80 are not in the region` and this is correct. The LimitedRegion doesn't have the origin blockstate coords. The coordinates are different, as it's pasting in a different location.

      Just adding an empty Collection<BlockTransformer> will also cause the error to throw.

       

            Assignee:
            Unassigned
            Reporter:
            LimeGlass
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: