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

Enchantments Limiter

An all in one Enchantments Limiter!

339
1

Enchantments Limiter 2.0 Recode

release19 января 2026 г.

EnchantmentsLimiter v2.0 - Complete Recode

🔄 Recode Highlights

  • Complete architectural redesign - Rewrote entire codebase from scratch with modern Java patterns
  • Performance optimized - Config caching eliminates repeated file I/O on every enchantment check
  • Memory leak prevention - Automatic cleanup of message cooldown data
  • Zero breaking changes - Automatic config migration ensures seamless updates

✨ New Features

Per-Item Enchantment Limits

  • Set different limits for specific materials
  • Example: Allow Sharpness 5 on Netherite Sword but only 4 on Diamond Sword
  • Overrides global limits when configured
per_item:
  DIAMOND_SWORD:
    SHARPNESS: 4
  NETHERITE_SWORD:
    SHARPNESS: 5

Action Mode System

  • DOWNGRADE - Reduces enchantment level to maximum allowed (default)
  • REMOVE - Completely removes enchantments that exceed limits
  • Configurable per-server preference
action_mode: DOWNGRADE  # or REMOVE

Anvil Support

  • Now catches enchantment combinations in anvils before they're created
  • Prevents players from bypassing limits through anvil merging
  • Runs at LOWEST priority to catch combinations early

Enhanced Player Feedback

  • Icon system - Visual icons for enchantment types (⚔️ 🛡 🔥 💎 ⚡)
  • Detailed changes - Shows exact modifications: "⚔️ Sharpness V → IV"
  • Configurable display:
    • Toggle between ActionBar and Chat messages
    • Enable/disable detailed change information

Automatic Config Migration

  • Detects old v1.x config format automatically
  • Converts to new structure without manual intervention
  • Preserves all existing enchantment limits
  • Never breaks servers - Zero downtime updates

Bypass Permission

  • enchantmentslimiter.bypass - Skip all enchantment checks
  • Useful for staff testing or special events
  • Works across all events (enchanting, anvil, pickup, inventory)

Namespace Support

  • Accepts both formats: SHARPNESS and minecraft:sharpness
  • Compatible with custom enchantments from other plugins
  • Proper NamespacedKey handling for 1.21+ compatibility

🔧 Technical Improvements

Architecture Redesign

ComponentPurpose
ConfigManagerSingle source of truth for all configuration data
EnchantmentRuleData model for global + per-item limits
EnchantmentRuleManagerBusiness logic for enchantment processing
EnchantmentListenerEvent handling with proper priority
ModificationResultImmutable state tracking for changes
ActionModeType-safe enum for action strategies

Performance Optimizations

  • Config caching - Rules loaded once, cached in HashMap (O(1) lookup)
  • Async operations - Update checker and cooldown cleanup run async
  • Early returns - Bypass permission checked first in all events
  • Smart inventory sync - Only syncs when items actually modified

Memory Management

  • Cooldown cleanup - Removes old entries every 5 minutes
  • ConcurrentHashMap - Thread-safe cooldown tracking
  • No memory leaks - Automatic garbage collection of stale data

Event Coverage

Eventv1.xv2.0Notes
EnchantItemEventNow returns modified map directly
PrepareAnvilEventNEW - Catches anvil combinations
EntityPickupItemEventBetter feedback system
InventoryClickEventSimplified logic, eliminated 24-case switch

🔄 Changed

Command System

  • Renamed command from /enchantmentslimiter to /elimit
  • Tab completion for subcommand
  • Better error messages with usage hints

Config Structure

# OLD (v1.x)
enchantment_limits:
  PROTECTION: 3
  SHARPNESS: 4

# NEW (v2.0)
enchantment_limits:
  global:
    PROTECTION: 3
  per_item:
    DIAMOND_SWORD:
      SHARPNESS: 4

Display Settings

  • Moved message settings to dedicated display section
  • ActionBar now default (was Chat in v1.x)

Message Cooldown

  • Reduced from 5 seconds to 3 seconds
  • Better player experience without spam
  • More responsive feedback

🐛 Fixed

Critical Fixes

  • Memory leak - Old version never cleaned up cooldown map
  • Config hot-reload - Properly clears cached rules on /elimit reload
  • Anvil bypass - Players could combine enchantments to bypass limits
  • Race conditions - Thread-safe cooldown map prevents concurrent modification

Logic Improvements

  • Armor detection removed - Relied on hardcoded 24-material switch case
  • Event priority - Now uses correct priorities (HIGH for enchanting, LOWEST for anvil)
  • Inventory desync - Added proper client-server sync after modifications
  • Null safety - Comprehensive null checks for items and enchantments

SpigotMC Update Checker

  • Automatic update notifications
  • Admin notification on join when updates available

📝 Migration Guide

Automatic Migration

  1. Replace old JAR with v2.0
  2. Start server
  3. Plugin detects old config automatically
  4. Converts to new format
  5. Saves migrated config
  6. Old structure removed

🎯 Compatibility

  • Minecraft: 1.21+ (api-version: 1.21)
  • Server: Spigot, Paper, Purpur, Pufferfish
  • Dependencies: None required

🔒 Permissions

enchantmentslimiter.admin:
  description: Access to /elimit reload
  default: op

enchantmentslimiter.bypass:
  description: Bypass all enchantment limits
  default: false

🙏 Notes

  • Backwards compatible - Existing configs work automatically
  • No data loss - All enchantment limits preserved during migration
  • Open for feedback - Report issues on Discord

📥 Download

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Сервер

Создатели

Детали

Лицензия:LicenseRef-All-Rights-Reserved
Опубликован:2 месяца назад
Обновлён:2 месяца назад
Главная