Skip to content

Commit

Permalink
fix: introduce updatecommands condition for versions prior to 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
blank038 committed Nov 22, 2023
1 parent 32133d9 commit a27bdff
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.blank038.servermarket.filter.FilterBuilder;
import com.blank038.servermarket.filter.impl.KeyFilterImpl;
import com.blank038.servermarket.util.TextUtil;
import de.tr7zw.nbtapi.utils.MinecraftVersion;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.SimpleCommandMap;
Expand Down Expand Up @@ -92,7 +93,9 @@ private static void registerVirtualMarketCommands() {
}
});
// update online player commands
Bukkit.getOnlinePlayers().forEach(Player::updateCommands);
if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_13_R1)) {
Bukkit.getOnlinePlayers().forEach(Player::updateCommands);
}
}
} catch (NoSuchFieldException | IllegalAccessException e) {
ServerMarket.getInstance().getLogger().log(Level.WARNING, e, () -> "Failed to register virtual command.");
Expand Down

0 comments on commit a27bdff

Please sign in to comment.