Unofficial site, not affiliated with modrinth.com.What is this?
Моды/CC:Libraries
CC:Libraries

CC:Libraries

Adds libraries to CC:Tweaked.

32
0

Small update, rework in file()

release2 мая 2026 г.

file() changes and fixes

  • 1.1 - Rework in table management.

    Removed "this()". "t" argument now supports booleans, strings and numbers.
    For "t", if "true", will edit the first unnamed table. Else if a string value, will edit a named table. Else if a number value, will edit a unnamed table according to the index position.

  • 1.2 - Rework in logic.

    The general logic also received a rework. Now data is stored inside a capsule, a large table that allows the system to manage multiple unnamed tables and also to have better control.

  • 1.3 - Fixes.

    Some bugs were caused by the old table management system, altough there may persist different bugs.

Complete guide in GitHub!

Important changes and optmizations

release25 апреля 2026 г.

loader.lua changes and optmizations

  • 1.1 - Optmizations

    Multiple sections were optimized with the new function file(), a new and powerful tool.

  • 1.2 - Hidden files

    Unnecessary files are now hidden from the normal scope (access with ".filename".)

  • 1.3 - setrepo() now accepts https.

    setrepo() accepts https (string).

  • [+] 1.4 - New function, autoimport(lib).

    Automatically imports files from the repository in every refresh. Toggle on and off to activate the automatic importation. Still no way to remove files from the auto importing file, so access it with ".autoimport" and manually remove unwanted files.

  • [+] 1.5 - New function, file(file, act, v, t)

    Explanation further in the changelog (down here).

file(file, act, v, t)

  • 2.1 - A better way to manage fs with just one line.
  • 2.2 - Variables to use the function (act)

    w - write
    a - add
    r - read
    c - clean
    rmv - remove
    del - delete
    [Other] this()

  • 2.3 - Using this()

    Used to perform the action in tables. Can be used with "t" to select a specific table.

  • 2.4 - Creating a file:

    file("filename", c)
    Altough "c" is used to clean, can also be used to create a file.

  • 2.5 - Demonstration

    file(".newfile", w, "hello") -- Writes "hello" in the file.
    file(".newfile", a, "hi") -- Adds "hi" to the file.
    local content = file(".newfile", r) -- Reads the file and returns it.

  • 2.6 - Limitations

    file() can't operate with multiple unnamed tables, something that will definetly change in the next update.

Using the functions

  • 3.1 - autoimport(file) to automatically import files.
>> autoimport(filex) -- Added "filex" to the importing table, but autoimport is still off.
------------------------------
>> autoimport(filex, true) -- Now it's also activated
> Set autoimport to true
------------------------------
>> autoimport(true)
> Set autoimport to true
>> autoimport(false)
> Set autoimport to false
>> autoimport(false) -- Won't print twice, only when changing states
> 
  • 3.2 - file(file, act, v, t) manages the file system (fs).
>> file("file", w, "hello") -- If it doesn't exist, it will ask if you want to create it.
> File doesn't exist, Create one? (y/n)
> y
>
-----------------------------
>> file("file", c) -- Creates the file if it doesn't exists.
>> file("file", c) -- Cleans the file if it exists.
>> file("file", w, "hello") -- Writes "hello" in the file.
>> local content = file("file", r) -- Reads the file.
...

Note:

>> The file system still got much room to development.

Loaded libraries system changed.

release16 апреля 2026 г.

loadedlibs() system changed!

1.1 - System remake.

Previously, loadedlibs() would gather data from a simple table. Now, the table is stored in a file using fs. Now you are able to unload imported libs from past sections.

1.2 - Optimization.

The system isn't as optimized as it could be, so expect an optimization for upcoming updates.

loader.lua changes

2.1 - import() changes.

Using "import()" now loads all files from the repo. Make sure to verify if stablecheck is set to true. If it is, the function will only import files ended in "S".

2.2 - Tiny changes.

Added colors to some functions such as unload().

Bugs fixed

3.1 - loadedlibs() still showing deleted libraries.

When unloading libraries, loadedlibs() would still show them as loaded.

Using the functions

4.1 - import() now loads all files at once.

>> import(OptLib)
> Success! Imported OptLib V1.3.1
--------------------------------------
>> import()
> Success! Imported Optlib V1.3.1
> Success! Imported BetterStrings V1.2

-- Note: Imported all the files from luiplib repo ended in "S".

Note:

>> Install Global Packs if you didn't!!

New loading system in V0.4 Beta

beta11 апреля 2026 г.

Loading System remake!

1.1 - Previously, libraries would be imported into loadedlib.lua file. Now, each library has its own file.

loader.lua changes

2.1 - New function, unload(lib).

You can now unload libraries that are registred in loadedlibs() table (every imported library should be registred).

2.2 - Changes to loadedlibs() function.

helpcmd file is no longer shown in loadedlibs table.

2.3 - Changes to reimport(lib) function.

You can now choose which library to reimport.

2.4 - Commands usage.

rootcmds and libraries are now usable outside LUA.

2.5 - Text in startup.

A text is now shown in startup.

Using the functions

3.1 - unload(lib) unloads imported libraries.

-----------------------------------
>> import(OptLib)
> Success! Imported Optlib V1.3.1
>> unload(Optlib)
> Unloaded OptLib
-----------------------------------
>> import(OptLib)
> Success! Imported Optlib V1.3.1
>> import(BetterStrings)
> Success! Imported BetterStrings V1.2
>> unload()
> Unloaded OptLib
> Unloaded BetterStrings

3.2 - reimport(lib) reimports a specific library.

-----------------------------------
>> import(OptLib)
> Success! Imported Optlib V1.3.1
>> import(BetterStrings)
> Success! Imported BetterStrings V1.2
>> reimport(OptLib)
> Success! Imported Optlib V1.3.1
-----------------------------------
>> import(OptLib)
> Success! Imported Optlib V1.3.1
>> import(BetterStrings)
> Success! Imported BetterStrings V1.2
>> reimport()
> Success! Imported Optlib V1.3.1
> Success! Imported BetterStrings V1.2

Note:

>> This is Beta version, some bugs are expected.

>> For those who previously installed the datapack: Sorry, I forgot to add the Global Packs dependency. The datapack should work correctly now.

Import your library!

release2 апреля 2026 г.

Import your library!

1.1 - New function, setrepo(creator, repo, Scheck, branch).

Usage: Set your own repository! Unfortunately, you must set it in every different computer. Maybe I can figure out a way to apply the change to every computer, who knows?

1.2 - Inside your library:

Create "vers" variable and write the library's version. /Ex: vers = "1.0x"/

loader.lua changes

2.1 - New function, set(var, bool).

Usage: Set a boolean state for an existing or non-existing variable.

2.2 - New function, loadedlibs().

Usage: Show every currently loaded library.

Using the functions

3.1 - setrepo(creator, repo, Scheck, branch) sets a new repository for import().

setrepo("userx", "libx") -- Maps every file inside the repository.
----------------------------------
setrepo("userx", "libx", true) -- Maps every file that ends in "S" inside the repository.
----------------------------------
setrepo("userx", "libx", true, "alt") -- Maps every file that ends in "S" inside the branch "alt".
----------------------------------
setrepo() -- Back to the default repository.

3.2 - set(var, bool) creates or modifies a boolean.

set("random", true)
> defined to true
print(random)
> true
> 1

To mention:

Use rootcmds() to see every root command explanation.

Use helplib([lib]) to see every command inside a library.

Совместимость

Minecraft: Java Edition

24w35a1.21.x1.20.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Детали

Лицензия:MIT
Опубликован:1 месяц назад
Обновлён:3 дня назад
Главная