PoiXson / pxnBackrooms-mirror

0 stars 1 forks source link

Could not pass event PlayerMoveNormalEvent to pxnBackrooms v0.1.19-SNAPSHOT #14

Closed AnatomyKing closed 8 months ago

AnatomyKing commented 8 months ago

I have a new bug, I thought it was due to my server? But I installed pxnBackrooms on a clean server and the error still shows up. https://mclo.gs/q0sJL6S

I think It's due to this? not sure though https://github.com/PoiXson/pxnBackrooms-mirror/blob/master/src/com/poixson/backrooms/BackroomsPlugin.java#L390C1-L403C3

because when I opend my code it was showing this

{
    "resource": "/C:/Users/mrluu/Documents/GitHub/pxnBackrooms-Anatomy/src/com/poixson/backrooms/BackroomsPlugin.java",
    "owner": "_generated_diagnostic_collection_name_#2",
    "code": "536871371",
    "severity": 4,
    "message": "Potential null pointer access: This expression of type Integer may be null but requires auto-unboxing",
    "source": "Java",
    "startLineNumber": 392,
    "startColumn": 10,
    "endLineNumber": 392,
    "endColumn": 70
}]

chatgpt suggested this fix, I hope this helps a bit

Integer worldLevel = this.getWorldLevel(world.getName());
return (worldLevel == null ? null : worldLevel);
lorenzop commented 8 months ago

fixed. the function getWorldLevel() was missing a few checks. it needs to be sure the world name starts with level. it's also safe to ignore number format exceptions here.

AnatomyKing commented 8 months ago

fixed. the function getWorldLevel() was missing a few checks. it needs to be sure the world name starts with level. it's also safe to ignore number format exceptions here.

Oh!! thank you for fixing it!!