Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n1ghtthef0x/figura-ts
Lua Types for the Minecraft Mod Figura
https://github.com/n1ghtthef0x/figura-ts
figura lua minecraft types typescript typescript-to-lua
Last synced: about 1 month ago
JSON representation
Lua Types for the Minecraft Mod Figura
- Host: GitHub
- URL: https://github.com/n1ghtthef0x/figura-ts
- Owner: N1ghtTheF0x
- License: mit
- Created: 2024-12-04T00:26:39.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-04T00:47:27.000Z (about 1 month ago)
- Last Synced: 2024-12-04T01:25:00.586Z (about 1 month ago)
- Topics: figura, lua, minecraft, types, typescript, typescript-to-lua
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/figura-ts
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# figura-ts
Lua Types for the Minecraft Mod [Figura](https://figuramc.org/) with [TypeScriptToLua](https://typescripttolua.github.io/)
## Setup
Install package via any package manager
```sh
npm install -D figura-ts
```Create a `tsconfig.json` with at least these options:
```json
{
"compilerOptions": {
"target": "ESNext",
"lib": ["ESNext"]
},
"tstl": {
"luaTarget": "5.2",
"luaLibImport": "require"
}
}
```Put this line inside the source directory somewhere:
```typescript
///
```Now you can code just like with lua, you can then compile the code with `tstl` and use it
## Limitations
### accessing `LuaEvent` from `events.entity_init`, `events.tick`, etc
In lua you can access the `LuaEvent` object from the lowercase named events but in figura-ts you can only access them from the uppercase named events (`ENTITY_INIT`, `TICK`, etc.)
```typescript
events.entity_init.register(someFunc,someName) // Does not work
events.ENTITY_INIT.register(someFunc,someName) // works
```### creating ping functions
For the time being you have to cast the parameters of your ping function until I figure out how not to do that
```typescript
pings.somePingFunction = function(arg)
{
someFunction(arg as boolean)
}
```## Changelog
- `1.0.0`
- inital version
- `1.0.1`
- finished current GitHub transpile
- renamed some functions/types to fit GitHub code
- fixed some functions/namepspaces## License
This project is licensed under [MIT License](./LICENSE)