Block nuisance hikari shutdown message

This commit is contained in:
PikaMug 2022-07-09 03:05:56 -04:00
parent e5d00e04d4
commit 55d2679f56
4 changed files with 8 additions and 4 deletions

View File

@ -492,7 +492,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
return null; return null;
} }
final ConcurrentSkipListSet<IQuester> set = (ConcurrentSkipListSet<IQuester>) questers; final ConcurrentSkipListSet<IQuester> set = (ConcurrentSkipListSet<IQuester>) questers;
for (final IQuester q: set) { for (final IQuester q : set) {
if (q != null && q.getUUID().equals(id)) { if (q != null && q.getUUID().equals(id)) {
return (Quester) q; return (Quester) q;
} }
@ -1707,7 +1707,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
} }
/** /**
* Reload quests, actions, config settings, lang and modules, and player data * Reload quests, actions, conditions, config settings, lang, modules, and player data
*/ */
public void reload(final ReloadCallback<Boolean> callback) { public void reload(final ReloadCallback<Boolean> callback) {
if (loading) { if (loading) {

View File

@ -316,7 +316,7 @@ public class BlockListener implements Listener {
} catch (final NoSuchMethodError err) { } catch (final NoSuchMethodError err) {
// Do nothing, getHand() not present pre-1.9 // Do nothing, getHand() not present pre-1.9
} }
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand) if (e == null || e.equals(EquipmentSlot.HAND)) { // If the event is fired by HAND (main hand)
final Player player = evt.getPlayer(); final Player player = evt.getPlayer();
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
final IQuester quester = plugin.getQuester(player.getUniqueId()); final IQuester quester = plugin.getQuester(player.getUniqueId());

View File

@ -39,6 +39,10 @@ public class QuestsLog4JFilter extends AbstractFilter {
if (message.contains("[PikaMug]")) { if (message.contains("[PikaMug]")) {
return Result.DENY; return Result.DENY;
} }
// Hikari outputs these messages as ERROR which concerns some
if (message.contains("quests-hikari - Shutdown")) {
return Result.DENY;
}
// Paper outputs errors when dependencies for module events are missing // Paper outputs errors when dependencies for module events are missing
return (message.contains("Plugin Quests") && message.contains("failed to register events")) return (message.contains("Plugin Quests") && message.contains("failed to register events"))
? Result.DENY : Result.NEUTRAL; ? Result.DENY : Result.NEUTRAL;

View File

@ -67,6 +67,6 @@ public class MySqlConnectionFactory extends HikariConnectionFactory {
@Override @Override
public Function<String, String> getStatementProcessor() { public Function<String, String> getStatementProcessor() {
return s -> s.replace("'", "`"); return s -> s.replace('\'', '`');
} }
} }