Skip to content

Commit

Permalink
use prismarine-recipe, progress on #336
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1504 committed Nov 22, 2015
1 parent aaa90b2 commit 9ab788c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 206 deletions.
70 changes: 1 addition & 69 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
- [mineflayer.Item](#mineflayeritem)
- [mineflayer.windows.Window (base class)](#mineflayerwindowswindow-base-class)
- [mineflayer.Recipe](#mineflayerrecipe)
- [Recipe.find(itemType, [metadata])](#recipefinditemtype-metadata)
- [recipe.result](#reciperesult)
- [recipe.inShape](#recipeinshape)
- [recipe.outShape](#recipeoutshape)
- [recipe.ingredients](#recipeingredients)
- [recipe.requiresTable](#reciperequirestable)
- [recipe.delta](#recipedelta)
- [mineflayer.Chest](#mineflayerchest)
- [chest.window](#chestwindow)
- [chest "open"](#chest-open)
Expand Down Expand Up @@ -299,68 +292,7 @@ See [prismarine-windows](https://github.com/PrismarineJS/prismarine-windows)

### mineflayer.Recipe

#### Recipe.find(itemType, [metadata])

Returns a list of matching `Recipe` instances.

* `itemType` - numerical id
* `metadata` - metadata to match. `null` means match anything.

#### recipe.result

The output item. It's a recipeItem :
```js
{
id:45,
metadata:3,
count:1
}
```

#### recipe.inShape

Looks like this:

```js
[
[recipeItem, recipeItem],
[recipeItem, recipeItem],
[recipeItem, recipeItem],
]
```

#### recipe.outShape

Looks the same as `inShape`. Only relevant for cake.

#### recipe.ingredients

List of shape-independent ingredients. Looks like this:

```js
[
recipeItem,
recipeItem
]
```

#### recipe.requiresTable

Boolean.

#### recipe.delta

Map of item type to how much more or less you will have after you use
the recipe.

This is what it looks like for the chest recipe:

```js
[
recipeItem,
recipeItem
]
```
See [prismarine-recipe](https://github.com/PrismarineJS/prismarine-recipe)

### mineflayer.Chest

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
Entity: require('prismarine-entity'),
Painting: require('./lib/painting'),
Item: require("prismarine-item")(version),
Recipe: require('./lib/recipe'),
Recipe: require('prismarine-recipe')(version).Recipe,
windows: require('prismarine-windows')(version).windows,
Chest: require('./lib/chest'),
Furnace: require('./lib/furnace'),
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/craft.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var version=require("../version");
var Item = require("prismarine-item")(version);
var Recipe = require('../recipe');
var Recipe = require('prismarine-recipe')(version).Recipe;
var windows = require('prismarine-windows')(version).windows;
var assert = require('assert');

Expand Down
111 changes: 0 additions & 111 deletions lib/recipe.js

This file was deleted.

24 changes: 0 additions & 24 deletions lib/recipe_item.js

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"prismarine-entity": "0.1.0",
"prismarine-item": "0.0.0",
"prismarine-windows": "0.0.0",
"prismarine-recipe": "0.0.0",
"quotemeta": "0.0.0",
"requireindex": "~1.0.0",
"vec3": "~0.1.3"
Expand Down

0 comments on commit 9ab788c

Please sign in to comment.