public static ObjectDefinition forId(int id) {
        for (int i = 0; i < 20; i++) {
            if (ObjectDefinition.cache[i].type == id) {
                return ObjectDefinition.cache[i];
            }
        }
        ObjectDefinition.cacheIndex = (ObjectDefinition.cacheIndex + 1) % 20;
        ObjectDefinition object = ObjectDefinition.cache[ObjectDefinition.cacheIndex];
        ObjectDefinition.buffer.offset = ObjectDefinition.objectIndices[id];
        object.type = id;
        object.setDefaults();
        object.readValues(ObjectDefinition.buffer);
        return object;
    }