Jump to content

Akxe

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by Akxe

  1. 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. 

  2. 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)

  3. 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)

  4. I have looked on unrelased documentation of @config (https://github.com/MinecraftForge/Documentation/pull/130) and found @LangKey as way to translate name to client's language, but I haven't found a way to do this for theirs comments.

     

    @LangKey("config.modid.common.enabled.name")
    @Comment("config.modid.common.enabled.decs")
    public static boolean enabled = true;

     

    This will produce correct name, but won't translate the @Comment.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.