PaintedPixels
一款适用于 Paper/Spigot 的 Minecraft 插件,允许玩家通过 URL 将图片转换为地图艺术。
描述
PaintedPixels 使玩家能够通过在线 URL 上传图片,并获得复制该图像的 Minecraft 地图艺术。插件会自动转换图像颜色以匹配 Minecraft 的地图调色板,从而实现近乎 1:1 的还原。
功能
- URL 转地图艺术:将任何图片 URL 转换为 Minecraft 地图艺术
- 自动调整大小:图像在保持宽高比的同时自动调整大小
- 多地图支持:大图像会自动分割到多个地图上
- 色彩匹配:高级颜色转换以匹配 Minecraft 的地图调色板
- 异步处理:异步下载和处理图像以防止服务器卡顿
- 队列系统:地图存储在队列中以防止地面杂乱(新增!)
- 基于权限:完整的权限控制系统
- 可配置:自定义最大尺寸、交付方式及其他设置
命令
| 命令 |
描述 |
权限 |
别名 |
/paint <url> |
从图片 URL 创建地图艺术 |
paintedpixels.use |
/mapimage, /imagemap, /paintpixels |
/paint next |
获取队列中的下一张地图 |
paintedpixels.use |
- |
/paint all |
获取队列中剩余的所有地图 |
paintedpixels.use |
- |
/paint status |
检查有多少地图正在等待 |
paintedpixels.use |
/paint queue |
/paint help |
显示帮助信息 |
paintedpixels.use |
- |
权限
| 权限 |
描述 |
默认值 |
paintedpixels.use |
允许使用 /paint 命令 |
true |
paintedpixels.admin |
管理员权限 |
op |
配置
config.yml 文件允许你自定义以下内容:
# 最大图像尺寸(以像素为单位)
max-width: 512
max-height: 512
# 创建地图的交付方式
# 选项:queue, immediate
delivery-method: queue
# 启用调试日志
debug: false
# 缓存设置
cache:
clear-on-restart: true
max-cached-images: 100
交付方式:
queue(默认)- 地图存储在队列中,使用 /paint next 或 /paint all 检索
immediate - 直接给予地图
使用示例
- 找到一张图片的 URL(例如来自 Imgur、Discord 等)
- 运行命令:
/paint https://example.com/image.png
- 等待插件下载并处理图像
- 地图会添加到你的队列中——使用
/paint next 一次获取一张!
注意:大图像将被分割成多张地图。例如,一张 256x256 的图像将创建 4 张地图(2x2 网格)。
/paint next - 一次获取一张地图
/paint all - 一次性获取所有地图
/paint status - 检查有多少地图正在等待
/paint all - 一次性获取所有地图
/paint status - 检查有多少地图正在等待
支持的图像格式
- PNG(推荐)
- JPEG/JPG
- GIF(仅第一帧)
- BMP
- Java ImageIO 支持的任何格式
技术细节
地图颜色:
Minecraft 地图使用基于方块颜色的有限调色板。插件使用 MapPalette API 尽可能匹配颜色。在转换过程中可能会丢失一些颜色信息,这是正常且预期的现象。
地图尺寸:
- 每张 Minecraft 地图为 128x128 像素
- 大于 128x128 的图像会被分割成多张地图
- 最大可配置尺寸为 512x512(16 张地图)
性能:
- 图像下载是异步进行的,以防止服务器卡顿
- 处理也是异步的,直到最终创建地图
- 地图创建在主线程上完成(Bukkit API 要求)
- 图像缓存到
plugins/PaintedPixels/cache/ 目录
限制
- 最大文件大小:10 MB(出于安全考虑硬编码)
- 下载超时时间:10 秒
- 调色板仅限于 Minecraft 的地图颜色
- 动画图像(如 GIF 等)将仅使用第一帧
故障排除
“下载图像失败”:
- 检查 URL 是否有效且公开可访问
- 确保 URL 直接指向图像文件
- 检查服务器的防火墙设置
“你的背包已满”:
地图显示为空/空白:
PaintedPixels
A Minecraft plugin for Paper/Spigot that allows players to create map art from images via URL.
Description
PaintedPixels enables players to upload an image through an online URL and receive a Minecraft map art that replicates the image. The plugin automatically converts the image colors to match Minecraft's map color palette for a near 1:1 replica.
Features
- URL to Map Art: Convert any image URL into Minecraft map art
- Automatic Resizing: Images are automatically resized while maintaining aspect ratio
- Multi-Map Support: Large images are automatically split across multiple maps
- Color Matching: Advanced color conversion to match Minecraft's map palette
- Async Processing: Downloads and processes images asynchronously to prevent server lag
- Queue System: Maps are stored in a queue to prevent floor clutter (NEW!)
- Permission Based: Full permission system for control
- Configurable: Customize max dimensions, delivery methods, and other settings
Commands
| Command |
Description |
Permission |
Aliases |
/paint <url> |
Create map art from an image URL |
paintedpixels.use |
/mapimage, /imagemap, /paintpixels |
/paint next |
Get the next map from your queue |
paintedpixels.use |
- |
/paint all |
Get all remaining maps from your queue |
paintedpixels.use |
- |
/paint status |
Check how many maps are waiting |
paintedpixels.use |
/paint queue |
/paint help |
Show help message |
paintedpixels.use |
- |
Permissions
| Permission |
Description |
Default |
paintedpixels.use |
Allows using the /paint command |
true |
paintedpixels.admin |
Admin permissions |
op |
Configuration
The config.yml file allows you to customize:
# Maximum image dimensions (in pixels)
max-width: 512
max-height: 512
# Delivery method for created maps
# Options: queue, immediate
delivery-method: queue
# Enable debug logging
debug: false
# Cache settings
cache:
clear-on-restart: true
max-cached-images: 100
Delivery Methods:
queue (default) - Maps are stored in a queue, retrieved with /paint next or /paint all
immediate - Maps are given directly
Usage Example
- Find an image URL (e.g., from Imgur, Discord, etc.)
- Run the command:
/paint https://example.com/image.png
- Wait for the plugin to download and process the image
- Maps are added to your queue - use
/paint next to get them one at a time!
Note: Large images will be split into multiple maps. For example, a 256x256 image will create 4 maps (2x2 grid).
/paint next - Get one map at a time
/paint all - Get all maps at once
/paint status - Check how many maps are waiting
/paint all - Get all maps at once
/paint status - Check how many maps are waiting
Supported Image Formats
- PNG (recommended)
- JPEG/JPG
- GIF (first frame only)
- BMP
- Any format supported by Java's ImageIO
Technical Details
Map Colors:
Minecraft maps use a limited color palette based on block colors. The plugin uses the MapPalette API to match colors as closely as possible. Some color information may be lost in the conversion, which is normal and expected.
Map Dimensions:
- Each Minecraft map is 128x128 pixels
- Images larger than 128x128 are split into multiple maps
- Maximum configurable size is 512x512 (16 maps)
Performance:
- Image downloading is done asynchronously to prevent server lag
- Processing is also asynchronous until the final map creation
- Map creation is done on the main thread (required by Bukkit API)
- Images are cached to the
plugins/PaintedPixels/cache/ directory
Limitations
- Maximum file size: 10 MB (hardcoded for security)
- Timeout for downloads: 10 seconds
- Color palette is limited to Minecraft's map colors
- Animated images (GIF, etc.) will only use the first frame
Troubleshooting
"Failed to download image":
- Check that the URL is valid and publicly accessible
- Ensure the URL points directly to an image file
- Check your server's firewall settings
"Your inventory is full":
- The map will be dropped at your location
- Pick it up or make space in your inventory
Maps appear as empty/blank:
- This may be a client-side issue
- Try relogging or reloading resource packs
评论 0
登录后参与评分
还没有评论,来抢沙发吧