964 Commits

Author SHA1 Message Date
Dylan K. Taylor
75bb4f8da6
Merge branch 'stable' into next-minor 2023-02-21 18:32:58 +00:00
Dylan K. Taylor
efdd7a186d
World: fixed population timer sometimes not being stopped 2023-02-21 18:31:33 +00:00
alvin0319
981385cf4a
GeneratorManager: Removed redundant Closure wrapping (#5551) 2023-02-04 14:04:31 +00:00
Dylan K. Taylor
7d59bafd83
World: added requestSafeSpawn() (async)
this simplifies usages of safe spawns, since the caller doesn't need to know which chunks will be needed for the spawn to be selected.

We'll need this in the future, because safe spawns may also get diverted horizontally as well as vertically, which might require loading adjacent chunks as well as the chunk the position is actually in.
2023-01-14 17:42:17 +00:00
Dylan K. Taylor
2ed48c8469
... 2023-01-13 17:46:16 +00:00
Dylan K. Taylor
d786ed5ebf
WorldManager: fixed debug spam 2023-01-13 17:43:02 +00:00
Dylan K. Taylor
dff3f45d22
Constify more tick-related things 2023-01-13 16:29:09 +00:00
Dylan K. Taylor
91ac47ecba
Merge branch 'stable' into next-minor 2023-01-12 21:47:37 +00:00
Dylan K. Taylor
a79be994de
World: fixed block placement when clicking on replaceable blocks
in vanilla, it appears to behave as if the player always clicked on the up face if a block was replaced.

In PM, we were still using the original face, which caused bugs when, for example, placing a button next to a wall by clicking on the side of tallgrass. The button would replace the tallgrass, but stick to the wall, instead of placing itself on the ground like vanilla expects.

This may appear unusual to anyone who also happens to implement canBePlacedAt(), since the facing behaviour will be different. However, this behaviour appears to match vanilla, and even slabs (which I feared might break because of this change) work perfectly.

In the future, it may be desirable to pass some other value here, such as null, to indicate that the clicked block is being replaced. However, that's a BC break and therefore outside of the scope of a stable bug fix.
2023-01-12 21:11:48 +00:00
Dylan K. Taylor
ece49f011c
Merge branch 'stable' into next-minor 2023-01-06 01:50:17 +00:00
IvanCraft623
e647e8c933
World: Use existing function to notify nearby blocks of an update (#5494) 2023-01-05 16:55:35 +00:00
IvanCraft623
433f5451d7
Improve World::notifyNeighbourBlockUpdate() doc (#5491) 2023-01-04 20:11:55 +00:00
Dylan K. Taylor
0d169b4e80
Filesystem: added fileGetContents to reduce ErrorToExceptionHandler boilerplate code 2022-12-25 17:13:51 +00:00
Dylan K. Taylor
17125ce0e3
Merge branch 'stable' into next-minor 2022-12-23 16:56:54 +00:00
Dylan K. Taylor
ee7d4728d8
World: added cache for isChunkTickable()
this considerably reduces the amount of work done by the function, since it's usually checking the same chunks over and over again.
2022-12-19 21:20:21 +00:00
Dylan K. Taylor
923dcec4e7
Revert "World: do not refresh ticked chunks list every tick"
This reverts commit aebcfc516ff97492c58ee478a3944915a777a75e.

this has edge cases in the handling of adjacent chunk locks which I
didn't consider at the time. Once accounting for those edge cases, it
became significantly more complex to the point that I realized this
needed more planning.
2022-12-19 20:57:51 +00:00
Dylan K. Taylor
1e5597f0d5
World: account for null chunk edge case in tickChunk()
the target chunk may no longer be loaded if it was unloaded during a previous chunk's tick (e.g. during BlockGrowEvent).
Since the parent function iterates over a pre-selected array of chunks, the chunk will still be present in the list even if it's no longer loaded by the time it's reached.
2022-12-19 20:20:52 +00:00
Dylan K. Taylor
aebcfc516f
World: do not refresh ticked chunks list every tick
this is just wasting CPU time, since the effects aren't noticeable on such a small timescale anyway.
This reduces the CPU impact of chunk selection by 95%. However, this is the lesser part of chunk ticking, and the lion's share of the performance impact still comes from actually ticking the chunks.
2022-12-19 20:17:29 +00:00
Dylan K. Taylor
95d0a3bf41
Merge branch 'stable' into next-minor 2022-12-15 19:38:22 +00:00
Armen Deroian
4357c110c8
Add the event: WorldParticleEvent (#5428) 2022-12-06 14:19:14 +00:00
Dylan K. Taylor
99996b62d6
Align PhpDoc @param tags according to PHP-CS-Fixer 2022-12-06 13:21:20 +00:00
Armen Deroian
fed2a6d917
Add the event: WorldSoundEvent (#5322) 2022-12-06 13:06:40 +00:00
zSALLAZAR
5c1e9a35a9
Fix missing sounds when interacting with item frames (#5383)
closes #5168
2022-11-25 14:28:41 +00:00
Dylan K. Taylor
2fcff13578
World: added getter and setter for simulation radius 2022-11-12 23:32:12 +00:00
Dylan K. Taylor
b4b8ef1c6b
World: Improve performance of ticked chunk selection when lots of loaders use the same chunk
since we use the same simulation distance for every loader, multiple loaders on the same chunk will produce the same set of ticked chunks.
2022-11-12 22:21:30 +00:00
Dylan K. Taylor
83ddcce987
World: Considerably simplify ticked chunk selection
WARNING: This WILL have a performance impact on larger servers, but that's the price to pay for having crops actually grow.

The old overengineered method for doing this was causing glacially slow crop growth, vanilla parity issues and really just didn't make much sense. This method is probably incorrect too, but it will at least produce visible results.
2022-11-12 16:57:35 +00:00
Dylan K. Taylor
824ed0a56a
Merge branch 'stable' into next-minor 2022-11-07 15:04:48 +00:00
Dylan K. Taylor
2d0602d19f
World: fixed spawning in the void when the spawn terrain is higher than y=70 on default worlds
fixes #5390
2022-11-07 14:24:17 +00:00
Dylan K. Taylor
cdbdcb5d67
Merge branch 'stable' into next-minor 2022-11-04 20:44:28 +00:00
Dylan K. Taylor
2fdc46c165
PHPStan 1.9 features 2022-11-04 20:23:34 +00:00
Dylan K. Taylor
b6f6671a81
Merge branch 'stable' into next-minor 2022-10-31 15:34:24 +00:00
Dylan K. Taylor
a9361b3f8b
Changes for 1.19.40 2022-10-25 23:11:41 +01:00
Dylan K. Taylor
7864294336
Merge branch 'stable' into next-minor 2022-10-16 16:53:14 +01:00
Dylan K. Taylor
2a910c1cc2
World: more minor documentation improvements 2022-10-16 16:50:42 +01:00
Dylan K. Taylor
cd04a3db2e
World: ensure that addParticle/addSound don't send stuff to players who are not in range, even when an array of targets is given
closes #5347
2022-10-16 16:45:52 +01:00
Dylan K. Taylor
572def9245
World: Improve quality of type information 2022-10-16 16:21:59 +01:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
IvanCraft623
fc56c041f3
Correct knockback from explosions (#5161) 2022-09-28 21:09:07 +01:00
IvanCraft623
5e5661de75
Play burp sound when consuming a FoodSource (#5158) 2022-09-27 17:21:55 +01:00
Eren A. Akyol
82ba7903c8
Fixed wrong key being used for entity type ID in save data (#5288)
closes #5260
2022-09-15 13:40:48 +01:00
Dylan K. Taylor
ca4b8a5827
World: remove local static recursion guard variable, closes #3125 2022-09-02 19:24:09 +01:00
Dylan K. Taylor
c13170a00b
Avoid implicit integer cast in Normal::pickBiome()
this throws deprecation warnings on PHP 8.1.
2022-08-20 17:16:38 +01:00
Dylan K. Taylor
dce8bd6d21
CS: Standardize new with braces 2022-08-15 17:16:23 +01:00
XenialDan
eb916fe43d
Use a falling block entity to improve client side performance of FloatingTextParticle (#4714)
Performance tests show that this has a considerable client-side performance advantage over using players. In my local tests, using 1000 floating texts in a 10x10x10 area, I observed an FPS increase from 1.5 to 8.0.
2022-07-24 18:22:21 +01:00
Dylan K. Taylor
5e3b3a0700
Fix assert spam on debug clients 2022-07-24 17:51:02 +01:00
Dylan K. Taylor
06655bee78
Updated to 1.19.10 2022-07-13 00:59:49 +01:00
Dylan K. Taylor
784d602600
Fixed ItemBreakParticle using untranslated internal ID/meta for network data
this caused it to display particles for incorrect items. It may also have been possibly responsible for client crashes.
2022-06-29 14:01:39 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
179cac45f5
Merge branch 'stable' into next-minor 2022-05-22 16:21:05 +01:00
Dylan K. Taylor
7eaf1246a0
Explosion: cap yield at 100%
this could overflow if the explosion size is less than 1.
While this currently doesn't have any negative effects, if we decided to support >100% yield, this would cause some issues.
2022-05-21 22:43:26 +01:00