Railcraft

Railcraft

34M Downloads

Make Magnifying glass respect addon mods

Vexatos opened this issue ยท 7 comments

commented

Currently, the Magnifying Glass only prints the owner of the block if it's a RailcraftTileEntity. I'd like it to use IOwnable instead. Since you cannot call getName() on those, I recommend either adding a new interface INameable to the API or a getName() to IOwnable. Otherwise, maybe default to the localized block name if INameable can't be found.

commented

I think here will be two variables: IOwnable tile and TileEntity t. So we could use some way to get the localized name on the variable t? And print the name of the GameProfile of the tile.

commented

There is a bigger problem...this is currently utterly broken (#407). The server can't localize things and the client doesn't have the necessary info, so the messages are not properly localized right now.

The only way I can think to fix it is to create a new chat packet.

commented

@CovertJaguar player.addChatMessage(new ChatComponentTranslation("the.chat.key", the, format, parameters))
Done. Will automatically be localized once arrived on the client. Mind that it may have children.

commented

Oh, I had no idea you could nest them. The chat code after Mojang's last rewrite was unintelligible to me. =P

commented

@Vexatos Um...I tested your PR. It doesn't work....

commented

In fact it breaks all my chat messages...probably because my localization strings use a custom format.

commented

I think I've got it figured out.