Rotate all Armorstands around a point

Discussion in 'Plugin Development' started by Ste3et_C0st, May 2, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Ste3et_C0st

    Hello i works for 4 days on a option to rotate armorstands around a point i have this ArmorStand model:

    [​IMG]

    The fence in the middle is the midpoint of the ArmorStandmodel i want do rotate it every degress of a circle this is my current code:

    Code:
    @EventHandler
        public void onMoving(FurnitureMoveEvent e){
            Location loc = FurnitureLib.getInstance().getLocationUtil().getCenter(e.getID().getStartLocation()).subtract(0, .5, 0);     
            for(fEntity entity : e.getID().getPacketList()){
                Relative relative = new Relative(loc, entity.getLocation());
                Vector vector = new Vector(relative.getOffsetX(), 0, relative.getOffsetZ());
                Vector rotate = MathUtil.rotate(2f, 0, vector.normalize());
                rotate = rotate.normalize();
                entity.move(rotate.getX(), rotate.getY(), rotate.getZ());
            }
        }
     
Thread Status:
Not open for further replies.

Share This Page