Commit Graph

1146 Commits

Author SHA1 Message Date
Dylan K. Taylor
d786ed5ebf WorldManager: fixed debug spam 2023-01-13 17:43:02 +00:00
Dylan K. Taylor
8909aa6a18 Merge branch 'next-minor' into next-major 2023-01-13 17:29:25 +00:00
Dylan K. Taylor
dff3f45d22 Constify more tick-related things 2023-01-13 16:29:09 +00:00
Dylan K. Taylor
ecd8f151f1 Merge branch 'next-minor' into next-major 2023-01-12 22:08:25 +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
c2918709a3 Merge branch 'next-minor' into next-major 2023-01-06 01:59:04 +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
8fd4918429 Use Filesystem::fileGetContents() in more places 2022-12-25 18:26:53 +00:00
Dylan K. Taylor
c89df7eb1c Merge remote-tracking branch 'origin/next-minor' into next-major 2022-12-25 18:22:13 +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
f8cc015c51 Merge branch 'next-minor' into next-major 2022-12-23 16:58:59 +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 aebcfc516f.

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
9809909072 BedrockWorldData: remove unused custom fields 2022-12-19 15:06:06 +00:00
Dylan K. Taylor
de3af9e660 Fix CS 2022-12-19 15:02:59 +00:00
Dylan K. Taylor
a30c649607 BedrockWorldData: enable commands by default 2022-12-19 14:59:55 +00:00
Dylan K. Taylor
d7ebabd771 Fixed the client asking to upgrade PM-generated worlds 2022-12-19 14:56:04 +00:00
Dylan K. Taylor
be1087c071 Accept worlds from 1.19.40 and up 2022-12-19 14:55:24 +00:00
Dylan K. Taylor
b27c47335c JavaWorldData: remove Bedrock-compatible hacks
we don't need these, since we don't write to Java world formats anymore anyway.
2022-12-19 13:43:28 +00:00
Dylan K. Taylor
58eec637c1 Constify NBT keys in world data handling
this code is one giant mess that needs to be cleaned up though...
2022-12-19 13:39:41 +00:00
Dylan K. Taylor
3d75094874 Standardize explosion radius terminology
closes #5061
2022-12-15 22:43:36 +00:00
Dylan K. Taylor
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +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
Dylan K. Taylor
b6982a84ef Merge branch 'next-minor' into next-major 2022-11-25 14:52:56 +00:00
zSALLAZAR
5c1e9a35a9 Fix missing sounds when interacting with item frames (#5383)
closes #5168
2022-11-25 14:28:41 +00:00
zSALLAZAR
34839da757 Fix missing sound when a projectile strikes an amethyst block (#5382)
closes #5358
2022-11-15 14:50:05 +00:00
Dylan K. Taylor
613ce251c5 Merge branch 'next-minor' into next-major 2022-11-13 14:32:54 +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
a205d64732 Merge branch 'next-minor' into next-major 2022-11-12 17:02:56 +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
1a5cc8212c World: fixed spawning in the void when the spawn terrain is higher than y=70 on default worlds
fixes #5390
2022-11-07 14:23:29 +00:00
Dylan K. Taylor
01bad344a0 Merge branch 'next-minor' into next-major 2022-11-04 20:47:26 +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
fba4895a17 Merge branch 'next-minor' into next-major 2022-10-31 19:11:39 +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
9f6c6b2b71 Merge branch 'next-minor' into next-major 2022-10-16 16:58:50 +01:00