https://github.com/organization/worldtojpeg
마인크래프트맵을 간단한 소스를 통해 이미지처리합니다
https://github.com/organization/worldtojpeg
image nukkit plugin
Last synced: about 1 year ago
JSON representation
마인크래프트맵을 간단한 소스를 통해 이미지처리합니다
- Host: GitHub
- URL: https://github.com/organization/worldtojpeg
- Owner: organization
- Created: 2016-10-02T06:50:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T05:10:08.000Z (over 9 years ago)
- Last Synced: 2025-04-03T06:22:05.603Z (over 1 year ago)
- Topics: image, nukkit, plugin
- Language: Java
- Size: 2.61 MB
- Stars: 8
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# worldToJpeg
마인크래프트맵을 간단한 소스를 통해 이미지처리합니다
```
BufferedImage image;
try {
image = new BufferedImage(600, 600, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = image.createGraphics();
Position spawn = getServer().getDefaultLevel().getSafeSpawn();
for (int x = 0; x != 600; x++) {
for (int y = 0; y != 600; y++) {
graphics.setColor(getServer().getDefaultLevel().getMapColorAt(spawn.getFloorX() - 300 + x,
spawn.getFloorZ() - 300 + y));
graphics.fillRect(x, y, x, y);
}
}
/**
* 플레이어를 인식하면 해당 플레이어의 위치와 그 닉네임을 추가로 이미지에 반영합니다
* 해당 기능을 원치않을경우 작성하지 않으시면 됩니다
*/
/*
for (Player player : getServer().getOnlinePlayers().values()) {
int x = player.getPosition().getFloorX();
int y = player.getPosition().getFloorZ();
Position spawn1 = getServer().getDefaultLevel().getSafeSpawn();
if (x <= spawn1.getFloorX() + 300 && x >= spawn1.getFloorX() - 300
|| y <= spawn1.getFloorZ() + 300 && y >= spawn1.getFloorZ() - 300) {
graphics.setColor(Color.RED);
graphics.fillRect((spawn.getFloorX() - x) + 299, (spawn.getFloorZ() - y) + 299,
// (spawn.getFloorX() - x) + 300,
// (spawn.getFloorZ() - y) + 300
2, 2);
graphics.setColor(Color.BLACK);
graphics.drawString(player.getName(), (spawn.getFloorX() - x) + 300,
(spawn.getFloorZ() - y) + 296);
}
}*/
try {
File file = new File(getDataFolder() + "/world.jpeg");
ImageIO.write(image, "jpeg", file);
getLogger().info("finsh");
} catch (IOException e) {
return;
}
} finally {
}
```
