Let the mod API name ItemEnergyBuffer

Since #6253 the hook's types appear in the generated mod_api code, which
only sees what mod_api re-exports: the buffer is now public (a mod builds
it) and re-exported there, and xtask's test stubs it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Ludovic MarieandClaude Opus 5.5 committed 2026-11-02 08:56:13 +01:00
1 parent 9c9cb89f98
commit 5aceab866a
4 files changed
+11 -8

No files matched your search

+1
View File
@@ -396,6 +396,7 @@ pub use native_claimed_items::{NativeHeldItem, NativeHit, NativeModEvent};
pub use native_data_maps::NativeDataMapType;
pub use native_falling::NativeFalling;
pub use native_hooks::{NativeClock, NativeShake};
pub use native_item_energy::ItemEnergyBuffer;
pub use native_mob_draw::{NativeMobRender, NativePlayerRender};
pub use native_server::NativeExperienceOrb;
pub use native_world_columns::NativeColumnBlocks;
@@ -15,12 +15,12 @@ use horizon_world::nbt::{Compound, JavaString, Tag};
/// NeoForge's `SimpleEnergyHandler` is built: its capacity and the most one
/// insert and one extract move.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub(crate) struct ItemEnergyBuffer {
pub(crate) capacity: i32,
pub struct ItemEnergyBuffer {
pub capacity: i32,
/// The most one insert moves; 0 takes none.
pub(crate) max_insert: i32,
pub max_insert: i32,
/// The most one extract moves; 0 gives none.
pub(crate) max_extract: i32,
pub max_extract: i32,
}
/// What one item of a stack holds (`native_item_energy`).
+4 -4
View File
@@ -16,10 +16,10 @@ pub use crate::first_person::Hand;
pub use crate::fog::{FogData, FogType};
pub use crate::game::native_block_entity_draw::{BlockEntityDraw, CubeFace};
pub use crate::game::{
NativeBlockEdit, NativeBlockRun, NativeClock, NativeColumnBlocks, NativeDataMapType,
NativeExperienceOrb, NativeFalling, NativeHeightmap, NativeHeldItem, NativeHit,
NativeMapDecoration, NativeMapInfo, NativeMobRender, NativeModEvent, NativePlayerRender,
NativeShake,
ItemEnergyBuffer, NativeBlockEdit, NativeBlockRun, NativeClock, NativeColumnBlocks,
NativeDataMapType, NativeExperienceOrb, NativeFalling, NativeHeightmap, NativeHeldItem,
NativeHit, NativeMapDecoration, NativeMapInfo, NativeMobRender, NativeModEvent,
NativePlayerRender, NativeShake,
};
pub use crate::gfx::native_render::{
RenderHooks, RenderNeeds, RenderNeedsEvent, WorldDrawn, WorldDrawnEvent, wgpu,
+2
View File
@@ -1025,6 +1025,8 @@ mod tests {
pub(super) struct NativeLootDrops<'a>(pub &'a ());
pub(super) struct NativeScreenView<'a>(pub &'a ());
pub(super) struct Corners;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub(super) struct ItemEnergyBuffer;
pub(super) struct Suggestion;
pub(super) struct HudBatch;
pub(super) struct BiomeColors;