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};
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};
79
80pub use yog_logging::{error, info, warn};
82
83pub mod core {
85 pub use yog_core::*;
86}
87
88pub mod event {
90 pub use yog_event::*;
91}
92
93pub mod world {
95 pub use yog_world::*;
96}
97
98pub mod entity {
100 pub use yog_entity::*;
101}
102
103pub mod player {
105 pub use yog_player::*;
106}
107
108pub mod content {
110 pub use yog_registry::*;
111}
112
113pub mod network {
115 pub use yog_network::*;
116}
117
118pub mod command {
120 pub use yog_command::*;
121}
122
123pub mod storage {
125 pub use yog_storage::*;
126}
127
128pub mod config {
130 pub use yog_config::*;
131}
132
133pub mod book {
135 pub use yog_book::*;
136}