diff --git a/jsconfig.json b/jsconfig.json index 292115b..208b94c 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -9,18 +9,6 @@ "noImplicitAny": true, "esModuleInterop": true, "moduleResolution": "bundler", - "forceConsistentCasingInFileNames": true, - "rootDirs": [ - "src/server_scripts", - "src/startup_scripts", - "src/client_scripts", - "src/lib" - ], - "typeRoots": [ - "./types/probe/user", - "./types/probe/generated", - "./types/probe/generated/internals" - ] - }, - "include": ["./src/**/*.js", "./types/**/*.d.ts"] + "forceConsistentCasingInFileNames": true + } } diff --git a/src/assets/kubejs/lang/en_us.json b/src/assets/kubejs/lang/en_us.json new file mode 100644 index 0000000..9310ddf --- /dev/null +++ b/src/assets/kubejs/lang/en_us.json @@ -0,0 +1,5 @@ +{ + "block.kubejs.c4_target": "C4 Target Block", + "block.kubejs.c4": "C4", + "item.kubejs.c4_item": "C4" +} diff --git a/src/assets/kubejs/lang/zh_cn.json b/src/assets/kubejs/lang/zh_cn.json new file mode 100644 index 0000000..9310ddf --- /dev/null +++ b/src/assets/kubejs/lang/zh_cn.json @@ -0,0 +1,5 @@ +{ + "block.kubejs.c4_target": "C4 Target Block", + "block.kubejs.c4": "C4", + "item.kubejs.c4_item": "C4" +} diff --git a/src/startup_scripts/C4.js b/src/startup_scripts/C4.js index ecd87ad..8708929 100644 --- a/src/startup_scripts/C4.js +++ b/src/startup_scripts/C4.js @@ -158,8 +158,7 @@ StartupEvents.registry("block", (event) => { .create("c4_target") // Create a new block .soundType(SoundType.WOOD) // Set a material (affects the sounds and some properties) .unbreakable() - .textureAll("minecraft:block/target_top") - .displayName(/** @type {any} */ ("C4 Target Block")); // Set a custom name + .textureAll("minecraft:block/target_top"); }); StartupEvents.registry("block", (event) => { @@ -171,8 +170,7 @@ StartupEvents.registry("block", (event) => { .noItem() // Player cannot hold or place the item .noDrops() .noCollision() // Set no hitbox - .textureAll("minecraft:block/tnt_top") - .displayName(/** @type {any} */ ("C4")); // Set a custom name + .textureAll("minecraft:block/tnt_top"); }); // ==================== Item Registration ==================== @@ -231,8 +229,7 @@ StartupEvents.registry("item", (event) => { itemstack.resetHoverName(); if (!entity.isPlayer() || entity.uuid === undefined) return; delete lastPlayerInfoMap[entity.uuid.toString()]; - }) - .displayName(/** @type {any} */ ("C4")); + }); }); // ==================== Client Side Logic ==================== @@ -346,7 +343,7 @@ function handleC4UseStarted(event) { * @param {C4ActivatedEvent} event */ function handleC4Activated(event) { - const server = Utils.server; + const server = Utils.getServer(); if (server === null) { console.error("C4 Handler: Server is not available"); return; diff --git a/src/startup_scripts/jsconfig.json b/src/startup_scripts/jsconfig.json new file mode 100644 index 0000000..46c8f1a --- /dev/null +++ b/src/startup_scripts/jsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://www.schemastore.org/jsconfig.json", + "extends": "../../jsconfig.json", + "compilerOptions": { + "typeRoots": ["../../types/probe/startup/probe-types/"] + }, + "include": ["./**/*", "../../types/*.d.ts"] +} diff --git a/types/EventBus.d.ts b/types/EventBus.d.ts index b1b7af9..87cb396 100644 --- a/types/EventBus.d.ts +++ b/types/EventBus.d.ts @@ -10,7 +10,6 @@ interface C4UseStartedEvent { */ interface C4ActivatedEvent { level: Internal.Level; - blockPos: { x: number; y: number; z: number }; player: Internal.Player; explosionTime: number; explosionPower: number;