This repository was archived by the owner on Oct 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathOItemInWorldManager.java
More file actions
137 lines (123 loc) · 4.44 KB
/
OItemInWorldManager.java
File metadata and controls
137 lines (123 loc) · 4.44 KB
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
public class OItemInWorldManager {
private OWorld b;
public OEntityPlayer a;
private float c = 0.0F;
private int d;
private int e = 0;
private float f = 0.0F;
private int g;
private int h;
private int i;
private int j;
private boolean k;
private int l;
private int m;
private int n;
private int o;
public OItemInWorldManager(OWorld paramOWorld) {
b = paramOWorld;
}
public void a() {
// hMod: workaround for servers that can't keep up
j = (int) System.currentTimeMillis() / 50;
if (k) {
int i1 = j - o;
int i2 = b.a(l, m, n);
if (i2 != 0) {
OBlock localOBlock = OBlock.m[i2];
float f1 = localOBlock.a(a) * (i1 + 1);
if (f1 >= 1.0F) {
k = false;
d(l, m, n);
}
} else {
k = false;
}
}
}
public void a(int paramInt1, int paramInt2, int paramInt3) {
d = j;
int i1 = b.a(paramInt1, paramInt2, paramInt3);
if (i1 > 0) {
OBlock.m[i1].b(b, paramInt1, paramInt2, paramInt3, a);
}
if ((i1 > 0) && (OBlock.m[i1].a(a) >= 1.0F)) {
d(paramInt1, paramInt2, paramInt3);
} else {
g = paramInt1;
h = paramInt2;
i = paramInt3;
}
}
public void b(int paramInt1, int paramInt2, int paramInt3) {
if ((paramInt1 == g) && (paramInt2 == h) && (paramInt3 == i)) {
int i1 = j - d;
int i2 = b.a(paramInt1, paramInt2, paramInt3);
if (i2 != 0) {
OBlock localOBlock = OBlock.m[i2];
float f1 = localOBlock.a(a) * (i1 + 1);
if (f1 >= 1.0F) {
d(paramInt1, paramInt2, paramInt3);
} else if (!k) {
k = true;
l = paramInt1;
m = paramInt2;
n = paramInt3;
o = d;
}
}
}
c = 0.0F;
e = 0;
}
public boolean c(int paramInt1, int paramInt2, int paramInt3) {
OBlock localOBlock = OBlock.m[b.a(paramInt1, paramInt2, paramInt3)];
int i1 = b.b(paramInt1, paramInt2, paramInt3);
boolean bool = b.e(paramInt1, paramInt2, paramInt3, 0);
if ((localOBlock != null) && (bool)) {
localOBlock.b(b, paramInt1, paramInt2, paramInt3, i1);
}
return bool;
}
public boolean d(int paramInt1, int paramInt2, int paramInt3) {
int i1 = b.a(paramInt1, paramInt2, paramInt3);
int i2 = b.b(paramInt1, paramInt2, paramInt3);
boolean bool = c(paramInt1, paramInt2, paramInt3);
OItemStack localOItemStack = a.z();
if (localOItemStack != null) {
localOItemStack.a(i1, paramInt1, paramInt2, paramInt3);
if (localOItemStack.a == 0) {
localOItemStack.a(a);
a.A();
}
}
if ((bool) && (a.b(OBlock.m[i1]))) {
OBlock.m[i1].a_(b, paramInt1, paramInt2, paramInt3, i2);
((OEntityPlayerMP) a).a.b(new OPacket53BlockChange(paramInt1, paramInt2, paramInt3, b));
}
return bool;
}
public boolean a(OEntityPlayer paramOEntityPlayer, OWorld paramOWorld, OItemStack paramOItemStack) {
int i1 = paramOItemStack.a;
OItemStack localOItemStack = paramOItemStack.a(paramOWorld, paramOEntityPlayer);
if ((localOItemStack != paramOItemStack) || ((localOItemStack != null) && (localOItemStack.a != i1))) {
paramOEntityPlayer.i.a[paramOEntityPlayer.i.c] = localOItemStack;
if (localOItemStack.a == 0) {
paramOEntityPlayer.i.a[paramOEntityPlayer.i.c] = null;
}
return true;
}
return false;
}
public boolean a(OEntityPlayer paramOEntityPlayer, OWorld paramOWorld, OItemStack paramOItemStack, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
int i1 = paramOWorld.a(paramInt1, paramInt2, paramInt3);
if ((i1 > 0)
&& (OBlock.m[i1].a(paramOWorld, paramInt1, paramInt2, paramInt3, paramOEntityPlayer))) {
return true;
}
if (paramOItemStack == null) {
return false;
}
return paramOItemStack.a(paramOEntityPlayer, paramOWorld, paramInt1, paramInt2, paramInt3, paramInt4);
}
}