Posted January 11, 20187 yr The whole class is annotated with @SideOnly(Side.CLIENT) as whole mod is meant to be client only and compatible with vanilla. I have very simple code trying to figure out how translation works: EntityPlayer player = Minecraft.getMinecraft().player; TextComponentTranslation message = new TextComponentTranslation("chat.banana.deathInfo.death.location", player.getPosition()) player.sendMessage(message) translation en_us.lang (extract) chat.banana.deathInfo.death.location=You have died at (%1) I am sure that translation file is located correctly as @LangKey annotation translated config correctly. Link to whole codebase (https://github.com/Akxe/Banana) Edited January 11, 20187 yr by Akxe added sideness
January 11, 20187 yr Author My bad, the class is annotated with @SideOnly(Side.CLIENT). Will add it to the original post. The whole mod is meant to be client only. Edited January 11, 20187 yr by Akxe
January 11, 20187 yr Author 3 minutes ago, diesieben07 said: Why are you using the UUID instead of just comparing the player then? Strangely enough I got EntityPlayerMP from the event, but EntityPlayerSP from Minecraft.getMinecraft().player. 4 minutes ago, diesieben07 said: And why are you not using LivingDeathEvent? I wanted the items doped, therefor this seemed as most appropriate event. 1 minute ago, diesieben07 said: Also, just found out your issue: Do not append siblings to a TextComponentTranslation. I was doing that before and it wasn't working either. Tested once more still no avail. (even updated git)
January 11, 20187 yr Author I have tried doing System.out.println(message.getFormattedText()); but only got "chat.banana.deathInfo.death.both§r"...
January 11, 20187 yr Author I was really trying not to cross the logical sides... what else should have I done? Also any recommendation, on what should I do next? I’ll probably rewrite the code from scratch.
January 11, 20187 yr 44 minutes ago, Akxe said: I was really trying not to cross the logical sides... what else should have I done? Also any recommendation, on what should I do next? I’ll probably rewrite the code from scratch. 1 hour ago, diesieben07 said: LivingDropsEvent, the event fires on the server side. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 11, 20187 yr 45 minutes ago, Akxe said: I was really trying not to cross the logical sides... what else should have I done? Also any recommendation, on what should I do next? I’ll probably rewrite the code from scratch. You need to get the player based on the event (since the code is for the event if fired on the side it is running on so it is side-safe, in this case on the server). So instead of doing your weird UUID comparison, you first take the entity from the event and check if it is instanceof EntityPlayer. If that is true then you know that the entity was a player (in fact should be an EntityPlayerMP) which you can then do the rest of the stuff like send a message to them. Edited January 11, 20187 yr by jabelar Check out my tutorials here: http://jabelarminecraft.blogspot.com/
January 11, 20187 yr Author 7 minutes ago, jabelar said: You need to get the player based on the event (since the code is for the event if fired on the side it is running on so it is side-safe, in this case on the server). So instead of doing your weird UUID comparison, you first take the entity from the event and check if it is instanceof EntityPlayer. If that is true then you know that the entity was a player (in fact should be an EntityPlayerMP) which you can then do the rest of the stuff like send a message to them. I was actually doing all of this, but I wanted this mode to be client only (working on vanilla servers). What event is client only, or both sides (so I can use @SideOnly on it)? I actually have annotated the class and event, but it obviously haven’t solved logical sideness.
January 11, 20187 yr It will only work if the event is actually even fired client side. Not all events are. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 11, 20187 yr Author Is there a list of them? And their sideness? I was able to pinpoint, I guess most of them, using the tree hierarchy tool in eclipse, but I don’t remember seeing any note on side.
January 11, 20187 yr 4 minutes ago, Akxe said: Is there a list of them? And their sideness? I was able to pinpoint, I guess most of them, using the tree hierarchy tool in eclipse, but I don’t remember seeing any note on side. Very rarely. You have to subscribe to them, have the console log which side it thinks its on, and run the code in single player. If you get 2 loggings you'll know it runs on both sides. If you get one, it'll tell you which side its on. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 11, 20187 yr Author Amazing, thank you. I'll handle it from here, as for TextComponentTranslation not working, I would assume it is due to server side not being able to translate. Case closed.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.