#Help with altering lang files via assets folder

65 messages · Page 1 of 1 (latest)

pseudo lodge
#

From what I've read the Kubejs "assets" folder can be use like a resource pack, so I'm trying to use it to alter lang files, but when ever I put the files in and make it take effect, the game completely breaks, and I need to remove everything from the assets folder to make it able to even start up again. Said lang files work completely fine when they're in a normal resourcepack, so whats different in this case?

rotund wagonBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

static kernel
#

wierd load order stuff

#

use the event

#
ClientEvents.generateAssets(event => {
  event.addLang('lang.key', 'Lang Key Translation')
})
pseudo lodge
#

Ok, and where would I put this code. startup_scripts?

#

oh, wait

#

do I just put in the code as you wrote it, or do I need to rename some of the strings to match stuff that'll be in the resource folder?

static kernel
#

client scripts

static kernel
pseudo lodge
#

OH, so instead of the resources handling the translation, the client script handles it in said format?

static kernel
#

yes

pseudo lodge
#

hmm, quick question: something like this:
"wood_type.quark.azalea" : "Verdiant"
would still work in that format, yeah?

static kernel
#

yes

pseudo lodge
#

Alright

#

uhh, I don't need to put the code in resources as well, do I?

Cause I put this code:

ClientEvents.generateAssets(event => {
    event.addLang('item.quark.azalea_boat', 'Verdiant Boat')
    event.addLang('item.quark.azalea_chest_boat', 'Verdiant Boat with Chest')
    event.addLang('block.quark.azalea_planks', 'Verdiant Planks')
    event.addLang('wood_type.quark.azalea', 'Verdiant')
  })
``` into the script file in client script, and booted up the game

and it has not taken effect
static kernel
#

anything in logs/kubejs/client.txt?

pseudo lodge
#
[01:18:46] [INFO ] client_scripts:script.js:3: Hello, World! (You will see this line every time client resources reload)
! [01:18:46] [ERR] client_scripts:script.js:9: Unknown event 'ClientEvents.generateAssets'!
[01:18:46] [INFO ] Loaded script client_scripts:script.js in 0.003 s
[01:18:46] [INFO ] Loaded 1/1 KubeJS client scripts in 0.022 s
#

thats all thats in it rn

static kernel
#

??kjs6wiki

dire acornBOT
static kernel
#

ah its highPriorityAssets not generateAssets

pseudo lodge
#

ah, I see

#

it still doesn't seem to be taking effect. Do the resourcepacks need to be ordered in a specific way for it to work?

static kernel
#

how are you reloading?

pseudo lodge
#

the minecraft/reload

#

is there a different command I should use?

static kernel
#

that only reloads server side stuff

#

use f3 + t for lang and client scripts

pseudo lodge
#

Ok, I reloaded w/ f3 +t and it

sorta works?
the ```js
event.addLang('wood_type.quark.azalea', 'Verdiant')

static kernel
#

check the client.txt log file for errors

pseudo lodge
#
[01:31:53] [INFO ] client_scripts:script.js:3: Hello, World! (You will see this line every time client resources reload)
[01:31:53] [INFO ] Loaded script client_scripts:script.js in 0.043 s
[01:31:53] [INFO ] Loaded 1/1 KubeJS client scripts in 0.192 s
``` No errors listed
static kernel
#

no idea why thats happening then

#

does it persist after a full game restart?

pseudo lodge
#

haven't tried that yet, but it's worth a shot

#

One full restart later and nope, the name changes aren't taking effect for eveything besides the wood type.

Maybe quark does something different with it's lang system?

#

Wait

would not putting commas mess up things with the code

static kernel
#

a mod author would have to be very dumb and determined to use a different lang system
and i know vaskii isnt a dumb mod author

static kernel
#

tho usually it would fail earlier and show an error in the log

pseudo lodge
#

hmmm

would having .addlang code that calls upon multie different mods in the```js
ClientEvents.highPriorityAssets()

static kernel
#

it shouldnt

pseudo lodge
#

I really don't know whats going on here. Thanks for your help, tho.

#

I think I'ma throw in the towel for tonight and see if I there's some answers in the morning. For now, here's the code I'm working with:

// priority: 0

console.info('Hello, World! (You will see this line every time client resources reload)')

JEIEvents.hideItems(event => {
    // Hide items in JEI here
    // event.hide('minecraft:cobblestone')
})
ClientEvents.highPriorityAssets(event => {
    event.addLang('item.quark.azalea_boat', 'Verdiant Boat'),
    event.addLang('item.quark.azalea_chest_boat', 'Verdiant Boat with Chest'),
    
    event.addLang('block.quark.azalea_planks', 'Verdiant Planks')
})
ClientEvents.highPriorityAssets(event => {
  event.addLang('wood_type.quark.azalea', 'Verdiant')

})
``` if anyone sees anything wrong here me n ArugChief ain't seeing, please let us know.
pseudo lodge
#

Work up earlier then I should've, so gonna try and get some more rest, but before I forget: could the name of the script file have any effect on things?

static kernel
#

it really shouldnt

#

unless you have multiple scripts with the same event doing very similar things

pseudo lodge
#

Done some experiments, seems like there are quite a few other mods besides quark that can't get name changed by event.addLang(). Haven't noticed any pattern to it. Maybe it's something to do with the way certain mod's Lang files are set up?

#

regardless, seeing as it's effecting several other mods, I think the issue may be on Kubejs's end. Though that diesn't mean there might not be a solution.

#

has there been any cases in the past of someone using the event.addLang() command to alter Alex's Mobs, Sully's Mod, or Quark, and it working?

If so that means the issue is something exclusive to newer versions of Kubejs, and I could just downgrade my version to bypass the problem

pseudo lodge
#

Not sure if we'll find a solution to this issue any time soon, but in the mean time I was able to acheve what I wanted via a different mod.

With that in mind: Should we close this thread?

static kernel
#

leave it open

olive fox
#

I've just encountered the same issue, also with Quark. Using newest KubeJS and trying to rename Quark's Chute, either via lang file or client script, does not work, while the client script does work for non-Quark items.

rotund wagonBOT
#

@pseudo lodge Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!

pseudo lodge
#

Ok there's a good chance I'm gonna leave this server in a bit (not because of anything this server has done wrong, just haven't been active here in millenia), but that begs the question on what fate this ticket should have

#

Cause like I know the problem probably was never resolved, but I don't know what will happen to this if I leave w/o closing it

static kernel
#

it will sit around

#

eventually someone will probably realize you left and close it

#

or the something will happen that fixes the bug and someone will close it for that

#

There are threads which are on the fourth unresolved message

pseudo lodge
#

So no worries then?

static kernel
#

yeah

pseudo lodge
#

Alright then. I'll be on my way then.

I'll probably see ya'll again someday when I get back into messin with kubejs. Until them, I wish you all well!

rotund wagonBOT
#

@pseudo lodge Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!

static kernel
#

User left, closing