@@ -31,8 +31,8 @@ pub struct EntityStateSyncModule;
31
31
fn track_previous < T : ComponentId + Copy + Debug + PartialEq > ( world : & World ) {
32
32
let post_store = world
33
33
. entity_named ( "post_store" )
34
- . add :: < flecs:: pipeline:: Phase > ( )
35
- . depends_on :: < flecs:: pipeline:: OnStore > ( ) ;
34
+ . add ( id :: < flecs:: pipeline:: Phase > ( ) )
35
+ . depends_on ( id :: < flecs:: pipeline:: OnStore > ( ) ) ;
36
36
37
37
// we include names so that if we call this multiple times, we don't get multiple observers/systems
38
38
let component_name = std:: any:: type_name :: < T > ( ) ;
@@ -46,14 +46,14 @@ fn track_previous<T: ComponentId + Copy + Debug + PartialEq>(world: &World) {
46
46
47
47
world
48
48
. observer_named :: < flecs:: OnSet , & T > ( & observer_name)
49
- . without :: < ( Prev , T ) > ( ) // we have not set Prev yet
49
+ . without ( ( id :: < Prev > ( ) , id :: < T > ( ) ) ) // we have not set Prev yet
50
50
. each_entity ( |entity, value| {
51
51
entity. set_pair :: < Prev , T > ( * value) ;
52
52
} ) ;
53
53
54
54
world
55
55
. system_named :: < ( & mut ( Prev , T ) , & T ) > ( system_name. as_str ( ) )
56
- . kind_id ( post_store)
56
+ . kind ( post_store)
57
57
. each ( |( prev, value) | {
58
58
* prev = * value;
59
59
} ) ;
@@ -70,7 +70,7 @@ impl Module for EntityStateSyncModule {
70
70
) > ( "entity_xp_sync" )
71
71
. term_at ( 0u32 )
72
72
. singleton ( )
73
- . kind :: < flecs:: pipeline:: OnStore > ( )
73
+ . kind ( id :: < flecs:: pipeline:: OnStore > ( ) )
74
74
. each_iter ( |table, idx, ( compose, net, prev_xp, current) | {
75
75
const {
76
76
assert ! ( size_of:: <Xp >( ) == size_of:: <u16 >( ) ) ;
@@ -87,8 +87,8 @@ impl Module for EntityStateSyncModule {
87
87
total_xp : VarInt :: default ( ) ,
88
88
} ;
89
89
90
- let entity = table. entity ( idx) ;
91
- entity. modified :: < Xp > ( ) ;
90
+ let entity = table. entity ( idx) . expect ( "idx must be in bounds" ) ;
91
+ entity. modified ( id :: < Xp > ( ) ) ;
92
92
93
93
compose. unicast ( & packet, * net, system) . unwrap ( ) ;
94
94
}
@@ -97,10 +97,10 @@ impl Module for EntityStateSyncModule {
97
97
} ) ;
98
98
99
99
system ! ( "entity_metadata_sync" , world, & Compose ( $) , & mut MetadataChanges )
100
- . kind :: < flecs:: pipeline:: OnStore > ( )
100
+ . kind ( id :: < flecs:: pipeline:: OnStore > ( ) )
101
101
. each_iter ( move |it, row, ( compose, metadata_changes) | {
102
102
let system = it. system ( ) ;
103
- let entity = it. entity ( row) ;
103
+ let entity = it. entity ( row) . expect ( "row must be in bounds" ) ;
104
104
let entity_id = VarInt ( entity. minecraft_id ( ) ) ;
105
105
106
106
let metadata = get_and_clear_metadata ( metadata_changes) ;
@@ -110,7 +110,7 @@ impl Module for EntityStateSyncModule {
110
110
entity_id,
111
111
tracked_values : RawBytes ( & view) ,
112
112
} ;
113
- if entity. has :: < Position > ( ) {
113
+ if entity. has ( id :: < Position > ( ) ) {
114
114
entity. get :: < & Position > ( |position| {
115
115
compose
116
116
. broadcast_local ( & pkt, position. to_chunk ( ) , system)
@@ -132,12 +132,12 @@ impl Module for EntityStateSyncModule {
132
132
?& ConnectionId ,
133
133
& mut ActiveAnimation ,
134
134
)
135
- . kind :: < flecs:: pipeline:: OnStore > ( )
135
+ . kind ( id :: < flecs:: pipeline:: OnStore > ( ) )
136
136
. each_iter (
137
137
move |it, row, ( position, compose, connection_id, animation) | {
138
138
let io = connection_id. copied ( ) ;
139
139
140
- let entity = it. entity ( row) ;
140
+ let entity = it. entity ( row) . expect ( "row must be in bounds" ) ;
141
141
let system = it. system ( ) ;
142
142
143
143
let entity_id = VarInt ( entity. minecraft_id ( ) ) ;
@@ -173,7 +173,7 @@ impl Module for EntityStateSyncModule {
173
173
& mut MovementTracking ,
174
174
& Flight ,
175
175
)
176
- . kind :: < flecs:: pipeline:: PreStore > ( )
176
+ . kind ( id :: < flecs:: pipeline:: PreStore > ( ) )
177
177
. each_iter (
178
178
|it,
179
179
row,
@@ -192,7 +192,7 @@ impl Module for EntityStateSyncModule {
192
192
) | {
193
193
let world = it. system ( ) . world ( ) ;
194
194
let system = it. system ( ) ;
195
- let entity = it. entity ( row) ;
195
+ let entity = it. entity ( row) . expect ( "row must be in bounds" ) ;
196
196
let entity_id = VarInt ( entity. minecraft_id ( ) ) ;
197
197
198
198
if let Some ( pending_teleport) = pending_teleport {
@@ -363,7 +363,7 @@ impl Module for EntityStateSyncModule {
363
363
& Owner ,
364
364
?& ConnectionId
365
365
)
366
- . kind :: < flecs:: pipeline:: OnUpdate > ( )
366
+ . kind ( id :: < flecs:: pipeline:: OnUpdate > ( ) )
367
367
. with_enum_wildcard :: < EntityKind > ( )
368
368
. each_iter ( |it, row, ( position, velocity, owner, connection_id) | {
369
369
if let Some ( _connection_id) = connection_id {
@@ -372,7 +372,7 @@ impl Module for EntityStateSyncModule {
372
372
373
373
let system = it. system ( ) ;
374
374
let world = system. world ( ) ;
375
- let arrow_entity = it. entity ( row) ;
375
+ let arrow_entity = it. entity ( row) . expect ( "row must be in bounds" ) ;
376
376
377
377
if velocity. 0 != Vec3 :: ZERO {
378
378
let center = * * position;
0 commit comments