mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-06 07:30:35 +07:00
Fixed #6865 / Fixed headless canvas crash
This commit is contained in:
parent
6989a81e03
commit
df082c39a3
@ -110,6 +110,8 @@ public class BlockRenderer{
|
||||
});
|
||||
|
||||
Events.on(TilePreChangeEvent.class, event -> {
|
||||
if(blockTree == null || floorTree == null) return;
|
||||
|
||||
if(indexBlock(event.tile)) blockTree.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 void updateTexture(){
|
||||
if(headless) return;
|
||||
|
||||
Pixmap pix = makePixmap();
|
||||
if(texture != null){
|
||||
texture.draw(pix);
|
||||
|
Loading…
Reference in New Issue
Block a user