Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void tick() {
- if (!isMounted) { return; }
- if (tick == 0) {
- final Location start = armorStand.getLocation();
- final Location end = start.clone().add(start.getDirection().multiply(20));
- this.x0 = start.getX();
- this.y0 = start.getY();
- this.z0 = start.getZ();
- this.x1 = end.getX();
- this.y1 = end.getY();
- this.z1 = end.getZ();
- // armorStand.setPassenger(player.getBukkitPlayer());
- }
- double x = (((x1 - x0) / TERMINAL_TIME) * tick) + x0;
- double y = (- GRAVITY * tick * tick) + (((y1 - y0 + GRAVITY * TERMINAL_TIME * TERMINAL_TIME) / TERMINAL_TIME) * tick) + y0;
- double z = (((z1 - z0) / TERMINAL_TIME) * tick) + z0;
- final Location target = new Location(player.getWorld(), x, y, z);
- armorStand.teleport(target);
- System.out.println(target);
- if (++tick >= TERMINAL_TIME) {
- this.isMounted = false;
- this.armorStand.remove();
- // this.armorStand.eject();
- tick = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement