1mod registry;
9
10pub use registry::{CServer, Mod, Registry};
11pub use yog_gfx::{GfxContext, core as gfx_core, gl as gfx_gl, draw2d as gfx_draw2d};
12
13pub use yog_abi::{ABI_VERSION, YogApi};
15
16#[doc(hidden)]
17pub use std::os::raw::c_void as __c_void;
18
19#[macro_export]
31macro_rules! export_mod {
32 ($mod_ty:ty) => {
33 #[no_mangle]
34 pub extern "C" fn yog_abi_version() -> u32 {
35 $crate::ABI_VERSION
36 }
37
38 #[no_mangle]
39 pub unsafe extern "C" fn yog_mod_register(
40 api: *const $crate::YogApi,
41 _ctx: *mut $crate::__c_void,
42 ) {
43 let outcome = ::std::panic::catch_unwind(::std::panic::AssertUnwindSafe(|| {
46 let mut registry = unsafe { $crate::Registry::from_raw(api) };
49 <$mod_ty as $crate::Mod>::register(&mut registry);
50 }));
51 if outcome.is_err() {
52 $crate::error!("mod {} panicked during register", ::core::stringify!($mod_ty));
53 }
54 }
55 };
56}
57
58pub use yog_command::CommandContext;
59pub use yog_core::{BlockPos, Server};
60pub use yog_event::{
61 AdvancementEvent, AttackEntityEvent, BlockBreakEvent, ChatEvent, ClientTickEvent,
62 ContainerCloseEvent, ContainerOpenEvent, CraftEvent, EntityDamageEvent, EntityDeathEvent,
63 EntityInteractEvent, EntitySpawnEvent, EventPhase, ExplosionEvent,
64 ItemPickupEvent, KeyPressEvent, PlaceBlockEvent, PlayerDeathEvent, PlayerJoinEvent,
65 PlayerLeaveEvent, PlayerMoveEvent, PlayerRespawnEvent, ProjectileHitEvent, ScreenEvent,
66 UseBlockEvent, UseItemEvent,
67};
68pub use yog_entity::Entity;
69pub use yog_network::{Packet, PacketEvent, PacketField};
70#[doc(inline)]
71pub use yog_network::packet;
72pub use yog_player::Player;
73pub use yog_registry::{BlockDef, FoodDef, FurnaceRecipe, ItemDef, ShapedRecipe, ShapelessRecipe, BookRecipe, ItemModifier, AdvancementReward, StartupGrant};
74pub use yog_config::Config;
75pub use yog_storage::{Storage, StorageScope, Value};
76pub use yog_world::World;
77pub use yog_book::{Book, BookCategory, BookEntry, BookPage, BookMacro, BookRegistry};
78pub use yog_book::{text_page, spotlight_page, crafting_page, smelting_page, image_page, entity_page, relations_page, pattern_page};
79pub use yog_ui::{UiRoot, widget, Align, FlexDir};
80
81pub use yog_logging::{error, info, warn};
83
84pub mod core {
86 pub use yog_core::*;
87}
88
89pub mod event {
91 pub use yog_event::*;
92}
93
94pub mod world {
96 pub use yog_world::*;
97}
98
99pub mod entity {
101 pub use yog_entity::*;
102}
103
104pub mod player {
106 pub use yog_player::*;
107}
108
109pub mod content {
111 pub use yog_registry::*;
112}
113
114pub mod network {
116 pub use yog_network::*;
117}
118
119pub mod command {
121 pub use yog_command::*;
122}
123
124pub mod storage {
126 pub use yog_storage::*;
127}
128
129pub mod config {
131 pub use yog_config::*;
132}
133
134pub mod book {
136 pub use yog_book::*;
137}
138
139pub mod ui {
141 pub use yog_ui::*;
142}