@shirokasoke/webapi-sdk 2.9.0-beta2-0.11-pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +576 -0
- package/dist/client.js +668 -0
- package/dist/esm/client.js +663 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/test.js +6 -0
- package/dist/esm/types/ae2.js +1 -0
- package/dist/esm/types/block.js +1 -0
- package/dist/esm/types/chunk.js +1 -0
- package/dist/esm/types/common.js +1 -0
- package/dist/esm/types/entity.js +1 -0
- package/dist/esm/types/fluid.js +1 -0
- package/dist/esm/types/fmp.js +1 -0
- package/dist/esm/types/gt5.js +1 -0
- package/dist/esm/types/index.js +13 -0
- package/dist/esm/types/item.js +1 -0
- package/dist/esm/types/rawInfo.js +1 -0
- package/dist/esm/types/recipe.js +1 -0
- package/dist/esm/types/threeD.js +1 -0
- package/dist/esm/types/world.js +1 -0
- package/dist/esm/validators/ae2.js +163 -0
- package/dist/esm/validators/block.js +85 -0
- package/dist/esm/validators/chunk.js +58 -0
- package/dist/esm/validators/common.js +28 -0
- package/dist/esm/validators/entity.js +117 -0
- package/dist/esm/validators/fluid.js +24 -0
- package/dist/esm/validators/fmp.js +34 -0
- package/dist/esm/validators/gt5.js +186 -0
- package/dist/esm/validators/index.js +13 -0
- package/dist/esm/validators/item.js +31 -0
- package/dist/esm/validators/rawInfo.js +25 -0
- package/dist/esm/validators/recipe.js +77 -0
- package/dist/esm/validators/threeD.js +34 -0
- package/dist/esm/validators/world.js +59 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +22 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.js +8 -0
- package/dist/types/ae2.d.ts +162 -0
- package/dist/types/ae2.js +2 -0
- package/dist/types/block.d.ts +87 -0
- package/dist/types/block.js +2 -0
- package/dist/types/chunk.d.ts +57 -0
- package/dist/types/chunk.js +2 -0
- package/dist/types/common.d.ts +27 -0
- package/dist/types/common.js +2 -0
- package/dist/types/entity.d.ts +114 -0
- package/dist/types/entity.js +2 -0
- package/dist/types/fluid.d.ts +23 -0
- package/dist/types/fluid.js +2 -0
- package/dist/types/fmp.d.ts +33 -0
- package/dist/types/fmp.js +2 -0
- package/dist/types/gt5.d.ts +210 -0
- package/dist/types/gt5.js +2 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +29 -0
- package/dist/types/item.d.ts +38 -0
- package/dist/types/item.js +2 -0
- package/dist/types/rawInfo.d.ts +25 -0
- package/dist/types/rawInfo.js +2 -0
- package/dist/types/recipe.d.ts +114 -0
- package/dist/types/recipe.js +2 -0
- package/dist/types/threeD.d.ts +43 -0
- package/dist/types/threeD.js +2 -0
- package/dist/types/world.d.ts +58 -0
- package/dist/types/world.js +2 -0
- package/dist/validators/ae2.d.ts +63 -0
- package/dist/validators/ae2.js +169 -0
- package/dist/validators/block.d.ts +12 -0
- package/dist/validators/block.js +91 -0
- package/dist/validators/chunk.d.ts +9 -0
- package/dist/validators/chunk.js +64 -0
- package/dist/validators/common.d.ts +8 -0
- package/dist/validators/common.js +36 -0
- package/dist/validators/entity.d.ts +9 -0
- package/dist/validators/entity.js +123 -0
- package/dist/validators/fluid.d.ts +4 -0
- package/dist/validators/fluid.js +30 -0
- package/dist/validators/fmp.d.ts +4 -0
- package/dist/validators/fmp.js +40 -0
- package/dist/validators/gt5.d.ts +24 -0
- package/dist/validators/gt5.js +192 -0
- package/dist/validators/index.d.ts +13 -0
- package/dist/validators/index.js +29 -0
- package/dist/validators/item.d.ts +13 -0
- package/dist/validators/item.js +37 -0
- package/dist/validators/rawInfo.d.ts +6 -0
- package/dist/validators/rawInfo.js +31 -0
- package/dist/validators/recipe.d.ts +30 -0
- package/dist/validators/recipe.js +83 -0
- package/dist/validators/threeD.d.ts +8 -0
- package/dist/validators/threeD.js +40 -0
- package/dist/validators/world.d.ts +5 -0
- package/dist/validators/world.js +65 -0
- package/package.json +49 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./common";
|
|
2
|
+
export * from "./block";
|
|
3
|
+
export * from "./item";
|
|
4
|
+
export * from "./fluid";
|
|
5
|
+
export * from "./entity";
|
|
6
|
+
export * from "./chunk";
|
|
7
|
+
export * from "./world";
|
|
8
|
+
export * from "./ae2";
|
|
9
|
+
export * from "./fmp";
|
|
10
|
+
export * from "./gt5";
|
|
11
|
+
export * from "./rawInfo";
|
|
12
|
+
export * from "./recipe";
|
|
13
|
+
export * from "./threeD";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
import { ClassInfoSchema } from "./common";
|
|
3
|
+
import { FluidSchema } from "./fluid";
|
|
4
|
+
import { ItemStackSchema } from "./item";
|
|
5
|
+
export const AEStackProvidersSchema = Joi.array().items(Joi.object({
|
|
6
|
+
x: Joi.number().required(),
|
|
7
|
+
y: Joi.number().required(),
|
|
8
|
+
z: Joi.number().required(),
|
|
9
|
+
dimension: Joi.number().required(),
|
|
10
|
+
})).required();
|
|
11
|
+
/** 对应服务端 Pattern.dumpAEStack 的输出:物品或流体堆,附加 stackSize 字段 */
|
|
12
|
+
export const AEStackSchema = Joi.alternatives(ItemStackSchema.append({ stackSize: Joi.number().required() }), FluidSchema.append({ stackSize: Joi.number().required() }));
|
|
13
|
+
export const AEStackWithProvidersSchema = Joi.alternatives(ItemStackSchema.append({
|
|
14
|
+
stackSize: Joi.number().required(),
|
|
15
|
+
providers: AEStackProvidersSchema,
|
|
16
|
+
}), FluidSchema.append({
|
|
17
|
+
stackSize: Joi.number().required(),
|
|
18
|
+
providers: AEStackProvidersSchema,
|
|
19
|
+
}));
|
|
20
|
+
export const AENodeSchema = Joi.object({
|
|
21
|
+
active: Joi.boolean().required(),
|
|
22
|
+
meetsChannel: Joi.boolean().required(),
|
|
23
|
+
playerID: Joi.number().required(),
|
|
24
|
+
machineClass: ClassInfoSchema.optional(),
|
|
25
|
+
isPart: Joi.boolean().required(),
|
|
26
|
+
isIActionHost: Joi.boolean().required(),
|
|
27
|
+
location: Joi.object({
|
|
28
|
+
x: Joi.number().required(),
|
|
29
|
+
y: Joi.number().required(),
|
|
30
|
+
z: Joi.number().required(),
|
|
31
|
+
dimension: Joi.number().required(),
|
|
32
|
+
}).optional(),
|
|
33
|
+
idlePowerUsage: Joi.number().required(),
|
|
34
|
+
flags: Joi.array().items(Joi.string()).required(),
|
|
35
|
+
});
|
|
36
|
+
export const AE2PatternSchema = ItemStackSchema.append({
|
|
37
|
+
crafting: Joi.boolean().required(),
|
|
38
|
+
substitute: Joi.boolean().required(),
|
|
39
|
+
beSubstitute: Joi.boolean().required(),
|
|
40
|
+
author: Joi.string().optional(),
|
|
41
|
+
inputs: Joi.array().items(Joi.alternatives(ItemStackSchema, Joi.valid(null))).optional(),
|
|
42
|
+
outputs: Joi.array().items(Joi.alternatives(ItemStackSchema, Joi.valid(null))).optional(),
|
|
43
|
+
isCraftable: Joi.boolean().optional(),
|
|
44
|
+
priority: Joi.number().optional(),
|
|
45
|
+
canSubstitute: Joi.boolean().optional(),
|
|
46
|
+
canBeSubstitute: Joi.boolean().optional(),
|
|
47
|
+
condensedInputs: Joi.array().items(AEStackSchema).optional(),
|
|
48
|
+
condensedOutputs: Joi.array().items(AEStackSchema).optional(),
|
|
49
|
+
patternParseError: Joi.string().optional(),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* `appeng.util.ScheduledReason` 枚举名。
|
|
53
|
+
* 采用严格枚举校验:取值必须是下方列表中的一项,未知值直接判非法。
|
|
54
|
+
* rv3-beta-1000-GTNH 已知取值:UNDEFINED / SOMETHING_STUCK / BLOCKING_MODE /
|
|
55
|
+
* LOCK_MODE / NO_TARGET / NOT_ENOUGH_INGREDIENTS / SAME_NETWORK / UNSUPPORTED_STACK
|
|
56
|
+
*/
|
|
57
|
+
export const AE_CPU_SCHEDULED_REASONS = [
|
|
58
|
+
"UNDEFINED",
|
|
59
|
+
"SOMETHING_STUCK",
|
|
60
|
+
"BLOCKING_MODE",
|
|
61
|
+
"LOCK_MODE",
|
|
62
|
+
"NO_TARGET",
|
|
63
|
+
"NOT_ENOUGH_INGREDIENTS",
|
|
64
|
+
"SAME_NETWORK",
|
|
65
|
+
"UNSUPPORTED_STACK",
|
|
66
|
+
];
|
|
67
|
+
export const AECPUScheduledReasonSchema = Joi.string()
|
|
68
|
+
.valid(...AE_CPU_SCHEDULED_REASONS)
|
|
69
|
+
.required();
|
|
70
|
+
export const AECPUTaskSchema = Joi.object({
|
|
71
|
+
remaining: Joi.number().required(),
|
|
72
|
+
scheduledReason: AECPUScheduledReasonSchema,
|
|
73
|
+
inputs: Joi.array().items(AEStackSchema).required(),
|
|
74
|
+
pattern: AE2PatternSchema.required(),
|
|
75
|
+
outputs: Joi.array().items(AEStackWithProvidersSchema).required(),
|
|
76
|
+
});
|
|
77
|
+
export const AECPUSchema = Joi.object({
|
|
78
|
+
name: Joi.string().allow("").required(),
|
|
79
|
+
busy: Joi.boolean().required(),
|
|
80
|
+
availableStorage: Joi.number().unsafe().required(),
|
|
81
|
+
usedStorage: Joi.number().required(),
|
|
82
|
+
coProcessors: Joi.number().required(),
|
|
83
|
+
remainingItemCount: Joi.number().required(),
|
|
84
|
+
startItemCount: Joi.number().required(),
|
|
85
|
+
elapsedTime: Joi.number().required(),
|
|
86
|
+
craftingAllowMode: Joi.string().required(),
|
|
87
|
+
waiting: Joi.boolean().required(),
|
|
88
|
+
suspended: Joi.boolean().required(),
|
|
89
|
+
missingMode: Joi.boolean().required(),
|
|
90
|
+
finalOutput: AEStackSchema.optional(),
|
|
91
|
+
waitingForMissing: Joi.array().items(AEStackSchema).optional(),
|
|
92
|
+
tasks: Joi.array().items(AECPUTaskSchema).optional(),
|
|
93
|
+
tasking: Joi.array().items(AEStackWithProvidersSchema).optional(),
|
|
94
|
+
tasksError: Joi.string().optional(),
|
|
95
|
+
});
|
|
96
|
+
export const AEMEInterfaceSchema = Joi.object({
|
|
97
|
+
display: Joi.boolean().required(),
|
|
98
|
+
name: Joi.string().required(),
|
|
99
|
+
rawName: Joi.string().allow(null).required(),
|
|
100
|
+
active: Joi.boolean().required(),
|
|
101
|
+
allowsPatternOptimization: Joi.boolean().required(),
|
|
102
|
+
playerID: Joi.number().required(),
|
|
103
|
+
location: Joi.object({
|
|
104
|
+
x: Joi.number().required(),
|
|
105
|
+
y: Joi.number().required(),
|
|
106
|
+
z: Joi.number().required(),
|
|
107
|
+
dimension: Joi.number().required(),
|
|
108
|
+
}).required(),
|
|
109
|
+
patterns: Joi.array().items(AE2PatternSchema.append({ slot: Joi.number().required() })).required(),
|
|
110
|
+
});
|
|
111
|
+
export const AECraftingTaskBodySchema = Joi.object({
|
|
112
|
+
id: Joi.number().required(),
|
|
113
|
+
Count: Joi.number().required(),
|
|
114
|
+
Type: Joi.string().valid("item", "fluid").optional(),
|
|
115
|
+
Damage: Joi.number().optional(),
|
|
116
|
+
tag: Joi.string().optional(),
|
|
117
|
+
cpu: Joi.string().optional(),
|
|
118
|
+
});
|
|
119
|
+
export const AECraftingTaskResultSchema = Joi.object({
|
|
120
|
+
bytes: Joi.number().required(),
|
|
121
|
+
cpu: Joi.string().required(),
|
|
122
|
+
output: ItemStackSchema.append({ stackSize: Joi.number().required() }).required(),
|
|
123
|
+
});
|
|
124
|
+
export const AECPUCancelBodySchema = Joi.object({
|
|
125
|
+
name: Joi.string().optional(),
|
|
126
|
+
id: Joi.number().optional(),
|
|
127
|
+
});
|
|
128
|
+
export const AECPUCancelResultSchema = Joi.object({
|
|
129
|
+
cpu: Joi.string().required(),
|
|
130
|
+
wasBusy: Joi.boolean().required(),
|
|
131
|
+
});
|
|
132
|
+
export const AEItemStackSchema = Joi.alternatives(ItemStackSchema.append({
|
|
133
|
+
type: Joi.string().valid("item").required(),
|
|
134
|
+
stackSize: Joi.number().required(),
|
|
135
|
+
Craftable: Joi.boolean().required(),
|
|
136
|
+
}), FluidSchema.append({
|
|
137
|
+
type: Joi.string().valid("fluid").required(),
|
|
138
|
+
stackSize: Joi.number().required(),
|
|
139
|
+
Craftable: Joi.boolean().required(),
|
|
140
|
+
}));
|
|
141
|
+
export const AEItemCellStatusSchema = Joi.object({
|
|
142
|
+
all: Joi.number().required(),
|
|
143
|
+
green: Joi.number().required(),
|
|
144
|
+
blue: Joi.number().required(),
|
|
145
|
+
orange: Joi.number().required(),
|
|
146
|
+
red: Joi.number().required(),
|
|
147
|
+
});
|
|
148
|
+
export const AEItemsResultSchema = Joi.object({
|
|
149
|
+
items: Joi.array().items(AEItemStackSchema).required(),
|
|
150
|
+
totalBytes: Joi.number().required(),
|
|
151
|
+
usedBytes: Joi.number().required(),
|
|
152
|
+
totalTypes: Joi.number().required(),
|
|
153
|
+
usedTypes: Joi.number().required(),
|
|
154
|
+
cellStatus: AEItemCellStatusSchema.required(),
|
|
155
|
+
fluidTotalBytes: Joi.number().required(),
|
|
156
|
+
fluidUsedBytes: Joi.number().required(),
|
|
157
|
+
fluidTotalTypes: Joi.number().required(),
|
|
158
|
+
fluidUsedTypes: Joi.number().required(),
|
|
159
|
+
fluidCellStatus: AEItemCellStatusSchema.required(),
|
|
160
|
+
});
|
|
161
|
+
export const AEHitResultSchema = Joi.object({
|
|
162
|
+
message: Joi.string().required(),
|
|
163
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
import { ClassInfoSchema, CoordinatesSchema } from "./common";
|
|
3
|
+
import { ItemStackSchema } from "./item";
|
|
4
|
+
export const MaterialSchema = Joi.object({
|
|
5
|
+
isLiquid: Joi.boolean().required(),
|
|
6
|
+
isSolid: Joi.boolean().required(),
|
|
7
|
+
blocksMovement: Joi.boolean().required(),
|
|
8
|
+
isOpaque: Joi.boolean().required(),
|
|
9
|
+
isFlammable: Joi.boolean().required(),
|
|
10
|
+
isReplaceable: Joi.boolean().required(),
|
|
11
|
+
requiresNoTool: Joi.boolean().required(),
|
|
12
|
+
mobilityFlag: Joi.number().required(),
|
|
13
|
+
isAdventureModeExempt: Joi.boolean().required(),
|
|
14
|
+
});
|
|
15
|
+
export const BlockSchema = Joi.object({
|
|
16
|
+
class: ClassInfoSchema.optional(),
|
|
17
|
+
id: Joi.number().required(),
|
|
18
|
+
registryName: Joi.string().required(),
|
|
19
|
+
unlocalizedName: Joi.string().required(),
|
|
20
|
+
localizedName: Joi.string().required(),
|
|
21
|
+
resistance: Joi.alternatives(Joi.number().unsafe(), Joi.valid("Infinity")).required(),
|
|
22
|
+
lightLevel: Joi.number().required(),
|
|
23
|
+
isOpaqueCube: Joi.boolean().required(),
|
|
24
|
+
isNormalCube: Joi.boolean().required(),
|
|
25
|
+
slipperiness: Joi.number().required(),
|
|
26
|
+
renderType: Joi.number().required(),
|
|
27
|
+
material: MaterialSchema.required(),
|
|
28
|
+
meta: Joi.number().optional(),
|
|
29
|
+
fileName: Joi.string().optional(),
|
|
30
|
+
blockColor: Joi.number().optional(),
|
|
31
|
+
});
|
|
32
|
+
export const BlockDetailSchema = Joi.object({
|
|
33
|
+
block: BlockSchema.append({
|
|
34
|
+
hardness: Joi.number().required(),
|
|
35
|
+
isReplaceable: Joi.boolean().required(),
|
|
36
|
+
isPassable: Joi.boolean().required(),
|
|
37
|
+
}).required(),
|
|
38
|
+
coordinates: CoordinatesSchema.required(),
|
|
39
|
+
metadata: Joi.number().required(),
|
|
40
|
+
isAir: Joi.boolean().required(),
|
|
41
|
+
tileEntity: Joi.object({
|
|
42
|
+
class: ClassInfoSchema.optional(),
|
|
43
|
+
inventorySize: Joi.number().optional(),
|
|
44
|
+
items: Joi.array().items(ItemStackSchema.append({ slot: Joi.number().required() })).optional(),
|
|
45
|
+
}).unknown().optional(),
|
|
46
|
+
});
|
|
47
|
+
export const SetBlockBodySchema = Joi.object({
|
|
48
|
+
id: Joi.number().required(),
|
|
49
|
+
metadataIn: Joi.number().optional(),
|
|
50
|
+
flag: Joi.number().optional(),
|
|
51
|
+
});
|
|
52
|
+
export const SetBlockResultSchema = Joi.valid(null);
|
|
53
|
+
export const BatchSetBlockTaskSchema = Joi.object({
|
|
54
|
+
x: Joi.number().required(),
|
|
55
|
+
y: Joi.number().required(),
|
|
56
|
+
z: Joi.number().required(),
|
|
57
|
+
dim: Joi.number().optional(),
|
|
58
|
+
id: Joi.number().required(),
|
|
59
|
+
metadata: Joi.number().optional(),
|
|
60
|
+
flag: Joi.number().optional(),
|
|
61
|
+
});
|
|
62
|
+
export const BatchSetBlockSubmitResultSchema = Joi.object({
|
|
63
|
+
id: Joi.string().required(),
|
|
64
|
+
total: Joi.number().required(),
|
|
65
|
+
});
|
|
66
|
+
export const BatchSetBlockJobStatusSchema = Joi.valid("pending", "running", "completed");
|
|
67
|
+
export const BatchSetBlockFailureSchema = Joi.object({
|
|
68
|
+
x: Joi.number().required(),
|
|
69
|
+
y: Joi.number().required(),
|
|
70
|
+
z: Joi.number().required(),
|
|
71
|
+
reason: Joi.string().required(),
|
|
72
|
+
});
|
|
73
|
+
export const BatchSetBlockJobResultSchema = Joi.object({
|
|
74
|
+
id: Joi.string().required(),
|
|
75
|
+
total: Joi.number().required(),
|
|
76
|
+
completed: Joi.number().required(),
|
|
77
|
+
success: Joi.number().required(),
|
|
78
|
+
failed: Joi.number().required(),
|
|
79
|
+
status: BatchSetBlockJobStatusSchema.required(),
|
|
80
|
+
createTime: Joi.number().required(),
|
|
81
|
+
finishTime: Joi.number().optional(),
|
|
82
|
+
durationMs: Joi.number().optional(),
|
|
83
|
+
failures: Joi.array().items(BatchSetBlockFailureSchema).optional(),
|
|
84
|
+
failuresTruncated: Joi.number().optional(),
|
|
85
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
import { ClassInfoSchema } from "./common";
|
|
3
|
+
import { EntitySchema } from "./entity";
|
|
4
|
+
export const ChunkSchema = Joi.object({
|
|
5
|
+
class: ClassInfoSchema.optional(),
|
|
6
|
+
chunkX: Joi.number().required(),
|
|
7
|
+
chunkZ: Joi.number().required(),
|
|
8
|
+
xStart: Joi.number().required(),
|
|
9
|
+
zStart: Joi.number().required(),
|
|
10
|
+
xEnd: Joi.number().required(),
|
|
11
|
+
zEnd: Joi.number().required(),
|
|
12
|
+
lastSaveTime: Joi.number().required(),
|
|
13
|
+
isTerrainPopulated: Joi.boolean().required(),
|
|
14
|
+
isLightPopulated: Joi.boolean().required(),
|
|
15
|
+
isModified: Joi.boolean().required(),
|
|
16
|
+
hasEntities: Joi.boolean().required(),
|
|
17
|
+
isChunkLoaded: Joi.boolean().required(),
|
|
18
|
+
sendUpdates: Joi.boolean().required(),
|
|
19
|
+
tileEntityCount: Joi.number().required(),
|
|
20
|
+
entityCount: Joi.number().optional(),
|
|
21
|
+
entityList: Joi.array().items(Joi.array().items(EntitySchema)).optional(),
|
|
22
|
+
inhabitedTime: Joi.number().required(),
|
|
23
|
+
});
|
|
24
|
+
export const ChunkWithDimensionSchema = ChunkSchema.append({
|
|
25
|
+
dimension: Joi.number().required(),
|
|
26
|
+
});
|
|
27
|
+
export const ChunksByDimensionSchema = Joi.object({
|
|
28
|
+
name: Joi.string().required(),
|
|
29
|
+
class: ClassInfoSchema.optional(),
|
|
30
|
+
chunks: Joi.array().items(ChunkSchema).required(),
|
|
31
|
+
count: Joi.number().required(),
|
|
32
|
+
});
|
|
33
|
+
export const ChunkLoadInfoSchema = Joi.object({
|
|
34
|
+
ticketKey: Joi.string().required(),
|
|
35
|
+
chunkX: Joi.number().required(),
|
|
36
|
+
chunkZ: Joi.number().required(),
|
|
37
|
+
minX: Joi.number().required(),
|
|
38
|
+
maxX: Joi.number().required(),
|
|
39
|
+
minZ: Joi.number().required(),
|
|
40
|
+
maxZ: Joi.number().required(),
|
|
41
|
+
dimension: Joi.number().required(),
|
|
42
|
+
startTime: Joi.number().required(),
|
|
43
|
+
durationSec: Joi.number().required(),
|
|
44
|
+
remainingSec: Joi.number().required(),
|
|
45
|
+
isActive: Joi.boolean().required(),
|
|
46
|
+
});
|
|
47
|
+
export const ChunkForceListSchema = Joi.object({
|
|
48
|
+
totalLoaded: Joi.number().required(),
|
|
49
|
+
chunks: Joi.array().items(ChunkLoadInfoSchema).required(),
|
|
50
|
+
});
|
|
51
|
+
export const ChunkLoadResultSchema = ChunkLoadInfoSchema.append({
|
|
52
|
+
action: Joi.valid("load", "unload").required(),
|
|
53
|
+
});
|
|
54
|
+
export const ChunkMapCellSchema = Joi.object({
|
|
55
|
+
name: Joi.string().required(),
|
|
56
|
+
meta: Joi.number().required(),
|
|
57
|
+
y: Joi.number().required(),
|
|
58
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
export const ClassInfoSchema = Joi.object({
|
|
3
|
+
package: Joi.string().optional(),
|
|
4
|
+
location: Joi.string().optional(),
|
|
5
|
+
extends: Joi.array().items(Joi.string()).optional(),
|
|
6
|
+
implements: Joi.array().items(Joi.string()).optional(),
|
|
7
|
+
});
|
|
8
|
+
export const CoordinatesSchema = Joi.object({
|
|
9
|
+
posX: Joi.number().required(),
|
|
10
|
+
posY: Joi.number().required(),
|
|
11
|
+
posZ: Joi.number().required(),
|
|
12
|
+
dimension: Joi.number().required(),
|
|
13
|
+
});
|
|
14
|
+
export const ApiSuccessResponseSchema = (dataSchema) => Joi.object({
|
|
15
|
+
success: Joi.valid(true).required(),
|
|
16
|
+
data: dataSchema.required(),
|
|
17
|
+
});
|
|
18
|
+
export const ApiErrorResponseSchema = Joi.object({
|
|
19
|
+
success: Joi.valid(false).required(),
|
|
20
|
+
message: Joi.string().required(),
|
|
21
|
+
stack: Joi.string().allow(null).optional(),
|
|
22
|
+
});
|
|
23
|
+
export const ApiResponseSchema = (dataSchema) => Joi.alternatives(ApiSuccessResponseSchema(dataSchema), ApiErrorResponseSchema);
|
|
24
|
+
export const RootInfoSchema = Joi.object({
|
|
25
|
+
modid: Joi.string().required(),
|
|
26
|
+
version: Joi.string().required(),
|
|
27
|
+
buildTime: Joi.number().optional(),
|
|
28
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
import { ClassInfoSchema } from "./common";
|
|
3
|
+
import { ItemStackSchema, NBTDataSchema } from "./item";
|
|
4
|
+
export const EntityBaseSchema = Joi.object({
|
|
5
|
+
name: Joi.string().required(),
|
|
6
|
+
entityId: Joi.number().required(),
|
|
7
|
+
uniqueId: Joi.string().required(),
|
|
8
|
+
dimension: Joi.number().required(),
|
|
9
|
+
posX: Joi.number().required(),
|
|
10
|
+
posY: Joi.number().required(),
|
|
11
|
+
posZ: Joi.number().required(),
|
|
12
|
+
prevPosX: Joi.number().optional(),
|
|
13
|
+
prevPosY: Joi.number().optional(),
|
|
14
|
+
prevPosZ: Joi.number().optional(),
|
|
15
|
+
motionX: Joi.number().required(),
|
|
16
|
+
motionY: Joi.number().required(),
|
|
17
|
+
motionZ: Joi.number().required(),
|
|
18
|
+
rotationYaw: Joi.number().required(),
|
|
19
|
+
rotationPitch: Joi.number().required(),
|
|
20
|
+
prevRotationYaw: Joi.number().optional(),
|
|
21
|
+
prevRotationPitch: Joi.number().optional(),
|
|
22
|
+
width: Joi.number().required(),
|
|
23
|
+
height: Joi.number().required(),
|
|
24
|
+
yOffset: Joi.number().required(),
|
|
25
|
+
stepHeight: Joi.number().required(),
|
|
26
|
+
boundingBoxMinX: Joi.number().optional(),
|
|
27
|
+
boundingBoxMinY: Joi.number().optional(),
|
|
28
|
+
boundingBoxMinZ: Joi.number().optional(),
|
|
29
|
+
boundingBoxMaxX: Joi.number().optional(),
|
|
30
|
+
boundingBoxMaxY: Joi.number().optional(),
|
|
31
|
+
boundingBoxMaxZ: Joi.number().optional(),
|
|
32
|
+
onGround: Joi.boolean().required(),
|
|
33
|
+
isCollided: Joi.boolean().required(),
|
|
34
|
+
isCollidedHorizontally: Joi.boolean().required(),
|
|
35
|
+
isCollidedVertically: Joi.boolean().required(),
|
|
36
|
+
isDead: Joi.boolean().required(),
|
|
37
|
+
isAirBorne: Joi.boolean().required(),
|
|
38
|
+
inWater: Joi.boolean().required(),
|
|
39
|
+
fallDistance: Joi.number().required(),
|
|
40
|
+
ticksExisted: Joi.number().required(),
|
|
41
|
+
fireResistance: Joi.number().required(),
|
|
42
|
+
hurtResistantTime: Joi.number().required(),
|
|
43
|
+
chunkCoordX: Joi.number().required(),
|
|
44
|
+
chunkCoordY: Joi.number().required(),
|
|
45
|
+
chunkCoordZ: Joi.number().required(),
|
|
46
|
+
RidingEntity: Joi.alternatives(Joi.string(), Joi.valid(null)).required(),
|
|
47
|
+
RiddenByEntity: Joi.alternatives(Joi.string(), Joi.valid(null)).required(),
|
|
48
|
+
});
|
|
49
|
+
export const PotionEffectSchema = Joi.object({
|
|
50
|
+
name: Joi.string().required(),
|
|
51
|
+
duration: Joi.number().required(),
|
|
52
|
+
amplifier: Joi.number().required(),
|
|
53
|
+
isAmbient: Joi.boolean().required(),
|
|
54
|
+
});
|
|
55
|
+
export const EntityLivingBaseInfoSchema = Joi.object({
|
|
56
|
+
health: Joi.number().required(),
|
|
57
|
+
maxHealth: Joi.number().required(),
|
|
58
|
+
absorptionAmount: Joi.number().required(),
|
|
59
|
+
prevHealth: Joi.number().optional(),
|
|
60
|
+
TotalArmor: Joi.number().required(),
|
|
61
|
+
items: Joi.array().items(ItemStackSchema).optional(),
|
|
62
|
+
hurtTime: Joi.number().required(),
|
|
63
|
+
maxHurtTime: Joi.number().required(),
|
|
64
|
+
attackTime: Joi.number().required(),
|
|
65
|
+
deathTime: Joi.number().required(),
|
|
66
|
+
attackedAtYaw: Joi.number().required(),
|
|
67
|
+
arrowCountInEntity: Joi.number().required(),
|
|
68
|
+
arrowHitTimer: Joi.number().required(),
|
|
69
|
+
entityAge: Joi.number().required(),
|
|
70
|
+
jumpMovementFactor: Joi.number().required(),
|
|
71
|
+
isOnLadder: Joi.boolean().required(),
|
|
72
|
+
canBreatheUnderwater: Joi.boolean().required(),
|
|
73
|
+
maxHurtResistantTime: Joi.number().required(),
|
|
74
|
+
cameraPitch: Joi.number().optional(),
|
|
75
|
+
prevCameraPitch: Joi.number().optional(),
|
|
76
|
+
attributes: Joi.object().pattern(Joi.string(), Joi.object({ baseValue: Joi.number().required(), currentValue: Joi.number().required() })).optional(),
|
|
77
|
+
creatureAttribute: Joi.string().required(),
|
|
78
|
+
revengeTargetId: Joi.number().optional(),
|
|
79
|
+
lastAttackerId: Joi.number().optional(),
|
|
80
|
+
activePotionEffects: Joi.object().pattern(Joi.string(), PotionEffectSchema).optional(),
|
|
81
|
+
});
|
|
82
|
+
export const PlayerInfoSchema = Joi.object({
|
|
83
|
+
experienceLevel: Joi.number().required(),
|
|
84
|
+
experience: Joi.number().required(),
|
|
85
|
+
experienceTotal: Joi.number().required(),
|
|
86
|
+
isSleeping: Joi.boolean().required(),
|
|
87
|
+
isBlocking: Joi.boolean().required(),
|
|
88
|
+
score: Joi.number().required(),
|
|
89
|
+
food: Joi.object({
|
|
90
|
+
foodLevel: Joi.number().required(),
|
|
91
|
+
saturationLevel: Joi.number().required(),
|
|
92
|
+
}).required(),
|
|
93
|
+
heldItem: ItemStackSchema.optional(),
|
|
94
|
+
armor: Joi.array().items(Joi.alternatives(ItemStackSchema, Joi.valid(null))).optional(),
|
|
95
|
+
items: Joi.array().items(ItemStackSchema.append({ slot: Joi.number().required() })).optional(),
|
|
96
|
+
});
|
|
97
|
+
export const EntitySchema = Joi.object({
|
|
98
|
+
Entity: EntityBaseSchema.concat(NBTDataSchema).required(),
|
|
99
|
+
EntityLivingBase: EntityLivingBaseInfoSchema.optional(),
|
|
100
|
+
Player: PlayerInfoSchema.optional(),
|
|
101
|
+
class: ClassInfoSchema.optional(),
|
|
102
|
+
});
|
|
103
|
+
export const EntitySummarySchema = Joi.object({
|
|
104
|
+
Entity: Joi.object({
|
|
105
|
+
name: Joi.string().required(),
|
|
106
|
+
entityId: Joi.number().required(),
|
|
107
|
+
uniqueId: Joi.string().required(),
|
|
108
|
+
dimension: Joi.number().required(),
|
|
109
|
+
posX: Joi.number().required(),
|
|
110
|
+
posY: Joi.number().required(),
|
|
111
|
+
posZ: Joi.number().required(),
|
|
112
|
+
}).required(),
|
|
113
|
+
});
|
|
114
|
+
export const EntitiesByDimensionSchema = Joi.object({
|
|
115
|
+
WorldName: Joi.string().required(),
|
|
116
|
+
loadedEntityList: Joi.array().items(EntitySummarySchema).required(),
|
|
117
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
import { ClassInfoSchema } from "./common";
|
|
3
|
+
import { ItemStackSchema } from "./item";
|
|
4
|
+
export const FluidSchema = Joi.object({
|
|
5
|
+
class: ClassInfoSchema.optional(),
|
|
6
|
+
id: Joi.number().required(),
|
|
7
|
+
name: Joi.string().required(),
|
|
8
|
+
registryName: Joi.string().required(),
|
|
9
|
+
unlocalizedName: Joi.string().required(),
|
|
10
|
+
localizedName: Joi.string().optional(),
|
|
11
|
+
color: Joi.number().required(),
|
|
12
|
+
luminosity: Joi.number().required(),
|
|
13
|
+
density: Joi.number().required(),
|
|
14
|
+
temperature: Joi.number().required(),
|
|
15
|
+
viscosity: Joi.number().required(),
|
|
16
|
+
gaseous: Joi.boolean().required(),
|
|
17
|
+
block: Joi.number().optional(),
|
|
18
|
+
});
|
|
19
|
+
export const FluidContainerSchema = Joi.object({
|
|
20
|
+
fluid: FluidSchema.optional(),
|
|
21
|
+
amount: Joi.number().optional(),
|
|
22
|
+
filledContainer: ItemStackSchema.optional(),
|
|
23
|
+
emptyContainer: ItemStackSchema.optional(),
|
|
24
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Joi from "joi";
|
|
2
|
+
import { ClassInfoSchema } from "./common";
|
|
3
|
+
import { ItemStackSchema } from "./item";
|
|
4
|
+
export const Cuboid6BoundsSchema = Joi.object({
|
|
5
|
+
minX: Joi.number().required(),
|
|
6
|
+
minY: Joi.number().required(),
|
|
7
|
+
minZ: Joi.number().required(),
|
|
8
|
+
maxX: Joi.number().required(),
|
|
9
|
+
maxY: Joi.number().required(),
|
|
10
|
+
maxZ: Joi.number().required(),
|
|
11
|
+
});
|
|
12
|
+
export const FMPPartSchema = Joi.object({
|
|
13
|
+
class: ClassInfoSchema.optional(),
|
|
14
|
+
type: Joi.string().required(),
|
|
15
|
+
lightValue: Joi.number().required(),
|
|
16
|
+
doesTick: Joi.boolean().required(),
|
|
17
|
+
bounds: Cuboid6BoundsSchema.optional(),
|
|
18
|
+
collisionBoxes: Joi.array().items(Cuboid6BoundsSchema).required(),
|
|
19
|
+
drops: Joi.array().items(ItemStackSchema).optional(),
|
|
20
|
+
ae2: Joi.object({
|
|
21
|
+
color: Joi.string().required(),
|
|
22
|
+
isEmpty: Joi.boolean().required(),
|
|
23
|
+
lightValue: Joi.number().required(),
|
|
24
|
+
parts: Joi.array().items(Joi.object({
|
|
25
|
+
direction: Joi.string().required(),
|
|
26
|
+
item: ItemStackSchema.optional(),
|
|
27
|
+
})).required(),
|
|
28
|
+
facades: Joi.array().items(Joi.object({
|
|
29
|
+
direction: Joi.string().required(),
|
|
30
|
+
item: ItemStackSchema.optional(),
|
|
31
|
+
})).required(),
|
|
32
|
+
error: Joi.string().optional(),
|
|
33
|
+
}).optional(),
|
|
34
|
+
});
|