|
35 | 35 | import com.sucy.skill.data.formula.Formula;
|
36 | 36 | import com.sucy.skill.data.formula.IValue;
|
37 | 37 | import com.sucy.skill.data.formula.value.CustomValue;
|
38 |
| -import mc.promcteam.engine.mccore.util.VersionManager; |
39 | 38 | import org.bukkit.Location;
|
40 | 39 | import org.bukkit.Material;
|
41 | 40 | import org.bukkit.entity.Player;
|
@@ -182,68 +181,54 @@ public void play(Location loc, int frame, int level) {
|
182 | 181 | double t = animation.getT(frame);
|
183 | 182 | double p = (double) frame / animation.getSteps();
|
184 | 183 |
|
185 |
| - int j = 0, k = 0; |
| 184 | + int j = 0; |
186 | 185 |
|
187 |
| - if (VersionManager.isVersionAtLeast(11300)) { |
188 |
| - ArrayList<Player> players = new ArrayList<>(); |
189 |
| - for (Player player : loc.getWorld().getPlayers()) { |
190 |
| - if (loc.distance(player.getLocation()) <= view) { |
191 |
| - players.add(player); |
192 |
| - } |
193 |
| - } |
194 |
| - org.bukkit.Particle effect = org.bukkit.Particle.valueOf(this.particle.type.name()); |
195 |
| - int count = this.particle.amount; |
196 |
| - double dx = this.particle.dx; |
197 |
| - double dy = this.particle.dy; |
198 |
| - double dz = this.particle.dz; |
199 |
| - float speed = this.particle.speed; |
200 |
| - Material material = this.particle.material; |
201 |
| - int data = this.particle.data; |
202 |
| - |
203 |
| - for (int i = frame * this.animation.getCopies(); i < next; ++i) { |
204 |
| - Point3D p1 = animPoints[i]; |
205 |
| - double animSize = this.animSize.compute(t, p, cs.x, cs.y, p1.x, p1.y, p1.z, level); |
206 |
| - |
207 |
| - for (Point3D p2 : shapePoints) { |
208 |
| - double size = this.size.compute(t, p, cs.x, cs.y, p2.x, p2.y, p2.z, level); |
209 |
| - if (initialRotation != 0) p2 = flatRot.rotateAboutY(p2, rotMatrix); |
210 |
| - if (withRotation) { |
211 |
| - double yaw = Math.toRadians(-loc.getYaw()); |
212 |
| - p2 = flatRot.rotateAboutY(p2, yaw); |
213 |
| - } |
214 |
| - double x = p1.x * animSize + this.animDir.rotateX(p2, trig[j]) * size + loc.getX(); |
215 |
| - double y = p1.y * animSize + this.animDir.rotateY(p2, trig[j]) * size + loc.getY(); |
216 |
| - double z = p1.z * animSize + this.animDir.rotateZ(p2, trig[j]) * size + loc.getZ(); |
217 |
| - Particle.play( |
218 |
| - players, |
219 |
| - effect, |
220 |
| - x, |
221 |
| - y, |
222 |
| - z, |
223 |
| - count, |
224 |
| - dx, |
225 |
| - dy, |
226 |
| - dz, |
227 |
| - speed, |
228 |
| - material, |
229 |
| - data); |
230 |
| - } |
231 |
| - ++j; |
| 186 | + ArrayList<Player> players = new ArrayList<>(); |
| 187 | + for (Player player : loc.getWorld().getPlayers()) { |
| 188 | + if (loc.distance(player.getLocation()) <= view) { |
| 189 | + players.add(player); |
232 | 190 | }
|
233 |
| - } else { |
234 |
| - for (int i = frame * animation.getCopies(); i < next; i++) { |
235 |
| - Point3D p1 = animPoints[i]; |
236 |
| - double animSize = this.animSize.compute(t, p, cs.x, cs.y, p1.x, p1.y, p1.z, level); |
237 |
| - for (Point3D p2 : shapePoints) { |
238 |
| - double size = this.size.compute(t, p, cs.x, cs.y, p2.x, p2.y, p2.z, level); |
239 |
| - double x = p1.x * animSize + animDir.rotateX(p2, trig[j]) * size + loc.getX(); |
240 |
| - double y = p1.y * animSize + animDir.rotateY(p2, trig[j]) * size + loc.getY(); |
241 |
| - double z = p1.z * animSize + animDir.rotateZ(p2, trig[j]) * size + loc.getZ(); |
242 |
| - packets[k++] = particle.instance(x, y, z); |
| 191 | + } |
| 192 | + org.bukkit.Particle effect = org.bukkit.Particle.valueOf(this.particle.type.name()); |
| 193 | + int count = this.particle.amount; |
| 194 | + double dx = this.particle.dx; |
| 195 | + double dy = this.particle.dy; |
| 196 | + double dz = this.particle.dz; |
| 197 | + float speed = this.particle.speed; |
| 198 | + Material material = this.particle.material; |
| 199 | + int data = this.particle.data; |
| 200 | + int durability = this.particle.durability; |
| 201 | + |
| 202 | + for (int i = frame * this.animation.getCopies(); i < next; ++i) { |
| 203 | + Point3D p1 = animPoints[i]; |
| 204 | + double animSize = this.animSize.compute(t, p, cs.x, cs.y, p1.x, p1.y, p1.z, level); |
| 205 | + |
| 206 | + for (Point3D p2 : shapePoints) { |
| 207 | + double size = this.size.compute(t, p, cs.x, cs.y, p2.x, p2.y, p2.z, level); |
| 208 | + if (initialRotation != 0) p2 = flatRot.rotateAboutY(p2, rotMatrix); |
| 209 | + if (withRotation) { |
| 210 | + double yaw = Math.toRadians(-loc.getYaw()); |
| 211 | + p2 = flatRot.rotateAboutY(p2, yaw); |
243 | 212 | }
|
244 |
| - j++; |
| 213 | + double x = p1.x * animSize + this.animDir.rotateX(p2, trig[j]) * size + loc.getX(); |
| 214 | + double y = p1.y * animSize + this.animDir.rotateY(p2, trig[j]) * size + loc.getY(); |
| 215 | + double z = p1.z * animSize + this.animDir.rotateZ(p2, trig[j]) * size + loc.getZ(); |
| 216 | + Particle.play( |
| 217 | + players, |
| 218 | + effect, |
| 219 | + x, |
| 220 | + y, |
| 221 | + z, |
| 222 | + count, |
| 223 | + dx, |
| 224 | + dy, |
| 225 | + dz, |
| 226 | + speed, |
| 227 | + material, |
| 228 | + data, |
| 229 | + durability); |
245 | 230 | }
|
246 |
| - Particle.send(loc, packets, view); |
| 231 | + ++j; |
247 | 232 | }
|
248 | 233 | } catch (Exception ex) {
|
249 | 234 | ex.printStackTrace();
|
|
0 commit comments