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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
package net.minecraft.server;
import java.util.*;
public class EntityTracker {
private Set a;
private MCHashTable b;
private MinecraftServer c;
private int d;
public EntityTracker(MinecraftServer minecraftserver) {
a = ((Set) (new HashSet()));
b = new MCHashTable();
c = minecraftserver;
d = minecraftserver.f.a();
}
public void a(Entity entity) {
if (entity instanceof EntityPlayerMP) {
a(entity, 512, 2);
EntityPlayerMP entityplayermp = (EntityPlayerMP) entity;
Iterator iterator = a.iterator();
do {
if (!iterator.hasNext()) {
break;
}
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
if (entitytrackerentry.a != entityplayermp) {
entitytrackerentry.b(entityplayermp);
}
} while (true);
} else if (entity instanceof EntityFish) {
a(entity, 64, 5, true);
} else if (entity instanceof EntityArrow) {
a(entity, 64, 5, true);
} else if (entity instanceof EntitySnowball) {
a(entity, 64, 5, true);
} else if (entity instanceof EntityEgg) {
a(entity, 64, 5, true);
} else if (entity instanceof EntityItem) {
a(entity, 64, 20, true);
} else if (entity instanceof EntityMinecart) {
a(entity, 160, 5, true);
} else if (entity instanceof EntityBoat) {
a(entity, 160, 5, true);
} else if (entity instanceof EntitySquid) {
a(entity, 160, 3, true);
} else if (entity instanceof IAnimals) {
a(entity, 160, 3);
} else if (entity instanceof EntityTNTPrimed) {
a(entity, 160, 10, true);
} else if (entity instanceof EntityFallingSand) {
a(entity, 160, 20, true);
} else if (entity instanceof EntityPainting) {
a(entity, 160, 0x7fffffff, false);
}
}
public void a(Entity entity, int i, int j) {
a(entity, i, j, false);
}
public void a(Entity entity, int i, int j, boolean flag) {
if (i > d) {
i = d;
}
if (b.b(entity.g)) {
throw new IllegalStateException("Entity is already tracked!");
} else {
EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(entity, i, j, flag);
a.add(((entitytrackerentry)));
b.a(entity.g, ((entitytrackerentry)));
entitytrackerentry.b(c.e.d);
return;
}
}
public void b(Entity entity) {
if (entity instanceof EntityPlayerMP) {
EntityPlayerMP entityplayermp = (EntityPlayerMP) entity;
EntityTrackerEntry entitytrackerentry1;
for (Iterator iterator = a.iterator(); iterator.hasNext(); entitytrackerentry1.a(entityplayermp)) {
entitytrackerentry1 = (EntityTrackerEntry) iterator.next();
}
}
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) b.d(entity.g);
if (entitytrackerentry != null) {
a.remove(((entitytrackerentry)));
entitytrackerentry.a();
}
}
public void a() {
ArrayList arraylist = new ArrayList();
Iterator iterator = a.iterator();
do {
if (!iterator.hasNext()) {
break;
}
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
entitytrackerentry.a(c.e.d);
if (entitytrackerentry.m && (entitytrackerentry.a instanceof EntityPlayerMP)) {
((List) (arraylist)).add((((EntityPlayerMP) entitytrackerentry.a)));
}
} while (true);
label0:
for (int i = 0; i < ((List) (arraylist)).size(); i++) {
EntityPlayerMP entityplayermp = (EntityPlayerMP) ((List) (arraylist)).get(i);
Iterator iterator1 = a.iterator();
do {
if (!iterator1.hasNext()) {
continue label0;
}
EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry) iterator1.next();
if (entitytrackerentry1.a != entityplayermp) {
entitytrackerentry1.b(entityplayermp);
}
} while (true);
}
}
public void a(Entity entity, Packet packet) {
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) b.a(entity.g);
if (entitytrackerentry != null) {
entitytrackerentry.a(packet);
}
}
public void b(Entity entity, Packet packet) {
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) b.a(entity.g);
if (entitytrackerentry != null) {
entitytrackerentry.b(packet);
}
}
public void a(EntityPlayerMP entityplayermp) {
EntityTrackerEntry entitytrackerentry;
for (Iterator iterator = a.iterator(); iterator.hasNext(); entitytrackerentry.c(entityplayermp)) {
entitytrackerentry = (EntityTrackerEntry) iterator.next();
}
}
}
|