diff --git a/index.coffee b/index.coffee index de00d4b..6f0f724 100644 --- a/index.coffee +++ b/index.coffee @@ -22,8 +22,9 @@ class Workbench opts.registerBlock ?= true opts.registerRecipe ?= true - - @workbenchDialog = new WorkbenchDialog(game, @playerInventory, @registry, @recipes) + + if @game.isClient + @workbenchDialog = new WorkbenchDialog(game, @playerInventory, @registry, @recipes) @opts = opts @enable() @@ -31,9 +32,10 @@ class Workbench enable: () -> if @opts.registerBlock @registry.registerBlock 'workbench', {texture: ['crafting_table_top', 'planks_oak', 'crafting_table_side'], onInteract: () => - @workbenchDialog.open() - true - } + # TODO: server-side + @workbenchDialog.open() + true + } if @opts.registerRecipe @recipes.register new AmorphousRecipe(['wood.plank', 'wood.plank', 'wood.plank', 'wood.plank'], new ItemPile('workbench', 1)) diff --git a/index.js b/index.js index 92bf051..01d0de9 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,9 @@ if (opts.registerRecipe == null) { opts.registerRecipe = true; } - this.workbenchDialog = new WorkbenchDialog(game, this.playerInventory, this.registry, this.recipes); + if (this.game.isClient) { + this.workbenchDialog = new WorkbenchDialog(game, this.playerInventory, this.registry, this.recipes); + } this.opts = opts; this.enable(); }