MarkusBordihn / BOs-Easy-NPC

Create easily NPC for your world or for your mod.
Other
16 stars 6 forks source link

Fabric: 1.20.1 Unable to click on npc(s) #195

Closed GeneralBread33 closed 22 hours ago

GeneralBread33 commented 2 months ago

I just can't open any npc menus. I've only tried humanoid so far but I also only want to use humanoids. Please Fix, I'm trying to make a cobblemon battletower. Fabric through curseforge

carisoul commented 2 months ago

I'm having the same issue unfortunately, I tested it in a modpack without any other mods so the issue isnt incompatibility

carisoul commented 2 months ago

Tested things out and this is only an issue with Fabric for 1.20.1, it works with Forge 1.20.1 and Fabric 1.19.2 (because those are the only versions for cobblemon)

MarkusBordihn commented 2 months ago

Sorry I was not really able to reproduce the issue in 1.20.1 in Fabric, see:

https://github.com/MarkusBordihn/BOs-Easy-NPC/assets/12183293/90436a50-19b3-45e5-93fe-8baf5cf21952

Please provide more details like requested in the original issue template to be able to reproduce the issue. Thanks.

seVik777 commented 2 months ago

Idk if this is the same issue as i have, but i can't seem to interact with npc's in any way exept moving them. I can't use the wand nor use any other way to target the npc. I'm currently using fabric with cursforge on 1.20.1 and don't understand what issues i could be having.

MarkusBordihn commented 2 months ago

I think there is a misunderstanding of the current status of the Fabric version.

There is a big note on the official mod release pages like: image

Which means that currently you can't configure the NPC over the wand item or any other configuration screen in Fabric, because it's not implemented yet. However you can use the Forge version to config the NPC and import them into Fabric.

If you have downloaded the mod from an unofficial web-page, it could be that such note is missing. For this reason and several other reasons I always recommend to only use the official mod release pages.

seVik777 commented 2 months ago

Big thank you and a nother one for the tip.

Qeltas commented 2 months ago

Sorry to hijack this issue-ticket I just wanted to understand this better. Is the code for the npc configuration fundamentally different from the forge version? or in any way harder to implement? trying to understand why there is no config for the npcs but they remain totally functional. I know Forge and Fabric are not the same just trying to understand it better as I have no clue how to code stuff. Anyways best npc mod created.

MarkusBordihn commented 2 months ago

Sorry to hijack this issue-ticket I just wanted to understand this better. Is the code for the npc configuration fundamentally different from the forge version? or in any way harder to implement? trying to understand why there is no config for the npcs but they remain totally functional. I know Forge and Fabric are not the same just trying to understand it better as I have no clue how to code stuff.

Good question, let me try to explain this on a high level. In general there are the following main mod loader like:

If you build a mod for only one specific mod loader you normally use the helper functionality of these mod, to write less code. Like in my case, this mod started as Forge only mod and use a lot of the Forge helper functionallity.

The problem with this is, that these helper functionality doesn't exists on other mod loader.

For entities this includes the entity, texture, model, behavior, renderer ... which are little bit different between these mod loaders. For the gui like the config screens this includes container, menu, text, icons, translations, screen and network packages to transfer data between server <-> client are much more difference between the mod loaders.

This means I need to remove the Forge helper and replace them with something generic which could be used by all mod loaders instead. However this could not be done with a simple search and replace, because some mod loader handles things complete different. It could be something simple like a color or something more complex like sending and receiving data, which requires time to rewrite the code and adding your own helper functionality in some cases instead.

If you start with a multi-loader mod from the beginning you can easily avoid all of the helper functionality to make this easier. In this case however I just started with Fabric modding this year and so I mostly focused on Forge only before.

To give you an idea about how many files and line of code we are talking about. For the configuration screen this includes the following folder (screen, menu and network).

Basically I need to rewrite each of these files about 25 times (1 common + 4 mod loaders x 5 versions ) to support all mod loaders and versions like 1.18.2, 1.19.2, 1.20.1, 1.20.2, 1.20.6.

Even with the help of AI is this still a lot of code, which needs to be changed.

Something simple like the following screen (left Fabric, right Forge), already took me some hours (135 file changes, 11 new files) to make it work for all mod loaders for 1.18.2. image

The positive side is however, because of the code rewrites some parts will be much faster and stable compared to the original code for all mod loaders.

All of this takes time, which I need to do besides my day-to-day job and other activities.

Qeltas commented 2 months ago

Holy...man I didn't expect such a thorough explanation and I thank you for that. You explained that very well and I could follow it well enough to understand this matter better now. It is like you said some parts will be much faster and more stable to update in the future and I hope you see this through! And thank you again for your time you took off of your modding-work. Keep that energy up! cheers