#Is there a way to check if an item is in a creative menu or not?

54 messages · Page 1 of 1 (latest)

ebon lion
#

Not a specific menu, just any

rough boltBOT
#

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

ebon lion
#

im thinking it might be a way to very lazily hide the stuff that shouldnt be displayed in REI

#

since i think JEI only displays stuff in creative menus

#

if there isnt a method for that, maybe i could get an array of all items in each creative menu, and then just loop through them?

#

though uhh, it might be really inefficient lol

exotic spruce
#

No jei doesnt

#

It can display stuff not in creative menus

#

Especially with mods and addons for JEI

#

What are you even trying to achieve?

knotty anvilBOT
#

The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.

This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.

Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.

ebon lion
#

rei displays everything that gets registered, even if players arent supposed to see it at all

ebon lion
exotic spruce
#

No I see it a lot

#

What don't you want players to see?

ebon lion
#

stuff like debug items

#

disabled items from quark

#

or stuff mods have registered but arent implemented

exotic spruce
#

Ah that's because quark specifically integrates with JEI and not REI

ebon lion
#

yep

exotic spruce
#

Isn't there a mod with converts JEI addons to REI ones?

ebon lion
#

REI plugin compatibilities?

#

doesnt do anything about mods using the JEI api to hide

exotic spruce
#

You sure?

ebon lion
#

as far as i could tell yea

#

at the very least it doesnt work for quark

exotic spruce
#

Hmm in that case there's no easy way to do it. Even if you could look through the creative inv it wouldn't be straightforward, fast, or memory efficient

#

You'd have to store every item in an array

ebon lion
#

i could use sets maybe

exotic spruce
#

It would not be a good idea

ebon lion
#

yea, kubejs cant handle sets anyways either :P

#

at least a few months ago it didnt

exotic spruce
#

The best way to do it in this case is just make yourself a few helper functions

#

Like a hideQk() that automatically adds the quark namespace then hides the item

#

And then do it all manually

#

Or create and array of all the items yourself and just loop through them that way

ebon lion
#

e.hide() supports arrays already

#

might try to use that lol

exotic spruce
#

You might be able to pull that using reflection

#

I've only ever pulled functions but you could give it a shot

ebon lion
#

i barely know enough java for this but yeah im gonna try i guess

ebon lion
#

hmm weird

#

its only returning [1 backpack, 1 ravager_hide] [java.util.ArrayList]

#
const Quark = Java.loadClass('org.violetmoon.quark.base.Quark')
console.log(Quark.ZETA.requiredModTooltipHandler.disabledItems())
#

ah wait i just found out why

ebon lion
#

getting this error now```js
const IDisableable = Java.loadClass('org.violetmoon.zeta.module.IDisableable')
const BuiltInRegistries = Java.loadClass('net.minecraft.core.registries.BuiltInRegistries')
BuiltInRegistries.ITEM.forEach(item => {
let loc = BuiltInRegistries.ITEM.getKey(item)
if (loc.getNamespace().equals('quark') && !IDisableable.isEnabled(item)) {
console.log(loc.toString())
}
})

knotty anvilBOT
#

Paste version of message.txt from @ebon lion

exotic spruce
#

I see the issue

#

basically it doesn't know whether you are trying to call IDisableable.isEnabled on a block or item

#

try IDisableable["isEnabled(net.minecraft.world.item.Item)"](item)