Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.9] Command and messaging translation.


needoriginalname
 Share

Recommended Posts

How does one send messages and command exceptions to the users that will be translated on arrival?

 

I know how to get messages sent from a ICommand implementation to a player, but how does that message get translated for them from the .lang file?

 

 

PS: Is there a way to check that all my translations in the .lang file was successfully read?

Link to comment
Share on other sites

Use a

TextComponentTranslation

to send a chat message that's translated to the client's locale on arrival. If you throw a

CommandException

(or a subclass) from your command, it will be sent to the command sender as a

TextComponentTranslation

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

All of the entries in your langfile will be successfully read.

 

That doesn't mean there wasn't a typo so that a string that goes for attempted translation ends up not finding one (validating this is an NP Hard problem).

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Optifine doesnt work, i do not know why. i got only 6 mods, and +1 would be 7, that 1 is optifine, it first doesnt work- i delete optifine and then it does work (new 1.17.1 forge btw) appleskin-forge-mc1.17.1-2.1.0, comforts-forge-1.17.1-5.0.0.1, chiselsandbits-1.1.6-RELEASE-universal, DoggyTalents-1.17.1-2.1.0.1, [1.17.1] + SecurityCraft+v1.8.23-beta5
    • show the code of your Structure, if possible via a git repo 
    • Is this the client or the server not starting? Show the debug.log.
    • Hello, I am trying to play Minecraft with a friend on a server but I need forge for it and it isn't starting. It just says this mesage: Memory Heap: 64 / 2048 MB (3,1%)   OffHeap: 36 MB It also doesn't tell me any bug reports. Please tell me how to fix it.
    • Don't be silly. A script kiddie is capable of basic copy pasting. I can't even do that. However, one more thing to add. How do you connect the registered FlowingFluidBlock, to your actual FluidBlock.class? I wasn't aware that you can actually customize the FlowingFluidBlock RegistryObject(or any other RegistryObject in that regard). Do it like that, and take info from the vanilla FluidBlocks how to build your FluidBlock.class accordingly: Change that...         public static final RegistryObject<FlowingFluidBlock> OIL_BLOCK = MatLibRegister.BLOCKS.register("crudeoil",             () -> new FlowingFluidBlock(() -> MatLibFluidOil.OIL_FLUID.get(), AbstractBlock.Properties.create(MATOIL)                     .doesNotBlockMovement().hardnessAndResistance(100f).noDrops()));           ...to that...         public static final RegistryObject<MyCustomFluidBlock> OIL_BLOCK = MatLibRegister.BLOCKS.register("crudeoil",             () -> new MyCustomFluidBlock(() -> MatLibFluidOil.OIL_FLUID.get(), AbstractBlock.Properties.create(MATOIL)                     .doesNotBlockMovement().hardnessAndResistance(100f).noDrops()));   ...and name your FluidBlock MyCustomFluidBlock.class. As far as I understand you do not want to extend to FlowableFluidBlock, but to FlowableFluid. I've yet to understand why, because in the past a fluid block, was still a block. It seems like it is now an "in between" thingy, or no longer a block at all. I hope someone of the wizards can spread some wisdom on that? And if it's just to ease the tinkering...👍 Edit: If someone wants more learning material, I'd recommend the TechReborn FlowableFluid.class, and their actual Fluid.class(Fabric only, so lots of adaptions needed, but good for getting an idea of structure), or PneumaticCraft(Forge). Notice they seem to be on 1.16.5 or even 1.17.1, but the code is compiling fine and dandy with minor adaptions(for 1.17.1 only?). You'd quickly find traces on how to "adapt" by highlighting methods/fields/etc., and open the declaration. Trouble starts really if references aren't public, because then you have to @Override in a custom.class. Which is something I've yet to learn as well. In the past, for 1.7(yes, that's 2013), it looked something like that:
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.