KAMKEEL / CustomNPC-Plus

Custom Version of 1.7.10 CustomNPC with backported features and original expansions
https://www.curseforge.com/minecraft/mc-mods/customnpc-plus
Other
53 stars 34 forks source link

add check FakePlayers #121

Closed JustCursed closed 7 months ago

JustCursed commented 8 months ago

when sending a packet to a fakeplayer (in my case a robot from opencomputers), an error is thrown in the console. i don't think they need to send packets to update quests i didn't understand under what circumstances the robot called the event, but the main thing is that this check fixed it

KAMKEEL commented 7 months ago

I think I'm going to need more information. I tested this just now and other mods that forcefully make FakePlayers and manipulate quest data do have error with this line. I'm not familiar with OpenComputers. However, you may want to test the events in which this is called.

JustCursed commented 7 months ago

i tried to reproduce this error, but i couldn't. for some reason only 1 robot on my server was causing it, and I didn't notice any peculiarities in him. he's just the only one who gets there are there fakeplayers that work with quests? if so, we can just do a robot specific check getCommandSenderName().endsWith(".robot")

JustCursed commented 7 months ago

okay, i found my log with error. message(14).txt i don't have time yet, but you could try the robot.suck method docs: https://ocdoc.cil.li/api:robot

KAMKEEL commented 7 months ago

@JustCursed Oh perfect! I know exactly whats happening I can fix it. It's called during the Item Pick Up Event. Your robot is simulating an Item Pick Up and CNPC+ is trying to check if it has an Item Quest to check for it. I can block it during the Pick Up Event.

See if you can simulate other events for your robot. This will be fixed this weekend :)

KAMKEEL commented 7 months ago

I'm going to close this PR. For now just open up an Issue Tab and we can communicate there or in my discord in the CustomNPC+ Bug Report Section!