Skip to content

Commit

Permalink
Fix headless (#436)
Browse files Browse the repository at this point in the history
* use node-canvas

* remove invisible_cape from player

* clean up

---------

Co-authored-by: Romain Beaumont <[email protected]>
  • Loading branch information
caenopy and rom1504 authored Feb 9, 2025
1 parent 8d91949 commit 1bcd495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions viewer/lib/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ const TWEEN = require('@tweenjs/tween.js')
const Entity = require('./entity/Entity')
const { dispose3 } = require('./dispose')

const { createCanvas } = require('canvas')

function getEntityMesh (entity, scene) {
if (entity.name) {
try {
const e = new Entity('1.16.4', entity.name, scene)

if (entity.username !== undefined) {
const canvas = document.createElement('canvas')
canvas.width = 500
canvas.height = 100
const canvas = createCanvas(500, 100)

const ctx = canvas.getContext('2d')
ctx.font = '50pt Arial'
Expand Down
3 changes: 1 addition & 2 deletions viewer/lib/entity/entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -11192,8 +11192,7 @@
"animated": "player_animated"
},
"textures": {
"default": "textures/entity/steve",
"cape": "textures/entity/cape_invisible"
"default": "textures/entity/steve"
},
"geometry": {
"default": {
Expand Down

0 comments on commit 1bcd495

Please sign in to comment.