mirror of
https://github.com/SikongJueluo/kubejs-utils.git
synced 2026-01-10 08:17:50 +08:00
refactor(project): support probejs v7.0
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
5
src/assets/kubejs/lang/en_us.json
Normal file
5
src/assets/kubejs/lang/en_us.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"block.kubejs.c4_target": "C4 Target Block",
|
||||
"block.kubejs.c4": "C4",
|
||||
"item.kubejs.c4_item": "C4"
|
||||
}
|
||||
5
src/assets/kubejs/lang/zh_cn.json
Normal file
5
src/assets/kubejs/lang/zh_cn.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"block.kubejs.c4_target": "C4 Target Block",
|
||||
"block.kubejs.c4": "C4",
|
||||
"item.kubejs.c4_item": "C4"
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
8
src/startup_scripts/jsconfig.json
Normal file
8
src/startup_scripts/jsconfig.json
Normal file
@@ -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"]
|
||||
}
|
||||
1
types/EventBus.d.ts
vendored
1
types/EventBus.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user