From 927641f005f44012ca5e657f7cd989ac1885268e Mon Sep 17 00:00:00 2001 From: BenCodez Date: Mon, 7 Oct 2024 07:33:08 -0600 Subject: [PATCH] Actually fix time changes on velocity not working correctly --- .../bencodez/votingplugin/bungee/VotingPluginBungee.java | 8 ++------ .../bungee/velocity/VotingPluginVelocity.java | 9 +++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java index 24e9f9095..a35ce48cc 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java @@ -877,9 +877,7 @@ protected void onMessage(String channel, String[] message) { String server = message[1]; getLogger().info("Status okay for " + server); } else if (message[0].equalsIgnoreCase("TimeChangeFinished")) { - if (getConfig().getGlobalDataEnabled()) { - getGlobalDataHandler().checkForFinishedTimeChanges(); - } + } else if (message[0].equalsIgnoreCase("login")) { String player = message[1]; String uuid = message[2]; @@ -1188,9 +1186,7 @@ public void onPluginMessage(PluginMessageEvent ev) { getLogger().info("Status okay for " + server); return; } else if (subchannel.equalsIgnoreCase("TimeChangeFinished")) { - if (getConfig().getGlobalDataEnabled()) { - getGlobalDataHandler().checkForFinishedTimeChanges(); - } + } else if (subchannel.equalsIgnoreCase("login")) { String player = in.readUTF(); String uuid = in.readUTF(); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java index a708b358c..f3fca291f 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java @@ -498,9 +498,7 @@ public void onPluginMessagingReceived(PluginMessageEvent event) { logger.info("Status okay for " + server); return; } else if (subchannel.equalsIgnoreCase("TimeChangeFinished")) { - if (getConfig().getGlobalDataEnabled()) { - getGlobalDataHandler().checkForFinishedTimeChanges(); - } + } else if (subchannel.equalsIgnoreCase("login")) { String player = in.readUTF(); @@ -706,6 +704,7 @@ public void timeChanged(TimeType type, boolean fake, boolean pre, boolean post) } } + globalDataHandler.onTimeChange(type); } @Override @@ -965,9 +964,7 @@ protected void onMessage(String channel, String[] message) { String server = message[1]; getLogger().info("Status okay for " + server); } else if (message[0].equalsIgnoreCase("TimeChangeFinished")) { - if (getConfig().getGlobalDataEnabled()) { - getGlobalDataHandler().checkForFinishedTimeChanges(); - } + } else if (message[0].equalsIgnoreCase("login")) { String player = message[1]; String uuid = message[2];