Add better support for turning mods on/off

* Make the Minecraft "mod" enabled at all times
* Sort the list of mods to move required mods to the top
* Automatically enable a mod which has a recipe selected (e.g., from
  a query param)
This commit is contained in:
Andrew Miner
2014-12-29 14:07:57 -08:00
parent 2dd4b7014f
commit c46bb8860c
7 changed files with 45 additions and 8 deletions
+3 -1
View File
@@ -26,13 +26,15 @@ module.exports = class CraftingTable extends BaseModel
# Public Methods ###############################################################################
craft: ->
if not @name?.length
if not @catalog.hasRecipe @name
@plan = null
return
toolPhrase = if @includingTools then ' includingTools' else ''
logger.verbose "calculating build plan for #{@quantity} #{@name}#{toolPhrase} with inventory: #{@have}"
@catalog.enableBooksForRecipe @name
plan = new CraftingPlan @catalog, @includingTools
plan.includingTools = @includingTools
plan.craft @name, @quantity, @have