isaacscript-common 6.11.2 → 6.14.0
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/callbacks/postGridEntityCustomRender.d.ts +2 -0
- package/dist/callbacks/postGridEntityCustomRender.d.ts.map +1 -0
- package/dist/callbacks/postGridEntityCustomRender.lua +36 -0
- package/dist/callbacks/postGridEntityCustomUpdate.d.ts +2 -0
- package/dist/callbacks/postGridEntityCustomUpdate.d.ts.map +1 -0
- package/dist/callbacks/postGridEntityCustomUpdate.lua +36 -0
- package/dist/callbacks/postNewRoomEarly.lua +2 -2
- package/dist/callbacks/postPickupInitFirst.lua +1 -20
- package/dist/callbacks/reorderedCallbacks.d.ts +5 -5
- package/dist/callbacks/reorderedCallbacks.d.ts.map +1 -1
- package/dist/callbacks/reorderedCallbacks.lua +5 -5
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomRender.lua +29 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts +6 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.lua +29 -0
- package/dist/constants.d.ts +1 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.lua +0 -7
- package/dist/constantsFirstLast.d.ts +5 -1
- package/dist/constantsFirstLast.d.ts.map +1 -1
- package/dist/constantsFirstLast.lua +6 -0
- package/dist/enums/ModCallbackCustom.d.ts +89 -66
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +62 -58
- package/dist/enums/private/SerializationBrand.d.ts +1 -1
- package/dist/enums/private/SerializationBrand.lua +1 -1
- package/dist/features/collectibleItemPoolType.d.ts +2 -2
- package/dist/features/collectibleItemPoolType.lua +2 -2
- package/dist/features/customGridEntity.d.ts +11 -2
- package/dist/features/customGridEntity.d.ts.map +1 -1
- package/dist/features/customGridEntity.lua +22 -2
- package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -1
- package/dist/features/customTrapdoor/blackSprite.lua +6 -6
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts +2 -2
- package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -1
- package/dist/features/customTrapdoor/customTrapdoorConstants.lua +2 -2
- package/dist/features/customTrapdoor/init.d.ts.map +1 -1
- package/dist/features/customTrapdoor/init.lua +4 -3
- package/dist/features/customTrapdoor/touched.d.ts.map +1 -1
- package/dist/features/customTrapdoor/touched.lua +51 -33
- package/dist/features/deployJSONRoom.d.ts +2 -2
- package/dist/features/deployJSONRoom.lua +2 -2
- package/dist/features/extraConsoleCommands/exports.d.ts +4 -3
- package/dist/features/extraConsoleCommands/exports.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/exports.lua +4 -3
- package/dist/features/extraConsoleCommands/init.lua +12 -14
- package/dist/features/extraConsoleCommands/listCommands.d.ts +15 -19
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +34 -42
- package/dist/features/pause.d.ts +1 -1
- package/dist/features/pause.d.ts.map +1 -1
- package/dist/features/pause.lua +87 -8
- package/dist/features/persistentEntities.d.ts.map +1 -1
- package/dist/features/persistentEntities.lua +7 -7
- package/dist/features/pickupIndex.d.ts +19 -0
- package/dist/features/pickupIndex.d.ts.map +1 -0
- package/dist/features/pickupIndex.lua +197 -0
- package/dist/features/roomHistory.d.ts +24 -0
- package/dist/features/roomHistory.d.ts.map +1 -0
- package/dist/features/roomHistory.lua +89 -0
- package/dist/functions/collectibles.d.ts +26 -13
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/collectibles.lua +26 -13
- package/dist/functions/color.d.ts +10 -0
- package/dist/functions/color.d.ts.map +1 -1
- package/dist/functions/color.lua +24 -0
- package/dist/functions/entities.d.ts +3 -3
- package/dist/functions/entities.d.ts.map +1 -1
- package/dist/functions/entities.lua +8 -3
- package/dist/functions/gridEntities.d.ts +4 -22
- package/dist/functions/gridEntities.d.ts.map +1 -1
- package/dist/functions/gridEntities.lua +4 -61
- package/dist/functions/isaacAPIClass.d.ts +64 -0
- package/dist/functions/isaacAPIClass.d.ts.map +1 -1
- package/dist/functions/isaacAPIClass.lua +84 -1
- package/dist/functions/kColor.d.ts +10 -0
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/kColor.lua +24 -0
- package/dist/functions/map.d.ts +2 -0
- package/dist/functions/map.d.ts.map +1 -1
- package/dist/functions/map.lua +7 -0
- package/dist/functions/npcs.d.ts +2 -2
- package/dist/functions/npcs.lua +2 -2
- package/dist/functions/pickupVariants.d.ts +2 -2
- package/dist/functions/pickupVariants.d.ts.map +1 -1
- package/dist/functions/pickupVariants.lua +2 -2
- package/dist/functions/playerCenter.lua +2 -2
- package/dist/functions/playerIndex.d.ts +0 -3
- package/dist/functions/playerIndex.d.ts.map +1 -1
- package/dist/functions/playerIndex.lua +4 -23
- package/dist/functions/random.d.ts +1 -1
- package/dist/functions/random.lua +1 -1
- package/dist/functions/rockAlt.d.ts +28 -0
- package/dist/functions/rockAlt.d.ts.map +1 -0
- package/dist/functions/rockAlt.lua +140 -0
- package/dist/functions/roomData.d.ts +3 -2
- package/dist/functions/roomData.d.ts.map +1 -1
- package/dist/functions/roomData.lua +3 -2
- package/dist/functions/rooms.d.ts +6 -6
- package/dist/functions/rooms.lua +6 -6
- package/dist/functions/set.d.ts +2 -0
- package/dist/functions/set.d.ts.map +1 -1
- package/dist/functions/set.lua +6 -0
- package/dist/functions/stage.d.ts +1 -0
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +4 -0
- package/dist/functions/vector.d.ts +11 -0
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/functions/vector.lua +23 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +31 -0
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +6 -0
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +6 -0
- package/dist/interfaces/AddCallbackParameterCustom.d.ts +4 -0
- package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/interfaces/RoomDescription.d.ts +14 -0
- package/dist/interfaces/RoomDescription.d.ts.map +1 -0
- package/dist/interfaces/RoomDescription.lua +2 -0
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +6 -0
- package/dist/types/CollectibleIndex.d.ts +1 -1
- package/dist/types/PickupIndex.d.ts +17 -0
- package/dist/types/PickupIndex.d.ts.map +1 -0
- package/dist/types/PickupIndex.lua +2 -0
- package/dist/types/PlayerIndex.d.ts +1 -1
- package/dist/upgradeMod.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/postGridEntityCustomRender.ts +44 -0
- package/src/callbacks/postGridEntityCustomUpdate.ts +44 -0
- package/src/callbacks/postNewRoomEarly.ts +2 -2
- package/src/callbacks/postPickupInitFirst.ts +3 -32
- package/src/callbacks/postPlayerReorderedCallbacks.ts +3 -3
- package/src/callbacks/reorderedCallbacks.ts +9 -8
- package/src/callbacks/subscriptions/postGridEntityCustomRender.ts +41 -0
- package/src/callbacks/subscriptions/postGridEntityCustomUpdate.ts +41 -0
- package/src/constants.ts +1 -9
- package/src/constantsFirstLast.ts +16 -0
- package/src/enums/ModCallbackCustom.ts +33 -8
- package/src/enums/private/SerializationBrand.ts +1 -1
- package/src/features/collectibleItemPoolType.ts +3 -3
- package/src/features/customGridEntity.ts +27 -2
- package/src/features/customTrapdoor/blackSprite.ts +11 -5
- package/src/features/customTrapdoor/customTrapdoorConstants.ts +2 -2
- package/src/features/customTrapdoor/init.ts +7 -5
- package/src/features/customTrapdoor/touched.ts +59 -39
- package/src/features/deployJSONRoom.ts +4 -4
- package/src/features/extraConsoleCommands/exports.ts +4 -3
- package/src/features/extraConsoleCommands/init.ts +18 -14
- package/src/features/extraConsoleCommands/listCommands.ts +38 -43
- package/src/features/pause.ts +97 -7
- package/src/features/persistentEntities.ts +9 -8
- package/src/features/pickupIndex.ts +257 -0
- package/src/features/playerInventory.ts +2 -2
- package/src/features/roomHistory.ts +113 -0
- package/src/features/saveDataManager/main.ts +2 -2
- package/src/features/taintedLazarusPlayers.ts +5 -5
- package/src/functions/collectibles.ts +26 -13
- package/src/functions/color.ts +22 -0
- package/src/functions/entities.ts +6 -3
- package/src/functions/gridEntities.ts +4 -56
- package/src/functions/isaacAPIClass.ts +106 -1
- package/src/functions/kColor.ts +22 -0
- package/src/functions/map.ts +10 -0
- package/src/functions/npcs.ts +2 -2
- package/src/functions/pickupVariants.ts +2 -2
- package/src/functions/playerCenter.ts +2 -2
- package/src/functions/playerIndex.ts +8 -21
- package/src/functions/random.ts +1 -1
- package/src/functions/rockAlt.ts +117 -0
- package/src/functions/roomData.ts +3 -2
- package/src/functions/rooms.ts +6 -6
- package/src/functions/set.ts +7 -1
- package/src/functions/stage.ts +10 -1
- package/src/functions/vector.ts +23 -0
- package/src/index.ts +4 -0
- package/src/initCustomCallbacks.ts +4 -0
- package/src/initFeatures.ts +4 -0
- package/src/interfaces/AddCallbackParameterCustom.ts +4 -0
- package/src/interfaces/RoomDescription.ts +19 -0
- package/src/objects/callbackRegisterFunctions.ts +6 -0
- package/src/types/CollectibleIndex.ts +1 -1
- package/src/types/PickupIndex.ts +15 -0
- package/src/types/PlayerIndex.ts +1 -1
- package/src/upgradeMod.ts +2 -1
package/src/functions/vector.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { SerializationBrand } from "../enums/private/SerializationBrand";
|
|
|
3
3
|
import { SerializationType } from "../enums/SerializationType";
|
|
4
4
|
import { angleToDirection } from "./direction";
|
|
5
5
|
import { isaacAPIClassEquals, isIsaacAPIClassOfType } from "./isaacAPIClass";
|
|
6
|
+
import { getRandomFloat } from "./random";
|
|
7
|
+
import { getRandomSeed, isRNG, newRNG } from "./rng";
|
|
6
8
|
import { copyValuesToTable, getNumbersFromTable, tableHasKeys } from "./table";
|
|
7
9
|
import { isTable } from "./types";
|
|
8
10
|
|
|
@@ -90,6 +92,27 @@ export function copyVector(
|
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Helper function to get a random vector between (-1, -1) and (1, 1).
|
|
97
|
+
*
|
|
98
|
+
* To get random vectors with a bigger length, multiply this with a number.
|
|
99
|
+
*
|
|
100
|
+
* Use this over the `RandomVector` function when you need the vector to be seeded.
|
|
101
|
+
*
|
|
102
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
103
|
+
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
104
|
+
*/
|
|
105
|
+
export function getRandomVector(
|
|
106
|
+
seedOrRNG: Seed | RNG = getRandomSeed(),
|
|
107
|
+
): Vector {
|
|
108
|
+
const rng = isRNG(seedOrRNG) ? seedOrRNG : newRNG(seedOrRNG);
|
|
109
|
+
|
|
110
|
+
const x = getRandomFloat(-1, 1, rng);
|
|
111
|
+
const y = getRandomFloat(-1, 1, rng);
|
|
112
|
+
|
|
113
|
+
return Vector(x, y);
|
|
114
|
+
}
|
|
115
|
+
|
|
93
116
|
/**
|
|
94
117
|
* Used to determine is the given table is a serialized `Vector` object created by the save data
|
|
95
118
|
* manager and/or the `deepCopy` function.
|
package/src/index.ts
CHANGED
|
@@ -47,10 +47,12 @@ export * from "./features/extraConsoleCommands/exports";
|
|
|
47
47
|
export { removeFadeIn, restoreFadeIn } from "./features/fadeInRemover";
|
|
48
48
|
export { disableFastReset, enableFastReset } from "./features/fastReset";
|
|
49
49
|
export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
50
|
+
export { pause, unpause } from "./features/pause";
|
|
50
51
|
export {
|
|
51
52
|
removePersistentEntity,
|
|
52
53
|
spawnPersistentEntity,
|
|
53
54
|
} from "./features/persistentEntities";
|
|
55
|
+
export * from "./features/pickupIndex";
|
|
54
56
|
export { getPlayerInventory } from "./features/playerInventory";
|
|
55
57
|
export {
|
|
56
58
|
anyPlayerUsingPony,
|
|
@@ -62,6 +64,7 @@ export {
|
|
|
62
64
|
getRoomClearGameFrame,
|
|
63
65
|
getRoomClearRoomFrame,
|
|
64
66
|
} from "./features/roomClearFrame";
|
|
67
|
+
export * from "./features/roomHistory";
|
|
65
68
|
export {
|
|
66
69
|
runInNGameFrames,
|
|
67
70
|
runInNRenderFrames,
|
|
@@ -141,6 +144,7 @@ export * from "./functions/pressurePlate";
|
|
|
141
144
|
export * from "./functions/random";
|
|
142
145
|
export * from "./functions/revive";
|
|
143
146
|
export * from "./functions/rng";
|
|
147
|
+
export * from "./functions/rockAlt";
|
|
144
148
|
export * from "./functions/roomData";
|
|
145
149
|
export * from "./functions/roomGrid";
|
|
146
150
|
export * from "./functions/rooms";
|
|
@@ -20,6 +20,8 @@ import { postFlipCallbacksInit } from "./callbacks/postFlip";
|
|
|
20
20
|
import { postGreedModeWaveInit } from "./callbacks/postGreedModeWave";
|
|
21
21
|
import { postGridEntityCallbacksInit } from "./callbacks/postGridEntity";
|
|
22
22
|
import { postGridEntityCollisionInit } from "./callbacks/postGridEntityCollision";
|
|
23
|
+
import { postGridEntityCustomRenderInit } from "./callbacks/postGridEntityCustomRender";
|
|
24
|
+
import { postGridEntityCustomUpdateInit } from "./callbacks/postGridEntityCustomUpdate";
|
|
23
25
|
import { postGridEntityRenderInit } from "./callbacks/postGridEntityRender";
|
|
24
26
|
import { postHolyMantleRemovedInit } from "./callbacks/postHolyMantleRemoved";
|
|
25
27
|
import { postItemDischargeInit } from "./callbacks/postItemDischarged";
|
|
@@ -89,6 +91,8 @@ export function initCustomCallbacks(mod: ModUpgraded): void {
|
|
|
89
91
|
postGreedModeWaveInit(mod);
|
|
90
92
|
postGridEntityCallbacksInit(mod);
|
|
91
93
|
postGridEntityCollisionInit(mod);
|
|
94
|
+
postGridEntityCustomRenderInit(mod);
|
|
95
|
+
postGridEntityCustomUpdateInit(mod);
|
|
92
96
|
postGridEntityRenderInit(mod);
|
|
93
97
|
postHolyMantleRemovedInit(mod);
|
|
94
98
|
postItemDischargeInit(mod);
|
package/src/initFeatures.ts
CHANGED
|
@@ -13,11 +13,13 @@ import { fastResetInit } from "./features/fastReset";
|
|
|
13
13
|
import { forgottenSwitchInit } from "./features/forgottenSwitch";
|
|
14
14
|
import { pauseInit } from "./features/pause";
|
|
15
15
|
import { persistentEntitiesInit } from "./features/persistentEntities";
|
|
16
|
+
import { pickupIndexInit } from "./features/pickupIndex";
|
|
16
17
|
import { playerInventoryInit } from "./features/playerInventory";
|
|
17
18
|
import { ponyDetectionInit } from "./features/ponyDetection";
|
|
18
19
|
import { preventCollectibleRotationInit } from "./features/preventCollectibleRotation";
|
|
19
20
|
import { registerHotkeyInit } from "./features/registerHotkey";
|
|
20
21
|
import { roomClearFrameInit } from "./features/roomClearFrame";
|
|
22
|
+
import { roomHistoryInit } from "./features/roomHistory";
|
|
21
23
|
import { runInNFramesInit } from "./features/runInNFrames";
|
|
22
24
|
import { runNextRoomInit } from "./features/runNextRoom";
|
|
23
25
|
import { sirenHelpersInit } from "./features/sirenHelpers";
|
|
@@ -48,11 +50,13 @@ function initFeaturesMinor(mod: ModUpgraded) {
|
|
|
48
50
|
collectibleItemPoolTypeInit(mod);
|
|
49
51
|
pauseInit(mod);
|
|
50
52
|
persistentEntitiesInit(mod);
|
|
53
|
+
pickupIndexInit(mod);
|
|
51
54
|
playerInventoryInit(mod);
|
|
52
55
|
ponyDetectionInit(mod);
|
|
53
56
|
preventCollectibleRotationInit(mod);
|
|
54
57
|
registerHotkeyInit(mod);
|
|
55
58
|
roomClearFrameInit(mod);
|
|
59
|
+
roomHistoryInit(mod);
|
|
56
60
|
runNextRoomInit(mod);
|
|
57
61
|
sirenHelpersInit(mod);
|
|
58
62
|
stageHistoryInit(mod);
|
|
@@ -23,6 +23,8 @@ import { PostGameStartedReorderedRegisterParameters } from "../callbacks/subscri
|
|
|
23
23
|
import { PostGreedModeWaveRegisterParameters } from "../callbacks/subscriptions/postGreedModeWave";
|
|
24
24
|
import { PostGridEntityBrokenRegisterParameters } from "../callbacks/subscriptions/postGridEntityBroken";
|
|
25
25
|
import { PostGridEntityCollisionRegisterParameters } from "../callbacks/subscriptions/postGridEntityCollision";
|
|
26
|
+
import { PostGridEntityCustomRenderRegisterParameters } from "../callbacks/subscriptions/postGridEntityCustomRender";
|
|
27
|
+
import { PostGridEntityCustomUpdateRegisterParameters } from "../callbacks/subscriptions/postGridEntityCustomUpdate";
|
|
26
28
|
import { PostGridEntityInitRegisterParameters } from "../callbacks/subscriptions/postGridEntityInit";
|
|
27
29
|
import { PostGridEntityRemoveRegisterParameters } from "../callbacks/subscriptions/postGridEntityRemove";
|
|
28
30
|
import { PostGridEntityRenderRegisterParameters } from "../callbacks/subscriptions/postGridEntityRender";
|
|
@@ -109,6 +111,8 @@ export interface AddCallbackParameterCustom {
|
|
|
109
111
|
[ModCallbackCustom.POST_GREED_MODE_WAVE]: PostGreedModeWaveRegisterParameters;
|
|
110
112
|
[ModCallbackCustom.POST_GRID_ENTITY_BROKEN]: PostGridEntityBrokenRegisterParameters;
|
|
111
113
|
[ModCallbackCustom.POST_GRID_ENTITY_COLLISION]: PostGridEntityCollisionRegisterParameters;
|
|
114
|
+
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER]: PostGridEntityCustomRenderRegisterParameters;
|
|
115
|
+
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE]: PostGridEntityCustomUpdateRegisterParameters;
|
|
112
116
|
[ModCallbackCustom.POST_GRID_ENTITY_INIT]: PostGridEntityInitRegisterParameters;
|
|
113
117
|
[ModCallbackCustom.POST_GRID_ENTITY_REMOVE]: PostGridEntityRemoveRegisterParameters;
|
|
114
118
|
[ModCallbackCustom.POST_GRID_ENTITY_RENDER]: PostGridEntityRenderRegisterParameters;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LevelStage,
|
|
3
|
+
RoomType,
|
|
4
|
+
StageID,
|
|
5
|
+
StageType,
|
|
6
|
+
} from "isaac-typescript-definitions";
|
|
7
|
+
|
|
8
|
+
/** Used by the room history feature. */
|
|
9
|
+
export interface RoomDescription {
|
|
10
|
+
stage: LevelStage;
|
|
11
|
+
stageType: StageType;
|
|
12
|
+
stageID: StageID;
|
|
13
|
+
roomType: RoomType;
|
|
14
|
+
roomVariant: int;
|
|
15
|
+
roomSubType: int;
|
|
16
|
+
roomName: string;
|
|
17
|
+
roomGridIndex: int;
|
|
18
|
+
roomListIndex: int;
|
|
19
|
+
}
|
|
@@ -23,6 +23,8 @@ import { postGameStartedReorderedRegister } from "../callbacks/subscriptions/pos
|
|
|
23
23
|
import { postGreedModeWaveRegister } from "../callbacks/subscriptions/postGreedModeWave";
|
|
24
24
|
import { postGridEntityBrokenRegister } from "../callbacks/subscriptions/postGridEntityBroken";
|
|
25
25
|
import { postGridEntityCollisionRegister } from "../callbacks/subscriptions/postGridEntityCollision";
|
|
26
|
+
import { postGridEntityCustomRenderRegister } from "../callbacks/subscriptions/postGridEntityCustomRender";
|
|
27
|
+
import { postGridEntityCustomUpdateRegister } from "../callbacks/subscriptions/postGridEntityCustomUpdate";
|
|
26
28
|
import { postGridEntityInitRegister } from "../callbacks/subscriptions/postGridEntityInit";
|
|
27
29
|
import { postGridEntityRemoveRegister } from "../callbacks/subscriptions/postGridEntityRemove";
|
|
28
30
|
import { postGridEntityRenderRegister } from "../callbacks/subscriptions/postGridEntityRender";
|
|
@@ -118,6 +120,10 @@ export const CALLBACK_REGISTER_FUNCTIONS: {
|
|
|
118
120
|
[ModCallbackCustom.POST_GRID_ENTITY_BROKEN]: postGridEntityBrokenRegister,
|
|
119
121
|
[ModCallbackCustom.POST_GRID_ENTITY_COLLISION]:
|
|
120
122
|
postGridEntityCollisionRegister,
|
|
123
|
+
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER]:
|
|
124
|
+
postGridEntityCustomRenderRegister,
|
|
125
|
+
[ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE]:
|
|
126
|
+
postGridEntityCustomUpdateRegister,
|
|
121
127
|
[ModCallbackCustom.POST_GRID_ENTITY_INIT]: postGridEntityInitRegister,
|
|
122
128
|
[ModCallbackCustom.POST_GRID_ENTITY_REMOVE]: postGridEntityRemoveRegister,
|
|
123
129
|
[ModCallbackCustom.POST_GRID_ENTITY_RENDER]: postGridEntityRenderRegister,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CollectibleIndex is a specific type of string; see the documentation for the
|
|
2
|
+
* `CollectibleIndex` is a specific type of string; see the documentation for the
|
|
3
3
|
* `getCollectibleIndex` function. Mods can signify that data structures handle collectibles by
|
|
4
4
|
* using this type.
|
|
5
5
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `PickupIndex` is a specific type of string; see the documentation for the `getPickupIndex`
|
|
3
|
+
* function. Mods can signify that data structures handle collectibles by using this type.
|
|
4
|
+
*
|
|
5
|
+
* For example:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const pickupNameMap = new Map<PickupIndex, string>();
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* This type is branded for extra type safety.
|
|
12
|
+
*/
|
|
13
|
+
export type PickupIndex = int & {
|
|
14
|
+
readonly __pickupIndexBrand: symbol;
|
|
15
|
+
};
|
package/src/types/PlayerIndex.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PlayerIndex is a specific type of number that represents a unique identifier for a player. Mods
|
|
2
|
+
* `PlayerIndex` is a specific type of number that represents a unique identifier for a player. Mods
|
|
3
3
|
* can signify that data structures handle `EntityPlayer` by using this type. For more information,
|
|
4
4
|
* see the documentation for the `getPlayerIndex` function.
|
|
5
5
|
*
|
package/src/upgradeMod.ts
CHANGED
|
@@ -39,7 +39,8 @@ export function upgradeMod(modVanilla: Mod): ModUpgraded {
|
|
|
39
39
|
patchErrorFunction();
|
|
40
40
|
loadShaderCrashFix(modVanilla);
|
|
41
41
|
|
|
42
|
-
// We initialize the
|
|
42
|
+
// We initialize the `POST_NEW_ROOM_EARLY` callback first since it is used by the save data
|
|
43
|
+
// manager.
|
|
43
44
|
postNewRoomEarlyCallbackInit(mod);
|
|
44
45
|
|
|
45
46
|
// We initialized the save data manager second since it is used by the other custom callbacks
|