diff --git a/modules/events-mod/src/main/typescript/generated/kafkatorio-schema/kafkatorio-schema.ts b/modules/events-mod/src/main/typescript/generated/kafkatorio-schema/kafkatorio-schema.ts index 54893f8..1037ced 100644 --- a/modules/events-mod/src/main/typescript/generated/kafkatorio-schema/kafkatorio-schema.ts +++ b/modules/events-mod/src/main/typescript/generated/kafkatorio-schema/kafkatorio-schema.ts @@ -67,7 +67,7 @@ export namespace KafkatorioPacketData { type: KafkatorioPacketData.Type.EntityUpdate; key: EntityUpdateKey; events?: { [key: EventName]: Tick[] } | null; - chunkPosition?: MapChunkPosition | null; + chunkPosition?: MapEntityPosition | null; graphicsVariation?: UByte | null; health?: Float | null; isActive?: boolean | null; @@ -136,9 +136,9 @@ export interface EntityUpdateKey { protoType: string; } -export type MapChunkPosition = [ - x: Int, - y: Int, +export type MapEntityPosition = [ + x: Double, + y: Double, ]; export type UByte = uint8; @@ -178,11 +178,6 @@ export type Colour = [ alpha: Float, ]; -export type MapEntityPosition = [ - x: Double, - y: Double, -]; - export type Int = int; export interface ConfigurationUpdateModData { @@ -192,28 +187,65 @@ export interface ConfigurationUpdateModData { } export type FactorioPrototype = + | FactorioPrototype.Entity | FactorioPrototype.MapTile; export namespace FactorioPrototype { export enum Type { MapTile = "kafkatorio.prototype.MapTile", + Entity = "kafkatorio.prototype.Entity", } export interface MapTile { type: FactorioPrototype.Type.MapTile; name: PrototypeName; - layer: UInt; mapColour: Colour; + layer: UInt; collisionMasks: List; order: string; canBeMined: boolean; } + + export interface Entity { + type: FactorioPrototype.Type.Entity; + name: PrototypeName; + mapColour: Colour; + protoType: string; + objectName: string; + colour: Colour; + maxHealth: Float; + isBuilding: boolean; + isEntityWithOwner: boolean; + isMilitaryTarget: boolean; + miningProperties: MiningProperties; + } } export type EventName = string; export type Byte = int8; +export type MapChunkPosition = [ + x: Int, + y: Int, +]; + export type List = any; -export type PrototypeKey = Int; \ No newline at end of file +export interface MiningProperties { + canBeMined: boolean; + products: MinedProduct[] | null; +} + +export type PrototypeKey = Int; + +export interface MinedProduct { + type: Type; + name: PrototypeName; + amount: Double | null; +} + +export enum Type { + item = "item", + fluid = "fluid", +} \ No newline at end of file diff --git a/modules/events-schema/src/commonMain/kotlin/dev/adamko/kafkatorio/schema/common/factorioPrototypes.kt b/modules/events-schema/src/commonMain/kotlin/dev/adamko/kafkatorio/schema/common/factorioPrototypes.kt index 49f8370..5f08e0c 100644 --- a/modules/events-schema/src/commonMain/kotlin/dev/adamko/kafkatorio/schema/common/factorioPrototypes.kt +++ b/modules/events-schema/src/commonMain/kotlin/dev/adamko/kafkatorio/schema/common/factorioPrototypes.kt @@ -32,7 +32,7 @@ sealed interface FactorioPrototype { override val name: PrototypeName, override val mapColour: Colour, - val type: String, + val protoType: String, val objectName: String, val colour: Colour, val maxHealth: Float,