#Dyeing items using colored beacon beams from Quark

91 messages · Page 1 of 1 (latest)

lament nacelle
#
arctic lion
#

there is a client script mentioned in the startup script, got that?

lavish oyster
#

This is so cool 😊

lament nacelle
normal willow
#

hey my game is giving me an error using those scripts, should i post it here? do you have a github or something? thanks!

arctic lion
#

do you have a github'
the links for the scripts are literally to 'a github'.
but its probably better to post them here

normal willow
#

yeah, i was asking for a github related to this scripts not to the modpack they are working xD

lament nacelle
#

These scripts aren't intended to be literally copied unless you want the direct functionality I'm implementing

#

You should probably modify them to do what you want.

#

I also reference some of my own libraries and helpers, which means you're always going to get errors unless you copy them too.

normal willow
#

i found the problem, didnt have one item used to activate the beacon. However, now the overcharged item gets consumed, the beacon gui opens and no crafting operation is done

lament nacelle
arctic lion
#

it would be nice if you could upload a self contained one

lament nacelle
#

Yeah, I'm trying to figure out what is and isn't required.

#

As far as I can tell, the only utility function I'm calling is the one to spawn particles.

#

What error were you seeing?

normal willow
#

so that was my bad, didnt see what mods you were using

#

i can send you my kubejs log if you want

lament nacelle
olive robinBOT
#

Paste version of energizedBeaconCrafting_startup.js, energizedBeaconCrafting_server.js from @lament nacelle

arctic lion
lament nacelle
#

If you don't have quark, this won't work.

normal willow
#

thank you!

#

still the same issue: the overcharged item gets consumed, beacon gui opens, but no glass is being dyed.

the only modification i did to those last scripts were removing:

    //'gag:energized_hearthstone': {
    //  result: 'gag:hearthstone',
    //  energy: 20000,
    //},

from lines 93-96 server_scripts

lament nacelle
#

If the beacon gui is opening, then it means that the event isn't being cancelled, so something is erroring out in the middle.

#

Comment out the spawnParticles lines

olive robinBOT
#

Paste version of energizedBeaconCrafting_server.js from @lament nacelle

lament nacelle
#

I replaced the function call

arctic lion
#

woah

#

please post that in the quark server, its amazing

lament nacelle
#

oo I'm not in the quark server

#

feel free to post it on my behalf if you want

arctic lion
#

im not in there either heh

normal willow
#

tested with that last script (the one that comments spawnParticles) but still not working

#

this is the error im getting:
[14:33:45] [ERROR] ! test.js#23: Error: minecraft:barrier with redirector quark:black_corundum_cluster already has a recipe!
[14:33:45] [ERROR] ! …rhino.JavaScriptException: Error: minecraft:barrier with redirector quark:black_corundum_cluster already has a recipe! (server_scripts:test.js#23)

#

i can share my kubejs log if you need it

arctic lion
#

your tags are empty

#

at least when the script is loading they are

#

yeah.... what omgi is doing when server scripts load doesnt work
you cant resolve tags on server script load

fathom tendon
#

oh you're here hallo

lament nacelle
arctic lion
#

wat

lament nacelle
#

Yeah, I'll link it after, but create the tag file in kubejs/data/kubejs/tags/items/corundum_cluster

#

It's the only way for tags to be available during server load

arctic lion
#

ooor you could just... not load it during server load

#

so that you dont have to copy any tags you want to use

lament nacelle
#

It's the only custom tag, the server load preprocesses the recipes for fast lookup. Any tag that is declared at startup through item registration should be fine. I couldn't determine if that was possible

lament nacelle
#

But yeah this is why it's hard to make it a standalone because it's just really specific to my implementation

#

I suggest using it as an example and tweaking

normal willow
#

yep, i want to tweak it but i need it working so i can understand what is going on 😅

#

if im not mistaken, here is where you are using that custom tag

   ingredient: '#kubejs:corundum_cluster',
   result: cluster,
   redirectorBlock: cluster,
   energy: 500,
 })```

startup_scripts 85-90
#

why arent you using 'minecraft:corundrum_cluster'?

lament nacelle
#

To signify that this a custom tag I'm adding

#

(even so it would be quark) I don't want to use any mods namespace for my own stuff

normal willow
#

oh cool

lament nacelle
#

It's in the server script where it's being preloaded

tender gorge
# normal willow oh cool

did you ever figure out how to solve it bc have the same problem along with the corundum just blocking the beam instead of changing the color and i tried all of them and many more fixes for hours and im stumped

tender gorge
#

and no errors but it just does not work

lament nacelle
#

Do you have quark... ?

tender gorge
#

yeah

lament nacelle
#

If you can't get the beacon beam to redirect that's not a script problem, it's a quark problem.

tender gorge
#

huh

#

ill look into it

#

ok fixed the quark issue one of my mods was messing with it

#

but it still just does not work when i right click with overcharged iron

#

it does not decharge the item but it also opens the gui

#

mabye i should chage it to just shift right click

tender gorge
#

hmm

#

but now it does consume it and open the gui while not crafting

tender gorge
#

i also keep getting a error about corundrum alr having a recipe or smth

lament nacelle
#

You should not use the example recipes I'm using. Define your own. If you use tags, you need to have them added in a datapack json file

tender gorge
#

k

lament nacelle
#

I've updated the permalinks in the original post to point to the latest version of my script. Most notably, I've moved the recipe preprocessing in the server side out of ServerEvents.loaded. This event only fires once on the first world load, which means changes to the recipes cannot be properly reloaded. Now changes to the startup script can now be reloaded by reloading first the startup script, and then the server script.

tender gorge
#

ive tried the latest verion but it still does not work.

if you need a copy of my modpack to see if mabye my other scripts are messing with some of the things then i can send one if needed

lament nacelle
#

What did you try and debug? If you just copy the scripts they won't work, you probably don't have the tags registered.

lament nacelle
# arctic lion yeah.... what omgi is doing when server scripts load doesnt work you cant resolv...

sooooo you ended up being right about this. I was testing this by exiting the world back to the main menu and loading up the world again. ServerEvents.loaded only fires once when the world is first loaded. Logging out and back in again does not fire it again so the preprocessed recipes are empty. This is actually just like a massive pain in the dick.

However, I have a sort of roundabout solution that came about as a result of trying to get the world seed on first load.

ServerEvents.loaded(e => {
  e.server.runCommandSilent('reload')
})

I cannot think of any way to get the world seed (for randomized per-world recipe generation) outside of doing this (and it seems support posts are doing the same thing). This only fires once so it's not expensive and it doesn't fire during /reload. A side effect of this is that on the second reload, tags are available in the server events, so if it's loaded with datapack json files, you can reference them with Ingredient.of('#tag').

#

Ugh, literally all of this complexity is because

  1. I want to use tags in the recipe, since it enables the JEI category to look very nice.
  2. I want to preprocess the recipes, but to get around the tag thing you can probably perform the preprocessing the first time the craft is triggered. It may lag a little the first time.
arctic lion
#

yeah getting the seed is one of the only times you actually need /reload at the moment

tender gorge
main terrace
#

how does it work to render a beacon beam? i want to make a laser kannon with it

normal willow
#

hellow! dont know if you are still working on this, sorry for bothering here (again 😅). Im trying to get this to work on mc 1.21.1, so far ive sorted some problems, but this one It exceeds my ability to understand JavaScript:

When trying to use a recipe (the terracotta one) my latest log shows this:
Error in 'BlockEvents.rightClicked': dev.latvian.mods.rhino.EcmaError: TypeError: Cannot find function getBlockList in object {EnergizedBeaconCraftingRecipes=[{ingredient: #minecraft:

normal willow
#

also seems like color constant in startup scripts isn working since any recipe that uses ${color} throws an error 'minecraft:barrier with redirector quark:red_corundum_cluster already has a recipe'

lament nacelle