-
Notifications
You must be signed in to change notification settings - Fork 5
/
NonPlayerCharacter.java
107 lines (81 loc) · 2.27 KB
/
NonPlayerCharacter.java
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import net.minecraft.server.MinecraftServer;
import java.util.List;
public abstract class NonPlayerCharacter {
public static List<?> players;
private et user;
private gw handler;
public NonPlayerCharacter(String name, double x, double y, double z, float rotation, float pitch, int itemInHand) {
if (players == null) getPlayerList();
MinecraftServer s = etc.getServer().getMCServer();
user = new et(s, s.e, name, new jv(s.e));
teleportTo(x,y,z,rotation,pitch);
if (itemInHand > 0) {
setItemInHand(itemInHand);
}
handler = new gw(user, 512, 1 , true );
}
public void delete() {
for (Object player : players) {
((et)player).a.b(new di(handler.a.g));
}
}
public void untrack(Player player) {
if (handler.q.contains(player.getUser())) {
handler.q.remove(player.getUser());
}
}
public void broadcastPosition() {
handler.b(players);
}
public void broadcastMovement() {
handler.a(players);
}
public String getName() {
return user.at;
}
public void setName(String name) {
user.at = name;
}
public double getX() {
return user.m;
}
public void setX(double x) {
user.m = x;
}
public double getY() {
return user.n;
}
public void setY(double y) {
user.n = y;
}
public double getZ() {
return user.o;
}
public void setZ(double z) {
user.o = z;
}
public float getRotation() {
return user.v;
}
public void setRotation(float rot) {
user.v = rot;
}
public float getPitch() {
return user.w;
}
public void setPitch(float pitch) {
user.w = pitch;
}
public int getItemInHand() {
return user.am.a[0].c;
}
public void setItemInHand(int type) {
user.am.a[0] = new hn(type);
}
public void teleportTo(double x, double y, double z, float rotation, float pitch) {
user.b(x,y,z,rotation,pitch);
}
public static void getPlayerList() {
players = etc.getServer().getMCServer().f.b;
}
}