rolandoislas / PeripheralsPlusOne

A pseudo-port of miscperipherals, with other stuff as well!
https://minecraft.curseforge.com/projects/peripheralsplusone
GNU General Public License v2.0
9 stars 11 forks source link

chat event does not include user #2

Closed SquidDev closed 6 years ago

SquidDev commented 6 years ago

Description

The username value in the the chat event is always nil.

Steps to Reproduce

  1. Place a chat box and set it up to print all messages
  2. Observe that the user argument is nil.

Tested on 1.11.2-1.0-build-T17.


This is due to this line: https://github.com/rolandoislas/PeripheralsPlusOne/blob/ac87f65879d7332f390cd6d0d200050c4dbc747d/src/main/java/com/austinv11/peripheralsplusplus/tiles/TileEntityChatBox.java#L77

It uses EntityPlayer.getDisplayName(), but that returns an ITextComponent which ComputerCraft will convert to null. One should probably call getUnformattedText on that (or use EntityPlayer.getDisplayNameString()).