Commit 07a4fee
authored
Fix unloaded postbox voiding packages (#8553)
There seems to be an area of chunks where `Level.isLoaded` returns
`false`, but `PostboxBlockEntity.onChunkUnloaded` has not yet been
called. Any trains delivering to that area will use the offline buffer,
but when the block entity is eventually unloaded, it will overwrite the
delivered packages with an older version of the inventory, causing them
to be lost.
I made the following changes to fix this:
- Sync the offline buffer whenever the inventory changes, rather than
in `onChunkUnloaded`.
- Fix `StationBlockEntity.attachPackagePort` incorrectly replacing
`GlobalPackagePort` instances with new ones, resetting their data.
- During mail transfer, get the `Level` from `ServerLifecycleHooks`
rather than `CarriageContraptionEntity`: this ensures a loaded
postbox will always be discovered, regardless of whether the train
itself is loaded.
Fixes #74911 parent 5f9289f commit 07a4fee
File tree
6 files changed
+84
-51
lines changed- src/main/java/com/simibubi/create/content
- logistics/packagePort/postbox
- trains
- schedule/destination
- station
6 files changed
+84
-51
lines changedLines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | | - | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
126 | | - | |
127 | | - | |
| 132 | + | |
128 | 133 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 134 | + | |
| 135 | + | |
133 | 136 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | | - | |
145 | 145 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | | - | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | | - | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Lines changed: 19 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
| 35 | + | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 164 | | |
173 | 165 | | |
174 | 166 | | |
175 | 167 | | |
176 | | - | |
177 | 168 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 169 | + | |
| 170 | + | |
185 | 171 | | |
| 172 | + | |
186 | 173 | | |
187 | 174 | | |
188 | 175 | | |
| |||
212 | 199 | | |
213 | 200 | | |
214 | 201 | | |
215 | | - | |
216 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
217 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
218 | 210 | | |
219 | 211 | | |
220 | 212 | | |
| |||
243 | 235 | | |
244 | 236 | | |
245 | 237 | | |
246 | | - | |
247 | 238 | | |
248 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
249 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
250 | 247 | | |
251 | 248 | | |
252 | 249 | | |
| |||
Lines changed: 8 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
985 | 985 | | |
986 | 986 | | |
987 | 987 | | |
988 | | - | |
989 | | - | |
| 988 | + | |
990 | 989 | | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
1002 | 996 | | |
1003 | | - | |
1004 | 997 | | |
1005 | 998 | | |
1006 | 999 | | |
| |||
0 commit comments