1.2.0
Compatibility
Changes
Gun Plugin Changelog
[1.2.0]
🎯 Major Updates
Grenade System
-
Added High Explosive Grenade
- Explodes after 5 seconds, dealing damage to entities within 5 block radius
- Center explosion damage: 20 points, edge damage: 2 points
- Material: Slime Ball
- Supports left-click low throw and right-click high throw
-
Added Molotov Cocktail
- Generates fire particles in 3 block radius at impact point
- Deals 4 damage per second to players in contact, lasts 10 seconds
- Fire spreads downward until hitting non-air blocks
- Material: Fire Charge
- Supports left-click low throw and right-click high throw
-
Added Smoke Grenade
- Generates smoke particles in 3x3x3 area at impact point
- Provides visual cover, lasts 15 seconds
- Material: Egg
- Supports left-click low throw and right-click high throw
Multi-Language System
-
Complete Multi-Language Support
- Supports Chinese (zh_CN) and English (en_US)
- Language switching via configuration file
- Language switching command
/gun lang
-
Localized Content
- All in-game messages support multiple languages
- Gun names, ammo names, grenade names localized
- Help information, error messages, console logs localized
- ActionBar messages, item descriptions localized
🔧 Feature Improvements
Grenade System Optimization
-
Throw Cooldown Mechanism
- 2-second throw interval to prevent spam
- Shows remaining time during cooldown
-
High Explosive Grenade Optimization
- Countdown starts when thrown, not when landing
- Landing sound effects:
minecraft:block.anvil.placeandminecraft:entity.tnt.primed - Continuous smoke particles during countdown
- Ensures entity cleanup after explosion
-
Molotov Cocktail Optimization
- Fire sound effect
minecraft:block.fire.ambientin flames - Optimized downward fire spread logic
- Maximum 20 block depth check
- Fire sound effect
-
Smoke Grenade Optimization
- Uses
minecraft:explosion_emitterparticle effect - Optimized smoke height and radius
- Uses
Language System Optimization
-
Language Manager Enhancement
- Automatically copies language files from resources folder
- Supports message key fallback mechanism
- Detailed debug logs and error handling
- Parameter replacement system support
-
Enum Multi-Language Support
GunTypeenum supports localized namesAmmoTypeenum supports localized names and descriptions- Dynamic current language setting retrieval
🎮 New Commands
Language Management Commands
/gun lang- Show current language and available languages/gun lang <language_code>- Switch language (zh_CN/en_US)
Grenade Commands
/gun give grenade [amount]- Get High Explosive Grenade/gun give molotov [amount]- Get Molotov Cocktail/gun give smoke [amount]- Get Smoke Grenade
📋 Configuration Updates
Language Configuration
# Language Settings
# Supported languages: zh_CN (Chinese), en_US (English)
language: "zh_CN"
Grenade Configuration
- Throw distance: High throw max 50 blocks, low throw max 10 blocks
- Throw cooldown: 2 seconds
- Explosion delay: 5 seconds
- Fire duration: 10 seconds
- Smoke duration: 15 seconds
🐛 Bug Fixes
Grenade System Fixes
- Fixed bug where items were consumed during cooldown
- Fixed High Explosive Grenade explosion center position error
- Fixed grenade entity not being cleared after explosion
- Fixed inaccurate countdown timing
Multi-Language System Fixes
- Fixed warnings caused by missing message keys
- Fixed gun item names not being translated
- Fixed ActionBar messages not being translated
- Fixed console logs not being translated
- Fixed help messages not being translated
📁 New Files
Language Files
src/main/resources/messages/zh_CN.yml- Chinese language filesrc/main/resources/messages/en_US.yml- English language file
Documentation Files
- Multi-language system usage guide
- Multi-language system fix guide
- Final fix guide
- Grenade system usage guide
🔄 Technical Improvements
Code Structure Optimization
- Added
LanguageManagerclass for multi-language management - Added
GrenadeManagerclass for grenade management - Added
Grenadeclass for grenade logic - Optimized
GunCommandclass for multi-language support - Optimized
GunListenerclass for multi-language support
Performance Optimization
- Optimized grenade entity management
- Optimized language file loading
- Optimized message retrieval performance
🎯 Compatibility
Backward Compatibility
- Maintains complete compatibility with existing gun system
- Maintains complete compatibility with existing command system
- Maintains complete compatibility with existing configuration format
Version Compatibility
- Supports Minecraft 1.21.4
- Supports Spigot API
- Supports Bukkit API
📊 Statistics
Code Statistics
- New code lines: ~2000+ lines
- New class files: 4
- New language files: 2
- Modified files: 15+
Feature Statistics
- New grenade types: 3
- New language support: 2
- New commands: 3
- New configuration options: 1
枪械插件更新日志
[1.2.0]
🎯 重大更新
投掷物系统
-
新增高爆手雷
- 投掷后5秒爆炸,对半径5格内的生物造成伤害
- 中心爆炸伤害20点,边缘伤害2点
- 材质:粘液球
- 支持左键低抛、右键高抛投掷
-
新增燃烧瓶
- 在落点生成半径3格的火焰粒子
- 对接触的玩家造成每秒4点伤害,持续10秒
- 火焰会向下传播直到遇到非空气方块
- 材质:火焰弹
- 支持左键低抛、右键高抛投掷
-
新增烟雾弹
- 在落点生成半径3格、高3格的烟雾粒子
- 提供视觉掩护,持续15秒
- 材质:鸡蛋
- 支持左键低抛、右键高抛投掷
多语言系统
-
完整的多语言支持
- 支持中文 (zh_CN) 和英文 (en_US)
- 可通过配置文件切换语言
- 支持语言切换命令
/gun lang
-
本地化内容
- 所有游戏内消息支持多语言
- 枪械名称、弹药名称、投掷物名称本地化
- 帮助信息、错误消息、控制台日志本地化
- ActionBar消息、物品描述本地化
🔧 功能改进
投掷物系统优化
-
投掷冷却机制
- 投掷间隔2秒,防止连续投掷
- 冷却期间显示剩余时间提示
-
高爆手雷优化
- 投掷时开始倒计时,不再等待落地
- 落地时播放音效:
minecraft:block.anvil.place和minecraft:entity.tnt.primed - 倒计时期间持续显示烟雾粒子
- 爆炸后确保实体正确清除
-
燃烧瓶优化
- 火焰中播放火焰音效
minecraft:block.fire.ambient - 火焰向下传播逻辑优化
- 最多检查20格深度
- 火焰中播放火焰音效
-
烟雾弹优化
- 使用
minecraft:explosion_emitter粒子效果 - 烟雾高度和半径优化
- 使用
语言系统优化
-
语言管理器增强
- 自动从资源文件夹复制语言文件
- 支持消息键回退机制
- 详细的调试日志和错误处理
- 参数替换系统支持
-
枚举多语言支持
GunType枚举支持本地化名称AmmoType枚举支持本地化名称和描述- 动态获取当前语言设置
🎮 新增命令
语言管理命令
/gun lang- 显示当前语言和可用语言/gun lang <语言代码>- 切换语言 (zh_CN/en_US)
投掷物命令
/gun give grenade [数量]- 获得高爆手雷/gun give molotov [数量]- 获得燃烧瓶/gun give smoke [数量]- 获得烟雾弹
📋 配置更新
语言配置
# 语言设置 (Language Settings)
# 支持的语言: zh_CN (中文), en_US (英文)
language: "zh_CN"
投掷物配置
- 投掷距离:高抛最远50格,低抛最远10格
- 投掷冷却:2秒
- 爆炸延迟:5秒
- 火焰持续时间:10秒
- 烟雾持续时间:15秒
🐛 错误修复
投掷物系统修复
- 修复投掷冷却期间仍扣除物品数量的bug
- 修复高爆手雷爆炸中心位置错误的问题
- 修复手雷爆炸后实体不清除的问题
- 修复倒计时时间不准确的问题
多语言系统修复
- 修复消息键不存在导致的警告
- 修复枪械物品名称不翻译的问题
- 修复ActionBar消息不翻译的问题
- 修复控制台日志不翻译的问题
- 修复帮助消息不翻译的问题
📁 新增文件
语言文件
src/main/resources/messages/zh_CN.yml- 中文语言文件src/main/resources/messages/en_US.yml- 英文语言文件
文档文件
多语言系统说明.md- 多语言系统使用说明多语言系统修复说明.md- 多语言系统修复说明多语言系统最终修复说明.md- 最终修复说明投掷物系统说明.md- 投掷物系统使用说明
🔄 技术改进
代码结构优化
- 新增
LanguageManager类管理多语言 - 新增
GrenadeManager类管理投掷物 - 新增
Grenade类处理投掷物逻辑 - 优化
GunCommand类支持多语言 - 优化
GunListener类支持多语言
性能优化
- 投掷物实体管理优化
- 语言文件加载优化
- 消息获取性能优化
🎯 兼容性
向后兼容
- 保持原有枪械系统完全兼容
- 保持原有命令系统完全兼容
- 保持原有配置文件格式兼容
版本兼容
- 支持 Minecraft 1.21.4
- 支持 Spigot API
- 支持 Bukkit API
📊 统计信息
代码统计
- 新增代码行数:约 2000+ 行
- 新增类文件:4个
- 新增语言文件:2个
- 修改文件:15+ 个
功能统计
- 新增投掷物类型:3种
- 新增语言支持:2种
- 新增命令:3个
- 新增配置项:1个
版本: 1.2.0
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:gK2oBkQi:lCyXwqPy"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:gK2oBkQi:lCyXwqPy"
}

