Move farmers delight to bworld
@@ -157,7 +157,7 @@ export interface BlockRegistry {
|
||||
place_in?: string[];
|
||||
// custom components from mods and their params, the server runs them
|
||||
components?: Record<string, unknown>;
|
||||
// draws the item a server script gives it (ServerWorld.set_block_item) on top of it, like farmer's delight's
|
||||
// draws the item a server script gives it (ServerWorld.set_block_item) on top of it, like the
|
||||
// cutting board. surface is the height in pixels it lies on. turned with the variant's y
|
||||
item_display?: { surface: number };
|
||||
// a fluid like water, drawn like luanti's: its top slopes down towards where it flows. see FluidProperties
|
||||
|
||||
@@ -648,7 +648,7 @@ export interface RecipeApi {
|
||||
is_smeltable(item: Id): boolean;
|
||||
// the smithing recipe for these items, whatever the material's count. addition is the optional third item
|
||||
smithing(tool: Id, material: Id, addition?: Id): { result: Id; material_count: number } | undefined;
|
||||
// every recipe of a mod's own type, like "farmersdelight:cooking", as its json. copies, in load order
|
||||
// every recipe of a mod's own type, like "bworld:cooking", as its json. copies, in load order
|
||||
// deno-lint-ignore no-explicit-any
|
||||
list(type: Id): any[];
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ export interface SharedContext {
|
||||
register(id: Id, rules: FluidRules): void;
|
||||
};
|
||||
readonly recipes: {
|
||||
// adds a recipe of type, like "shaped" or "farmersdelight:cooking", as a file in the mod's recipes/ with that
|
||||
// adds a recipe of type, like "shaped" or "bworld:cooking", as a file in the mod's recipes/ with that
|
||||
// json would, only during setup. for recipes made from other data, like one for every item with a component.
|
||||
// shared scripts run on the server and every client alike, so they all have it without it being sent. it's
|
||||
// there for server and client scripts, which set up after, and it throws when it's broken like a file would
|
||||
|
||||
@@ -631,12 +631,12 @@ const engine_recipes = new Map<string, z.ZodType>([
|
||||
["smithing", smithing_recipe],
|
||||
]);
|
||||
|
||||
// a mod's own types, like "farmersdelight:cooking" for its cooking pot, are only stored by the engine. the mod's server
|
||||
// a mod's own types, like "bworld:cooking" for its cooking pot, are only stored by the engine. the mod's server
|
||||
// script reads them with ctx.recipes.list and checks them
|
||||
const recipe_schema = by_kind(
|
||||
"type",
|
||||
(type) => engine_recipes.get(type) ?? (ID_PATTERN.test(type) ? json_object : undefined),
|
||||
'must be "shaped", "furnace", "fuel", "smithing" or a mod\'s own type like "farmersdelight:cooking"',
|
||||
'must be "shaped", "furnace", "fuel", "smithing" or a mod\'s own type like "bworld:cooking"',
|
||||
);
|
||||
|
||||
// a recipe type a mod made up, as opposed to the engine's shaped, furnace, fuel and smithing
|
||||
|
||||
@@ -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`);
|
||||
}
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:cabbages",
|
||||
"id": "bworld:cabbages",
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage0"
|
||||
"cross": "bworld:cabbages_stage0"
|
||||
},
|
||||
"model": "engine:cross",
|
||||
"variants": {
|
||||
"age=0": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage0"
|
||||
"cross": "bworld:cabbages_stage0"
|
||||
}
|
||||
},
|
||||
"age=1": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage1"
|
||||
"cross": "bworld:cabbages_stage1"
|
||||
}
|
||||
},
|
||||
"age=2": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage2"
|
||||
"cross": "bworld:cabbages_stage2"
|
||||
}
|
||||
},
|
||||
"age=3": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage3"
|
||||
"cross": "bworld:cabbages_stage3"
|
||||
}
|
||||
},
|
||||
"age=4": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage4"
|
||||
"cross": "bworld:cabbages_stage4"
|
||||
}
|
||||
},
|
||||
"age=5": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage5"
|
||||
"cross": "bworld:cabbages_stage5"
|
||||
}
|
||||
},
|
||||
"age=6": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage6"
|
||||
"cross": "bworld:cabbages_stage6"
|
||||
}
|
||||
},
|
||||
"age=7": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:cabbages_stage7"
|
||||
"cross": "bworld:cabbages_stage7"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -53,7 +53,7 @@
|
||||
"mining": {
|
||||
"toughness": 0
|
||||
},
|
||||
"loot_table": "farmersdelight:blocks/cabbages",
|
||||
"loot_table": "bworld:blocks/cabbages",
|
||||
"item": false,
|
||||
"place_on": [
|
||||
"bworld:hoed_dirt"
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:cooking_pot",
|
||||
"model": "bworld:cooking_pot",
|
||||
"textures": {
|
||||
"side": "bworld:cooking_pot_side",
|
||||
"top": "bworld:cooking_pot_top",
|
||||
"bottom": "bworld:cooking_pot_bottom",
|
||||
"parts": "bworld:cooking_pot_parts"
|
||||
},
|
||||
"render_layer": "cutout",
|
||||
"shape": [[2, 0, 2, 14, 10, 14]],
|
||||
"mining": {
|
||||
"toughness": 2,
|
||||
"tool": "pickaxe"
|
||||
},
|
||||
"drops": "bworld:cooking_pot",
|
||||
"item": false,
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:cooking_pot": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:cutting_board",
|
||||
"model": "farmersdelight:cutting_board",
|
||||
"id": "bworld:cutting_board",
|
||||
"model": "bworld:cutting_board",
|
||||
"textures": {
|
||||
"main": "farmersdelight:cutting_board"
|
||||
"main": "bworld:cutting_board"
|
||||
},
|
||||
"variants": {
|
||||
"facing=1": { "y": 90 },
|
||||
@@ -17,7 +17,7 @@
|
||||
"toughness": 2,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "farmersdelight:cutting_board",
|
||||
"drops": "bworld:cutting_board",
|
||||
"interactive": true,
|
||||
"item_display": { "surface": 1 },
|
||||
"states": [
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
],
|
||||
"components": {
|
||||
"farmersdelight:cutting_board": {}
|
||||
"bworld:cutting_board": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:onions",
|
||||
"id": "bworld:onions",
|
||||
"textures": {
|
||||
"crop": "farmersdelight:onions_stage0"
|
||||
"crop": "bworld:onions_stage0"
|
||||
},
|
||||
"model": "engine:crop",
|
||||
"variants": {
|
||||
"age=0": {
|
||||
"textures": {
|
||||
"crop": "farmersdelight:onions_stage0"
|
||||
"crop": "bworld:onions_stage0"
|
||||
}
|
||||
},
|
||||
"age=1": {
|
||||
"textures": {
|
||||
"crop": "farmersdelight:onions_stage1"
|
||||
"crop": "bworld:onions_stage1"
|
||||
}
|
||||
},
|
||||
"age=2": {
|
||||
"textures": {
|
||||
"crop": "farmersdelight:onions_stage2"
|
||||
"crop": "bworld:onions_stage2"
|
||||
}
|
||||
},
|
||||
"age=3": {
|
||||
"textures": {
|
||||
"crop": "farmersdelight:onions_stage3"
|
||||
"crop": "bworld:onions_stage3"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -33,7 +33,7 @@
|
||||
"mining": {
|
||||
"toughness": 0
|
||||
},
|
||||
"loot_table": "farmersdelight:blocks/onions",
|
||||
"loot_table": "bworld:blocks/onions",
|
||||
"item": false,
|
||||
"place_on": [
|
||||
"bworld:hoed_dirt"
|
||||
@@ -1,35 +1,35 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:rice",
|
||||
"id": "bworld:rice",
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_stage0"
|
||||
"cross": "bworld:rice_stage0"
|
||||
},
|
||||
"model": "engine:cross",
|
||||
"variants": {
|
||||
"age=0": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_stage0"
|
||||
"cross": "bworld:rice_stage0"
|
||||
}
|
||||
},
|
||||
"age=1": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_stage1"
|
||||
"cross": "bworld:rice_stage1"
|
||||
}
|
||||
},
|
||||
"age=2": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_stage2"
|
||||
"cross": "bworld:rice_stage2"
|
||||
}
|
||||
},
|
||||
"age=3": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_stage3"
|
||||
"cross": "bworld:rice_stage3"
|
||||
}
|
||||
},
|
||||
"age=4": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_supporting"
|
||||
"cross": "bworld:rice_supporting"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -40,7 +40,7 @@
|
||||
"mining": {
|
||||
"toughness": 0
|
||||
},
|
||||
"loot_table": "farmersdelight:blocks/rice",
|
||||
"loot_table": "bworld:blocks/rice",
|
||||
"item": false,
|
||||
"place_on": [
|
||||
"bworld:dirt",
|
||||
@@ -64,7 +64,7 @@
|
||||
"fertilizer": "bworld:bone_meal",
|
||||
"water": "always",
|
||||
"upper": {
|
||||
"block": "farmersdelight:rice_panicles",
|
||||
"block": "bworld:rice_panicles",
|
||||
"stages": 4,
|
||||
"supporting_age": 4
|
||||
},
|
||||
@@ -1,30 +1,30 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:rice_panicles",
|
||||
"id": "bworld:rice_panicles",
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_panicles_stage0"
|
||||
"cross": "bworld:rice_panicles_stage0"
|
||||
},
|
||||
"model": "engine:cross",
|
||||
"variants": {
|
||||
"age=0": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_panicles_stage0"
|
||||
"cross": "bworld:rice_panicles_stage0"
|
||||
}
|
||||
},
|
||||
"age=1": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_panicles_stage1"
|
||||
"cross": "bworld:rice_panicles_stage1"
|
||||
}
|
||||
},
|
||||
"age=2": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_panicles_stage2"
|
||||
"cross": "bworld:rice_panicles_stage2"
|
||||
}
|
||||
},
|
||||
"age=3": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:rice_panicles_stage3"
|
||||
"cross": "bworld:rice_panicles_stage3"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -33,10 +33,10 @@
|
||||
"mining": {
|
||||
"toughness": 0
|
||||
},
|
||||
"loot_table": "farmersdelight:blocks/rice_panicles",
|
||||
"loot_table": "bworld:blocks/rice_panicles",
|
||||
"item": false,
|
||||
"place_on": [
|
||||
"farmersdelight:rice"
|
||||
"bworld:rice"
|
||||
],
|
||||
"states": [
|
||||
{
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:stove",
|
||||
"id": "bworld:stove",
|
||||
"textures": {
|
||||
"top": "farmersdelight:stove_top",
|
||||
"bottom": "farmersdelight:stove_bottom",
|
||||
"front": "farmersdelight:stove_front",
|
||||
"side": "farmersdelight:stove_side"
|
||||
"top": "bworld:stove_top",
|
||||
"bottom": "bworld:stove_bottom",
|
||||
"front": "bworld:stove_front",
|
||||
"side": "bworld:stove_side"
|
||||
},
|
||||
"variants": {
|
||||
"facing=1": { "y": 90 },
|
||||
@@ -14,10 +14,10 @@
|
||||
"facing=3": { "y": 270 },
|
||||
"lit=1": {
|
||||
"textures": {
|
||||
"top": "farmersdelight:stove_top_on",
|
||||
"bottom": "farmersdelight:stove_bottom",
|
||||
"front": "farmersdelight:stove_front_on",
|
||||
"side": "farmersdelight:stove_side"
|
||||
"top": "bworld:stove_top_on",
|
||||
"bottom": "bworld:stove_bottom",
|
||||
"front": "bworld:stove_front_on",
|
||||
"side": "bworld:stove_side"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -26,7 +26,7 @@
|
||||
"tool": "pickaxe",
|
||||
"requires_tool": true
|
||||
},
|
||||
"drops": "farmersdelight:stove",
|
||||
"drops": "bworld:stove",
|
||||
"states": [
|
||||
{
|
||||
"name": "lit",
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
],
|
||||
"components": {
|
||||
"farmersdelight:stove": {}
|
||||
"bworld:stove": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,50 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "farmersdelight:tomatoes",
|
||||
"id": "bworld:tomatoes",
|
||||
"textures": {
|
||||
"cross": "farmersdelight:budding_tomatoes_stage0"
|
||||
"cross": "bworld:budding_tomatoes_stage0"
|
||||
},
|
||||
"model": "engine:cross",
|
||||
"variants": {
|
||||
"age=0": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:budding_tomatoes_stage0"
|
||||
"cross": "bworld:budding_tomatoes_stage0"
|
||||
}
|
||||
},
|
||||
"age=1": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:budding_tomatoes_stage1"
|
||||
"cross": "bworld:budding_tomatoes_stage1"
|
||||
}
|
||||
},
|
||||
"age=2": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:budding_tomatoes_stage2"
|
||||
"cross": "bworld:budding_tomatoes_stage2"
|
||||
}
|
||||
},
|
||||
"age=3": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:budding_tomatoes_stage3"
|
||||
"cross": "bworld:budding_tomatoes_stage3"
|
||||
}
|
||||
},
|
||||
"age=4": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:tomatoes_stage0"
|
||||
"cross": "bworld:tomatoes_stage0"
|
||||
}
|
||||
},
|
||||
"age=5": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:tomatoes_stage1"
|
||||
"cross": "bworld:tomatoes_stage1"
|
||||
}
|
||||
},
|
||||
"age=6": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:tomatoes_stage2"
|
||||
"cross": "bworld:tomatoes_stage2"
|
||||
}
|
||||
},
|
||||
"age=7": {
|
||||
"textures": {
|
||||
"cross": "farmersdelight:tomatoes_stage3"
|
||||
"cross": "bworld:tomatoes_stage3"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -53,7 +53,7 @@
|
||||
"mining": {
|
||||
"toughness": 0
|
||||
},
|
||||
"loot_table": "farmersdelight:blocks/tomatoes",
|
||||
"loot_table": "bworld:blocks/tomatoes",
|
||||
"item": false,
|
||||
"place_on": [
|
||||
"bworld:hoed_dirt"
|
||||
@@ -71,7 +71,7 @@
|
||||
"stages": 8,
|
||||
"fertilizer": "bworld:bone_meal",
|
||||
"regrow_days": 4,
|
||||
"harvest": "farmersdelight:harvest/tomatoes",
|
||||
"harvest": "bworld:harvest/tomatoes",
|
||||
"seasons": [
|
||||
"summer"
|
||||
]
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:cabbage",
|
||||
"texture": "farmersdelight:cabbage",
|
||||
"id": "bworld:cabbage",
|
||||
"texture": "bworld:cabbage",
|
||||
"food": {
|
||||
"nutrition": 2,
|
||||
"saturation_modifier": 0.4
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:cabbage_leaf",
|
||||
"texture": "farmersdelight:cabbage_leaf",
|
||||
"id": "bworld:cabbage_leaf",
|
||||
"texture": "bworld:cabbage_leaf",
|
||||
"food": {
|
||||
"nutrition": 1,
|
||||
"saturation_modifier": 0.4
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:cabbage_rolls",
|
||||
"texture": "farmersdelight:cabbage_rolls",
|
||||
"id": "bworld:cabbage_rolls",
|
||||
"texture": "bworld:cabbage_rolls",
|
||||
"food": {
|
||||
"nutrition": 5,
|
||||
"saturation_modifier": 0.5
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "bworld:cabbage_seeds",
|
||||
"texture": "bworld:cabbage_seeds",
|
||||
"places": "bworld:cabbages"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:cod_slice",
|
||||
"texture": "farmersdelight:cod_slice",
|
||||
"id": "bworld:cod_slice",
|
||||
"texture": "bworld:cod_slice",
|
||||
"food": {
|
||||
"nutrition": 1,
|
||||
"saturation_modifier": 0.1
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"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,
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "bworld:cooking_pot",
|
||||
"texture": "bworld:cooking_pot",
|
||||
"places": "bworld:cooking_pot",
|
||||
"max_stack": 1
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:copper_knife",
|
||||
"texture": "farmersdelight:copper_knife",
|
||||
"id": "bworld:copper_knife",
|
||||
"texture": "bworld:copper_knife",
|
||||
"tool": {
|
||||
"type": "knife",
|
||||
"tier": 1,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:gold_knife",
|
||||
"texture": "farmersdelight:gold_knife",
|
||||
"id": "bworld:gold_knife",
|
||||
"texture": "bworld:gold_knife",
|
||||
"tool": {
|
||||
"type": "knife",
|
||||
"tier": 0,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:iron_knife",
|
||||
"texture": "farmersdelight:iron_knife",
|
||||
"id": "bworld:iron_knife",
|
||||
"texture": "bworld:iron_knife",
|
||||
"tool": {
|
||||
"type": "knife",
|
||||
"tier": 2,
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:onion",
|
||||
"texture": "farmersdelight:onion",
|
||||
"places": "farmersdelight:onions",
|
||||
"id": "bworld:onion",
|
||||
"texture": "bworld:onion",
|
||||
"places": "bworld:onions",
|
||||
"food": {
|
||||
"nutrition": 2,
|
||||
"saturation_modifier": 0.4
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "bworld:rice",
|
||||
"texture": "bworld:rice",
|
||||
"places": "bworld:rice",
|
||||
"base_sell_value": 13
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "bworld:rice_panicle",
|
||||
"texture": "bworld:rice_panicle",
|
||||
"base_sell_value": 10
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:salmon_slice",
|
||||
"texture": "farmersdelight:salmon_slice",
|
||||
"id": "bworld:salmon_slice",
|
||||
"texture": "bworld:salmon_slice",
|
||||
"food": {
|
||||
"nutrition": 1,
|
||||
"saturation_modifier": 0.1
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:stone_knife",
|
||||
"texture": "farmersdelight:stone_knife",
|
||||
"id": "bworld:stone_knife",
|
||||
"texture": "bworld:stone_knife",
|
||||
"tool": {
|
||||
"type": "knife",
|
||||
"tier": 1,
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:tomato",
|
||||
"texture": "farmersdelight:tomato",
|
||||
"id": "bworld:tomato",
|
||||
"texture": "bworld:tomato",
|
||||
"food": {
|
||||
"nutrition": 1,
|
||||
"saturation_modifier": 0.3
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:tomato_sauce",
|
||||
"texture": "farmersdelight:tomato_sauce",
|
||||
"id": "bworld:tomato_sauce",
|
||||
"texture": "bworld:tomato_sauce",
|
||||
"food": {
|
||||
"nutrition": 4,
|
||||
"saturation_modifier": 0.4,
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "bworld:tomato_seeds",
|
||||
"texture": "bworld:tomato_seeds",
|
||||
"places": "bworld:tomatoes"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"item": {
|
||||
"id": "farmersdelight:wood_knife",
|
||||
"texture": "farmersdelight:wood_knife",
|
||||
"id": "bworld:wood_knife",
|
||||
"texture": "bworld:wood_knife",
|
||||
"tool": {
|
||||
"type": "knife",
|
||||
"tier": 0,
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:cabbage",
|
||||
"item": "bworld:cabbage",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "block_state",
|
||||
@@ -16,7 +16,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"item": "farmersdelight:cabbage_seeds",
|
||||
"item": "bworld:cabbage_seeds",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "inverted",
|
||||
@@ -42,7 +42,7 @@
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:cabbage_seeds",
|
||||
"item": "bworld:cabbage_seeds",
|
||||
"functions": [
|
||||
{
|
||||
"function": "set_count",
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:onion"
|
||||
"item": "bworld:onion"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -20,7 +20,7 @@
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:onion",
|
||||
"item": "bworld:onion",
|
||||
"functions": [
|
||||
{
|
||||
"function": "set_count",
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:rice"
|
||||
"item": "bworld:rice"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:rice_panicle"
|
||||
"item": "bworld:rice_panicle"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:tomato_seeds"
|
||||
"item": "bworld:tomato_seeds"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -20,7 +20,7 @@
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:tomato"
|
||||
"item": "bworld:tomato"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"entries": [
|
||||
{
|
||||
"item": "farmersdelight:tomato",
|
||||
"item": "bworld:tomato",
|
||||
"count": {
|
||||
"min": 1,
|
||||
"max": 2
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "farmersdelight:cooking_pot",
|
||||
"id": "bworld:cooking_pot",
|
||||
"textures": {
|
||||
"side": "farmersdelight:cooking_pot_side",
|
||||
"top": "farmersdelight:cooking_pot_top",
|
||||
"bottom": "farmersdelight:cooking_pot_bottom",
|
||||
"parts": "farmersdelight:cooking_pot_parts"
|
||||
"side": "bworld:cooking_pot_side",
|
||||
"top": "bworld:cooking_pot_top",
|
||||
"bottom": "bworld:cooking_pot_bottom",
|
||||
"parts": "bworld:cooking_pot_parts"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "farmersdelight:cutting_board",
|
||||
"id": "bworld:cutting_board",
|
||||
"textures": {
|
||||
"main": "farmersdelight:cutting_board"
|
||||
"main": "bworld:cutting_board"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "bworld:cooking",
|
||||
"ingredients": [
|
||||
"bworld:cabbage",
|
||||
["bworld:carrot", "bworld:potato", "bworld:onion", "bworld:tomato"]
|
||||
],
|
||||
"result": { "id": "bworld:cabbage_rolls", "count": 1 },
|
||||
"cook_time": 100
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "bworld:cooking",
|
||||
"ingredients": ["bworld:rice"],
|
||||
"result": { "id": "bworld:cooked_rice", "count": 1 },
|
||||
"container": "bworld:bowl",
|
||||
"cook_time": 100
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "bworld:cooking",
|
||||
"ingredients": ["bworld:tomato", "bworld:tomato"],
|
||||
"result": { "id": "bworld:tomato_sauce", "count": 1 },
|
||||
"container": "bworld:bowl",
|
||||
"cook_time": 100
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@
|
||||
"type": "shaped",
|
||||
"pattern": ["iSi", "i i", "iii"],
|
||||
"key": { "i": "bworld:iron_ingot", "S": "bworld:stick" },
|
||||
"result": { "id": "farmersdelight:cooking_pot", "count": 1 }
|
||||
"result": { "id": "bworld:cooking_pot", "count": 1 }
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
"P": "#bworld:planks"
|
||||
},
|
||||
"result": {
|
||||
"id": "farmersdelight:cutting_board",
|
||||
"id": "bworld:cutting_board",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@
|
||||
"type": "shaped",
|
||||
"pattern": ["iii", "B B", "BCB"],
|
||||
"key": { "i": "bworld:iron_ingot", "B": "bworld:stone", "C": "bworld:coal" },
|
||||
"result": { "id": "farmersdelight:stove", "count": 1 }
|
||||
"result": { "id": "bworld:stove", "count": 1 }
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
"S": "bworld:stick"
|
||||
},
|
||||
"result": {
|
||||
"id": "farmersdelight:wood_knife",
|
||||
"id": "bworld:wood_knife",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "bworld:cutting",
|
||||
"ingredients": ["bworld:cabbage"],
|
||||
"tool": "knife",
|
||||
"result": [{ "id": "bworld:cabbage_leaf", "count": 2 }]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "bworld:cutting",
|
||||
"ingredients": ["bworld:cod"],
|
||||
"tool": "knife",
|
||||
"result": [{ "id": "bworld:cod_slice", "count": 2 }, { "id": "bworld:bone_meal", "count": 1 }]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "bworld:cutting",
|
||||
"ingredients": ["bworld:salmon"],
|
||||
"tool": "knife",
|
||||
"result": [{ "id": "bworld:salmon_slice", "count": 2 }, { "id": "bworld:bone_meal", "count": 1 }]
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "smithing",
|
||||
"tool": "farmersdelight:stone_knife",
|
||||
"tool": "bworld:stone_knife",
|
||||
"material": {
|
||||
"id": "bworld:copper_ingot",
|
||||
"count": 5
|
||||
},
|
||||
"result": "farmersdelight:copper_knife"
|
||||
"result": "bworld:copper_knife"
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "smithing",
|
||||
"tool": "farmersdelight:iron_knife",
|
||||
"tool": "bworld:iron_knife",
|
||||
"material": {
|
||||
"id": "bworld:gold_ingot",
|
||||
"count": 5
|
||||
},
|
||||
"result": "farmersdelight:gold_knife"
|
||||
"result": "bworld:gold_knife"
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "smithing",
|
||||
"tool": "farmersdelight:copper_knife",
|
||||
"tool": "bworld:copper_knife",
|
||||
"material": {
|
||||
"id": "bworld:iron_ingot",
|
||||
"count": 5
|
||||
},
|
||||
"result": "farmersdelight:iron_knife"
|
||||
"result": "bworld:iron_knife"
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
"format_version": 1,
|
||||
"recipe": {
|
||||
"type": "smithing",
|
||||
"tool": "farmersdelight:wood_knife",
|
||||
"tool": "bworld:wood_knife",
|
||||
"material": {
|
||||
"id": "bworld:stone",
|
||||
"count": 5
|
||||
},
|
||||
"result": "farmersdelight:stone_knife"
|
||||
"result": "bworld:stone_knife"
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,22 @@ export function setup(ctx: ClientContext) {
|
||||
ctx.ui.register_menu_screen("bworld:stonecutter", (menu) => stonecutter_screen(ctx, menu));
|
||||
ctx.ui.register_menu_screen("bworld:fishing_minigame", fishing_minigame_screen);
|
||||
ctx.render.register_visual("bworld:juicer", juicer_visual);
|
||||
|
||||
ctx.ui.register_menu_screen("bworld:cooking_pot", (menu) => ({
|
||||
width: WIDTH,
|
||||
height: HEIGHT,
|
||||
on_render_background(g) {
|
||||
g.panel(0, 0, WIDTH, HEIGHT);
|
||||
// lit under the ingredients while something heats the pot, the arrow fills as the meal cooks
|
||||
g.progress("bworld:fire_empty", "bworld:fire_full", 47, 53, 18, 18, menu.data.heated, "up");
|
||||
const { progress, progress_max } = menu.data;
|
||||
g.progress("bworld:arrow_empty", "bworld:arrow_full", 95, 25, 18, 18, progress / progress_max);
|
||||
},
|
||||
on_render_labels(g) {
|
||||
g.text(menu.title, 8, 6);
|
||||
g.text("Inventory", 8, 73);
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
// the middle of the bottom copy of what's in the juicer, just over its floor, and how much higher each next one is
|
||||
|
||||
@@ -5,13 +5,8 @@
|
||||
// CookingPotBlockEntity, cooks its recipes while something hot is under it, keeps the meal, and serves it into the
|
||||
// container the meal needs (a bowl), or straight out when it needs none. the cutting board, like its
|
||||
// CuttingBoardBlockEntity, holds a stack of anything and cuts it one at a time with the right tool
|
||||
import type { BlockRef, Container, ItemStack, ServerContext } from "bworld/server";
|
||||
|
||||
export function setup(ctx: ServerContext) {
|
||||
register_stove(ctx);
|
||||
register_cooking_pot(ctx);
|
||||
register_cutting_board(ctx);
|
||||
}
|
||||
import type { BlockRef, Container, ItemStack, ServerContext } from "bworld/server";
|
||||
|
||||
// stove
|
||||
|
||||
@@ -23,12 +18,12 @@ const STOVE_EXTINGUISHER_TOOL = "shovel";
|
||||
const STOVE_BURN_DAMAGE = 1;
|
||||
const STOVE_BURN_TICKS = 10;
|
||||
|
||||
function register_stove(ctx: ServerContext) {
|
||||
export function register_stove(ctx: ServerContext) {
|
||||
const lit = (block: BlockRef) => ctx.world.get_state(block.x, block.y, block.z, "lit") === 1;
|
||||
const set_lit = (block: BlockRef, value: boolean) =>
|
||||
ctx.world.set_state(block.x, block.y, block.z, "lit", value ? 1 : 0);
|
||||
|
||||
ctx.components.register_block("farmersdelight:stove", {
|
||||
ctx.components.register_block("bworld:stove", {
|
||||
// placed lit, like the java mod. block data so it ticks, to burn whoever stands on it
|
||||
on_create(block) {
|
||||
block.data ??= {};
|
||||
@@ -72,10 +67,10 @@ const DEFAULT_COOK_TIME = 200;
|
||||
// what's under the pot that heats it, and the state that has to be 1 for it to, like minecraft's heat_sources tag
|
||||
const HEAT_SOURCES: Record<string, string | undefined> = {
|
||||
"bworld:furnace": "lit",
|
||||
"farmersdelight:stove": "lit",
|
||||
"bworld:stove": "lit",
|
||||
};
|
||||
|
||||
// a farmersdelight:cooking recipe: the ingredients in any slots. in the json each is an item id or #tag, or a list of
|
||||
// a bworld:cooking recipe: the ingredients in any slots. in the json each is an item id or #tag, or a list of
|
||||
// those any of which will do. here each is every item that will do
|
||||
interface CookingRecipe {
|
||||
ingredients: string[][];
|
||||
@@ -105,8 +100,8 @@ function item_or_tag(ctx: ServerContext, where: string, id: unknown) {
|
||||
|
||||
// checked when the server starts, so a broken recipe is a load error naming it
|
||||
function load_recipes(ctx: ServerContext): CookingRecipe[] {
|
||||
return ctx.recipes.list("farmersdelight:cooking").map((json, i) => {
|
||||
const where = `farmersdelight:cooking recipe ${i + 1} (${json.result?.id ?? "no result"})`;
|
||||
return ctx.recipes.list("bworld:cooking").map((json, i) => {
|
||||
const where = `bworld:cooking recipe ${i + 1} (${json.result?.id ?? "no result"})`;
|
||||
const item = (id: unknown) => {
|
||||
if (typeof id !== "string" || !ctx.items.exists(id)) throw new Error(`${where}: there's no item ${id}`);
|
||||
return id;
|
||||
@@ -166,7 +161,7 @@ function matches(ingredients: string[][], items: string[], used = new Set<number
|
||||
return false;
|
||||
}
|
||||
|
||||
function register_cooking_pot(ctx: ServerContext) {
|
||||
export function register_cooking_pot(ctx: ServerContext) {
|
||||
const recipes = load_recipes(ctx);
|
||||
|
||||
const pot_data = (block: BlockRef): PotData => {
|
||||
@@ -185,7 +180,7 @@ function register_cooking_pot(ctx: ServerContext) {
|
||||
|
||||
// like the java mod's CookingPotMenu, in gui pixels: the ingredients in 2 rows of 3, the meal, and the containers
|
||||
// and served meal under it. the screen is in scripts/client.ts
|
||||
const menu_type = ctx.menus.register<BlockRef>("farmersdelight:cooking_pot", (menu, block) => {
|
||||
const menu_type = ctx.menus.register<BlockRef>("bworld:cooking_pot", (menu, block) => {
|
||||
const container = ctx.containers.get(pot_data(block).container)!;
|
||||
menu.title = "Cooking Pot";
|
||||
for (let slot = 0; slot < INGREDIENT_SLOTS; slot++) {
|
||||
@@ -248,7 +243,7 @@ function register_cooking_pot(ctx: ServerContext) {
|
||||
meal.count -= count;
|
||||
};
|
||||
|
||||
ctx.components.register_block("farmersdelight:cooking_pot", {
|
||||
ctx.components.register_block("bworld:cooking_pot", {
|
||||
on_create(block) {
|
||||
pot_data(block);
|
||||
},
|
||||
@@ -302,7 +297,7 @@ function register_cooking_pot(ctx: ServerContext) {
|
||||
|
||||
// cutting board
|
||||
|
||||
// a farmersdelight:cutting recipe, like the java mod's: one ingredient (an item, or a list any of which will do), the
|
||||
// a bworld:cutting recipe, like the java mod's: one ingredient (an item, or a list any of which will do), the
|
||||
// tool type that cuts it, and everything one of it is cut into
|
||||
interface CuttingRecipe {
|
||||
ingredient: string[];
|
||||
@@ -312,8 +307,8 @@ interface CuttingRecipe {
|
||||
|
||||
// checked when the server starts, like the cooking pot's
|
||||
function load_cutting_recipes(ctx: ServerContext): CuttingRecipe[] {
|
||||
return ctx.recipes.list("farmersdelight:cutting").map((json, i) => {
|
||||
const where = `farmersdelight:cutting recipe ${i + 1} (${json.ingredients?.[0] ?? "no ingredient"})`;
|
||||
return ctx.recipes.list("bworld:cutting").map((json, i) => {
|
||||
const where = `bworld:cutting recipe ${i + 1} (${json.ingredients?.[0] ?? "no ingredient"})`;
|
||||
const item = (id: unknown) => {
|
||||
if (typeof id !== "string" || !ctx.items.exists(id)) throw new Error(`${where}: there's no item ${id}`);
|
||||
return id;
|
||||
@@ -341,13 +336,13 @@ function load_cutting_recipes(ctx: ServerContext): CuttingRecipe[] {
|
||||
|
||||
// like the java mod's CuttingBoardBlock and CuttingBoardBlockEntity. what's on the board is the item it shows
|
||||
// (set_block_item), so the client draws it, like its CuttingBoardRenderer
|
||||
function register_cutting_board(ctx: ServerContext) {
|
||||
export function register_cutting_board(ctx: ServerContext) {
|
||||
const recipes = load_cutting_recipes(ctx);
|
||||
const on_board = (block: BlockRef) => ctx.world.get_block_item(block.x, block.y, block.z);
|
||||
const set_on_board = (block: BlockRef, item: ItemStack | undefined) =>
|
||||
ctx.world.set_block_item(block.x, block.y, block.z, item);
|
||||
|
||||
ctx.components.register_block("farmersdelight:cutting_board", {
|
||||
ctx.components.register_block("bworld:cutting_board", {
|
||||
on_interact(block, _params, player) {
|
||||
const held = player.inventory.get(player.selected_slot);
|
||||
const item = on_board(block);
|
||||
@@ -11,6 +11,7 @@ import { register_verdigris } from "./verdigris/server.ts";
|
||||
import { type JuiceableParams, JUICER_CAPACITY, JUICER_PRESSES } from "./shared.ts";
|
||||
import { juicing_for, juicing_recipes } from "./juicing.ts";
|
||||
import { fermentable_recipes } from "./fermenting.ts";
|
||||
import { register_cooking_pot, register_cutting_board, register_stove } from "./cooking.ts";
|
||||
|
||||
export function setup(ctx: ServerContext) {
|
||||
register_hoeable(ctx);
|
||||
@@ -33,6 +34,9 @@ export function setup(ctx: ServerContext) {
|
||||
register_effects(ctx);
|
||||
register_growable_block(ctx);
|
||||
register_verdigris(ctx);
|
||||
register_stove(ctx);
|
||||
register_cooking_pot(ctx);
|
||||
register_cutting_board(ctx);
|
||||
}
|
||||
|
||||
// right clicking with a type of tool turns the block into another, like any hoe on grass
|
||||
@@ -279,7 +283,7 @@ function register_furnace(ctx: ServerContext) {
|
||||
}
|
||||
}
|
||||
|
||||
// burning, so it heats what's on top, like farmer's delight's cooking pot
|
||||
// burning, so it heats what's on top, like the cooking pot
|
||||
const lit = data.fuel > 0 ? 1 : 0;
|
||||
if (ctx.world.get_state(block.x, block.y, block.z, "lit") !== lit) {
|
||||
ctx.world.set_state(block.x, block.y, block.z, "lit", lit);
|
||||
|
||||
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 342 B |
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 157 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 297 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 399 B |
|
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
|
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
|
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
|
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 497 B |
|
Before Width: | Height: | Size: 302 B After Width: | Height: | Size: 302 B |
|
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 350 B |
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |