dannydjdk / Tiny-Redstone

Forge mod for Minecraft that adds many tiny redstone pieces that you can put together on redstone panels to form tiny redstone circuits.
https://www.curseforge.com/minecraft/mc-mods/tiny-redstone
GNU General Public License v3.0
27 stars 5 forks source link

[1.16] Kicks player from server when TinyBlockItem.getName is called #97

Closed jeremiahwinsley closed 2 years ago

jeremiahwinsley commented 2 years ago

https://gist.github.com/radiomike/744fa87fbb9e97cc38bd564053b25e1a

This method calls ITextComponent.nullToEmpty which is only available client-side: https://github.com/dannydjdk/Tiny-Redstone/blob/0d4b4b7e847a0dd77f97dc8c81c9263d4c4b104b/src/main/java/com/dannyandson/tinyredstone/items/TinyBlockItem.java#L39

dannydjdk commented 2 years ago

Thanks for reporting this! It looks like Mahou Sukai is grabbing the item name text component on the server side. It's not something I would have expected, and thus it didn't come up in testing. However, it should be easy to fix on my end.

Note: This is only an issue in 1.16. Component.nullToEmpty is available server-side in 1.17+. Apparently, Mojang also stumbled upon a use case for text components server side.

dannydjdk commented 2 years ago

Fix released in 1.13.2

jeremiahwinsley commented 2 years ago

@dannydjdk Seems like the same issue is present on PanelCoverItem as well.

dannydjdk commented 2 years ago

@dannydjdk Seems like the same issue is present on PanelCoverItem as well.

Yes. This should be fixed in the latest release as well.