Documentation
CreateToolboxScreen
Create toolbox screen (1.21.1 original atlas): 8-color dye bar, ring-arranged compartment slots and player inventory.
工具箱
import { useState } from "react";
import { CREATE_DEMO_INGOT, CREATE_DEMO_PLAYER, CREATE_DEMO_WHEAT } from "../create-demo-data";
import { CreateToolboxScreen } from "./index";
/**
* CreateToolboxScreen 预览用例:橙色配色 + 2 个物品。
*/
export function CreateToolboxScreenDemo() {
const [selectedColor, setSelectedColor] = useState<string | undefined>("#f9801d");
return (
<CreateToolboxScreen
items={[CREATE_DEMO_INGOT, CREATE_DEMO_WHEAT]}
onColorChange={color => setSelectedColor(color)}
player={CREATE_DEMO_PLAYER}
selectedColor={selectedColor}
/>
);
}
Install
$pnpm add @tennantite/createnpm installs the compiled package; use the CLI copy above to adapt the source.
Source
packages/create/src/create-toolbox-screen/index.tsxThe npm package keeps the source tree, so you can copy and adapt it directly.