Compatibility
Minecraft: Java Edition
1.21.x
Platforms
Creators
Details
Changelog
Version 1.1.5
Overview
This release reintroduces HikariCP for enhanced MySQL database performance and adds a public API for other plugins to interact with OllamaChat's AI chat functionality. It focuses on improving database efficiency, extensibility, and developer integration while maintaining compatibility with existing configurations.
New Features
- HikariCP Integration:
- Added HikariCP connection pooling for MySQL databases to improve performance and resource management.
- Configurable HikariCP settings in
config.yml
underdatabase.mysql.hikari
for tuning connection pool parameters (e.g.,maximum-pool-size
,connection-timeout
).
- Public API:
- Introduced
OllamaChatAPI
interface (com.ollamachat.api.OllamaChatAPI
) for other plugins. - Supports sending AI queries, managing conversations, and accessing chat history programmatically with methods like
sendAIQuery
,createConversation
, andlistConversations
. - Added API documentation in
API.md
for developer integration.
- Introduced
Enhancements
- Database Management:
- Updated
DatabaseManager
to leverage HikariCP for MySQL connections, while preserving SQLite functionality.
- Updated
- Dependency Management:
- Updated
DependencyLoader
to include HikariCP (version 5.1.0) alongside MySQL and SQLite JDBC drivers, downloaded at runtime toplugins/OllamaChat/libs
. - Maintained
compileOnly
inbuild.gradle
for non-Paper dependencies to minimize JAR size.
- Updated
- Configuration:
- Added
database.mysql.hikari
section toconfig.yml
with default settings for connection pooling. - Improved
config.yml
comments for clarity and ease of use.
- Added
Bug Fixes
- No specific bug fixes in this release, as the focus was on new features and performance improvements.
API Usage Example
Plugin ollamaPlugin = getServer().getPluginManager().getPlugin("OllamaChat");
if (ollamaPlugin != null && ollamaPlugin.isEnabled()) {
OllamaChatAPI api = ((com.ollamachat.core.Ollamachat) ollamaPlugin).getAPI();
api.sendAIQuery(player, "ollama", "Hello, how are you?")
.thenAccept(response -> player.sendMessage("AI Response: " + response));
}
Configuration Example
database:
type: mysql
mysql:
host: localhost
port: 3306
database: ollamachat
username: root
password: ""
hikari:
maximum-pool-size: 10
connection-timeout: 30000
Notes for Upgrading
- Configuration:
- Update
config.yml
to include thedatabase.mysql.hikari
section if using MySQL. Default values are added automatically. - Backup existing
config.yml
before updating to avoid data loss.
- Update
- Dependencies:
- The plugin downloads HikariCP (version 5.1.0) automatically on first startup. Ensure server internet access or verify
HikariCP-5.1.0.jar
inplugins/OllamaChat/libs
. - Delete the
libs
folder to force re-download if dependencies are corrupted.
- The plugin downloads HikariCP (version 5.1.0) automatically on first startup. Ensure server internet access or verify
- API Integration:
- Developers can hook into
OllamaChat
usingOllamaChatAPI
. Addsoftdepend: [OllamaChat]
toplugin.yml
and refer toAPI.md
.
- Developers can hook into
- Compatibility:
- This update is backward-compatible with existing configurations and databases.
- Testing:
- Test database operations (e.g.,
/ollamachat conversation new
) to verify MySQL/SQLite functionality. - Check server logs for dependency loading or database errors.
- Test database operations (e.g.,
Known Issues
- HikariCP settings may require manual tuning for optimal performance based on server load and MySQL configuration.
版本 1.1.5
概述
本次更新重新引入HikariCP以提升MySQL数据库性能,并新增公共API供其他插件与OllamaChat的AI聊天功能交互。重点改进数据库效率、可扩展性和开发者集成,同时保持与现有配置的兼容性。
新特性
- HikariCP集成:
- 为MySQL数据库添加HikariCP连接池,提升性能和资源管理
- 在
config.yml
的database.mysql.hikari
下可配置连接池参数(如maximum-pool-size
、connection-timeout
)
- 公共API:
- 新增
OllamaChatAPI
接口(com.ollamachat.api.OllamaChatAPI
) - 支持通过编程方式发送AI查询、管理会话和访问聊天记录(如
sendAIQuery
、createConversation
、listConversations
等方法) - 开发者文档见
API.md
- 新增
功能增强
- 数据库管理:
- 更新
DatabaseManager
以使用HikariCP管理MySQL连接,同时保留SQLite功能
- 更新
- 依赖管理:
- 更新
DependencyLoader
包含HikariCP(5.1.0版)及MySQL/SQLite驱动,运行时下载至plugins/OllamaChat/libs
- 保持
build.gradle
中非Paper依赖使用compileOnly
以减小JAR体积
- 更新
- 配置优化:
- 在
config.yml
新增database.mysql.hikari
配置段 - 改进配置注释的清晰度
- 在
问题修复
- 本版本主要侧重新功能和性能提升,无特定问题修复
API使用示例
Plugin ollamaPlugin = getServer().getPluginManager().getPlugin("OllamaChat");
if (ollamaPlugin != null && ollamaPlugin.isEnabled()) {
OllamaChatAPI api = ((com.ollamachat.core.Ollamachat) ollamaPlugin).getAPI();
api.sendAIQuery(player, "ollama", "你好吗?")
.thenAccept(response -> player.sendMessage("AI回复: " + response));
}
配置示例
database:
type: mysql
mysql:
host: localhost
port: 3306
database: ollamachat
username: root
password: ""
hikari:
maximum-pool-size: 10
connection-timeout: 30000
升级须知
- 配置:
- 使用MySQL需更新
config.yml
添加hikari
配置段(默认值会自动生成) - 升级前备份现有配置
- 使用MySQL需更新
- 依赖:
- 首次启动自动下载HikariCP(5.1.0版),确保服务器联网或检查
plugins/OllamaChat/libs
目录 - 依赖损坏时可删除
libs
文件夹强制重新下载
- 首次启动自动下载HikariCP(5.1.0版),确保服务器联网或检查
- API集成:
- 开发者可通过
OllamaChatAPI
集成,在plugin.yml
添加softdepend: [OllamaChat]
并参考API.md
- 开发者可通过
- 兼容性:
- 保持与现有配置和数据库的向后兼容
- 测试建议:
- 测试数据库操作(如
/ollamachat conversation new
命令) - 检查服务器日志中的依赖加载和数据库错误
- 测试数据库操作(如
已知问题
- HikariCP参数可能需要根据服务器负载手动调优
Files
Metadata
Release channel
ReleaseVersion number
1.1.5Loaders
Game versions
1.21–1.21.9Downloads
50Publication date
July 31, 2025 at 5:48 PMPublisher

xwwsdd
Member