mcmonkeyprojects / Sentinel

Combat NPCs for Spigot!
MIT License
168 stars 84 forks source link

Error spam due to SentinelTowny not handling #358

Closed galacticwarrior9 closed 3 years ago

galacticwarrior9 commented 3 years ago

The output of command /version on my server is: This server is running Tuinity version git-Tuinity-"d5bb4d2" (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT) The output of command /version citizens on my server is: Citizens version 2.0.27-SNAPSHOT (build 2197) The output of command /version sentinel on my server is: Sentinel version 2.2.0-SNAPSHOT (build 373) A pastebin.com link to my (full!) Sentinel/config.yml file is: Untouched default configuration.

When one or more player-type NPCs are in the proximity of an NPC with the "nationallies" or "nationenemies" targeting label from Sentinel's Towny integration, this error is spammed in console.

The issue is caused by com.palmergames.bukkit.towny.exceptions.NotRegisteredException not being handled when fetching residents via TownyUniverse.getDataSource().getResident(ent.getName()), as ent can be a NPC and is thus not registered as a resident with Towny.

BehrRiley commented 3 years ago

That looks like an issue with the plugin SentinelTowny - additionally, I'd recommend testing on a supported server version like Spigot or Paper

galacticwarrior9 commented 3 years ago

That looks like an issue with the plugin SentinelTowny - additionally, I'd recommend testing on a supported server version like Spigot or Paper

Hi there,

SentinelTowny is not a separate plugin - it is the name of the class within Sentinel which manages its Towny integration. I have edited the OP to clarify this.

I have reproduced this on the latest build of Paper 1.16.4, which at the time of writing is Paper 1.16.4 build 325 (git-Paper-325).

mcmonkey4eva commented 3 years ago

I've fixed this via the commit above for build 382+ from https://ci.citizensnpcs.co/job/Sentinel/ However, this is more properly considered a Towny error in the way it handles Residents (ie: by name instead of UUID or entity object, and throwing an error when it should be returning null and/or an invalid-resident instance of some form).

While the new build will prevent the error message, I'd recommend relaying the problem to Towny's devs.

LlmDl commented 3 years ago

I've fixed this via the commit above for build 382+ from https://ci.citizensnpcs.co/job/Sentinel/ However, this is more properly considered a Towny error in the way it handles Residents (ie: by name instead of UUID or entity object, and throwing an error when it should be returning null and/or an invalid-resident instance of some form).

While the new build will prevent the error message, I'd recommend relaying the problem to Towny's devs.

We're transitioning away from using Names in the database, it has been possible to get a resident from a player UUID for a while now.