Skip to content

Commit 381bf2d

Browse files
authored
Create README.md
1 parent 86f0f2e commit 381bf2d

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Lua Stub Generator
2+
3+
A Kotlin-based tool to generate Lua stub files with LuaLS annotations (Teal type defintions planned) from Java source or compiled JARs. Designed for use with [LuaLink](https://github.com/LuaLink/LuaLink).
4+
5+
## Features
6+
7+
- Parses both source and compiled JARs
8+
- Supports LuaLS Teal-style annotations
9+
- Extracts method signatures, field types, and class documentation
10+
- Processes Javadoc comments
11+
- Outputs structured Lua files for use with IDEs and Lua tooling
12+
13+
## Usage
14+
15+
```bash
16+
java -jar lua-stubgen.jar path/to/jar/paper.jar path/to/jar/adventure.jar...
17+
```
18+
19+
# Example output of Bukkit `Player` from Paper sources JAR
20+
```lua
21+
--- Represents a player, connected or not
22+
-- org.bukkit.entity.Player
23+
---@class Player
24+
local Player = {}
25+
26+
---@return Identity
27+
--- Paper start
28+
function Player:identity() end
29+
30+
---@return BossBar>
31+
--- Gets an unmodifiable view of all known currently active bossbars. This currently only returns bossbars shown to the player via #showBossBar(net.kyori.adventure.bossbar.BossBar) and does not contain bukkit org.bukkit.boss.BossBar instances shown to the player.
32+
function Player:activeBossBars() end
33+
34+
---@return Component
35+
--- Gets the "friendly" name to display of this player.
36+
function Player:displayName() end
37+
38+
---@param displayName? Component
39+
---@return nil
40+
--- Sets the "friendly" name to display of this player.
41+
function Player:displayName(displayName) end
42+
43+
---@return string
44+
function Player:getName() end
45+
46+
---@deprecated
47+
---@return string
48+
--- Gets the "friendly" name to display of this player. This may include color. Note that this name will not be displayed in game, only in chat and places defined by plugins.
49+
function Player:getDisplayName() end
50+
51+
---@deprecated
52+
---@param name string
53+
---@return nil
54+
--- Sets the "friendly" name to display of this player. This may include color. Note that this name will not be displayed in game, only in chat and places defined by plugins.
55+
function Player:setDisplayName(name) end
56+
57+
---@param name? Component
58+
---@return nil
59+
--- Sets the name that is shown on the in-game player list. If the value is null, the name will be identical to #getName().
60+
function Player:playerListName(name) end
61+
```

0 commit comments

Comments
 (0)