Snownee / Lychee

Minecraft data-driven in-world crafting mod.
https://www.curseforge.com/minecraft/mc-mods/lychee
28 stars 3 forks source link

Use KubeJS Server scripts instead of Startup scripts #51

Closed slava110 closed 1 year ago

slava110 commented 1 year ago

Mod loader

Forge

Minecraft version

1.19.2

Mod version

3.14.0

Modloader version

Forge 43.2.21

Modpack info

No response

If bug:

If bug: The latest.log file

No response

Issue description

It isn't convenient from modpack maker's perspective to reload minecraft after changing a few lines of code in KubeJS custom action or condition. Instead of using Startup scripts Server scripts could be used for KubeJS integration. It will allow modpack makers to make changes and test them right after reload command (instead of restarting the whole game).

Snownee commented 1 year ago

use /kubejs reload startup_scripts

slava110 commented 1 year ago

It doesn't reload Lychee custom actions defined in my script

Snownee commented 1 year ago

does it work if you run /reload then?

slava110 commented 1 year ago

No it doesn't. /reload only reloads server scripts. Currently Lychee requires full client restart to apply changes

slava110 commented 1 year ago

Oh, I see. I need to use both /kubejs reload startup_scripts and /reload. That's weird. Is it possible to just use Server Scripts in the future?

Snownee commented 1 year ago

probably not. because some part of the code will be executed on the client side (testInTooltipsFunc)

slava110 commented 1 year ago

What if testInTooltips will be on client side then? Something like LycheeEvents.customConditionTooltip(String conditionId, ...). And customAction, customCondition will be used on server side.

Snownee commented 1 year ago

not only that, the event.condition.testFunc can also be executed on the client side