KubeJS

KubeJS

69M Downloads

Unable to manipulate REI entries of items, that don't "exist"

SplendidAlakey opened this issue ยท 12 comments

commented

Minecraft Version

1.19.2

KubeJS Version

1902.6.0-build.128

Rhino Version

1902.2.2-build.264

Architectury Version

6.3.56

Forge/Fabric Version

0.67.1

Describe your issue

  1. Create a simple script to hide anything at all from Charm in REI
// priority: 0

REIEvents.hide('item', event => {
	event.hide('charm:azalea_planks')
})
  1. Change Charm config to disable whatever item you are trying to hide from REI, in my case Azalea wood, so we set
    "AzaleaWood Enabled" = false
  2. Launch the game and observe that the entry was not hidden from REI

Recipe editing scripts work just fine. E.g. removing the same item's recipe works.

Crash report/logs

https://gist.github.com/SplendidAlakey/608c3b2132ac4965a4a733f2f1c999fa

commented

Hmm, this might be the same as #299; can you verify the items are still found in a Creative Tab?

commented

Nope, they aren't (first planks in the Creative Tab are from Aurora's Decorations, the rest are Colorful Azaleas; in REI first one is Aurora's Decorations, followed by Charm and the rest are Colorful Azaleas).

2022-12-06_14 58 02

commented

This might be an REI issue in that case? We don't really do anything special with the ingredients here, so it might be that wrapping them to EntryStack, it tries to go through the creative search somehow

commented

Should I report this to REI or is it better, if you do it? Since you could also explain the way things work on your side, etc.

commented

I'm already talking to the REI dev about it, hopefully we can find a solution for this soon ^^

commented

That's not how you hide items, you would need to do this:
REIEvents.hide('item', event => { event.hide('charm:azalea_planks') })

commented

Ok, weird. First of all, sorry, the example you provided is what I actually use, but with multiple entries like so REIEvents.hide('item', event => { event.hide(['charm:azalea_planks','charm:azalea_button'])}). I just quickly copied the script I wrote in the original post from the wiki for a test. However, it turns out the issue is probably some mod incompatibility, rather than Charm + KubeJS combo itself, because that script works with just the 2 mods, but not in a pack. I will investigate and come back with what I find...

commented

I figured it out. Disabling the item you want to hide from REI in Charm's config, prevents it from being hidden by KubeJS. Enabling items and then filtering them only with KubeJS is not an option, as, for example, Azalea wood not only adds recipes, but also completely replaces Azalea wood generation, which I want to leave disabled.

I updated the initial message and logs to reflect my findings.

commented

Upon further testing, it seems that any REI entry with an item, that doesn't "exist", is not editable with KubeJS at all. For instance, Dramatic Doors has a bunch of modded doors, but since I don't have those mods installed, I can't hide nor collapse these entries.

2022-11-28_18 56 52
2022-11-28_18 56 55

commented

Thank you for tracking this. Does REI have a corresponding GitHub issue?

commented

I don't think this is an REI issue, so no. We simply need to figure out a better way to wrap input strings (or other inputs) to REI's entry types, but that's exactly what I have been struggling with

commented

This should of been solved by #678, can someone confirm that?