hytopia 0.6.11 → 0.6.13
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/bun-server.mjs +161 -161
- package/docs/server.baseentityoptions.isenvironmental.md +13 -0
- package/docs/server.baseentityoptions.md +19 -0
- package/docs/server.entity.isenvironmental.md +13 -0
- package/docs/server.entity.md +21 -0
- package/docs/server.iterationmap._symbol.iterator_.md +19 -0
- package/docs/server.iterationmap.clear.md +17 -0
- package/docs/server.iterationmap.delete.md +55 -0
- package/docs/server.iterationmap.entries.md +19 -0
- package/docs/server.iterationmap.foreach.md +69 -0
- package/docs/server.iterationmap.get.md +55 -0
- package/docs/server.iterationmap.has.md +55 -0
- package/docs/server.iterationmap.keys.md +19 -0
- package/docs/server.iterationmap.md +264 -0
- package/docs/server.iterationmap.set.md +71 -0
- package/docs/server.iterationmap.size.md +13 -0
- package/docs/server.iterationmap.values.md +19 -0
- package/docs/server.iterationmap.valuesarray.md +13 -0
- package/docs/server.md +11 -0
- package/node-server.mjs +162 -162
- package/package.json +1 -1
- package/server.api.json +625 -0
- package/server.d.ts +108 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BaseEntityOptions](./server.baseentityoptions.md) > [isEnvironmental](./server.baseentityoptions.isenvironmental.md)
|
4
|
+
|
5
|
+
## BaseEntityOptions.isEnvironmental property
|
6
|
+
|
7
|
+
Whether the entity is environmental, if true it will not invoke its tick function or change position. Defaults to false.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
isEnvironmental?: boolean;
|
13
|
+
```
|
@@ -53,6 +53,25 @@ Description
|
|
53
53
|
_(Optional)_ The entity controller to use for the entity.
|
54
54
|
|
55
55
|
|
56
|
+
</td></tr>
|
57
|
+
<tr><td>
|
58
|
+
|
59
|
+
[isEnvironmental?](./server.baseentityoptions.isenvironmental.md)
|
60
|
+
|
61
|
+
|
62
|
+
</td><td>
|
63
|
+
|
64
|
+
|
65
|
+
</td><td>
|
66
|
+
|
67
|
+
boolean
|
68
|
+
|
69
|
+
|
70
|
+
</td><td>
|
71
|
+
|
72
|
+
_(Optional)_ Whether the entity is environmental, if true it will not invoke its tick function or change position. Defaults to false.
|
73
|
+
|
74
|
+
|
56
75
|
</td></tr>
|
57
76
|
<tr><td>
|
58
77
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Entity](./server.entity.md) > [isEnvironmental](./server.entity.isenvironmental.md)
|
4
|
+
|
5
|
+
## Entity.isEnvironmental property
|
6
|
+
|
7
|
+
Whether the entity is environmental, if true it will not invoke its tick function or change position.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get isEnvironmental(): boolean;
|
13
|
+
```
|
package/docs/server.entity.md
CHANGED
@@ -231,6 +231,27 @@ boolean
|
|
231
231
|
Whether the entity is a block entity.
|
232
232
|
|
233
233
|
|
234
|
+
</td></tr>
|
235
|
+
<tr><td>
|
236
|
+
|
237
|
+
[isEnvironmental](./server.entity.isenvironmental.md)
|
238
|
+
|
239
|
+
|
240
|
+
</td><td>
|
241
|
+
|
242
|
+
`readonly`
|
243
|
+
|
244
|
+
|
245
|
+
</td><td>
|
246
|
+
|
247
|
+
boolean
|
248
|
+
|
249
|
+
|
250
|
+
</td><td>
|
251
|
+
|
252
|
+
Whether the entity is environmental, if true it will not invoke its tick function or change position.
|
253
|
+
|
254
|
+
|
234
255
|
</td></tr>
|
235
256
|
<tr><td>
|
236
257
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [\[Symbol.iterator\]](./server.iterationmap._symbol.iterator_.md)
|
4
|
+
|
5
|
+
## IterationMap.\[Symbol.iterator\]() method
|
6
|
+
|
7
|
+
Returns an iterator for the key-value pairs in the IterationMap.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
13
|
+
```
|
14
|
+
**Returns:**
|
15
|
+
|
16
|
+
IterableIterator<\[K, V\]>
|
17
|
+
|
18
|
+
An iterator for the entries.
|
19
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [clear](./server.iterationmap.clear.md)
|
4
|
+
|
5
|
+
## IterationMap.clear() method
|
6
|
+
|
7
|
+
Removes all key-value pairs from the IterationMap. Highly optimized for the common "build up, iterate, clear" pattern.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
clear(): void;
|
13
|
+
```
|
14
|
+
**Returns:**
|
15
|
+
|
16
|
+
void
|
17
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [delete](./server.iterationmap.delete.md)
|
4
|
+
|
5
|
+
## IterationMap.delete() method
|
6
|
+
|
7
|
+
Removes the key-value pair from the IterationMap.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
delete(key: K): boolean;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
key
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
K
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The key to delete.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
boolean
|
53
|
+
|
54
|
+
True if the key existed and was deleted, false otherwise.
|
55
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [entries](./server.iterationmap.entries.md)
|
4
|
+
|
5
|
+
## IterationMap.entries() method
|
6
|
+
|
7
|
+
Returns an iterator for the key-value pairs in the IterationMap.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
entries(): IterableIterator<[K, V]>;
|
13
|
+
```
|
14
|
+
**Returns:**
|
15
|
+
|
16
|
+
IterableIterator<\[K, V\]>
|
17
|
+
|
18
|
+
An iterator for the entries.
|
19
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [forEach](./server.iterationmap.foreach.md)
|
4
|
+
|
5
|
+
## IterationMap.forEach() method
|
6
|
+
|
7
|
+
Executes a provided function once for each key-value pair.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
forEach(callbackfn: (value: V, key: K, map: IterationMap<K, V>) => void, thisArg?: any): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
callbackfn
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
(value: V, key: K, map: [IterationMap](./server.iterationmap.md)<!-- --><K, V>) => void
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
Function to execute for each element.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
thisArg
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
any
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
_(Optional)_ Value to use as this when executing callback.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
**Returns:**
|
67
|
+
|
68
|
+
void
|
69
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [get](./server.iterationmap.get.md)
|
4
|
+
|
5
|
+
## IterationMap.get() method
|
6
|
+
|
7
|
+
Returns the value associated with the key, or undefined if the key doesn't exist.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get(key: K): V | undefined;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
key
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
K
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The key to look up.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
V \| undefined
|
53
|
+
|
54
|
+
The value associated with the key, or undefined.
|
55
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [has](./server.iterationmap.has.md)
|
4
|
+
|
5
|
+
## IterationMap.has() method
|
6
|
+
|
7
|
+
Returns true if the key exists in the IterationMap.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
has(key: K): boolean;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
key
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
K
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The key to check.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
boolean
|
53
|
+
|
54
|
+
True if the key exists, false otherwise.
|
55
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md) > [keys](./server.iterationmap.keys.md)
|
4
|
+
|
5
|
+
## IterationMap.keys() method
|
6
|
+
|
7
|
+
Returns an iterator for the keys in the IterationMap.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
keys(): IterableIterator<K>;
|
13
|
+
```
|
14
|
+
**Returns:**
|
15
|
+
|
16
|
+
IterableIterator<K>
|
17
|
+
|
18
|
+
An iterator for the keys.
|
19
|
+
|
@@ -0,0 +1,264 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [IterationMap](./server.iterationmap.md)
|
4
|
+
|
5
|
+
## IterationMap class
|
6
|
+
|
7
|
+
A high-performance Map-like data structure optimized for frequent iteration.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export default class IterationMap<K, V>
|
13
|
+
```
|
14
|
+
|
15
|
+
## Remarks
|
16
|
+
|
17
|
+
IterationMap maintains both a Map for O(1) lookups and an Array for fast iteration, eliminating the need for Array.from() calls and providing \~2x faster iteration than Map.values(). Optimized for "build up, iterate, clear" usage patterns common in game loops.
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
|
22
|
+
```typescript
|
23
|
+
const iterationMap = new IterationMap<number, string>();
|
24
|
+
iterationMap.set(1, 'hello');
|
25
|
+
iterationMap.set(2, 'world');
|
26
|
+
|
27
|
+
// Fast O(1) lookup
|
28
|
+
const value = iterationMap.get(1);
|
29
|
+
|
30
|
+
// Fast array iteration (no Map.values() overhead)
|
31
|
+
for (const item of iterationMap.valuesArray) {
|
32
|
+
console.log(item);
|
33
|
+
}
|
34
|
+
|
35
|
+
// Efficient bulk clear
|
36
|
+
iterationMap.clear();
|
37
|
+
```
|
38
|
+
|
39
|
+
## Properties
|
40
|
+
|
41
|
+
<table><thead><tr><th>
|
42
|
+
|
43
|
+
Property
|
44
|
+
|
45
|
+
|
46
|
+
</th><th>
|
47
|
+
|
48
|
+
Modifiers
|
49
|
+
|
50
|
+
|
51
|
+
</th><th>
|
52
|
+
|
53
|
+
Type
|
54
|
+
|
55
|
+
|
56
|
+
</th><th>
|
57
|
+
|
58
|
+
Description
|
59
|
+
|
60
|
+
|
61
|
+
</th></tr></thead>
|
62
|
+
<tbody><tr><td>
|
63
|
+
|
64
|
+
[size](./server.iterationmap.size.md)
|
65
|
+
|
66
|
+
|
67
|
+
</td><td>
|
68
|
+
|
69
|
+
`readonly`
|
70
|
+
|
71
|
+
|
72
|
+
</td><td>
|
73
|
+
|
74
|
+
number
|
75
|
+
|
76
|
+
|
77
|
+
</td><td>
|
78
|
+
|
79
|
+
Returns the number of key-value pairs in the IterationMap.
|
80
|
+
|
81
|
+
|
82
|
+
</td></tr>
|
83
|
+
<tr><td>
|
84
|
+
|
85
|
+
[valuesArray](./server.iterationmap.valuesarray.md)
|
86
|
+
|
87
|
+
|
88
|
+
</td><td>
|
89
|
+
|
90
|
+
`readonly`
|
91
|
+
|
92
|
+
|
93
|
+
</td><td>
|
94
|
+
|
95
|
+
readonly V\[\]
|
96
|
+
|
97
|
+
|
98
|
+
</td><td>
|
99
|
+
|
100
|
+
Returns a readonly array of all values for fast iteration. This is the key performance feature - use this instead of .values() for iteration.
|
101
|
+
|
102
|
+
|
103
|
+
</td></tr>
|
104
|
+
</tbody></table>
|
105
|
+
|
106
|
+
## Methods
|
107
|
+
|
108
|
+
<table><thead><tr><th>
|
109
|
+
|
110
|
+
Method
|
111
|
+
|
112
|
+
|
113
|
+
</th><th>
|
114
|
+
|
115
|
+
Modifiers
|
116
|
+
|
117
|
+
|
118
|
+
</th><th>
|
119
|
+
|
120
|
+
Description
|
121
|
+
|
122
|
+
|
123
|
+
</th></tr></thead>
|
124
|
+
<tbody><tr><td>
|
125
|
+
|
126
|
+
[\[Symbol.iterator\]()](./server.iterationmap._symbol.iterator_.md)
|
127
|
+
|
128
|
+
|
129
|
+
</td><td>
|
130
|
+
|
131
|
+
|
132
|
+
</td><td>
|
133
|
+
|
134
|
+
Returns an iterator for the key-value pairs in the IterationMap.
|
135
|
+
|
136
|
+
|
137
|
+
</td></tr>
|
138
|
+
<tr><td>
|
139
|
+
|
140
|
+
[clear()](./server.iterationmap.clear.md)
|
141
|
+
|
142
|
+
|
143
|
+
</td><td>
|
144
|
+
|
145
|
+
|
146
|
+
</td><td>
|
147
|
+
|
148
|
+
Removes all key-value pairs from the IterationMap. Highly optimized for the common "build up, iterate, clear" pattern.
|
149
|
+
|
150
|
+
|
151
|
+
</td></tr>
|
152
|
+
<tr><td>
|
153
|
+
|
154
|
+
[delete(key)](./server.iterationmap.delete.md)
|
155
|
+
|
156
|
+
|
157
|
+
</td><td>
|
158
|
+
|
159
|
+
|
160
|
+
</td><td>
|
161
|
+
|
162
|
+
Removes the key-value pair from the IterationMap.
|
163
|
+
|
164
|
+
|
165
|
+
</td></tr>
|
166
|
+
<tr><td>
|
167
|
+
|
168
|
+
[entries()](./server.iterationmap.entries.md)
|
169
|
+
|
170
|
+
|
171
|
+
</td><td>
|
172
|
+
|
173
|
+
|
174
|
+
</td><td>
|
175
|
+
|
176
|
+
Returns an iterator for the key-value pairs in the IterationMap.
|
177
|
+
|
178
|
+
|
179
|
+
</td></tr>
|
180
|
+
<tr><td>
|
181
|
+
|
182
|
+
[forEach(callbackfn, thisArg)](./server.iterationmap.foreach.md)
|
183
|
+
|
184
|
+
|
185
|
+
</td><td>
|
186
|
+
|
187
|
+
|
188
|
+
</td><td>
|
189
|
+
|
190
|
+
Executes a provided function once for each key-value pair.
|
191
|
+
|
192
|
+
|
193
|
+
</td></tr>
|
194
|
+
<tr><td>
|
195
|
+
|
196
|
+
[get(key)](./server.iterationmap.get.md)
|
197
|
+
|
198
|
+
|
199
|
+
</td><td>
|
200
|
+
|
201
|
+
|
202
|
+
</td><td>
|
203
|
+
|
204
|
+
Returns the value associated with the key, or undefined if the key doesn't exist.
|
205
|
+
|
206
|
+
|
207
|
+
</td></tr>
|
208
|
+
<tr><td>
|
209
|
+
|
210
|
+
[has(key)](./server.iterationmap.has.md)
|
211
|
+
|
212
|
+
|
213
|
+
</td><td>
|
214
|
+
|
215
|
+
|
216
|
+
</td><td>
|
217
|
+
|
218
|
+
Returns true if the key exists in the IterationMap.
|
219
|
+
|
220
|
+
|
221
|
+
</td></tr>
|
222
|
+
<tr><td>
|
223
|
+
|
224
|
+
[keys()](./server.iterationmap.keys.md)
|
225
|
+
|
226
|
+
|
227
|
+
</td><td>
|
228
|
+
|
229
|
+
|
230
|
+
</td><td>
|
231
|
+
|
232
|
+
Returns an iterator for the keys in the IterationMap.
|
233
|
+
|
234
|
+
|
235
|
+
</td></tr>
|
236
|
+
<tr><td>
|
237
|
+
|
238
|
+
[set(key, value)](./server.iterationmap.set.md)
|
239
|
+
|
240
|
+
|
241
|
+
</td><td>
|
242
|
+
|
243
|
+
|
244
|
+
</td><td>
|
245
|
+
|
246
|
+
Sets the value for the key in the IterationMap.
|
247
|
+
|
248
|
+
|
249
|
+
</td></tr>
|
250
|
+
<tr><td>
|
251
|
+
|
252
|
+
[values()](./server.iterationmap.values.md)
|
253
|
+
|
254
|
+
|
255
|
+
</td><td>
|
256
|
+
|
257
|
+
|
258
|
+
</td><td>
|
259
|
+
|
260
|
+
Returns an iterator for the values in the IterationMap. Note: For performance-critical iteration, use .valuesArray instead.
|
261
|
+
|
262
|
+
|
263
|
+
</td></tr>
|
264
|
+
</tbody></table>
|