-
Notifications
You must be signed in to change notification settings - Fork 14
/
interfaces.d
69 lines (54 loc) · 1.6 KB
/
interfaces.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/charge/charge.d (GPLv2 only).
module miners.classic.interfaces;
/**
* A classic connection interface.
*/
interface ClassicClientConnection
{
void setListener(ClassicClientListener l);
/*
* Message Listener
*/
void setMessageListener(ClassicClientMessageListener ml);
ClassicClientMessageListener getMessageListener();
}
/**
* Receiver of client packages from a ClientConnection.
*/
interface ClassicClientListener
{
void indentification(ubyte ver, string name, string motd, ubyte type);
void levelInitialize();
void levelLoadUpdate(ubyte precent);
void levelFinalize(uint x, uint y, uint z, ubyte[] data);
void disconnect(string reason);
/*
* These packets are what normaly comes during gameplay.
*/
void setBlock(short x, short y, short z, ubyte type);
void playerSpawn(byte id, string name, double x, double y, double z,
double heading, double pitch);
void playerMoveTo(byte id, double x, double y, double z,
double heading, double pitch);
void playerMove(byte id, double x, double y, double z,
double heading, double pitch);
void playerMove(byte id, double x, double y, double z);
void playerMove(byte id, double heading, double pitch);
void playerDespawn(byte id);
void playerType(ubyte type);
void ping();
}
/**
* Receiver of client messages from a ClientConnection.
*/
interface ClassicClientMessageListener
{
void archive(byte id, string message);
/*
* Player tracking.
*/
void addPlayer(byte id, string name);
void removePlayer(byte id);
void removeAllPlayers();
}