Skip to content

Commit 6b54c74

Browse files
committed
Skip private fields in Lua generator
A lot of the newer Paper and Adventure API have public methods the same name as private fields and the Lua LS doesn't know how to deal with a field the same name as a method
1 parent 1c285c2 commit 6b54c74

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/kotlin/generator/LuaEmitter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class LuaEmitter {
1919

2020
// Process fields (variables)
2121
parsedClass.fields.forEach { field ->
22+
// Skip private fields
23+
if (field.visibility == Visibility.PRIVATE) return@forEach
2224
sb.appendLine(
2325
"---@field ${
2426
field.visibility.toString().lowercase()

0 commit comments

Comments
 (0)