Skip to content

Minecraft: Java Edition 26.3 rewritten from scratch in Rust, checked against vanilla with 281 differential harnesses. Get it with the Horizon launcher.

28.5 KB
Raw Blame
// @generated by cargo run -p xtask -- mod-api; do not edit.
use super::*;
use std::path::PathBuf;
use std::sync::Arc;
/// Services supplied by the game to trait mods.
pub trait Host {
    /// Draws a quad with `corners` in blocks under `draw`'s pose, in a model
    /// face's order (top left, bottom left, bottom right, top right as seen
    /// from its front), textured with the `uv` rectangle (u0, v0, u1, v1 in
    /// texels of 16 per side) of `sprite` (`mymod:entity/screen`,
    /// `mymod:block/casing`, `block/stone`) times the 0xRRGGBB `tint`
    /// (0xFFFFFF for none). False for an unknown sprite. API 71.
    fn draw_quad(
        &self,
        draw: &mut BlockEntityDraw,
        sprite: &str,
        corners: [[f32; 3]; 4],
        uv: [f32; 4],
        tint: u32,
    ) -> bool;
    /// Draws a box from `from` to `to` (texels of 16 per block, as a block
    /// model's element) under `draw`'s pose, with the faces given, by
    /// `Direction` (down, up, north, south, west, east), baked as a model
    /// element's are (`FaceBakery`), times the 0xRRGGBB `tint`. A turned box
    /// is drawn under a turned pose (`BlockEntityDraw::rotate_about`). False
    /// when a face's sprite is unknown; that face is left out. API 71.
    fn draw_cube(
        &self,
        draw: &mut BlockEntityDraw,
        from: [f32; 3],
        to: [f32; 3],
        faces: [Option<CubeFace<'_>>; 6],
        tint: u32,
    ) -> bool;
    /// Draws block `block`'s model (`mymod:cog`, any block with a model) in
    /// the state with `properties` (`[("axis", "x")]`, the rest default)
    /// under `draw`'s pose, as vanilla's `submitBlockModel` draws a block in
    /// an entity's place: a block's baked model, with its default tints. A
    /// moving part that is no block is a standalone model
    /// (`native_draw_model`). False for an unknown block or property. API 71.
    fn draw_block(
        &self,
        draw: &mut BlockEntityDraw,
        block: &str,
        properties: &[(&str, &str)],
    ) -> bool;
    /// Draws `stack` under `draw`'s pose as an item is drawn in the world
    /// (`ItemModelResolver.updateForTopItem` and `ItemStackRenderState.submit`), centred on the
    /// pose's origin, in its model's `display` transform: `Fixed` as a
    /// campfire's or an item frame's, `Ground` as a dropped item's. `seed`
    /// picks among random models (a campfire passes its slot plus its
    /// position's hash). `owner_yaw` makes the block entity the item's
    /// owner (`ItemOwner`), at the block's centre and turned that many
    /// degrees (`getVisualRotationYInDegrees`), as a shelf is: a compass on
    /// it points to its target from there. None draws it with no owner, as
    /// a campfire does. False for an empty stack or one with no model. The
    /// client's copy of a block entity has no item slots (`entity.items` is
    /// empty there): send the stacks you draw in
    /// `native_block_entity_update_tag` and read them from `entity.nbt`.
    /// API 91.
    fn draw_item(
        &self,
        draw: &mut BlockEntityDraw,
        stack: &ItemStack,
        display: DisplayContext,
        owner_yaw: Option<f32>,
        seed: i32,
    ) -> bool;
    /// Access a server-owned holder's attachment map.
    fn attachments(&mut self, holder: Holder) -> AttachmentResult<&mut Attachments>;
    /// Moves mob `id` to `pos` at once, as `/tp` does: it dismounts, drops its
    /// path and resets its fall. False for no such mob, another dimension or a
    /// position outside `/summon`'s bounds. API 37.
    fn teleport_mob(&mut self, dimension: &str, id: u32, pos: [f64; 3]) -> bool;
    /// Adds `velocity` to mob `id`'s: false for no such mob, another dimension
    /// or a velocity that isn't finite. API 37.
    fn push_mob(&mut self, dimension: &str, id: u32, velocity: [f64; 3]) -> bool;
    /// Sets the living mob `id`'s health, cut to its maximum: false for no such
    /// mob, another dimension or a health that isn't above 0 (`native_kill_mob`
    /// kills). API 37.
    fn set_mob_health(&mut self, dimension: &str, id: u32, health: f32) -> bool;
    /// Kills mob `id` as `/kill` does: it falls and drops its loot. False for
    /// no such living mob or another dimension. API 37.
    fn kill_mob(&mut self, dimension: &str, id: u32) -> bool;
    /// Takes mob `id` out of the world with no death and no loot: false for no
    /// such mob or another dimension. API 37.
    fn remove_mob(&mut self, dimension: &str, id: u32) -> bool;
    /// Spawns an entity of `kind` (`minecraft:item_display`) at `pos` in the
    /// level in place, `dimension`, from `nbt` (its compound, as `/summon
    /// <kind> <pos> <nbt>` takes it; passengers included): its id. None on a
    /// client's copy of the world, for another dimension, a position outside
    /// `/summon`'s bounds, a chunk that isn't loaded, a kind Horizon can't
    /// load, or one a mod kept out (`native_entity_join_level`). API
    /// 59.
    fn summon(&mut self, dimension: &str, kind: &str, pos: [f64; 3], nbt: Compound) -> Option<u32>;
    /// Moves entity `id`, one Horizon keeps without simulating (a display, a
    /// marker, an interaction), to `pos` facing `yaw` and `pitch` in degrees;
    /// a display eases there over its `teleport` ticks. False for no such
    /// entity, another dimension or a position outside `/summon`'s bounds.
    /// Mobs move with `native_teleport_mob`. API 59.
    fn move_entity(
        &mut self,
        dimension: &str,
        id: u32,
        pos: [f64; 3],
        yaw: f32,
        pitch: f32,
    ) -> bool;
    /// Removes entity `id`, one Horizon keeps without simulating, as `/kill`
    /// does (it drops nothing and isn't saved). False for no such entity or
    /// another dimension. Mobs go with `native_remove_mob`. API
    /// 59.
    fn remove_entity(&mut self, dimension: &str, id: u32) -> bool;
    /// The players on this server, in the order they joined. Empty on a
    /// client and in a world nobody else can join.
    fn server_players(&self) -> Vec<NativeServerPlayer>;
    /// A system line in that player's chat, also inside a player's hook for
    /// the acting player; false when they aren't on.
    fn tell(&mut self, uuid: u128, line: Text) -> bool;
    /// A line over that player's hotbar (the action bar), also inside a
    /// player's hook for the acting player; false when they aren't on. API 21.
    fn action_bar(&mut self, uuid: u128, line: Text) -> bool;
    /// The lines over and under that player's list of players (Tab):
    /// `ClientboundTabListPacket`, an empty text for none. False when they
    /// aren't on. API 49.
    fn tab_list(&mut self, uuid: u128, header: &Text, footer: &Text) -> bool;
    /// The server's tick rate (20 unless `/tick rate` changed it) and the
    /// milliseconds its ticks took on average lately, as `/tick query`
    /// reports them. The ticks a second it keeps up is the rate, or
    /// 1000 / milliseconds when that is lower. API 49.
    fn tick_stats(&self) -> (f32, f64);
    /// Whether that player counts for `players_sleeping_percentage`: an
    /// ignored player who isn't in bed is left out of the players the night
    /// needs asleep, as a spectator is (an away-from-keyboard mod). Kept
    /// until a mod sets it back or the server stops, also if they leave and
    /// come back. Only where no player's state is swapped in, as
    /// `native_run_command`; false there and when they aren't on. API 49.
    fn sleep_ignored(&mut self, uuid: u128, ignored: bool) -> bool;
    /// Shows `nickname` in place of that player's name in chat (their
    /// messages, `/me`, `/msg`) and in the Tab list; None shows their name
    /// again. Hovering the shown name gives the real one, which stays in the
    /// log, commands, selectors and the server's events. Kept until a mod
    /// sets it again or the server stops (also if they leave and come back).
    /// Plain text: the mod checks it (`native_text_allowed`, its length,
    /// other players' names). Only where no player's state is swapped in,
    /// as `native_run_command`; false there and when they aren't on. API
    /// 62.
    fn set_nickname(&mut self, uuid: u128, nickname: Option<&str>) -> bool;
    /// Whether the server's chat filter (`server.toml` `[chat_filter]`)
    /// lets `text` through: true without a filter, None inside a player's
    /// hook (where the server is out of reach). API 62.
    fn text_allowed(&self, text: &str) -> Option<bool>;
    /// A system line in every player's chat and the server's log.
    fn broadcast(&self, line: Text);
    /// A line of the command's answer, inside `native_perform_command`:
    /// sent to the player whose command it is after the call, as vanilla
    /// commands' feedback is.
    fn feedback(&mut self, line: Text);
    /// The player whose action or command a hook hears, as their state is
    /// swapped in (`native_perform_command`, `native_right_click_block`,
    /// `native_use_item_on`, `native_destroy_block`...): None outside such a
    /// hook. API 21.
    fn acting_player(&self) -> Option<NativeServerPlayer>;
    /// Runs `line` (no slash) as the server's console does: permission
    /// level 4, from the overworld's spawn, with no output. A teleport to
    /// another level (`execute in minecraft:the_nether run tp Alex 0 70 0`)
    /// happens at the next tick's start, as the console's. Whether it ran
    /// without failing. Only where no player's state is swapped in
    /// (`native_tick`, `native_menu_clicked`): false inside a player's hook,
    /// where the other players are out of reach. API 21.
    fn run_command(&mut self, line: &str) -> bool;
    /// The open world's folder (`world/`, beside its `level.dat`): a server
    /// mod keeps its data in a folder of its own there, so the world's
    /// backups carry it. None when no world is open.
    fn world_dir(&self) -> Option<PathBuf>;
    /// The main hand's stack: its item, count, and whether it is plain. On a
    /// client, the player's own.
    fn held(&self) -> Option<(String, u32, bool)>;
    /// How many of plain `item` (`minecraft:diamond`) the player carries.
    fn count_items(&mut self, item: &str) -> u32;
    /// Every plain item the player carries, with how many, by id.
    fn carried_items(&self) -> Vec<(String, u32)>;
    /// Takes up to `count` plain `item`, the main hand first; what it took.
    fn take_items(&mut self, item: &str, count: u32) -> u32;
    /// How many plain `item` still fit; 0 for an unknown item.
    fn room_for(&mut self, item: &str) -> u32;
    /// Gives up to `count` plain `item` where they fit, as `Inventory.add`
    /// places them; what it gave (nothing is dropped). 0 for an unknown item.
    fn give_items(&mut self, item: &str, count: u32) -> u32;
    /// Gives `stack` whole (its damage, name, enchantments... kept) to the
    /// player `uuid`, as `Inventory.add` places it: onto equal stacks first,
    /// then into empty inventory slots, never the armour or an empty off
    /// hand. What did not fit comes back (nothing is dropped): all of it for
    /// a player who isn't here, is dead, or whose state is swapped out by
    /// another player's (inside that player's hook, only they are reached).
    /// The player's screen follows as for any change to their inventory.
    /// What an auto-pickup or a machine's output to a player needs, from any
    /// server hook. API 98.
    fn give_stack(&mut self, uuid: u128, stack: ItemStack) -> Option<ItemStack>;
    /// Gives `points` of experience to the player `uuid` as an orb they touch
    /// does (`ExperienceOrb.playerTouch`): Mending repairs their damaged items
    /// with it first (`repairPlayerItems`), then the rest goes to their
    /// experience (`Player.giveExperiencePoints`), with the level-up sound
    /// every fifth level. No orb pickup sound. False, and nothing given, for
    /// a player who isn't here or is dead, and for another player than the one
    /// whose state is swapped in (inside that player's hook, only they are
    /// reached), and while the server's player list is busy elsewhere in the
    /// tick: give first, and cancel an orb only when this returned true.
    /// Their bar follows as for any change to their experience.
    fn give_experience(&mut self, uuid: u128, points: u32) -> bool;
    /// Adds `levels` to the player `uuid`'s level, or takes them off when
    /// negative (`Player.giveExperienceLevels`): what the anvil and the
    /// enchanting table charge with, and a mod can charge or reward with.
    /// Below level 0 the level and the points are 0. The progress toward the
    /// next level is kept. False, and nothing changed, as for
    /// `native_give_experience`.
    fn give_levels(&mut self, uuid: u128, levels: i32) -> bool;
    /// Read a loaded, light-emitting block. No implicit chunk loading.
    fn lit_block_name(&self, pos: [i32; 3]) -> Option<&str>;
    /// A small local vanilla particle; caller should rate-limit emission.
    fn flame_particle(&mut self, at: [f64; 3], soul: bool);
    /// The stack the acting player carries in `slot`, by
    /// `native_inventory_tick`'s numbers: none for an empty slot or another
    /// number. Change it as you like: a count of 0 empties the slot at the end
    /// of `native_inventory_tick`, and the player's client gets the change.
    /// API 39.
    fn carried_stack(&mut self, slot: i32) -> Option<&mut ItemStack>;
    /// Sets a block in the current authoritative level through `Level.setBlock`.
    /// Returns false for another dimension, an invalid state, or no change.
    /// `flags` selects vanilla's neighbour and shape updates; Horizon sends
    /// every write to players whatever the flags. A block entity block gets
    /// its block entity. API 24.
    fn set_block(
        &mut self,
        dimension: &str,
        pos: [i32; 3],
        state: BlockStateId,
        flags: i32,
    ) -> bool;
    /// Sets the stack of item entity `id` in the server level `dimension`, as
    /// a hopper's `addItem` leaves what it couldn't take (`ItemEntity.setItem`);
    /// an empty stack (count 0) removes the entity (`setItem(EMPTY)`, then
    /// `discard`). Players see it on their next tracker update. False when the
    /// level in place has no such item entity, or on a client. API 42.
    fn set_item_entity(&mut self, dimension: &str, id: u32, stack: ItemStack) -> bool;
    /// The block at `pos` changed its comparator output
    /// (`native_analog_output`) without changing its state: the comparators
    /// beside it, or behind a conductor there, read it again
    /// (`Level.updateNeighbourForOutputSignal`). Acts on the level in place:
    /// false (and nothing happens) when `dimension` is another, or this
    /// window isn't a server. API 64.
    fn update_output_neighbors(&mut self, dimension: &str, pos: [i32; 3]) -> bool;
    /// The block at `pos` changed the signal it gives: its neighbours, and
    /// theirs (a block it powers passes the signal on), read it again, as
    /// around a lever (`Level.updateNeighborsAt`). Call it when the answer
    /// changes and once the block is placed. Acts on the level in place:
    /// false (and nothing happens) when `dimension` is another, or this
    /// window isn't a server. API 38.
    fn update_signal_neighbors(&mut self, dimension: &str, pos: [i32; 3]) -> bool;
    /// Sends clients the block at `pos` and its block entity's update tag
    /// (`native_block_entity_update_tag`) again, as `Level.sendBlockUpdated`
    /// does: with the level's other block changes, to the players who see its
    /// chunk, once however often it is called before then. Changes made in a
    /// block entity's tick go out at the start of the next tick, as vanilla's
    /// do (`ServerLevel.tick` broadcasts chunks before it ticks block
    /// entities). Call it when what clients show changed (a machine started),
    /// not for every tick's progress: a menu's data slots carry that. Nothing
    /// happens for an unloaded block. API 52.
    fn block_entity_sync(&mut self, pos: [i32; 3]);
    /// Plays sound event `sound` (`minecraft:entity.generic.explode`, or a
    /// mod's own from its `assets/<id>/sounds.json`) at `at` for this
    /// player only, `delay` ticks from now (0 to 1200, a minute): a client
    /// mod's sound that waits, as thunder heard after the flash or a blast
    /// heard when its shock wave arrives. `volume` past 1 carries farther,
    /// as vanilla's attenuation does (16 blocks times the volume). False, with
    /// nothing played, on a server or for a value out of range; an event the
    /// resources don't have plays nothing, as vanilla's. API
    /// 83.
    fn play_local_sound(
        &mut self,
        sound: &str,
        at: [f64; 3],
        volume: f32,
        pitch: f32,
        delay: i32,
    ) -> bool;
    /// A rectangle in GUI pixels, `argb` (0x78000000 is the extras' box).
    fn fill(&self, batch: &mut HudBatch, rect: [f32; 4], argb: u32);
    /// Part `src` (`[x, y, w, h]` in the sprite's own pixels) of sprite
    /// `name` (vanilla's `gui/...`, or a content mod's GUI texture
    /// `mymod:gui/...`), drawn stretched into `dst` (`[x, y, w, h]` in GUI
    /// pixels). False when there is no such sprite. API 19.
    fn sprite(&self, batch: &mut HudBatch, name: &str, src: [f32; 4], dst: [f32; 4]) -> bool;
    /// Item `item`'s icon (`mymod:machine`) with its top left at `at`,
    /// `size` GUI pixels square (16 in a slot); false for an unknown item.
    /// API 20.
    fn item(&self, batch: &mut HudBatch, item: &str, at: [f32; 2], size: f32) -> bool;
    /// The open menu's title (the block's name, or the one it was given),
    /// as plain text. API 20.
    fn screen_title(&self) -> Option<String>;
    /// A data file of the game's resources, content mods' included
    /// (`data/mymod/machines.json`), when there is one: what a mod's content
    /// says, read at runtime. Only relative paths of plain names. API 20.
    fn data(&self, path: &str) -> Option<Vec<u8>>;
    /// The block at `pos` (`mymod:cable`; air where nothing is loaded).
    /// API 20.
    fn block(&self, pos: [i32; 3]) -> String;
    /// Property `key` of the block at `pos` (a machine's `facing`), if it
    /// has one. API 20.
    fn block_property(&self, pos: [i32; 3], key: &str) -> Option<String>;
    /// Puts `stack` into the container at `pos` (a chest, a furnace, a mod
    /// container) through its side `face`, as a hopper would, one by one, and
    /// returns what did not fit: a machine's auto-output. A composter takes
    /// one a call, and a client's copy of the world none. API 20.
    fn insert_item(
        &mut self,
        pos: [i32; 3],
        face: Direction,
        stack: ItemStack,
    ) -> Option<ItemStack>;
    /// Where the mouse is, in GUI pixels. API 20.
    fn cursor(&self) -> [f32; 2];
    /// A line of text at `(x, y)` in GUI pixels, opaque `rgb`.
    fn text(&self, batch: &mut HudBatch, text: &str, at: [f32; 2], rgb: u32, shadow: bool);
    /// The folder mod `mod_id`'s post-build step wrote into when the launcher built the game
    /// (`native-data/<id>/` in the build's version folder); None when the game's own path is
    /// unknown. API 41.
    fn built_data(&self, mod_id: &str) -> Option<PathBuf>;
    /// Shows the panel beside container screens with these items (at most
    /// 8192), as the game's own slots in pages, with a search box; the
    /// player's clicks, searches and keys over items come back as
    /// `native_panel_event`. The panel is the last mod's to show one; empty
    /// items and no recipe page take yours away.
    fn panel_items(&mut self, mod_id: &str, items: Vec<NativeStack>);
    /// The recipes of type `kind` (`mymod:crusher`), a type outside `minecraft`,
    /// from `data/<namespace>/recipe/*.json` of the content mods (`.hmod`) and
    /// the world's data packs, in file order: each one's id and its file as
    /// JSON, for the mod to read as it likes. A data pack changes them on
    /// `/reload`, so look them up again when you need them. Empty for a type
    /// nobody uses and outside a world. These are the server's table on the
    /// server thread, a dedicated server or a LAN host; a client, the
    /// single-player window included, sees only the content mods' recipes, not
    /// the world's data packs', unless a mod had the server send it the type
    /// (`native_datapack_sync`). API 36.
    fn recipes_of_type(&self, kind: &str) -> &[CustomRecipe];
    /// An ingredient as a recipe's JSON names it: an item, a `#tag`, or a list
    /// of them, a bare id as `minecraft:` (as vanilla reads it); `test` says
    /// whether a stack fits. Items the game doesn't know are left out; None
    /// when nothing is left (an unknown or empty tag, for one) and outside a
    /// world. API 36.
    fn recipe_ingredient(&self, json: &serde_json::Value) -> Option<Ingredient>;
    /// A stack as a recipe's `result` names it: `id` (a bare one as
    /// `minecraft:`), `count` (1 by default, up to 99) and `components`. None
    /// without an `id`, for an item the game doesn't know or a count outside
    /// that, and outside a world. API 36.
    fn recipe_result(&self, json: &serde_json::Value) -> Option<ItemStack>;
    /// The `book_id`s of the recipes the player's recipe book holds now
    /// (the server's book on a server); empty outside a world.
    fn known_recipes(&mut self) -> Arc<[i32]>;
    /// Places a recipe in the open screen's grid as a click in the recipe
    /// book does (`ServerboundPlaceRecipePacket`): the inventory's grid or a
    /// crafting table's. `all` places as many as the items allow, as with
    /// Shift. Refused while no such screen is open and for a recipe the
    /// player's book doesn't hold; one missing items shows as a ghost.
    fn place_recipe(&mut self, book_id: i32, all: bool) -> Result<(), String>;
    /// Creative mode only: gives the player `count` of `item`
    /// (`minecraft:diamond`) as taking it from the creative inventory does
    /// (`ServerboundSetCreativeModeSlot`): the selected slot first, then the
    /// hotbar, then the inventory. The count is cut to one stack.
    fn give(&mut self, item: &str, count: u32) -> Result<(), String>;
    /// For a client mod: a push added to the local player's velocity, in blocks a tick, as an
    /// explosion's knockback is (the window's player moves itself, as vanilla's client does). Each component is
    /// clamped to -4..4; a spectator, or a value that is not a number, is left alone. API 105.
    fn push_player(&mut self, kick: [f32; 3]);
    /// For a server mod: `player`'s creative flying speed (vanilla's 0.05 when none, at most `FLYING_MAX`), kept on
    /// the server's player and sent to their client. A respawn or a game mode change keeps it, and it is saved
    /// with the player (`abilities.flySpeed`, as vanilla saves it). False for a player not here or a client of a
    /// server, and inside a player's hook, where the server's player list is busy: call it from a tick hook.
    /// API 105.
    fn set_flying_speed(&mut self, player: u128, speed: Option<f32>) -> bool;
    /// Sends `data` on `channel` (`mod_id:name`, at most 30 000 bytes, at
    /// most 32 a player a tick) to `player`'s client, at the tick's end, from
    /// any server hook. Ok means accepted: a player who left or isn't on a
    /// Horizon client doesn't get it. API 40.
    fn net_send_to_player(
        &mut self,
        player: u128,
        channel: &str,
        data: &[u8],
    ) -> Result<(), String>;
    /// The client half: sends `data` on `channel` to the server (the same
    /// caps, 32 a tick). An error when the server doesn't carry mod messages
    /// (a vanilla server), and until the player has joined: a server says it
    /// carries them during configuration, before it can take one. API 40.
    fn net_send_to_server(&mut self, channel: &str, data: &[u8]) -> Result<(), String>;
    /// Drop one item as DefaultDispenseItemBehavior does. For a dispenser hook:
    /// return this remainder in its answer with `CLICK`; the caller plays the
    /// answer's event and smoke once. A client, another dimension or an unloaded
    /// chunk keeps the input stack unchanged. API 67.
    fn dispense_default(
        &mut self,
        dimension: &str,
        pos: [i32; 3],
        facing: Direction,
        stack: ItemStack,
    ) -> Option<ItemStack>;
    /// Opens a chest menu of `rows` rows (1 to 6) titled `title` for the
    /// player, showing `items` (by slot, padded with empty ones), in place of
    /// the menu they had open: its window id.
    fn open_menu(
        &mut self,
        uuid: u128,
        rows: u8,
        title: Text,
        items: Vec<Option<ItemStack>>,
    ) -> Option<i32>;
    /// Replaces what the player's open native menu shows; sent with the
    /// tick's container sync.
    fn set_menu_items(&mut self, uuid: u128, items: Vec<Option<ItemStack>>);
    /// Closes the player's native menu (a `native_menu_closed` follows).
    fn close_menu(&mut self, uuid: u128);
    /// The player's 36 inventory slots (0..9 the hotbar), to show or offer
    /// them; None for a player not here, dead, or whose state is swapped in.
    fn player_stacks(&self, uuid: u128) -> Option<Vec<Option<ItemStack>>>;
    /// Swaps two players' offers (inventory slots, each with the stack it
    /// must still hold, exactly) in one step: the stacks leave their slots
    /// and go to the other player where they fit whole, or nothing moves and
    /// the Err says why. Both must be here and alive, neither with their
    /// state swapped in. Their screens follow with the tick's sync.
    fn exchange_items(
        &mut self,
        a: u128,
        a_offer: &[(usize, ItemStack)],
        b: u128,
        b_offer: &[(usize, ItemStack)],
    ) -> Result<(), String>;
    /// `native_fluid_insert`: up to `amount` millibuckets of `fluid`
    /// (`minecraft:water`, `minecraft:lava`) into the block at `pos`, through
    /// its side `face`, in the level in place: a mod block's tanks first
    /// those with the same fluid, then empty ones, by the sides and tanks its
    /// table gave; a cauldron by thirds of a bucket, a lava one only whole.
    /// What did not fit. API 54.
    fn fluid_insert(&mut self, pos: [i32; 3], face: Direction, fluid: &str, amount: i32) -> i32;
    /// Takes up to `amount` millibuckets out of the block at `pos` in the
    /// level in place, `dimension`, through its side `face`: a mod block's
    /// drainable tanks, one fluid only (the first that's there), or a
    /// cauldron, which drains in thirds of a bucket and a lava one only
    /// whole. The fluid and how much; none when the side reaches nothing.
    /// API 54.
    fn fluid_extract(
        &mut self,
        dimension: &str,
        pos: [i32; 3],
        face: Direction,
        amount: i32,
    ) -> Option<(String, i32)>;
    /// Moves up to `max` millibuckets from the block at `from`, through its
    /// side `from_face`, into the one at `to`, through its side `to_face`, as
    /// `native_move_items` moves items: what the target won't take goes back
    /// into the source, so none is lost — a cauldron's whole thirds included.
    /// The fluid and how much moved; none where `native_fluid_tanks` is none
    /// at `from`, where nothing drainable is, where no block holds fluids at
    /// `to` or it has no room for that fluid, and within one block. The
    /// source is asked for no more than the target's room. API 55.
    fn move_fluids(
        &mut self,
        dimension: &str,
        from: [i32; 3],
        from_face: Direction,
        to: [i32; 3],
        to_face: Direction,
        max: i32,
    ) -> Option<(String, i32)>;
    /// The level in place (`minecraft:overworld`), for a hook that isn't told
    /// which it runs in. API 48.
    fn dimension(&self) -> &'static str;
    /// Takes up to `count` items out of slot `slot` of the container at `pos`,
    /// through its side `face`; they're the mod's to place then, as a hopper's
    /// are: to hand them on without losing any, use `native_move_items`. None
    /// when nothing can be taken: see `native_container_slots`. API 48.
    fn extract_item(
        &mut self,
        dimension: &str,
        pos: [i32; 3],
        face: Direction,
        slot: usize,
        count: u32,
    ) -> Option<ItemStack>;
    /// Moves up to `max` items from the container at `from`, through its side
    /// `from_face`, into the one at `to`, through its side `to_face`, one by
    /// one as a hopper does: an item the target refuses stays in its slot, so
    /// none is lost. `item` (`minecraft:coal`) takes only that item. How many
    /// moved: 0 where `native_container_slots` is none at `from`, where no
    /// container is at `to`, and within one container. A composter takes one
    /// a call. API 48.
    fn move_items(
        &mut self,
        dimension: &str,
        from: [i32; 3],
        from_face: Direction,
        to: [i32; 3],
        to_face: Direction,
        item: Option<&str>,
        max: u32,
    ) -> u32;
}