Not Enough Items 1.8.+

Not Enough Items 1.8.+

16M Downloads

NEI, apparently, doesn't like skipping parameters?

Twisted-Code opened this issue ยท 14 comments

commented

since my server runs Nucleus (via SpongeForge) and thus has a command that overrides /gamemode and doesn't require a target-user parameter to target yourself, well, I tried configuring NEI to reflect that. Instead of simply skipping the parameter I didn't specify, however, NEI caused the game to crash when I clicked the gamemode button. After that, I tried adding the parameter I left out, but for some reason the game still crashed when I clicked the button, which makes me wonder what the real bug is.

crash-2017-06-06_17.10.53-client.txt

Minecraft version 1.10, server is running Sponge
if you need any more info, just let me know.

commented

crash-2017-06-08_07.31.30-client.txt
this crash occurred after, as I said above, I replace the 'missing' parameters

commented

I ended up having to delete the config element for the command from the global cfg, after which it stopped crashing

commented

any idea what was going on here? I mean, don't get me wrong, I understand if you don't want to deal with a bug involving a SpongeForge server, but you haven't even labeled this? maybe you're just busy, I guess... wish I could say the same for myself.

commented

Sorry, this probably is a bug yes, it comes down to the way NEI formats the parameters of the command, there really isn't much I can do but I'll look in to it.

commented

You might at least try try-except-catching the exception and outputting it to chat or something so it doesn't crash the whole game. In other words, the attempt to change game modes should just fail instead of causing a crash.
At any rate, maybe you could at least try to figure out why it continued to crash after I added the parameter back. As far as I know, I put it back exactly as the config was originally, but it continued to crash until I forced the mod to reset the entry by removing it.

commented

Try catch will be implemented for 1.11, But sadly its not easy to just skip parameters.

commented

really? oh, I suppose you're using Java's equivalent of the string formatting operator, right? I'm not sure what it would be, but I know of such a thing in Python, so if Java has a similar operator, I can relate.

Maybe you should work on it though, since not every server is going to need all the parameters, and might not even accept them without side effects... though in the latter case I suppose it's more the fault of the server than your mod.
For instance, in the case of my server, I can use the username parameter for /gamemode, but unless I specifically run the vanilla command (to which sponge gives the alias "/minecraft:gamemode"), specifying a username causes it to tell me who's gamemode I toggled and who toggled mine.

anyway, all that aside, I'd much rather fix the root problem that's making NEI default to using those commands when I know for a fact the mod is running on the server so it should be able to change it via a packet to the server mod, as it normally does. I'll open an issue about that shortly and reference it here

commented

it uses stuff in java that ive never seen before, when i have time ill look in to it more.

commented

No sadly, 1.10 is going to have to stay as it is, I've started the 1.12 process and I don't have time to deal with 3 versions. Lots in Nei got rewritten in the 1.11 port and I don't have time to break my brain over it again, even though this may be a simple fix, I just don't have time.

commented

okay, sounds good. And I'm glad at least try-catch is implemented, although I wish it were so in 1.10. Any chance you'll back-port that fix at some point?

commented

Sure, Id be happy to accept a PR, Obviously it would need to target 1.11, and very soon 1.12. But i will accept the PR for 1.12 if you create the pr by the time its ready, then ill also accept a second pr for 1.11

commented

okay :/

commented

maybe I can PR it at some point. Need to get a little more familiar with modding first though

commented

honestly it's quite unlikely to happen at all, as I'm busy with other things like trying to get stuff in order for college. I wouldn't rule it out, but I wouldn't hold my breath for it either