NetherRatio
一款 Paper/Spigot 插件,允许你自定义通过传送门旅行时下界与主世界的坐标比例。非常适合希望将原版 8:1 的比例更改为符合其世界设计的服务器!
✨ 功能
- ? 按世界设置比例:为每个世界对设置不同的比例
- ? 坐标计算器:无需建造传送门即可计算传送门坐标
- ?️ 坐标边界限制:防止传送到未生成的区块或世界边界之外
- ? 多世界支持:为复杂的服务器配置设置不同的世界对
- ? 国际化:内置对英语、德语、法语、意大利语和韩语的支持
- ⚡ 性能优化:轻量级,对服务器影响极小
- ? 基于权限:完全集成权限管理插件
- ? 热重载:更改设置时无需重启服务器
- ? 文档完善:提供全面的 JavaDoc 和代码注释
- ⚙️ 易于配置:简单的 YAML 配置文件
? 要求
- 服务器:Paper 1.21.4+(或兼容的 Spigot 分支)
- Java:Java 21 或更高版本
- 依赖项:无需任何依赖
? 安装
- 从 GitHub Releases 下载最新版本
- 将 JAR 文件放入服务器的
plugins 文件夹中
- 重启服务器
- 在
plugins/NetherRatio/config.yml 中配置插件
- 使用
/netherratio reload 应用更改
⚙️ 配置
config.yml
# 消息语言(可用选项:en, de, fr, it, ko)
language: en
# 未配置特定比例的默认世界对比例
# 主世界值 : 下界 1
# 若要实现原版 Minecraft 行为,请设置为 8
value: 8
# 坐标边界 - 防止玩家被传送到安全区域之外
# 这有助于避免传送到未生成的区块或世界边界之外
coordinate-bounds:
enabled: false
# Minecraft 的世界边界默认为 ±29,999,984 格
# 这些值适用于目标坐标(计算比例后)
min-x: -29999968
max-x: 29999968
min-z: -29999968
max-z: 29999968
# 传送门旅行的世界对
# 定义哪个主世界连接到哪个下界世界
#
# 简单格式(使用默认比例):
# 主世界名称: 下界名称
#
# 高级格式(按世界比例):
# 主世界名称:
# nether: 下界名称
# ratio: 16
#
# 示例:
world-pairs:
world: world_nether
# 带自定义比例的示例:
# survival:
# nether: survival_nether
# ratio: 16
# 带坐标偏移量的示例:
# adventure:
# nether: adventure_nether
# ratio: 8
# offset-x: 1000
# offset-z: -500
# 简单格式示例:
# creative: creative_nether
配置选项
| 选项 |
类型 |
默认值 |
描述 |
language |
String |
en |
游戏内消息的语言(en, de, fr, it, ko) |
value |
Double |
8 |
默认的坐标转换比例(主世界格数 : 1 下界格数) |
coordinate-bounds |
Section |
见下文 |
安全坐标限制,以防止传送到未生成区域 |
world-pairs |
Map |
见下文 |
主世界与其对应的下界世界的映射关系 |
坐标边界配置
坐标边界有助于防止玩家在使用传送门时被传送到未生成的区块或世界边界之外。这对于具有自定义世界大小或预生成区域的服务器尤其有用。
配置选项:
| 选项 |
类型 |
默认值 |
描述 |
enabled |
Boolean |
false |
启用或禁用坐标边界检查 |
min-x |
Integer |
-29999968 |
传送门目的地的最小 X 坐标 |
max-x |
Integer |
29999968 |
传送门目的地的最大 X 坐标 |
min-z |
Integer |
-29999968 |
传送门目的地的最小 Z 坐标 |
max-z |
Integer |
29999968 |
传送门目的地的最大 Z 坐标 |
工作原理:
- 启用后,将对目的地坐标进行边界检查
- 如果目的地超出边界,坐标会自动钳制到最近的安全位置
- 边界适用于目标坐标(计算比例后)
- 适用于拥有较小世界边界或预生成区域的服务器
示例:
coordinate-bounds:
enabled: true
min-x: -10000
max-x: 10000
min-z: -10000
max-z: 10000
使用此配置,没有任何传送门会将玩家传送到目标世界中 ±10,000 格以外的地方。
世界对配置
你可以使用两种格式来配置世界对:
简单格式(使用来自 value 的默认比例):
world-pairs:
world: world_nether
creative: creative_nether
高级格式(按世界自定义比例和偏移量):
world-pairs:
world: world_nether # 使用默认比例 (8)
survival:
nether: survival_nether
ratio: 16 # 此世界对的自定义 16:1 比例
skyblock:
nether: skyblock_nether
ratio: 4 # 此世界对的自定义 4:1 比例
adventure:
nether: adventure_nether
ratio: 8
offset-x: 1000 # 前往下界时在 X 轴上增加 1000 格
offset-z: -500 # 前往下界时在 Z 轴上减少 500 格
坐标偏移量:
offset-x 和 offset-z 选项允许你相对于主世界移动整个下界坐标空间。这适用于以下场景:
- 对齐维度之间的出生点
- 为主世界不同区域创建分离的下界区域
- 下界和主世界不共享相同原点的自定义世界设计
偏移量的工作原理:
- 当穿越 主世界 → 下界 时:坐标按比例缩放,然后加上偏移量
- 当穿越 下界 → 主世界 时:先减去偏移量,然后再按比例缩放
示例:
world-pairs:
world:
nether: world_nether
ratio: 8
offset-x: 1000
offset-z: 0
使用此配置:
- 主世界 (0, 0) → 下界 (1000, 0)
- 主世界 (800, 0) → 下界 (1100, 0)
- 下界 (1000, 0) → 主世界 (0, 0)
配置示例
所有世界的默认比例 (8:1):
value: 8
world-pairs:
world: world_nether
survival: survival_nether
1:1 比例(两个维度中的坐标相同):
value: 1
world-pairs:
world: world_nether
每个世界不同的比例:
value: 8 # 默认比例
world-pairs:
world: world_nether # 使用默认的 8:1
survival:
nether: survival_nether
ratio: 16 # 生存世界使用 16:1
skyblock:
nether: skyblock_nether
ratio: 1 # Skyblock 世界使用 1:1
? 命令
所有命令都使用一致的子命令结构:
/netherratio 或 /netherratio list
显示所有配置的比例(默认值和按世界设置的值)。
权限:netherratio.netherratio
用法:/netherratio 或 /netherratio list
输出示例:
Default ratio: 8.0
World-specific ratios:
world: 8.0
survival: 16.0
/netherratio set <ratio>
设置所有未指定特定比例的全球对的默认比例。
权限:netherratio.netherratio
用法:/netherratio set <ratio>
示例:/netherratio set 8 - 将默认比例设置为 8:1
/netherratio set <ratio> <world>
为特定的全球对设置自定义比例。
权限:netherratio.netherratio
用法:/netherratio set <ratio> <world>
示例:/netherratio set 16 survival - 为生存世界设置 16:1 的比例
/netherratio calc [x z]
计算一个维度中的坐标在另一个维度中对应的坐标。
权限:netherratio.calc(默认:所有玩家)
用法:
/netherratio calc - 使用当前位置进行计算
/netherratio calc 800 600 - 计算特定坐标
输出示例:
Coordinates 800.0, 600.0 in world correspond to 100.0, 75.0 in world_nether
/netherratio reload
从磁盘重新加载插件配置。
权限:netherratio.netherratio
用法:/netherratio reload
? 权限
| 权限 |
描述 |
默认值 |
netherratio.netherratio |
允许管理比例和重新加载配置 |
仅限 OP |
netherratio.calc |
允许使用坐标计算器 |
所有人 |
权限示例
LuckPerms:
/lp group admin permission set netherratio.netherratio true
PermissionsEx:
/pex group admin add netherratio.netherratio
? 支持的语言
NetherRatio 内置了以下语言的翻译:
- ?? English (
en)
- ?? German (
de)
- ?? French (
fr)
- ?? Italian (
it)
- ?? Korean (
ko)
要更改语言,请在 config.yml 中将 language: en 改为你首选的语言代码。
自定义语言
你可以通过以下步骤创建自定义翻译:
- 在
plugins/NetherRatio/messages/ 中创建一个新文件
- 将其命名为
<language_code>.yml
- 从任何现有的消息文件中复制结构
- 在 config.yml 中设置
language: <language_code>
? 工作原理
坐标转换
当玩家或实体通过下界传送门时:
-
主世界 → 下界:坐标按比例除以比例值
- 8:1 比例示例:
X=800, Z=600 → X=100, Z=75
-
下界 → 主世界:坐标按比例乘以比例值
- 8:1 比例示例:
X=100, Z=75 → X=800, Z=600
-
坐标边界(如果启用):检查并限制目标坐标
- 防止传送到未生成的区块
- 使玩家保持在安全、预生成的区域内
- 示例:如果 max-x 为 10000 且计算出的 X 为 12000,玩家将在 X=10000 处生成
世界映射
插件使用 world-pairs 配置来确定哪个下界世界对应于每个主世界。这允许:
- 在同一服务器上拥有多个独立的全球对
- 自定义世界名称(不限于
world_nether 命名)
- 灵活的多世界设置
?️ 从源代码构建
前提条件
- Git
- Maven 3.6+
- Java 21 JDK
构建步骤
# 克隆仓库
git clone https://github.com/ZyanKLee/NetherRatio.git
cd NetherRatio
# 使用 Maven 构建
mvn clean package
# 编译后的 JAR 将位于 target/ 目录中
构建的插件将位于 target/NetherRatio-2.3.1.jar
? 故障排除
更改比例后传送门不起作用
- 确保已保存配置并运行
/netherratio reload
- 验证
world-pairs 中的世界名称是否与实际世界名称匹配
- 检查服务器日志中是否有任何错误消息
“World not found” 错误
- 确保你的
world-pairs 配置正确映射了你的世界
- 使用
/worlds(如果你有世界管理插件)来验证世界名称
- 世界名称区分大小写
权限错误
- 验证权限是否正确设置:
netherratio.netherratio
- 检查你的权限插件的配置
- 如果使用默认设置,请确保 OP 拥有权限
? 技术细节
- 事件优先级:HIGH(在大多数插件之后运行,在监控之前运行)
- 支持的实体:玩家、矿车、物品以及所有其他实体
- 传送门类型:仅下界传送门(末地传送门不受影响)
- 线程安全:所有操作都是线程安全的
- 性能:每次传送门事件的处理时间 < 1ms
? 贡献
欢迎贡献!请随时提交 Pull Request。对于重大更改:
- Fork 本仓库
- 创建功能分支(
git checkout -b feature/AmazingFeature)
- 提交更改(
git commit -m 'Add some AmazingFeature')
- 推送到分支(
git push origin feature/AmazingFeature)
- 发起 Pull Request
代码规范
- 遵循现有的代码约定
- 为公共方法添加 JavaDoc 注释
- 包含适当的错误处理
- 编写清晰的提交信息
? 许可证
本项目采用 MIT 许可证授权——详见 LICENSE 文件以获取详细信息。
? 链接
? 支持
如果您觉得这个插件有用,请考虑:
- ⭐ 给本仓库加星
- ? 分享给他人
- ? 报告 bug 并提出建议
? 致谢
本项目是 xDxRAx 原始工作的 fork 和延续。
原作者: xDxRAx
当前维护者: ZyanKLee
特别感谢原作者为该插件奠定了基础!
用 ❤️ 为 Minecraft 社区制作
NetherRatio
A Paper/Spigot plugin that allows you to customize the Nether-to-Overworld coordinate ratio for portal travel. Perfect for servers that want to change the vanilla 8:1 ratio to suit their world design!
✨ Features
- ? Per-World Ratios: Set different ratios for each world pair
- ? Coordinate Calculator: Calculate portal coordinates without building portals
- ?️ Coordinate Bounds: Prevent teleportation into ungenerated chunks or beyond world borders
- ? Multi-World Support: Configure different world pairs for complex server setups
- ? Internationalization: Built-in support for English, German, French, Italian, and Korean
- ⚡ Performance Optimized: Lightweight with minimal server impact
- ? Permission-Based: Full integration with permission management plugins
- ? Hot Reload: Change settings without restarting the server
- ? Well Documented: Comprehensive JavaDoc and code comments
- ⚙️ Easy Configuration: Simple YAML configuration files
? Requirements
- Server: Paper 1.21.4+ (or compatible Spigot fork)
- Java: Java 21 or higher
- Dependencies: None required
? Installation
- Download the latest version from GitHub Releases
- Place the JAR file in your server's
plugins folder
- Restart your server
- Configure the plugin in
plugins/NetherRatio/config.yml
- Use
/netherratio reload to apply changes
⚙️ Configuration
config.yml
# Language for messages (available: en, de, fr, it, ko)
language: en
# Default ratio for world pairs that don't have a specific ratio configured
# Overworld value : Nether 1
# For vanilla Minecraft behavior, set to 8
value: 8
# Coordinate bounds - Prevent players from being teleported outside safe areas
# This helps avoid teleportation into ungenerated chunks or beyond world borders
coordinate-bounds:
enabled: false
# Minecraft's world border default is ±29,999,984 blocks
# These values apply to the destination coordinates (after ratio calculation)
min-x: -29999968
max-x: 29999968
min-z: -29999968
max-z: 29999968
# World pairs for portal travel
# Define which overworld connects to which nether world
#
# Simple format (uses default ratio):
# overworld_name: nether_name
#
# Advanced format (per-world ratio):
# overworld_name:
# nether: nether_name
# ratio: 16
#
# Examples:
world-pairs:
world: world_nether
# Example with custom ratio:
# survival:
# nether: survival_nether
# ratio: 16
# Example with coordinate offsets:
# adventure:
# nether: adventure_nether
# ratio: 8
# offset-x: 1000
# offset-z: -500
# Example with simple format:
# creative: creative_nether
Configuration Options
| Option |
Type |
Default |
Description |
language |
String |
en |
Language for in-game messages (en, de, fr, it, ko) |
value |
Double |
8 |
Default coordinate conversion ratio (Overworld blocks : 1 Nether block) |
coordinate-bounds |
Section |
See below |
Safe coordinate limits to prevent teleportation into ungenerated areas |
world-pairs |
Map |
See below |
Mapping of Overworld worlds to their corresponding Nether worlds |
Coordinate Bounds Configuration
Coordinate bounds help prevent players from being teleported into ungenerated chunks or beyond world borders when using portals. This is especially useful for servers with custom world sizes or pre-generated regions.
Configuration Options:
| Option |
Type |
Default |
Description |
enabled |
Boolean |
false |
Enable or disable coordinate bounds checking |
min-x |
Integer |
-29999968 |
Minimum X coordinate for portal destinations |
max-x |
Integer |
29999968 |
Maximum X coordinate for portal destinations |
min-z |
Integer |
-29999968 |
Minimum Z coordinate for portal destinations |
max-z |
Integer |
29999968 |
Maximum Z coordinate for portal destinations |
How it works:
- When enabled, portal destinations are checked against these bounds
- If a destination exceeds the bounds, coordinates are automatically clamped to the nearest safe position
- Bounds apply to the destination coordinates (after ratio calculation)
- Useful for servers with smaller world borders or pre-generated areas
Example:
coordinate-bounds:
enabled: true
min-x: -10000
max-x: 10000
min-z: -10000
max-z: 10000
With this configuration, no portal will teleport a player beyond ±10,000 blocks in the destination world.
World Pairs Configuration
You can configure world pairs using two formats:
Simple Format (uses the default ratio from value):
world-pairs:
world: world_nether
creative: creative_nether
Advanced Format (per-world custom ratios and offsets):
world-pairs:
world: world_nether # Uses default ratio (8)
survival:
nether: survival_nether
ratio: 16 # Custom 16:1 ratio for this world pair
skyblock:
nether: skyblock_nether
ratio: 4 # Custom 4:1 ratio for this world pair
adventure:
nether: adventure_nether
ratio: 8
offset-x: 1000 # Add 1000 blocks to X when going to nether
offset-z: -500 # Subtract 500 blocks from Z when going to nether
Coordinate Offsets:
The offset-x and offset-z options allow you to shift the entire nether coordinate space relative to the overworld. This is useful for:
- Aligning spawn points between dimensions
- Creating separated nether regions for different overworld areas
- Custom world designs where nether and overworld don't share the same origin
How offsets work:
- When traveling Overworld → Nether: Coordinates are divided by ratio, then offsets are added
- When traveling Nether → Overworld: Offsets are subtracted first, then coordinates are multiplied by ratio
Example:
world-pairs:
world:
nether: world_nether
ratio: 8
offset-x: 1000
offset-z: 0
With this configuration:
- Overworld (0, 0) → Nether (1000, 0)
- Overworld (800, 0) → Nether (1100, 0)
- Nether (1000, 0) → Overworld (0, 0)
Configuration Examples
Default Ratio for All Worlds (8:1):
value: 8
world-pairs:
world: world_nether
survival: survival_nether
1:1 Ratio (same coordinates in both dimensions):
value: 1
world-pairs:
world: world_nether
Different Ratios Per World:
value: 8 # Default ratio
world-pairs:
world: world_nether # Uses default 8:1
survival:
nether: survival_nether
ratio: 16 # 16:1 for survival world
skyblock:
nether: skyblock_nether
ratio: 1 # 1:1 for skyblock
? Commands
All commands use a consistent subcommand structure:
/netherratio or /netherratio list
Display all configured ratios (default and per-world).
Permission: netherratio.netherratio
Usage: /netherratio or /netherratio list
Example Output:
Default ratio: 8.0
World-specific ratios:
world: 8.0
survival: 16.0
/netherratio set <ratio>
Set the default ratio for all world pairs that don't have a specific ratio.
Permission: netherratio.netherratio
Usage: /netherratio set <ratio>
Example: /netherratio set 8 - Sets default ratio to 8:1
/netherratio set <ratio> <world>
Set a custom ratio for a specific world pair.
Permission: netherratio.netherratio
Usage: /netherratio set <ratio> <world>
Example: /netherratio set 16 survival - Sets 16:1 ratio for the survival world
/netherratio calc [x z]
Calculate what coordinates in one dimension correspond to in the other dimension.
Permission: netherratio.calc (default: all players)
Usage:
/netherratio calc - Calculate using your current position
/netherratio calc 800 600 - Calculate specific coordinates
Example Output:
Coordinates 800.0, 600.0 in world correspond to 100.0, 75.0 in world_nether
/netherratio reload
Reload the plugin configuration from disk.
Permission: netherratio.netherratio
Usage: /netherratio reload
? Permissions
| Permission |
Description |
Default |
netherratio.netherratio |
Allows managing ratios and reloading config |
OP only |
netherratio.calc |
Allows using the coordinate calculator |
Everyone |
Permission Examples
LuckPerms:
/lp group admin permission set netherratio.netherratio true
PermissionsEx:
/pex group admin add netherratio.netherratio
? Supported Languages
NetherRatio comes with built-in translations for:
- ?? English (
en)
- ?? German (
de)
- ?? French (
fr)
- ?? Italian (
it)
- ?? Korean (
ko)
To change the language, edit language: en in config.yml to your preferred language code.
Custom Languages
You can create custom translations by:
- Creating a new file in
plugins/NetherRatio/messages/
- Naming it
<language_code>.yml
- Copying the structure from any existing message file
- Setting
language: <language_code> in config.yml
? How It Works
Coordinate Conversion
When a player or entity travels through a Nether portal:
-
Overworld → Nether: Coordinates are divided by the ratio
- Example with 8:1 ratio:
X=800, Z=600 → X=100, Z=75
-
Nether → Overworld: Coordinates are multiplied by the ratio
- Example with 8:1 ratio:
X=100, Z=75 → X=800, Z=600
-
Coordinate Bounds (if enabled): Destination coordinates are checked and clamped
- Prevents teleportation into ungenerated chunks
- Keeps players within safe, pre-generated areas
- Example: If max-x is 10000 and calculated X is 12000, player spawns at X=10000
World Mapping
The plugin uses the world-pairs configuration to determine which Nether world corresponds to each Overworld. This allows:
- Multiple separate world pairs on the same server
- Custom world names (not restricted to
world_nether naming)
- Flexible multi-world setups
?️ Building from Source
Prerequisites
- Git
- Maven 3.6+
- Java 21 JDK
Build Steps
# Clone the repository
git clone https://github.com/ZyanKLee/NetherRatio.git
cd NetherRatio
# Build with Maven
mvn clean package
# The compiled JAR will be in target/
The built plugin will be available at target/NetherRatio-2.3.1.jar
? Troubleshooting
Portal doesn't work after changing ratio
- Make sure you've saved the config and run
/netherratio reload
- Verify the world names in
world-pairs match your actual world names
- Check server logs for any error messages
"World not found" errors
- Ensure your
world-pairs configuration correctly maps your worlds
- Use
/worlds (if you have a world management plugin) to verify world names
- World names are case-sensitive
Permission errors
- Verify the permission is correctly set:
netherratio.netherratio
- Check your permission plugin's configuration
- Ensure OPs have permissions if using the default setup
? Technical Details
- Event Priority: HIGH (runs after most plugins, before monitoring)
- Supported Entities: Players, minecarts, items, and all other entities
- Portal Types: Nether portals only (End portals are not affected)
- Thread Safety: All operations are thread-safe
- Performance: < 1ms processing time per portal event
? Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
Code Style
- Follow existing code conventions
- Add JavaDoc comments for public methods
- Include appropriate error handling
- Write clear commit messages
? License
This project is licensed under the MIT License - see the LICENSE file for details.
? Links
? Support
If you find this plugin useful, please consider:
- ⭐ Starring this repository
- ? Sharing it with others
- ? Reporting bugs and suggesting features
? Credits
This project is a fork and continuation of the original work by xDxRAx.
Original Author: xDxRAx
Current Maintainer: ZyanKLee
Special thanks to the original author for creating the foundation of this plugin!
Made with ❤️ for the Minecraft community
评论 0
登录后参与评分
还没有评论,来抢沙发吧