Fixed #6865 / Fixed headless canvas crash
This commit is contained in:
@@ -110,6 +110,8 @@ public class BlockRenderer{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Events.on(TilePreChangeEvent.class, event -> {
|
Events.on(TilePreChangeEvent.class, event -> {
|
||||||
|
if(blockTree == null || floorTree == null) return;
|
||||||
|
|
||||||
if(indexBlock(event.tile)) blockTree.remove(event.tile);
|
if(indexBlock(event.tile)) blockTree.remove(event.tile);
|
||||||
if(indexFloor(event.tile)) floorTree.remove(event.tile);
|
if(indexFloor(event.tile)) floorTree.remove(event.tile);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public class CanvasBlock extends Block{
|
|||||||
public byte[] data = new byte[Mathf.ceil(canvasSize * canvasSize * bitsPerPixel / 8f)];
|
public byte[] data = new byte[Mathf.ceil(canvasSize * canvasSize * bitsPerPixel / 8f)];
|
||||||
|
|
||||||
public void updateTexture(){
|
public void updateTexture(){
|
||||||
|
if(headless) return;
|
||||||
|
|
||||||
Pixmap pix = makePixmap();
|
Pixmap pix = makePixmap();
|
||||||
if(texture != null){
|
if(texture != null){
|
||||||
texture.draw(pix);
|
texture.draw(pix);
|
||||||
|
|||||||
Reference in New Issue
Block a user