mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
fix wrong width & height
This commit is contained in:
parent
6856904905
commit
23f64fec11
@ -28,13 +28,13 @@ public interface LargeFramebuffer {
|
||||
* @param 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 height = Math.min(height(), top+Framebuffer.HEIGHT) - top;
|
||||
for (int y = top; y < height; y++) {
|
||||
for (int x = left; x < width; x++) {
|
||||
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