Fixed a bug in the ReachArea completion condition related to world name detection: The original ReachArea condition had a hardcoded world name check, which caused it to fail in temporary instance copies.
Reason: Each instance copy has its own unique, temporary world name (e.g., dungeon_example_abc123_1703123456), whereas the world name in the configuration file is static (e.g., world).
Fix: The dependency on the world name has been removed. The condition now only checks the player's relative coordinates within the current instance.
Impact: The ReachArea condition now functions correctly across all temporary instance copies.
Functional Improvements
Optimized ReachArea Detection Mechanism
Configuration Format Update: The format has been changed from a single location string like location: "world,100,64,100" to a more structured coordinate configuration: YAML reachArea: x: 5 # Target X coordinate y: 5 # Target Y coordinate z: 5 # Target Z coordinate range: 10 # Detection range
Detection Method Improvement: The detection method has been changed from a circular radius check to a cubic (box-shaped) area check, which is more intuitive and easier to understand.
Range Setting: A new range parameter has been added to define the cubic detection area centered around the target coordinates.
Code Optimization
Refactored the ReachAreaCondition class constructor to accept coordinate parameters directly, rather than a Location object.
The detection logic is now deltaX <= range && deltaY <= range && deltaZ <= range.
Removed the world name comparison to ensure it works correctly in any instance copy.
Updated the CompletionManager loading logic to read the x, y, z, and range parameters from the configuration file.
Removed the dependency on LocationUtil.stringToLocation().
Optimized the GUI management interface (TemplateCompletionEditGUI) to save coordinates instead of a location string.
Updated the logic for reading and displaying configurations.
Configuration File Updates
The sample template configuration file has been updated to include examples of the new ReachArea configuration format.
Detailed configuration instructions and comments have been provided.
Backward Compatibility: The new format is designed to be backward compatible.
The new configuration format is more concise and intuitive.
Administrators no longer need to manage world names and only need to set the coordinates and range.
Technical Features
World-Agnostic: The ReachArea condition is no longer dependent on specific world names.
Universal Compatibility: It is suitable for all temporary instance copies.
Simplified Configuration: Configuration for administrators is now simpler and more intuitive.
Performance Optimization: The logic now uses simple coordinate comparisons, eliminating the need for complex distance calculations.