Crabpot model and gui
This commit is contained in:
@@ -2182,3 +2182,33 @@ Credits Ajay Karat | Devil's Work.shop http://devilswork.shop/
|
||||
https://devilsworkshop.itch.io/pixel-art-chess-asset-pack
|
||||
|
||||
license: CC0 1.0 Universal (CC0 1.0)
|
||||
|
||||
# Fishermens-Trap
|
||||
|
||||
https://github.com/Uraneptus/Fishermens-Trap
|
||||
|
||||
license:
|
||||
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Uraneptus
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"block": {
|
||||
"id": "bworld:crabpot",
|
||||
"name": "Crab Pot",
|
||||
"textures": {
|
||||
"front": "bworld:crabpot_front",
|
||||
"side": "bworld:crabpot_side",
|
||||
"top": "bworld:crabpot_top",
|
||||
"bottom": "bworld:crabpot_bottom"
|
||||
},
|
||||
"model": "bworld:crabpot",
|
||||
"item_model": "bworld:crabpot",
|
||||
"render_layer": "cutout",
|
||||
"states": [
|
||||
{
|
||||
"name": "facing",
|
||||
"bits": 2,
|
||||
"default": 0
|
||||
}
|
||||
],
|
||||
"variants": {
|
||||
"facing=1": { "y": 90 },
|
||||
"facing=2": { "y": 180 },
|
||||
"facing=3": { "y": 270 }
|
||||
},
|
||||
"mining": {
|
||||
"toughness": 3,
|
||||
"tool": "axe"
|
||||
},
|
||||
"drops": "bworld:crabpot",
|
||||
"waterloggable": "bworld:water",
|
||||
"interactive": true,
|
||||
"components": {
|
||||
"bworld:crabpot": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"model": {
|
||||
"id": "bworld:crabpot",
|
||||
"elements": [
|
||||
{
|
||||
"from": [0, 0, 3],
|
||||
"to": [16, 10, 13],
|
||||
"faces": {
|
||||
"bottom": { "texture": "#bottom", "uv": [16, 3, 0, 13] },
|
||||
"top": { "texture": "#top", "uv": [16, 13, 0, 3] },
|
||||
"north": { "texture": "#front", "uv": [0, 3, 16, 13] },
|
||||
"south": { "texture": "#front", "uv": [0, 3, 16, 13] },
|
||||
"west": { "texture": "#side", "uv": [3, 3, 13, 13] },
|
||||
"east": { "texture": "#side", "uv": [3, 3, 13, 13] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ const HEIGHT = 166;
|
||||
export function setup(ctx: ClientContext) {
|
||||
ctx.ui.register_menu_screen("bworld:storage", chest_screen);
|
||||
ctx.ui.register_menu_screen("bworld:furnace", furnace_screen);
|
||||
ctx.ui.register_menu_screen("bworld:crabpot", (menu) => container_screen(menu, HEIGHT));
|
||||
ctx.ui.register_menu_screen("bworld:smithing_table", smithing_screen);
|
||||
ctx.ui.register_menu_screen("bworld:fishing_minigame", fishing_minigame_screen);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ export function setup(ctx: ServerContext) {
|
||||
const storage_menu = register_storage(ctx);
|
||||
register_shipping_bin(ctx, storage_menu);
|
||||
register_furnace(ctx);
|
||||
register_crabpot(ctx);
|
||||
register_smithing_table(ctx);
|
||||
register_farming(ctx);
|
||||
register_fishing(ctx);
|
||||
@@ -261,6 +262,34 @@ const MATERIAL = 1;
|
||||
const ADDITION = 2;
|
||||
const RESULT = 3;
|
||||
|
||||
// the crab pot's menu: its bait slot at the top, and a row of 9 slots under it for what it catches, which players can
|
||||
// only take from. it doesn't catch anything yet
|
||||
const CRABPOT_BAIT = 0;
|
||||
const CRABPOT_OUTPUT = 9;
|
||||
|
||||
function register_crabpot(ctx: ServerContext) {
|
||||
const menu_type = ctx.menus.register<BlockRef>("bworld:crabpot", (menu, block) => {
|
||||
const container = block_container(ctx, block, 1 + CRABPOT_OUTPUT);
|
||||
menu.title = "Crab Pot";
|
||||
menu.add_slot(container, CRABPOT_BAIT, { x: 79, y: 17, icon: "bworld:empty_slot_bait" });
|
||||
for (let i = 0; i < CRABPOT_OUTPUT; i++) {
|
||||
menu.add_slot(container, 1 + i, { x: 7 + i * 18, y: 45, output_only: true });
|
||||
}
|
||||
menu.add_player_inventory(7, INVENTORY_Y);
|
||||
menu.still_valid_near(block);
|
||||
});
|
||||
|
||||
ctx.components.register_block("bworld:crabpot", {
|
||||
on_interact(block, _params, player) {
|
||||
menu_type.open(player, block);
|
||||
return true;
|
||||
},
|
||||
on_break(block) {
|
||||
drop_contents(ctx, block);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function register_smithing_table(ctx: ServerContext) {
|
||||
const menu_type = ctx.menus.register<BlockRef>("bworld:smithing_table", (menu, block, player) => {
|
||||
const container = ctx.containers.create(4);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 374 B |
Binary file not shown.
|
After Width: | Height: | Size: 435 B |
Binary file not shown.
|
After Width: | Height: | Size: 425 B |
Binary file not shown.
|
After Width: | Height: | Size: 399 B |
Binary file not shown.
|
After Width: | Height: | Size: 182 B |
Reference in New Issue
Block a user