Skip to content

Commit 5c4d846

Browse files
authored
Merge pull request #19 from astorks/dev
Dev -> Master v1.1.10
2 parents 040a72e + a87343c commit 5c4d846

37 files changed

+733
-480
lines changed

.github/workflows/build-dev.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build Dev
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Set up JDK 1.8
12+
uses: actions/setup-java@v1
13+
with:
14+
java-version: 1.8
15+
- name: Set up Node.js 12.14.1
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12.14.1
19+
- name: Fix gradlew permissions
20+
run: chmod +x ./gradlew
21+
- name: Export TypeScript Libraries with Gradle
22+
run: ./gradlew :ScriptableMC-Tools-TS:exportTypeScriptLibraries
23+
- name: Compile TypeScript libraries and create archives
24+
run: |
25+
cd ./ScriptableMC-Tools-TS/lib/
26+
npm install
27+
npm run compile
28+
cd ./ts/
29+
zip -r ../ScriptableMC-TypeScript-Lib.zip ./*
30+
cd ../js/
31+
zip -r ../ScriptableMC-JavaScript-Lib.zip ./*
32+
cd ../
33+
cp ./ScriptableMC-JavaScript-Lib.zip ../../ScriptableMC-Engine-JS/src/main/resources/libraries.zip
34+
- name: Build JS Engine with Gradle
35+
run: ./gradlew :ScriptableMC-Engine-JS:shadowJar
36+
- name: Copy artifacts
37+
run: |
38+
mkdir artifacts
39+
cp ./ScriptableMC-Engine-JS/build/libs/ScriptableMC-Engine-JS.jar ./artifacts/
40+
cp ./ScriptableMC-Tools-TS/lib/ScriptableMC-TypeScript-Lib.zip ./artifacts/
41+
cp ./ScriptableMC-Tools-TS/lib/ScriptableMC-JavaScript-Lib.zip ./artifacts/
42+
- uses: actions/upload-artifact@v1
43+
with:
44+
name: ScriptableMC-Engine-DEV
45+
path: artifacts/

.github/workflows/build.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,35 @@ jobs:
1818
- name: Fix gradlew permissions
1919
run: chmod +x ./gradlew
2020
- name: Export TypeScript Libraries with Gradle
21-
run: ./gradlew exportTypeScriptLibraries
22-
- name: Compile TypeScript libraries and create archives for release
21+
run: ./gradlew :ScriptableMC-Tools-TS:exportTypeScriptLibraries
22+
- name: Compile TypeScript libraries and create archives
2323
run: |
24-
cd ./lib/
24+
cd ./ScriptableMC-Tools-TS/lib/
2525
npm install
2626
npm run compile
2727
cd ./ts/
2828
zip -r ../ScriptableMC-TypeScript-Lib.zip ./*
2929
cd ../js/
3030
zip -r ../ScriptableMC-JavaScript-Lib.zip ./*
31-
cd ../../
32-
cp ./lib/ScriptableMC-JavaScript-Lib.zip ./src/main/resources/libraries.zip
33-
- name: Build with Gradle
34-
run: ./gradlew shadowJar
35-
- name: Upload Plugin Jar
31+
cd ../
32+
cp ./ScriptableMC-JavaScript-Lib.zip ../../ScriptableMC-Engine-JS/src/main/resources/libraries.zip
33+
- name: Build JS Engine with Gradle
34+
run: ./gradlew :ScriptableMC-Engine-JS:shadowJar
35+
- name: Upload JS Engine Plugin Jar
3636
uses: skx/github-action-publish-binaries@master
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
with:
40-
args: 'build/libs/ScriptableMC.jar'
40+
args: 'ScriptableMC-Engine-JS/build/libs/ScriptableMC-Engine-JS.jar'
4141
- name: Upload TypeScript Libraries
4242
uses: skx/github-action-publish-binaries@master
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545
with:
46-
args: 'lib/ScriptableMC-TypeScript-Lib.zip'
46+
args: 'ScriptableMC-Tools-TS/lib/ScriptableMC-TypeScript-Lib.zip'
4747
- name: Upload JavaScript Libraries
4848
uses: skx/github-action-publish-binaries@master
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151
with:
52-
args: 'lib/ScriptableMC-JavaScript-Lib.zip'
52+
args: 'ScriptableMC-Tools-TS/lib/ScriptableMC-JavaScript-Lib.zip'

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/astorks/ScriptableMC-Engine?label=ScriptableMC&style=for-the-badge)](https://github.com/astorks/ScriptableMC-Engine/releases/latest)
44
[![SpigotMC Resource](https://img.shields.io/badge/SpigotMC-Resource-yellow?style=for-the-badge)](https://www.spigotmc.org/resources/scriptablemc-engine.74690/)
55

6-
Run JavaScript/TypeScript plugins for Bukkit/Spigot/Paper Minecraft 1.15 using the GraalJS script engine.
6+
Run JavaScript/TypeScript plugins for Minecraft 1.15 using the GraalJS script engine.<br />
7+
Supported Minecraft Versions: Bukkit/Spigot/Paper 1.12, 1.13, 1.14, **1.15**<br />
8+
Untested but should work: 1.8+
79

810
**This plugin is in a preview state, there may be breaking changes, missing features, and possibly a few bugs.**<br >
911
Feel free to create an issue if you find any missing features, bugs, or just have an idea for a great feature to add.
@@ -20,13 +22,24 @@ GraalVM-CE is a free open source java runtime created by Oracle that is pre-pack
2022
You can take the typescript example and compile it, then directly modify the javascript if you don't want to use typescript.
2123

2224
## Commands and Permissions
25+
##### ScritableMC Base Command
26+
| Command | Alias | Description | Permission |
27+
| ------------- | ------------- |-----------------------------------------------------| ------------------------ |
28+
| `/scriptablemc menu` | `/smc m` | Opens an inventory menu that allows you to control the scriptable engine. | `scriptablemc.menu` |
29+
| `/scriptablemc info` | `/smc i` | Prints plugin version and GraalVM/GraalJS versions if available. | `scriptablemc.info` |
30+
| `/scriptablemc reload` | `/smc rl` | Fully reloads all script engines. | `scriptablemc.reload` |
31+
| `/scriptablemc version` | `/smc v` | Check the github releases for any updates. | `scriptablemc.version` |
32+
33+
##### ScritableMC JavaScript Sub Command
2334
| Command | Alias | Description | Permission |
2435
| ------------- | ------------- |-----------------------------------------------------| ------------------------ |
2536
| `/scriptablemc reload` | `/smc rl /jsrl` | Fully reloads the script engine and all script files. | `scriptablemc.reload` |
2637
| `/scriptablemc javascript execute <source>` | `/smc js ex <source>` | Executes javascript source and prints the return value. | `scriptablemc.js.execute` |
38+
| `/scriptablemc javascript execute stash` | `/smc js ex stash` | Executes javascript source stored in your stash. | `scriptablemc.js.execute` |
2739
| `/scriptablemc javascript file <filePath>` | `/smc js f <filePath>` | Executes javascript file from the scripts folder. | `scriptablemc.js.execute.file` |
28-
| `/scriptablemc menu` | `/smc menu` | Opens an inventory menu that allows you to control the scriptable engine. | `scriptablemc.menu` |
29-
| `/scriptablemc info` | `/smc info` | Prints plugin version and GraalVM/GraalJS versions if available. | `scriptablemc.info` |
40+
| `/scriptablemc javascript stash` | `/smc js st` | Prints all stored javascript lines in your stash. | `scriptablemc.js.execute` |
41+
| `/scriptablemc javascript stash <source>` | `/smc js st <source>` | Adds a line to your javascript stash. | `scriptablemc.js.execute` |
42+
| `/scriptablemc javascript stash clear` | `/smc js st clear` | Clears your javascript stash. | `scriptablemc.js.execute` |
3043

3144
### `/smc javascript execute` Command Example
3245
> `/jsex return 1 + 1` <br>
@@ -37,6 +50,8 @@ You can take the typescript example and compile it, then directly modify the jav
3750
3851

3952
### Third Party Libraries
40-
https://github.com/MinusKube/SmartInvs - Inventory menu library<br />
53+
https://github.com/MinusKube/SmartInvs - Inventory helper library<br />
54+
https://github.com/lucko/helper - MinecraftVersions helper library<br />
55+
https://github.com/jkcclemens/khttp - HTTP helper library<br />
4156
https://github.com/aikar/commands - Built-in commands and auto-completion<br />
4257
https://github.com/graalvm/graaljs - JavaScript engine
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
plugins {
2+
java
3+
id("org.jetbrains.kotlin.jvm") version "1.3.61"
4+
id("com.github.johnrengelman.shadow") version "5.2.0"
5+
id("org.jetbrains.gradle.plugin.idea-ext") version "0.7"
6+
}
7+
8+
group = "com.pixlfox.scriptablemc"
9+
version = "1.1.10"
10+
11+
java {
12+
sourceCompatibility = JavaVersion.VERSION_1_8
13+
targetCompatibility = JavaVersion.VERSION_1_8
14+
}
15+
16+
17+
idea {
18+
module {
19+
isDownloadJavadoc = true
20+
isDownloadSources = true
21+
}
22+
}
23+
24+
repositories {
25+
mavenCentral()
26+
jcenter()
27+
maven {
28+
name = "JitPack"
29+
url = uri("https://jitpack.io")
30+
}
31+
maven {
32+
name = "spigotmc"
33+
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
34+
}
35+
maven {
36+
name = "spigotmc nexus"
37+
url = uri("https://hub.spigotmc.org/nexus/content/repositories/sonatype-nexus-snapshots/")
38+
}
39+
maven {
40+
name = "minecraft"
41+
url = uri("https://libraries.minecraft.net")
42+
}
43+
maven {
44+
name = "papermc"
45+
url = uri("https://papermc.io/repo/repository/maven-public/")
46+
}
47+
maven {
48+
name = "placeholderapi"
49+
url = uri("http://repo.extendedclip.com/content/repositories/placeholderapi/")
50+
}
51+
maven {
52+
name = "aikar-acf"
53+
url = uri("https://repo.aikar.co/content/groups/aikar/")
54+
}
55+
}
56+
57+
dependencies {
58+
// GraalVM SDK & GraalJS Engine
59+
implementation("org.graalvm.sdk:graal-sdk:19.3.1")
60+
implementation("org.graalvm.js:js:19.3.1")
61+
implementation("org.graalvm.js:js-scriptengine:19.3.1")
62+
implementation("org.graalvm.truffle:truffle-api:19.3.1")
63+
64+
implementation("com.github.jkcclemens:khttp:-SNAPSHOT")
65+
compileOnly("org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT")
66+
implementation("co.aikar:acf-paper:0.5.0-SNAPSHOT")
67+
implementation("fr.minuskube.inv:smart-invs:1.2.7")
68+
compileOnly("me.clip:placeholderapi:2.10.4")
69+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
70+
71+
testImplementation("junit", "junit", "4.12")
72+
}
73+
74+
tasks.compileKotlin {
75+
kotlinOptions.jvmTarget = "1.8"
76+
kotlinOptions.javaParameters = true
77+
}
78+
tasks.compileTestKotlin {
79+
kotlinOptions.jvmTarget = "1.8"
80+
kotlinOptions.javaParameters = true
81+
}
82+
83+
tasks.jar {
84+
85+
}
86+
87+
tasks.shadowJar {
88+
archiveFileName.set("ScriptableMC-Engine-JS.jar")
89+
relocate("co.aikar.commands", "com.pixlfox.scriptablemc.acf")
90+
mergeServiceFiles()
91+
}
57.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Thu Jan 23 21:43:03 MST 2020
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip

src/main/java/com/smc/version/MinecraftVersion.java renamed to ScriptableMC-Engine-JS/src/main/java/com/smc/version/MinecraftVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public final class MinecraftVersion implements Comparable<MinecraftVersion> {
5252
/**
5353
* The newest known version of Minecraft
5454
*/
55-
private static final String NEWEST_MINECRAFT_VERSION = "1.13.1";
55+
private static final String NEWEST_MINECRAFT_VERSION = "1.15.2";
5656

5757
/**
5858
* The date (with ISO 8601 or YYYY-MM-DD) when the most recent version was released.
5959
*/
60-
private static final String MINECRAFT_LAST_RELEASE_DATE = "2018-08-22";
60+
private static final String MINECRAFT_LAST_RELEASE_DATE = "2020-01-21";
6161

6262
/**
6363
* Gets the {@link MinecraftVersion} of the runtime server.

0 commit comments

Comments
 (0)