SpongePowered / Sponge

The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms.
MIT License
390 stars 211 forks source link

Applying Keys.SIGN_LINES to a block state fails silently #1682

Open Techdaan opened 6 years ago

Techdaan commented 6 years ago

I am currently running

Issue Description When constructing a new BlockState with the BlockType WALL_SIGN you are able to apply the data key SIGN_LINES without errors, while no text actually appears on the sign. I have not yet tested this with a regular sign.

        List<Text> signText = new ArrayList<>();
        signText.add(Text.of("Text"));

        BlockState sign = BlockState.builder()
                .blockType(BlockTypes.WALL_SIGN)
                .add(Keys.DIRECTION, Direction.SOUTH)
                .add(Keys.SIGN_LINES, signText)
                .build();
parlough commented 6 years ago

This has been an issue for quite a while as seen here, but I've also seen other issues mentioning it in the past.

ryantheleach commented 6 years ago

@Meronat That's a different issue. This is about causing an error if the data is not applicable to a blockstate builder.

The linked issue is about offering data to a BlockSnapshot, incorrectly being assigned to a block state instead of the tile entity data.

Fixing this issue would have made the other bug extremely apparent, as now offering data to a BlockSnapshot would result in a confusing error message, instead of offering it to the tile entity representation within.

gabizou commented 6 years ago

The question should be whether Sponge should be throwing an exception for the lack of the values being set, I think I will set up the exceptions for manipulators that are not supported by block states.