Skip to content

Commit

Permalink
Merge branch 'master' into precompiling
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 authored Mar 14, 2024
2 parents c4f2f8c + e06f7ec commit 1a0e4e5
Show file tree
Hide file tree
Showing 141 changed files with 12,051 additions and 2,151 deletions.
14 changes: 14 additions & 0 deletions addon.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
configurations {
lsp4j
implementation.extendsFrom(lsp4j)
}

jar {
from provider {
configurations.lsp4j.collect {
it.isDirectory() ? it : zipTree(it)
}
}, {
exclude 'META-INF', 'META-INF/**', 'about*.html'
}
}
46 changes: 38 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
dependencies {
embed "org.apache.groovy:groovy:${project.groovy_version}"

// TODO: check if there is anything to exclude
embed "io.github.classgraph:classgraph:4.8.165"

lsp4j("org.eclipse.lsp4j:org.eclipse.lsp4j:0.20.1") {
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'com.google.code.gson', module: 'gson'
}
lsp4j("org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.20.1") {
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'com.google.code.gson', module: 'gson'
}

compileOnly rfg.deobf('curse.maven:packmode-278398:2567799')
if (project.debug_packmode.toBoolean()) {
runtimeOnly rfg.deobf('curse.maven:packmode-278398:2567799')
Expand All @@ -36,13 +48,29 @@ dependencies {
runtimeOnly rfg.deobf('curse.maven:avaritia_1_10-261348:3143349')
}

compileOnly rfg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465")
compileOnly rfg.deobf("curse.maven:alchemylib-293426:2761706")
compileOnly rfg.deobf("curse.maven:alchemistry-293425:3186612")
if (project.debug_alchemistry.toBoolean()) {
runtimeOnly rfg.deobf('curse.maven:shadowfacts-forgelin-248453:2785465')
runtimeOnly rfg.deobf('curse.maven:alchemylib-293426:2761706')
runtimeOnly rfg.deobf('curse.maven:alchemistry-293425:3186612')
}

compileOnly rfg.deobf("curse.maven:ctm-267602:2915363")
compileOnly rfg.deobf("curse.maven:chisel-235279:2915375")
if (project.debug_chisel.toBoolean()) {
runtimeOnly rfg.deobf('curse.maven:ctm-267602:2915363')
runtimeOnly rfg.deobf('curse.maven:chisel-235279:2915375')
}

compileOnly rfg.deobf('curse.maven:bwm-suite-246760:3289033')
compileOnly rfg.deobf('curse.maven:bwm-core-294335:2624990')
if (project.debug_better_with_mods.toBoolean()) {
runtimeOnly rfg.deobf('curse.maven:bwm-suite-246760:3289033')
runtimeOnly rfg.deobf('curse.maven:bwm-core-294335:2624990')
}

compileOnly rfg.deobf('curse.maven:mantle-74924:2713386')
if (project.debug_inspirations.toBoolean() || project.debug_tinkers.toBoolean()) {
runtimeOnly rfg.deobf('curse.maven:mantle-74924:2713386')
Expand Down Expand Up @@ -214,14 +242,10 @@ dependencies {
}

compileOnly 'com.enderio:endercore:0.5.78'
compileOnly('crazypants:enderio:5.3.72') {
transitive = false
}
compileOnly 'crazypants:enderio:5.3.72'
if (project.debug_enderio.toBoolean()) {
runtimeOnly 'com.enderio:endercore:0.5.78'
runtimeOnly('crazypants:enderio:5.3.72') {
transitive = false
}
runtimeOnly 'crazypants:enderio:5.3.72'
}

compileOnly rfg.deobf('curse.maven:forestry-59751:2918418')
Expand All @@ -235,6 +259,11 @@ dependencies {
runtimeOnly rfg.deobf('curse.maven:advancedmortars-283777:2780626')
}

compileOnly rfg.deobf('curse.maven:aether-255308:3280119')
if (project.debug_aether.toBoolean()) {
runtimeOnly rfg.deobf('curse.maven:aether-255308:3280119')
}

compileOnly rfg.deobf('curse.maven:pyrotech-306676:4956838')
compileOnly rfg.deobf('curse.maven:athenaeum-284350:4633750')

Expand All @@ -243,8 +272,6 @@ dependencies {
runtimeOnly rfg.deobf('curse.maven:pyrotech-306676:4956838')
runtimeOnly rfg.deobf("curse.maven:dropt-284973:3758733")
}


}

minecraft {
Expand All @@ -253,4 +280,7 @@ minecraft {
if (project.debug_use_examples_folder.toBoolean()) {
extraRunJvmArguments.add('-Dgroovyscript.use_examples_folder=true')
}
if (project.debug_run_ls.toBoolean()) {
extraRunJvmArguments.add('-Dgroovyscript.run_ls=true')
}
}
9 changes: 9 additions & 0 deletions editors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Supported editors

- Visual Studio Code

# TODO:

- IntelliJ IDEA via [lsp4intellij](https://github.com/ballerina-platform/lsp4intellij)
or [lsp4ij](https://github.com/redhat-developer/lsp4ij)
- helix + vim via `netcat`
5 changes: 5 additions & 0 deletions editors/vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
out
dist
node_modules
.vscode-test/
*.vsix
21 changes: 21 additions & 0 deletions editors/vscode/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"name": "Launch Extension",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm",
"request": "launch",
"type": "extensionHost"
}

]
}
10 changes: 10 additions & 0 deletions editors/vscode/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"json.schemas": [
{
"fileMatch": [
"*.snippets.json"
],
"url": "vscode://schemas/global-snippets"
}
]
}
13 changes: 13 additions & 0 deletions editors/vscode/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": [],
"label": "npm",
"detail": "npm run build-base -- --sourcemap"
}
]
}
6 changes: 6 additions & 0 deletions editors/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**
!out/main.js
!package-lock.json
!package.json
!README.md
!logo.png
32 changes: 32 additions & 0 deletions editors/vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# GroovyScript

This is the official VSC extension for the Minecraft 1.12.2 mod [GroovyScript](https://github.com/CleanroomMC/GroovyScript).
It allows VSC to connect to a running minecraft instance with a groovy folder and provide various tools for writing
scripts like auto-completion and hover info.

## Getting Started
First you need to start the language server. Then you can connect VSC.
### Starting the language Server
There are two ways to do that.
1. Adding `-Dgroovyscript.run_ls=true` to the JVM arguments in your preferred launcher and start Minecraft with GroovyScript.
You will be able to connect VSC as soon as GroovyScript start running `preInit` scripts.
2. By starting Minecraft and GroovyScript and running `/grs runLS` command. Obviously you need to load into a world for that.

You can check if the server started by checking for a `Starting Language server` message in the groovy log.

By default, the language server is started with a port of `25564`. It must be the same as the port in the VSC extension,
which is configurable.

### Connect VSC
1. Open VSC (skip if already open)
2. Install GroovyScript extension (skip if already installed)
3. Open the instance folder or groovy folder of a modpack in VSC
4. If you just opened VSC, it should auto connect. Otherwise, run the `GroovyScript: Reconnect` command.
5. Done

At the bottom right in the status bar is a thumbs up/down emoji. This indicates the server connection status.

That's it. The important part is that Minecraft needs to be running and the language server is started.
Note that minecraft has higher memory and cpu usage while the language server is running.

Happy scripting :)
Binary file added editors/vscode/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1a0e4e5

Please sign in to comment.