Curios API (Forge/NeoForge)

Curios API (Forge/NeoForge)

140M Downloads

1.16.5 GUI wont open

TheShadowModsUK opened this issue ยท 4 comments

commented

Versions (Be specific, do not write "latest"):

  • Curios: 4..0.5.3
  • Forge/Fabric: Forge 1.16.5 - 36.2.0

Observed Behavior: GUI wont open

Expected Behavior: Menu showing

Steps to Reproduce:

  1. Added Curse to my build file(works)
    2.Created a file to register my item
    3.Created json file of for item.

My code:

package codedomain.modname;


import top.theillusivec4.curios.api.CuriosApi;
import net.minecraftforge.fml.InterModComms;
import top.theillusivec4.curios.api.SlotTypeMessage;
import top.theillusivec4.curios.api.SlotTypePreset;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;

import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;

public class CuriosBelt {

	private void enqueue(final InterModEnqueueEvent evt) {
		InterModComms.sendTo("curios", SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.BELT.getMessageBuilder().build());
	}
}

Json: belt.json

{
    "replace": false,
    "values": [
        "modname:belt1"
    ]
}

The item has the slot: belt option on it but no slots are shown, I feel I am missing a stage but after reading the wiki a few times I can't see about showing the GUI panel in this case the Belt Slot.

commented

Yes, the tooltip is driven by the data files, so that part seems to be working fine. It's just the slot registration that may have some problems depending on if your code is running or not.

commented

It sounds like your slot registration code may not be running. For your InterModEnqueueEvent listener, how are you subscribing to the event?

commented

I have just jumped into bed so will post my old version what was registered better I think this noe one I forgot that part but it didn't work before also, I 100% believe the code isn't running, I take it that the slot: belt on the tool tip is driven by the JSON file then ?

Thanks for the reply and I will be back with you tomorrow.

commented

This was my error I missed out my "EventBusSubscribe" when changing it, I have been able to get the belt to now show I am hoping to get my head around things, sorry for opening a bug report when it was my error but thanks for your insight.