Paper icon indicating copy to clipboard operation
Paper copied to clipboard

IllegalArgumentException when using Painting#getArt() on custom painting variant

Open Toseflo opened this issue 6 months ago • 0 comments

Expected behavior

1.21 introduced support for data driven custom paintings. I didn't expect them to throw an exception.

Observed/Actual behavior

You get the following stacktrace when trying to run the method. stacktrace.txt

Steps/models to reproduce

  1. Install the TestPainting datapack on the server TestPainting.zip
  2. Give yourself the custom painting with /give @p painting[entity_data={id:"minecraft:painting",variant:"test:new_painting"}]
  3. Run Painting#getArt(), e.g., with this event listener:
public class TestListener implements Listener {
    @EventHandler
    public void onHangingPlace(HangingPlaceEvent event) {
        Entity entity = event.getEntity();
        if (!(entity instanceof Painting painting)) {
            return;
        }

        painting.getArt();
    }
}

Plugin and Datapack List

Only the TestPainting datapack and a plugin for the event listener.

Paper version

This server is running Paper version 1.21.1-5-master@7d7f123 (2024-08-10T22:35:17Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.21-49-b0ef3ca (MC: 1.21)

Other

No response

Toseflo avatar Aug 11 '24 10:08 Toseflo