From 80f23fe7d3992263a9280efc0cf13dd652952c0a Mon Sep 17 00:00:00 2001 From: hypercross Date: Sun, 30 Nov 2025 11:43:11 +0800 Subject: [PATCH] feat: kubejs basics --- .gitignore | 6 ++++++ kubejs/README.txt | 15 +++++++++++++++ kubejs/client_scripts/jsconfig.json | 20 ++++++++++++++++++++ kubejs/server_scripts/jsconfig.json | 20 ++++++++++++++++++++ kubejs/startup_scripts/jsconfig.json | 20 ++++++++++++++++++++ 5 files changed, 81 insertions(+) create mode 100644 kubejs/README.txt create mode 100644 kubejs/client_scripts/jsconfig.json create mode 100644 kubejs/server_scripts/jsconfig.json create mode 100644 kubejs/startup_scripts/jsconfig.json diff --git a/.gitignore b/.gitignore index 0e8e3b5..86bfa5b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,9 @@ modernfix/ saves/ resourcepacks/ shaderpacks/ + +# kubejs dev shit +.probe +.vscode +rhino.local.properties +local diff --git a/kubejs/README.txt b/kubejs/README.txt new file mode 100644 index 0000000..5cf0fdf --- /dev/null +++ b/kubejs/README.txt @@ -0,0 +1,15 @@ +Find out more info on the website: https://kubejs.com/ + +Directory information: + +assets - Acts as a resource pack, you can put any client resources in here, like textures, models, etc. Example: assets/kubejs/textures/item/test_item.png +data - Acts as a datapack, you can put any server resources in here, like loot tables, functions, etc. Example: data/kubejs/loot_tables/blocks/test_block.json + +startup_scripts - Scripts that get loaded once during game startup - Used for adding items and other things that can only happen while the game is loading (Can be reloaded with /kubejs reload_startup_scripts, but it may not work!) +server_scripts - Scripts that get loaded every time server resources reload - Used for modifying recipes, tags, loot tables, and handling server events (Can be reloaded with /reload) +client_scripts - Scripts that get loaded every time client resources reload - Used for JEI events, tooltips and other client side things (Can be reloaded with F3+T) + +config - KubeJS config storage. This is also the only directory that scripts can access other than world directory +exported - Data dumps like texture atlases end up here + +You can find type-specific logs in logs/kubejs/ directory \ No newline at end of file diff --git a/kubejs/client_scripts/jsconfig.json b/kubejs/client_scripts/jsconfig.json new file mode 100644 index 0000000..0203d61 --- /dev/null +++ b/kubejs/client_scripts/jsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "ES2015", + "lib": [ + "ES5", + "ES2015" + ], + "rootDir": "./src", + "typeRoots": [ + "../../.probe/client/probe-types" + ], + "baseUrl": "../../.probe/client/probe-types", + "skipLibCheck": true + }, + "include": [ + "./src/**/*", + null + ] +} \ No newline at end of file diff --git a/kubejs/server_scripts/jsconfig.json b/kubejs/server_scripts/jsconfig.json new file mode 100644 index 0000000..ace5557 --- /dev/null +++ b/kubejs/server_scripts/jsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "ES2015", + "lib": [ + "ES5", + "ES2015" + ], + "rootDir": "./src", + "typeRoots": [ + "../../.probe/server/probe-types" + ], + "baseUrl": "../../.probe/server/probe-types", + "skipLibCheck": true + }, + "include": [ + "./src/**/*", + null + ] +} \ No newline at end of file diff --git a/kubejs/startup_scripts/jsconfig.json b/kubejs/startup_scripts/jsconfig.json new file mode 100644 index 0000000..a97546a --- /dev/null +++ b/kubejs/startup_scripts/jsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "ES2015", + "lib": [ + "ES5", + "ES2015" + ], + "rootDir": "./src", + "typeRoots": [ + "../../.probe/startup/probe-types" + ], + "baseUrl": "../../.probe/startup/probe-types", + "skipLibCheck": true + }, + "include": [ + "./src/**/*", + null + ] +} \ No newline at end of file