mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-30 23:47:37 +02:00
fix wrong width & height
This commit is contained in:
parent
6856904905
commit
23f64fec11
@ -28,13 +28,13 @@ public interface LargeFramebuffer {
|
|||||||
* @param top
|
* @param top
|
||||||
*/
|
*/
|
||||||
default void preparePacket(MapDataPacket packet, int left, int top) {
|
default void preparePacket(MapDataPacket packet, int left, int top) {
|
||||||
byte[] colors = new byte[width()*height()];
|
byte[] colors = new byte[Framebuffer.WIDTH*Framebuffer.WIDTH];
|
||||||
int width = Math.min(width(), left+Framebuffer.WIDTH) - left;
|
int width = Math.min(width(), left+Framebuffer.WIDTH) - left;
|
||||||
int height = Math.min(height(), top+Framebuffer.HEIGHT) - top;
|
int height = Math.min(height(), top+Framebuffer.HEIGHT) - top;
|
||||||
for (int y = top; y < height; y++) {
|
for (int y = top; y < height; y++) {
|
||||||
for (int x = left; x < width; x++) {
|
for (int x = left; x < width; x++) {
|
||||||
byte color = getMapColor(left, top);
|
byte color = getMapColor(left, top);
|
||||||
colors[Framebuffer.index(x-left, y-top, width)] = color;
|
colors[Framebuffer.index(x-left, y-top)] = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user