▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/DK CommandItems
DK CommandItems

DK CommandItems

DKCommandItems is a powerful Minecraft plugin that lets you create custom items with automatic commands, bringing new levels of interaction and creativity to your server

128
2
Все версииDK CommandItems 1.3-SNAPSHOT

DK CommandItems 1.3-SNAPSHOT

Release3 нед. назад

Список изменений

DKCommandItems - Changelog v1.3

🆕 New Features

Customizable Lore System

  • Toggle Default Lore: Added show-default-lore option in config.yml to enable/disable the default plugin lore
  • Hidden Identifier: When disabled, only an invisible identifier is added to items
  • Custom Lore Freedom: Allows players to create items with fully customized lore without plugin information
  • Configuration: New setting in config.yml with comments in English, Portuguese, and Spanish

Case-Insensitive Placeholders

  • Flexible Placeholders: All placeholders now work regardless of capitalization
  • Supported Formats: %player%, %Player%, %PLAYER%, %PlAyEr% all work correctly
  • All Placeholders: Applies to all placeholders including %world%, %x%, %y%, %z%, %health%, %food%, %level%

🔧 Bug Fixes

GUI Listener Management

  • Fixed Duplicate Messages: Implemented GUIManager to prevent multiple listeners from being active simultaneously
  • Automatic Cleanup: Old GUI listeners are automatically unregistered when opening new GUIs
  • No More Duplicates: Resolved issues with duplicate messages when saving items, getting items, toggling settings, and listing commands
  • Centralized Control: All GUIs now use GUIManager.registerGUIListener() for proper listener management

Single-Use Item Consumption

  • Fixed Consumption Order: Single-use items are now consumed BEFORE executing commands
  • Prevents Loss: Solves the issue where items weren't consumed when using commands like kill %player%
  • Proper Verification: Added checks to ensure the item is still in hand before consumption
  • Debug Logging: Added logging to track item consumption for troubleshooting

Delete Items GUI

  • Fixed Item Detection: Improved item name extraction from display names and lore
  • Multi-Language Support: Detects items with "Name:", "Nome:", or "Nombre:" in lore
  • Display Name Parsing: Extracts item names from "[DELETAR]" or "[DELETE]" prefixes
  • Confirmation Dialog: Fixed confirmation GUI to use correct localized titles
  • Proper Deletion: Confirmation buttons now work correctly instead of giving items

NullPointerException Fixes

  • CreateItemGUI: Fixed null baseItem error by saving item reference before chat input
  • CommandsGUI: Added validation to prevent null item references
  • Error Messages: Added user-friendly error messages when item base is not found

Localization

  • English Lore: Changed hardcoded Portuguese lore to English in CustomItem class
  • Consistent Language: "Commands:" instead of "Comandos:", "Single use" instead of "Uso único"
  • Cleanup Detection: Removes both Portuguese and English lore lines when updating items

🛠️ Technical Improvements

GUIManager Utility Class

  • Centralized Management: New utility class to manage all GUI listeners
  • Active Listener Tracking: Maintains a set of active GUI listeners
  • Automatic Unregistration: Unregisters all previous listeners when registering a new one
  • Memory Efficient: Prevents listener accumulation and memory leaks

Listener Lifecycle

  • isActive Flag: Added to all GUI classes to track listener state
  • HandlerList Cleanup: Proper use of HandlerList.unregisterAll() before opening new GUIs
  • Event Priority: Maintained EventPriority.HIGHEST for critical GUI events
  • Thread Safety: Proper use of SchedulerUtil for async operations

Code Quality

  • Better Error Handling: Added try-catch blocks with informative error messages
  • Logging: Added debug logging for troubleshooting item consumption and GUI operations
  • Validation: Added null checks and validation before operations
  • Comments: Added explanatory comments in English for better code maintainability

📋 Configuration Changes

config.yml

# Show default lore on custom items
show-default-lore: true
  • Default: true (shows plugin information in lore)
  • When false: Only adds hidden identifier, preserves original item lore

🔄 Compatibility

  • Backward Compatible: Items created with previous versions continue to work
  • Lore Detection: Recognizes both old (Portuguese) and new (English) lore formats
  • Automatic Migration: Old items work seamlessly with new system
  • No Data Loss: All existing items and configurations are preserved

🐛 Known Issues Resolved

  1. ✅ Duplicate messages when saving items
  2. ✅ Duplicate messages when getting items from GUI
  3. ✅ Duplicate messages when toggling single-use
  4. ✅ Duplicate messages when listing commands
  5. ✅ Single-use items not being consumed
  6. ✅ Items not consumed when using kill command
  7. ✅ Delete confirmation not working
  8. ✅ NullPointerException in CommandsGUI
  9. ✅ Portuguese lore showing in English mode
  10. ✅ Case-sensitive placeholder issues

📝 Notes

  • All GUI classes now use GUIManager for listener registration
  • Single-use items are consumed immediately before command execution
  • Placeholders are now case-insensitive for better user experience
  • Default lore is now in English for international compatibility
  • Delete confirmation GUI properly detects item names in all languages

Файлы

dkcommanditems-1.3-SNAPSHOT.jar(79.03 KiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

1.3-SNAPSHOT

Загрузчики

Bukkit
Folia
Paper
Purpur
Spigot

Версии игры

1.21–1.21.11

Загрузок

4

Дата публикации

3 нед. назад

Загрузил

ID версии

Главная