1use crate::{BlockHit, BlockInfo, BlockPos, EntityInfo, Face, PlayerInfo, Server};
5
6#[derive(Debug, Clone, Default)]
11pub struct NullServer {
12 pub game_dir: String,
13}
14
15impl NullServer {
16 pub fn new(dir: impl Into<String>) -> Self {
18 Self {
19 game_dir: dir.into(),
20 }
21 }
22}
23
24#[allow(unused_variables)]
25impl Server for NullServer {
26 fn broadcast(&self, message: &str) {
27 Default::default()
28 }
29 fn get_block(&self, dimension: &str, pos: BlockPos) -> Option<String> {
30 Default::default()
31 }
32 fn set_block(&self, dimension: &str, pos: BlockPos, block_id: &str) -> bool {
33 Default::default()
34 }
35 fn give_item(&self, player: &str, item_id: &str, count: u32) -> bool {
36 Default::default()
37 }
38 fn teleport(&self, player: &str, x: f64, y: f64, z: f64) -> bool {
39 Default::default()
40 }
41 fn send_to_player(&self, player: &str, channel: &str, payload: &[u8]) -> bool {
42 Default::default()
43 }
44 fn send_to_server(&self, channel: &str, payload: &[u8]) -> bool {
45 Default::default()
46 }
47 fn entity_teleport(&self, uuid: &str, x: f64, y: f64, z: f64) -> bool {
48 Default::default()
49 }
50 fn entity_position(&self, uuid: &str) -> Option<(f64, f64, f64)> {
51 Default::default()
52 }
53 fn entity_health(&self, uuid: &str) -> Option<f32> {
54 Default::default()
55 }
56 fn entity_set_health(&self, uuid: &str, health: f32) -> bool {
57 Default::default()
58 }
59 fn entity_kill(&self, uuid: &str) -> bool {
60 Default::default()
61 }
62 fn spawn_entity(
63 &self,
64 entity_type: &str,
65 dimension: &str,
66 x: f64,
67 y: f64,
68 z: f64,
69 ) -> Option<String> {
70 Default::default()
71 }
72 fn entity_add_effect(
73 &self,
74 uuid: &str,
75 effect_id: &str,
76 duration_ticks: i32,
77 amplifier: u8,
78 show_particles: bool,
79 ) -> bool {
80 Default::default()
81 }
82 fn entity_remove_effect(&self, uuid: &str, effect_id: &str) -> bool {
83 Default::default()
84 }
85 fn entity_clear_effects(&self, uuid: &str) -> bool {
86 Default::default()
87 }
88 fn drop_loot(&self, table_id: &str, dimension: &str, x: f64, y: f64, z: f64) -> bool {
89 Default::default()
90 }
91 fn has_item_tag(&self, item_id: &str, tag_id: &str) -> bool {
92 Default::default()
93 }
94 fn has_block_tag(&self, block_id: &str, tag_id: &str) -> bool {
95 Default::default()
96 }
97 fn world_time(&self, dimension: &str) -> Option<i64> {
98 Default::default()
99 }
100 fn world_set_time(&self, dimension: &str, time: i64) -> bool {
101 Default::default()
102 }
103 fn world_is_raining(&self, dimension: &str) -> bool {
104 Default::default()
105 }
106 fn world_set_weather(&self, dimension: &str, raining: bool, duration_ticks: i32) -> bool {
107 Default::default()
108 }
109 fn entity_velocity(&self, uuid: &str) -> Option<(f64, f64, f64)> {
110 Default::default()
111 }
112 fn entity_set_velocity(&self, uuid: &str, vx: f64, vy: f64, vz: f64) -> bool {
113 Default::default()
114 }
115 fn entity_add_velocity(&self, uuid: &str, vx: f64, vy: f64, vz: f64) -> bool {
116 Default::default()
117 }
118 fn scoreboard_get(&self, objective: &str, player: &str) -> Option<i32> {
119 Default::default()
120 }
121 fn scoreboard_set(&self, objective: &str, player: &str, score: i32) -> bool {
122 Default::default()
123 }
124 fn scoreboard_add(&self, objective: &str, player: &str, delta: i32) -> Option<i32> {
125 Default::default()
126 }
127 fn play_sound(
128 &self,
129 dimension: &str,
130 x: f64,
131 y: f64,
132 z: f64,
133 sound_id: &str,
134 volume: f32,
135 pitch: f32,
136 ) -> bool {
137 Default::default()
138 }
139 fn play_sound_to_player(&self, player: &str, sound_id: &str, volume: f32, pitch: f32) -> bool {
140 Default::default()
141 }
142 fn send_title(
143 &self,
144 player: &str,
145 title: &str,
146 subtitle: &str,
147 fadein: i32,
148 stay: i32,
149 fadeout: i32,
150 ) -> bool {
151 Default::default()
152 }
153 fn send_actionbar(&self, player: &str, message: &str) -> bool {
154 Default::default()
155 }
156 fn entity_rotation(&self, uuid: &str) -> Option<(f32, f32)> {
157 Default::default()
158 }
159 fn kick_player(&self, player: &str, reason: &str) -> bool {
160 Default::default()
161 }
162 fn set_gamemode(&self, player: &str, gamemode: &str) -> bool {
163 Default::default()
164 }
165 fn bossbar_create(&self, id: &str, title: &str, color: &str, style: &str) -> bool {
166 Default::default()
167 }
168 fn bossbar_remove(&self, id: &str) -> bool {
169 Default::default()
170 }
171 fn bossbar_set_title(&self, id: &str, title: &str) -> bool {
172 Default::default()
173 }
174 fn bossbar_set_progress(&self, id: &str, progress: f32) -> bool {
175 Default::default()
176 }
177 fn bossbar_set_color(&self, id: &str, color: &str) -> bool {
178 Default::default()
179 }
180 fn bossbar_add_player(&self, id: &str, player: &str) -> bool {
181 Default::default()
182 }
183 fn bossbar_remove_player(&self, id: &str, player: &str) -> bool {
184 Default::default()
185 }
186 fn bossbar_set_visible(&self, id: &str, visible: bool) -> bool {
187 Default::default()
188 }
189 fn game_dir(&self) -> String {
190 self.game_dir.clone()
191 }
192
193 fn world_dir(&self) -> String {
194 self.game_dir.clone()
195 }
196 fn online_players(&self) -> Vec<String> {
197 Default::default()
198 }
199 fn get_block_nbt(&self, dimension: &str, pos: BlockPos) -> Option<String> {
200 Default::default()
201 }
202 fn set_block_nbt(&self, dimension: &str, pos: BlockPos, snbt: &str) -> bool {
203 Default::default()
204 }
205 fn get_inventory_slot(
206 &self,
207 dimension: &str,
208 pos: BlockPos,
209 slot: u32,
210 ) -> Option<(String, u32, String)> {
211 Default::default()
212 }
213 fn set_inventory_slot(
214 &self,
215 dimension: &str,
216 pos: BlockPos,
217 slot: u32,
218 item_id: &str,
219 count: u32,
220 snbt: &str,
221 ) -> bool {
222 Default::default()
223 }
224 fn player_inventory(&self, player: &str) -> Vec<(u32, String, u32)> {
225 Default::default()
226 }
227 fn player_set_slot(&self, player: &str, slot: u32, item_id: &str, count: u32) -> bool {
228 Default::default()
229 }
230 fn teleport_to_dim(&self, player: &str, dimension: &str, x: f64, y: f64, z: f64) -> bool {
231 Default::default()
232 }
233 fn entity_teleport_to_dim(&self, uuid: &str, dimension: &str, x: f64, y: f64, z: f64) -> bool {
234 Default::default()
235 }
236 fn world_entity_count(&self, dimension: &str, entity_type: &str) -> i32 {
237 Default::default()
238 }
239 fn entity_get_nbt(&self, uuid: &str) -> Option<String> {
240 Default::default()
241 }
242 fn entity_set_nbt(&self, uuid: &str, snbt: &str) -> bool {
243 Default::default()
244 }
245 fn spawn_particles(
246 &self,
247 dimension: &str,
248 x: f64,
249 y: f64,
250 z: f64,
251 particle_type: &str,
252 count: i32,
253 dx: f64,
254 dy: f64,
255 dz: f64,
256 speed: f64,
257 ) -> bool {
258 Default::default()
259 }
260 fn entity_attribute_get(&self, uuid: &str, attribute_id: &str) -> Option<f64> {
261 Default::default()
262 }
263 fn entity_attribute_value(&self, uuid: &str, attribute_id: &str) -> Option<f64> {
264 Default::default()
265 }
266 fn entity_attribute_set(&self, uuid: &str, attribute_id: &str, value: f64) -> bool {
267 Default::default()
268 }
269 fn get_held_item_nbt(&self, player: &str) -> Option<String> {
270 Default::default()
271 }
272 fn set_held_item_nbt(&self, player: &str, snbt: &str) -> bool {
273 Default::default()
274 }
275 fn get_offhand_item_nbt(&self, player: &str) -> Option<String> {
276 Default::default()
277 }
278 fn set_offhand_item_nbt(&self, player: &str, snbt: &str) -> bool {
279 Default::default()
280 }
281 fn get_slot_item(&self, player: &str, slot: u32) -> Option<(String, u32, String)> {
282 Default::default()
283 }
284 fn set_slot_item(
285 &self,
286 player: &str,
287 slot: u32,
288 item_id: &str,
289 count: u32,
290 snbt: &str,
291 ) -> bool {
292 Default::default()
293 }
294 fn entity_info(&self, uuid: &str) -> Option<EntityInfo> {
295 Default::default()
296 }
297 fn entities_in_box(
298 &self,
299 dimension: &str,
300 min: (f64, f64, f64),
301 max: (f64, f64, f64),
302 ) -> Vec<String> {
303 Default::default()
304 }
305 fn raycast_block(
306 &self,
307 dimension: &str,
308 from: (f64, f64, f64),
309 to: (f64, f64, f64),
310 ) -> Option<BlockHit> {
311 Default::default()
312 }
313 fn raycast_entity(
314 &self,
315 dimension: &str,
316 from: (f64, f64, f64),
317 to: (f64, f64, f64),
318 exclude: &str,
319 ) -> Option<String> {
320 Default::default()
321 }
322 fn block_info(&self, dimension: &str, pos: BlockPos) -> Option<BlockInfo> {
323 Default::default()
324 }
325 fn break_block(&self, dimension: &str, pos: BlockPos, drop: bool, breaker: &str) -> bool {
326 Default::default()
327 }
328 fn place_block_from_slot(
329 &self,
330 player: &str,
331 slot: u32,
332 dimension: &str,
333 pos: BlockPos,
334 ) -> bool {
335 Default::default()
336 }
337 fn bonemeal(&self, dimension: &str, pos: BlockPos) -> bool {
338 Default::default()
339 }
340 fn explode(
341 &self,
342 dimension: &str,
343 x: f64,
344 y: f64,
345 z: f64,
346 power: f32,
347 fire: bool,
348 source: &str,
349 ) -> bool {
350 Default::default()
351 }
352 fn tellraw(&self, player: &str, json: &str) -> bool {
353 Default::default()
354 }
355 fn entity_damage(&self, uuid: &str, amount: f32, damage_type: &str, attacker: &str) -> bool {
356 Default::default()
357 }
358 fn entity_set_fire_ticks(&self, uuid: &str, ticks: i32) -> bool {
359 Default::default()
360 }
361 fn player_add_xp(&self, player: &str, amount: i32) -> bool {
362 Default::default()
363 }
364 fn player_set_may_fly(&self, player: &str, may_fly: bool) -> bool {
365 Default::default()
366 }
367 fn player_info(&self, player: &str) -> Option<PlayerInfo> {
368 Default::default()
369 }
370 fn spawn_item(
371 &self,
372 dimension: &str,
373 pos: (f64, f64, f64),
374 vel: (f64, f64, f64),
375 item_id: &str,
376 count: u32,
377 snbt: &str,
378 ) -> Option<String> {
379 Default::default()
380 }
381 fn item_entity_stack(&self, uuid: &str) -> Option<(String, u32, String)> {
382 Default::default()
383 }
384 fn item_entity_set_stack(&self, uuid: &str, item_id: &str, count: u32, snbt: &str) -> bool {
385 Default::default()
386 }
387 fn actionbar_json(&self, player: &str, json: &str) -> bool {
388 Default::default()
389 }
390 fn use_item_on_block(
391 &self,
392 dimension: &str,
393 pos: BlockPos,
394 face: Face,
395 item_id: &str,
396 player: &str,
397 ) -> bool {
398 Default::default()
399 }
400 fn pour_fluid(&self, dimension: &str, pos: BlockPos, bucket_item_id: &str) -> bool {
401 Default::default()
402 }
403 fn has_entity_tag(&self, entity_type: &str, tag_id: &str) -> bool {
404 Default::default()
405 }
406 fn item_block(&self, item_id: &str) -> Option<String> {
407 Default::default()
408 }
409 fn place_feature(&self, dimension: &str, pos: BlockPos, feature_id: &str) -> bool {
410 Default::default()
411 }
412 fn set_item_cooldown(&self, player: &str, item_id: &str, ticks: u32) -> bool {
413 Default::default()
414 }
415 fn entity_vehicle(&self, uuid: &str) -> Option<String> {
416 Default::default()
417 }
418 fn entity_passengers(&self, uuid: &str) -> Vec<String> {
419 Default::default()
420 }
421 fn entity_mount(&self, rider: &str, vehicle: &str, force: bool) -> bool {
422 Default::default()
423 }
424 fn entity_dismount(&self, uuid: &str) -> bool {
425 Default::default()
426 }
427 fn entity_data(&self, uuid: &str, key: &str) -> Option<Vec<u8>> {
428 Default::default()
429 }
430 fn set_entity_data(&self, uuid: &str, key: &str, value: Option<&[u8]>, persist: bool) -> bool {
431 Default::default()
432 }
433 fn entity_set_dimensions(&self, uuid: &str, size: Option<(f32, f32, f32)>) -> bool {
434 Default::default()
435 }
436 fn entity_set_fall_distance(&self, uuid: &str, distance: f32) -> bool {
437 Default::default()
438 }
439 fn redstone_signal(&self, dimension: &str, pos: BlockPos) -> Option<u8> {
440 Default::default()
441 }
442 fn redstone_power(&self, dimension: &str, pos: BlockPos) -> Option<u8> {
443 Default::default()
444 }
445 fn set_redstone_output(&self, dimension: &str, pos: BlockPos, level: u8) -> bool {
446 Default::default()
447 }
448 fn get_block_state(&self, dimension: &str, pos: BlockPos) -> Option<String> {
449 Default::default()
450 }
451 fn set_block_state(&self, dimension: &str, pos: BlockPos, state: &str) -> bool {
452 Default::default()
453 }
454 fn world_is_thundering(&self, dimension: &str) -> bool {
455 Default::default()
456 }
457 fn world_set_thunder(&self, dimension: &str, thundering: bool, duration_ticks: i32) -> bool {
458 Default::default()
459 }
460 fn fill_region(&self, dimension: &str, from: BlockPos, to: BlockPos, state: &str) -> Option<u32> {
461 Default::default()
462 }
463 fn scan_region(&self, dimension: &str, from: BlockPos, to: BlockPos) -> Vec<(BlockPos, String)> {
464 Default::default()
465 }
466}