Fix various minor bugs
* Fix "update" recipes in IC2 classic to use the new "update" command * Remove the crafting plan model from the item detail page as it isn't being used there right now and can be slow for complex items * Update the `Recipe.compareFor` method to be able to work without an item slug as a reference
This commit is contained in:
@@ -98,24 +98,6 @@ item: Biofuel Cell
|
|||||||
input: Bio Cell
|
input: Bio Cell
|
||||||
pattern: ... .0. ...
|
pattern: ... .0. ...
|
||||||
tools: Extractor
|
tools: Extractor
|
||||||
recipe:
|
|
||||||
input: Bio Cell
|
|
||||||
pattern: ... .0. ...
|
|
||||||
tools: Extractor
|
|
||||||
|
|
||||||
item: Blaze Powder
|
|
||||||
recipe:
|
|
||||||
input: Blaze Rod
|
|
||||||
pattern: ... .0. ...
|
|
||||||
quantity: 5
|
|
||||||
tools: Macerator
|
|
||||||
|
|
||||||
item: Bone Meal
|
|
||||||
recipe:
|
|
||||||
input: Bone
|
|
||||||
pattern: ... .0. ...
|
|
||||||
quantity: 5
|
|
||||||
tools: Macerator
|
|
||||||
|
|
||||||
item: Bronze Axe
|
item: Bronze Axe
|
||||||
recipe:
|
recipe:
|
||||||
@@ -201,6 +183,12 @@ item: Carbon Plate
|
|||||||
pattern: ... .0. ...
|
pattern: ... .0. ...
|
||||||
tools: Compressor
|
tools: Compressor
|
||||||
|
|
||||||
|
item: CF Backpack
|
||||||
|
recipe:
|
||||||
|
input: (empty) Fuel Can, CF Sprayer, Electronic Circuit, Tin Ingot
|
||||||
|
pattern: 121 030 0.0
|
||||||
|
tools: Crafting Table
|
||||||
|
|
||||||
item: CF Pellet
|
item: CF Pellet
|
||||||
recipe:
|
recipe:
|
||||||
input: Construction Foam
|
input: Construction Foam
|
||||||
@@ -213,12 +201,6 @@ item: CF Sprayer
|
|||||||
pattern: 00. 01. ..0
|
pattern: 00. 01. ..0
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: CF Backpack
|
|
||||||
recipe:
|
|
||||||
input: CF Sprayer, Electronic Circuit, (empty) Fuel Can, Tin Ingot
|
|
||||||
pattern: 010 232 2.2
|
|
||||||
tools: Crafting Table
|
|
||||||
|
|
||||||
item: Chainsaw
|
item: Chainsaw
|
||||||
recipe:
|
recipe:
|
||||||
input: Electronic Circuit, RE Battery, Refined Iron
|
input: Electronic Circuit, RE Battery, Refined Iron
|
||||||
@@ -355,6 +337,13 @@ item: Copper Ingot
|
|||||||
item: Copper Ore
|
item: Copper Ore
|
||||||
gatherable: yes
|
gatherable: yes
|
||||||
|
|
||||||
|
item: Crop
|
||||||
|
recipe:
|
||||||
|
input: Stick
|
||||||
|
pattern: ... 0.0 0.0
|
||||||
|
quantity: 2
|
||||||
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Crop-Matron
|
item: Crop-Matron
|
||||||
recipe:
|
recipe:
|
||||||
input: Chest, Crop, Electronic Circuit, Machine Block
|
input: Chest, Crop, Electronic Circuit, Machine Block
|
||||||
@@ -367,13 +356,6 @@ item: Cropnalyzer
|
|||||||
pattern: 22. 313 303
|
pattern: 22. 313 303
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Crop
|
|
||||||
recipe:
|
|
||||||
input: Stick
|
|
||||||
pattern: ... 0.0 0.0
|
|
||||||
quantity: 2
|
|
||||||
tools: Crafting Table
|
|
||||||
|
|
||||||
item: Dense Copper Plate
|
item: Dense Copper Plate
|
||||||
recipe:
|
recipe:
|
||||||
input: Copper Ingot
|
input: Copper Ingot
|
||||||
@@ -386,10 +368,10 @@ item: Depleted Isotope Cell
|
|||||||
pattern: ... .0. .1.
|
pattern: ... .0. .1.
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: EU Detector Cable
|
item: Diamond Drill
|
||||||
recipe:
|
recipe:
|
||||||
input: Electronic Circuit, 4x Ins. HV Cable, Redstone
|
input: Diamond, Mining Drill
|
||||||
pattern: .0. 212 .2.
|
pattern: ... .0. 010
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Diamond (industrial)
|
item: Diamond (industrial)
|
||||||
@@ -398,12 +380,6 @@ item: Diamond (industrial)
|
|||||||
pattern: ... .0. ...
|
pattern: ... .0. ...
|
||||||
tools: Compressor
|
tools: Compressor
|
||||||
|
|
||||||
item: Diamond Drill
|
|
||||||
recipe:
|
|
||||||
input: Diamond, Mining Drill
|
|
||||||
pattern: ... .0. 010
|
|
||||||
tools: Crafting Table
|
|
||||||
|
|
||||||
item: Dual Uranium Cell
|
item: Dual Uranium Cell
|
||||||
recipe:
|
recipe:
|
||||||
input: Dense Copper Plate, Uranium Cell
|
input: Dense Copper Plate, Uranium Cell
|
||||||
@@ -496,6 +472,12 @@ item: Energy Storage Upgrade
|
|||||||
pattern: 222 101 232
|
pattern: 222 101 232
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
|
item: EU Detector Cable
|
||||||
|
recipe:
|
||||||
|
input: 4x Ins. HV Cable, Electronic Circuit, Redstone
|
||||||
|
pattern: .1. 202 .2.
|
||||||
|
tools: Crafting Table
|
||||||
|
|
||||||
item: EU Reader
|
item: EU Reader
|
||||||
recipe:
|
recipe:
|
||||||
input: Electronic Circuit, Glowstone Dust, Insulated Copper Cable
|
input: Electronic Circuit, Glowstone Dust, Insulated Copper Cable
|
||||||
@@ -525,12 +507,12 @@ item: Fertilizer
|
|||||||
|
|
||||||
item: (filled) Fuel Can
|
item: (filled) Fuel Can
|
||||||
recipe:
|
recipe:
|
||||||
input: Coalfuel Cell, (empty) Fuel Can
|
input: (empty) Fuel Can, Coalfuel Cell
|
||||||
pattern: 000 000 .1.
|
pattern: 111 111 .0.
|
||||||
tools: Canning Machine
|
tools: Canning Machine
|
||||||
recipe:
|
recipe:
|
||||||
input: Biofuel Cell, (empty) Fuel Can
|
input: (empty) Fuel Can, Biofuel Cell
|
||||||
pattern: 000 000 .1.
|
pattern: 111 111 .0.
|
||||||
tools: Canning Machine
|
tools: Canning Machine
|
||||||
|
|
||||||
item: (Filled) Tin Can
|
item: (Filled) Tin Can
|
||||||
@@ -637,15 +619,10 @@ item: HV Cable
|
|||||||
quantity: 12
|
quantity: 12
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Insulated HV Cable
|
|
||||||
recipe:
|
|
||||||
input: HV Cable, Rubber
|
|
||||||
pattern: ... .0. .1.
|
|
||||||
|
|
||||||
item: HV Transformer
|
item: HV Transformer
|
||||||
recipe:
|
recipe:
|
||||||
input: Electronic Circuit, Energy Crystal, 4x Ins. HV Cable, MV Transformer
|
input: 4x Ins. HV Cable, Electronic Circuit, Energy Crystal, MV Transformer
|
||||||
pattern: .2. 031 .2.
|
pattern: .0. 132 .0.
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Hydrated Coal Dust
|
item: Hydrated Coal Dust
|
||||||
@@ -662,12 +639,6 @@ item: Hydration Cell
|
|||||||
pattern: ... .0. ...
|
pattern: ... .0. ...
|
||||||
tools: Extractor
|
tools: Extractor
|
||||||
|
|
||||||
item: Ice
|
|
||||||
recipe:
|
|
||||||
input: Snowball
|
|
||||||
pattern: ... .0. ...
|
|
||||||
tools: Compressor
|
|
||||||
|
|
||||||
item: Induction Furnace
|
item: Induction Furnace
|
||||||
recipe:
|
recipe:
|
||||||
input: Advanced Machine Block, Copper Ingot, Electric Furnace
|
input: Advanced Machine Block, Copper Ingot, Electric Furnace
|
||||||
@@ -691,6 +662,11 @@ item: Insulated Gold Cable
|
|||||||
input: Gold Cable, Rubber
|
input: Gold Cable, Rubber
|
||||||
pattern: ... .0. .1.
|
pattern: ... .0. .1.
|
||||||
|
|
||||||
|
item: Insulated HV Cable
|
||||||
|
recipe:
|
||||||
|
input: HV Cable, Rubber
|
||||||
|
pattern: ... .0. .1.
|
||||||
|
|
||||||
item: Insulation Cutter
|
item: Insulation Cutter
|
||||||
recipe:
|
recipe:
|
||||||
input: Iron Ingot, Refined Iron
|
input: Iron Ingot, Refined Iron
|
||||||
@@ -742,7 +718,7 @@ item: Iron Scaffold
|
|||||||
|
|
||||||
item: Jetpack
|
item: Jetpack
|
||||||
recipe:
|
recipe:
|
||||||
input: (Empty) Fuel Can, Electronic Circuit, Redstone, Refined Iron
|
input: (empty) Fuel Can, Electronic Circuit, Redstone, Refined Iron
|
||||||
pattern: 313 303 2.2
|
pattern: 313 303 2.2
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
@@ -893,12 +869,6 @@ item: Near-Depleted Uranium Cell
|
|||||||
pattern: 000 010 000
|
pattern: 000 010 000
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Nether Brick
|
|
||||||
recipe:
|
|
||||||
input: Netherrack
|
|
||||||
pattern: .0. .0. .0.
|
|
||||||
tools: Compressor
|
|
||||||
|
|
||||||
item: Neutron Reflector
|
item: Neutron Reflector
|
||||||
recipe:
|
recipe:
|
||||||
input: Coal Dust, Dense Copper Plate, Tin Dust
|
input: Coal Dust, Dense Copper Plate, Tin Dust
|
||||||
@@ -1115,6 +1085,9 @@ item: Rubber Sheet
|
|||||||
pattern: ... 000 000
|
pattern: ... 000 000
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
|
item: Rubber Wood
|
||||||
|
gatherable: yes
|
||||||
|
|
||||||
item: Scaffold
|
item: Scaffold
|
||||||
recipe:
|
recipe:
|
||||||
input: Oak Wood Planks, Stick
|
input: Oak Wood Planks, Stick
|
||||||
@@ -1122,6 +1095,9 @@ item: Scaffold
|
|||||||
quantity: 16
|
quantity: 16
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
|
item: Scrap
|
||||||
|
gatherable: yes
|
||||||
|
|
||||||
item: Scrap Box
|
item: Scrap Box
|
||||||
recipe:
|
recipe:
|
||||||
input: Scrap
|
input: Scrap
|
||||||
@@ -1146,12 +1122,6 @@ item: Single-Use Battery
|
|||||||
quantity: 5
|
quantity: 5
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Snowball
|
|
||||||
recipe:
|
|
||||||
input: Water Cell
|
|
||||||
pattern: ... .0. ...
|
|
||||||
tools: Compressor
|
|
||||||
|
|
||||||
item: Solar Helmet
|
item: Solar Helmet
|
||||||
recipe:
|
recipe:
|
||||||
input: Insulated Copper Cable, Iron Ingot, Solar Panel
|
input: Insulated Copper Cable, Iron Ingot, Solar Panel
|
||||||
@@ -1186,13 +1156,6 @@ item: Stone Mug
|
|||||||
pattern: 00. 000 00.
|
pattern: 00. 000 00.
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: String
|
|
||||||
recipe:
|
|
||||||
input: Wool
|
|
||||||
pattern: ... .0. ...
|
|
||||||
quantity: 4
|
|
||||||
tools: Macerator
|
|
||||||
|
|
||||||
item: Terraformer
|
item: Terraformer
|
||||||
recipe:
|
recipe:
|
||||||
input: Advanced Machine Block, Dirt, Glowstone Dust, TFBP - Empty
|
input: Advanced Machine Block, Dirt, Glowstone Dust, TFBP - Empty
|
||||||
@@ -1253,13 +1216,6 @@ item: Tin Block
|
|||||||
pattern: 000 000 000
|
pattern: 000 000 000
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Ultra Low Current Cable
|
|
||||||
recipe:
|
|
||||||
input: Tin Ingot
|
|
||||||
pattern: ... 000 ...
|
|
||||||
quantity: 9
|
|
||||||
tools: Crafting Table
|
|
||||||
|
|
||||||
item: Tin Can
|
item: Tin Can
|
||||||
recipe:
|
recipe:
|
||||||
input: Tin Ingot
|
input: Tin Ingot
|
||||||
@@ -1307,6 +1263,13 @@ item: Treetap
|
|||||||
pattern: .0. 000 0..
|
pattern: .0. 000 0..
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
|
item: Ultra Low Current Cable
|
||||||
|
recipe:
|
||||||
|
input: Tin Ingot
|
||||||
|
pattern: ... 000 ...
|
||||||
|
quantity: 9
|
||||||
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Uranium
|
item: Uranium
|
||||||
gatherable: yes
|
gatherable: yes
|
||||||
|
|
||||||
@@ -1355,8 +1318,41 @@ item: Wrench
|
|||||||
pattern: 0.0 000 .0.
|
pattern: 0.0 000 .0.
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Rubber Wood
|
update: Nether Brick
|
||||||
gatherable: yes
|
recipe:
|
||||||
|
input: Netherrack
|
||||||
|
pattern: .0. .0. .0.
|
||||||
|
tools: Compressor
|
||||||
|
|
||||||
item: Scrap
|
update: Blaze Powder
|
||||||
gatherable: yes
|
recipe:
|
||||||
|
input: Blaze Rod
|
||||||
|
pattern: ... .0. ...
|
||||||
|
quantity: 5
|
||||||
|
tools: Macerator
|
||||||
|
|
||||||
|
update: Bone Meal
|
||||||
|
recipe:
|
||||||
|
input: Bone
|
||||||
|
pattern: ... .0. ...
|
||||||
|
quantity: 5
|
||||||
|
tools: Macerator
|
||||||
|
|
||||||
|
update: Ice
|
||||||
|
recipe:
|
||||||
|
input: Snowball
|
||||||
|
pattern: ... .0. ...
|
||||||
|
tools: Compressor
|
||||||
|
|
||||||
|
update: Snowball
|
||||||
|
recipe:
|
||||||
|
input: Water Cell
|
||||||
|
pattern: ... .0. ...
|
||||||
|
tools: Compressor
|
||||||
|
|
||||||
|
update: String
|
||||||
|
recipe:
|
||||||
|
input: Wool
|
||||||
|
pattern: ... .0. ...
|
||||||
|
quantity: 4
|
||||||
|
tools: Macerator
|
||||||
@@ -2924,12 +2924,6 @@ group: Tools
|
|||||||
pattern: 0.0 .0. 101
|
pattern: 0.0 .0. 101
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
item: Windmeter
|
|
||||||
recipe:
|
|
||||||
input: Bronze Item Casing, Small Power Unit, Tin Item Casing
|
|
||||||
pattern: .2. 202 .21
|
|
||||||
tools: Crafting Table
|
|
||||||
|
|
||||||
item: Wrench
|
item: Wrench
|
||||||
recipe:
|
recipe:
|
||||||
input: Bronze Ingot
|
input: Bronze Ingot
|
||||||
@@ -2996,6 +2990,12 @@ group: Tools: Electric
|
|||||||
pattern: 30. 30. 121
|
pattern: 30. 30. 121
|
||||||
tools: Crafting Table
|
tools: Crafting Table
|
||||||
|
|
||||||
|
item: Windmeter
|
||||||
|
recipe:
|
||||||
|
input: Bronze Item Casing, Small Power Unit, Tin Item Casing
|
||||||
|
pattern: .2. 202 .21
|
||||||
|
tools: Crafting Table
|
||||||
|
|
||||||
group: Tools: Painters
|
group: Tools: Painters
|
||||||
|
|
||||||
item: Black Painter
|
item: Black Painter
|
||||||
|
|||||||
@@ -18,14 +18,6 @@ module.exports = class ItemPage extends BaseModel
|
|||||||
attributes.item ?= null
|
attributes.item ?= null
|
||||||
super attributes, options
|
super attributes, options
|
||||||
|
|
||||||
@_plan = new CraftingPlan modPack:@modPack
|
|
||||||
@on Event.change + ':item', => @_updateCraftingPlan()
|
|
||||||
@_updateCraftingPlan()
|
|
||||||
|
|
||||||
Object.defineProperties this,
|
|
||||||
craftingRawMaterials: {get:-> @_plan.need}
|
|
||||||
craftingSteps: {get:-> @_plan.steps}
|
|
||||||
|
|
||||||
# Property Methods #############################################################################
|
# Property Methods #############################################################################
|
||||||
|
|
||||||
findComponentInItems: ->
|
findComponentInItems: ->
|
||||||
@@ -56,17 +48,3 @@ module.exports = class ItemPage extends BaseModel
|
|||||||
|
|
||||||
findRecipes: ->
|
findRecipes: ->
|
||||||
return @modPack.findRecipes @item?.slug
|
return @modPack.findRecipes @item?.slug
|
||||||
|
|
||||||
# Private Methods ##############################################################################
|
|
||||||
|
|
||||||
_updateCraftingPlan: ->
|
|
||||||
@_plan.clear()
|
|
||||||
|
|
||||||
if @item?
|
|
||||||
@_plan.want.add @item.slug
|
|
||||||
@_plan.craft()
|
|
||||||
|
|
||||||
if @_plan.steps.length > 0
|
|
||||||
@_primaryRecipe = @_plan.steps[@_plan.steps.length - 1].recipe
|
|
||||||
else
|
|
||||||
@_primaryRecipe = null
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ BaseModel = require './base_model'
|
|||||||
{Event} = require '../constants'
|
{Event} = require '../constants'
|
||||||
Item = require './item'
|
Item = require './item'
|
||||||
ItemSlug = require './item_slug'
|
ItemSlug = require './item_slug'
|
||||||
|
Recipe = require './recipe'
|
||||||
{RequiredMods} = require '../constants'
|
{RequiredMods} = require '../constants'
|
||||||
{Url} = require '../constants'
|
{Url} = require '../constants'
|
||||||
|
|
||||||
@@ -116,13 +117,16 @@ module.exports = class ModVersion extends BaseModel
|
|||||||
# Recipe Methods ###############################################################################
|
# Recipe Methods ###############################################################################
|
||||||
|
|
||||||
addRecipe: (recipe)->
|
addRecipe: (recipe)->
|
||||||
|
return unless recipe?
|
||||||
|
|
||||||
recipe.modVersion = this
|
recipe.modVersion = this
|
||||||
if @_recipes[recipe.slug]? then throw new Error "duplicate recipe: #{recipe.slug}"
|
if @_recipes[recipe.slug]? then throw new Error "duplicate recipe: #{recipe.slug}"
|
||||||
|
|
||||||
@_recipes[recipe.slug] = recipe
|
@_recipes[recipe.slug] = recipe
|
||||||
return this
|
return this
|
||||||
|
|
||||||
eachRecipe: (callback)->
|
eachRecipe: (callback)->
|
||||||
recipes = _.values(@_recipes).sort (a, b)-> a.compareTo b
|
recipes = _.values(@_recipes).sort (a, b)-> Recipe.compareFor a, b
|
||||||
for recipe in recipes
|
for recipe in recipes
|
||||||
callback recipe
|
callback recipe
|
||||||
return this
|
return this
|
||||||
|
|||||||
@@ -38,16 +38,17 @@ module.exports = class Recipe extends BaseModel
|
|||||||
# Class Methods ################################################################################
|
# Class Methods ################################################################################
|
||||||
|
|
||||||
@compareFor: (a, b, itemSlug)->
|
@compareFor: (a, b, itemSlug)->
|
||||||
aValue = a.itemSlug.matches itemSlug
|
if itemSlug?
|
||||||
bValue = b.itemSlug.matches itemSlug
|
aValue = a.itemSlug.matches itemSlug
|
||||||
if aValue isnt bValue
|
bValue = b.itemSlug.matches itemSlug
|
||||||
return -1 if aValue
|
if aValue isnt bValue
|
||||||
return +1 if bValue
|
return -1 if aValue
|
||||||
|
return +1 if bValue
|
||||||
|
|
||||||
aValue = a.getQuantityProducedOf itemSlug
|
aValue = a.getQuantityProducedOf itemSlug
|
||||||
bValue = b.getQuantityProducedOf itemSlug
|
bValue = b.getQuantityProducedOf itemSlug
|
||||||
if aValue isnt bValue
|
if aValue isnt bValue
|
||||||
return if aValue > bValue then -1 else +1
|
return if aValue > bValue then -1 else +1
|
||||||
|
|
||||||
aValue = a.getInputCount()
|
aValue = a.getInputCount()
|
||||||
bValue = b.getInputCount()
|
bValue = b.getInputCount()
|
||||||
|
|||||||
Reference in New Issue
Block a user