Move farmers delight to bworld
This commit is contained in:
@@ -7,7 +7,7 @@ Crops grow on Stardew Valley's clock with Minecraft's rules: every morning at 06
|
||||
the day before grows a day, then all farmland dries out. The crop shows the stage for how far along it is. A crop with
|
||||
`seasons` dies the first morning that's in another season, turning into a `bworld:dead_bush`, so a summer crop has to be
|
||||
harvested before autumn comes. The season is its biome's, so a crop that only grows in summer is always out of season in
|
||||
a snowy biome. `mods/farmersdelight` adds its cabbages, onions, tomatoes and rice this way.
|
||||
a snowy biome.
|
||||
|
||||
## A Basic Crop
|
||||
|
||||
@@ -17,17 +17,17 @@ a snowy biome. `mods/farmersdelight` adds its cabbages, onions, tomatoes and ric
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:cabbages",
|
||||
"id": "bworld:cabbages",
|
||||
"model": "engine:cross",
|
||||
"textures": { "cross": "farmersdelight:cabbages_stage0" },
|
||||
"textures": { "cross": "bworld:cabbages_stage0" },
|
||||
"variants": {
|
||||
"age=1": { "textures": { "cross": "farmersdelight:cabbages_stage1" } },
|
||||
"age=2": { "textures": { "cross": "farmersdelight:cabbages_stage2" } }
|
||||
"age=1": { "textures": { "cross": "bworld:cabbages_stage1" } },
|
||||
"age=2": { "textures": { "cross": "bworld:cabbages_stage2" } }
|
||||
},
|
||||
"render_layer": "cutout",
|
||||
"collision": false,
|
||||
"mining": { "toughness": 0 },
|
||||
"loot_table": "farmersdelight:blocks/cabbages",
|
||||
"loot_table": "bworld:blocks/cabbages",
|
||||
"item": false,
|
||||
"place_on": ["bworld:hoed_dirt"],
|
||||
"states": [{ "name": "age", "bits": 3, "default": 0 }],
|
||||
@@ -48,9 +48,9 @@ a snowy biome. `mods/farmersdelight` adds its cabbages, onions, tomatoes and ric
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:cabbage_seeds",
|
||||
"texture": "farmersdelight:cabbage_seeds",
|
||||
"places": "farmersdelight:cabbages"
|
||||
"id": "bworld:cabbage_seeds",
|
||||
"texture": "bworld:cabbage_seeds",
|
||||
"places": "bworld:cabbages"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -71,11 +71,11 @@ and 1 to 4 seeds, like Minecraft's wheat:
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:cabbage",
|
||||
"item": "bworld:cabbage",
|
||||
"conditions": [{ "condition": "block_state", "states": { "age": 7 } }]
|
||||
},
|
||||
{
|
||||
"item": "farmersdelight:cabbage_seeds",
|
||||
"item": "bworld:cabbage_seeds",
|
||||
"conditions": [
|
||||
{ "condition": "inverted", "term": { "condition": "block_state", "states": { "age": 7 } } }
|
||||
]
|
||||
@@ -86,7 +86,7 @@ and 1 to 4 seeds, like Minecraft's wheat:
|
||||
"conditions": [{ "condition": "block_state", "states": { "age": 7 } }],
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:cabbage_seeds",
|
||||
"item": "bworld:cabbage_seeds",
|
||||
"functions": [{ "function": "set_count", "count": { "n": 3, "p": 0.5714 }, "add": true }]
|
||||
}
|
||||
]
|
||||
@@ -119,7 +119,7 @@ Tomatoes are picked instead of broken:
|
||||
"days": 11,
|
||||
"stages": 8,
|
||||
"regrow_days": 4,
|
||||
"harvest": "farmersdelight:harvest/tomatoes"
|
||||
"harvest": "bworld:harvest/tomatoes"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -129,7 +129,7 @@ with `loot_tables/harvest/tomatoes.json` giving 1 or 2 tomatoes:
|
||||
{
|
||||
"format_version": 1,
|
||||
"loot_table": {
|
||||
"pools": [{ "entries": [{ "item": "farmersdelight:tomato", "count": { "min": 1, "max": 2 } }] }]
|
||||
"pools": [{ "entries": [{ "item": "bworld:tomato", "count": { "min": 1, "max": 2 } }] }]
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -147,7 +147,7 @@ block goes through its own `stages`:
|
||||
"days": 6,
|
||||
"stages": 4,
|
||||
"water": "always",
|
||||
"upper": { "block": "farmersdelight:rice_panicles", "stages": 4, "supporting_age": 4 },
|
||||
"upper": { "block": "bworld:rice_panicles", "stages": 4, "supporting_age": 4 },
|
||||
"leaves": "bworld:water"
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ The top block uses `bworld:crop_top` with its own `stages`, and its own loot tab
|
||||
whole plant:
|
||||
|
||||
```json
|
||||
"loot_table": "farmersdelight:blocks/rice_panicles",
|
||||
"loot_table": "bworld:blocks/rice_panicles",
|
||||
"components": {
|
||||
"bworld:crop_top": { "stages": 4 }
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ A block that isn't a fluid can hold one, like Minecraft's waterlogged fences. `w
|
||||
- Broken, it leaves a source of the fluid behind.
|
||||
- Raycasts with `fluids` other than `"none"` hit the fluid in it, filling the block, and say the fluid's id.
|
||||
|
||||
The base game's wooden fences are waterloggable, and Farmer's Delight's rice is `waterlogged_only`.
|
||||
The base game's wooden fences are waterloggable, and rice is `waterlogged_only`.
|
||||
|
||||
## Tinting
|
||||
|
||||
|
||||
@@ -97,4 +97,4 @@ look, 0 to 3. Pair it with turning variants, like the furnace:
|
||||
|
||||
A lit furnace facing east matches both `facing=1` (its turn) and `lit=1` (its textures).
|
||||
|
||||
Turning also turns a [displayed item](tiledata.md#showing-an-item), like the knife on Farmer's Delight's cutting board.
|
||||
Turning also turns a [displayed item](tiledata.md#showing-an-item), like the knife on the cutting board.
|
||||
|
||||
@@ -86,7 +86,7 @@ to every player near it.
|
||||
|
||||
## Showing an Item
|
||||
|
||||
A block with `item_display` draws one item lying on top of it, like the food on Farmer's Delight's cutting board:
|
||||
A block with `item_display` draws one item lying on top of it, like the food on cutting board:
|
||||
|
||||
```json
|
||||
"item_display": { "surface": 1 }
|
||||
@@ -95,7 +95,7 @@ A block with `item_display` draws one item lying on top of it, like the food on
|
||||
`surface` is the height in pixels the item lies at, 0 to 16. The server script sets the item:
|
||||
|
||||
```ts
|
||||
ctx.world.set_block_item(x, y, z, { id: "farmersdelight:cabbage", count: 1 });
|
||||
ctx.world.set_block_item(x, y, z, { id: "bworld:cabbage", count: 1 });
|
||||
const shown = ctx.world.get_block_item(x, y, z); // a copy, or undefined
|
||||
ctx.world.set_block_item(x, y, z, undefined); // shows nothing
|
||||
```
|
||||
|
||||
@@ -5,7 +5,7 @@ under it once, while mods load. After that the game refers to things only by the
|
||||
|
||||
## Identifiers
|
||||
|
||||
An id looks like `namespace:name`, like `farmersdelight:cabbage`:
|
||||
An id looks like `namespace:name`, like `bworld:cabbage`:
|
||||
|
||||
- `namespace` is the id of the mod that registers it, 1-32 characters of `a-z`, `0-9` and `_`.
|
||||
- `name` is `a-z`, `0-9` and `_`.
|
||||
|
||||
@@ -27,8 +27,8 @@ name.
|
||||
|
||||
> [!TIP]
|
||||
> The mods already in the repository are the best reference. `mods/bworld` is the base game itself, written against the
|
||||
> same API as any other mod. `mods/farmersdelight` adds crops, a stove, a cooking pot and a cutting board, and
|
||||
> `mods/recipe_viewer` is a client-only mod with an inventory overlay and a screen of its own.
|
||||
> same API as any other mod. `mods/creates` adds a lot of blocks and mechanics, and `mods/recipe_viewer` is a
|
||||
> client-only mod with an inventory overlay and a screen of its own.
|
||||
|
||||
## Checking Your Mod
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ Menus are how players use [containers](containers.md), like NeoForge's. A GUI ha
|
||||
- The **screen** lives in the client script. It only draws the menu and sends the player's clicks.
|
||||
|
||||
Every click goes to the server, which applies it following the menu's rules, so a modified client can only do what the
|
||||
menu allows. Chests, furnaces, the smithing table and Farmer's Delight's cooking pot are all menus, and the base game's
|
||||
curios slots are part of [the player's inventory](#the-players-inventory).
|
||||
menu allows. Chests, furnaces, the smithing table and cooking pot are all menus, and the base game's curios slots are
|
||||
part of [the player's inventory](#the-players-inventory).
|
||||
|
||||
## Registering a Menu Type
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ An item with a `food` property can be eaten. Players eat by right clicking while
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:cooked_rice",
|
||||
"texture": "farmersdelight:cooked_rice",
|
||||
"id": "bworld:cooked_rice",
|
||||
"texture": "bworld:cooked_rice",
|
||||
"max_stack": 16,
|
||||
"food": { "nutrition": 6, "saturation_modifier": 0.4, "returns": "bworld:bowl" }
|
||||
}
|
||||
|
||||
@@ -155,16 +155,16 @@ Use a tag rather than listing ids when other mods might have more of the same th
|
||||
|
||||
## Custom Recipe Types
|
||||
|
||||
Any `type` with a namespace is a mod's own, like `farmersdelight:cooking` for the cooking pot. The engine only stores
|
||||
these recipes. Everything else about them is up to the mod:
|
||||
Any `type` with a namespace is a mod's own, like `bworld:cooking` for the cooking pot. The engine only stores these
|
||||
recipes. Everything else about them is up to the mod:
|
||||
|
||||
```json
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "farmersdelight:cooking",
|
||||
"ingredients": ["farmersdelight:cabbage", ["bworld:carrot", "bworld:potato", "farmersdelight:onion"]],
|
||||
"result": { "id": "farmersdelight:cabbage_rolls", "count": 1 },
|
||||
"type": "bworld:cooking",
|
||||
"ingredients": ["bworld:cabbage", ["bworld:carrot", "bworld:potato", "bworld:onion"]],
|
||||
"result": { "id": "bworld:cabbage_rolls", "count": 1 },
|
||||
"cook_time": 100
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ these recipes. Everything else about them is up to the mod:
|
||||
The mod's server script reads them in `setup` and checks their fields itself:
|
||||
|
||||
```ts
|
||||
const recipes = ctx.recipes.list("farmersdelight:cooking").map((json, i) => {
|
||||
const recipes = ctx.recipes.list("bworld:cooking").map((json, i) => {
|
||||
if (!Array.isArray(json.ingredients) || json.ingredients.length > 6) {
|
||||
throw new Error(`cooking recipe ${i + 1}: ingredients must be 1 to 6 items`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user