1163 Commits

Author SHA1 Message Date
Dylan K. Taylor
efdd7a186d
World: fixed population timer sometimes not being stopped 2023-02-21 18:31:33 +00:00
Dylan K. Taylor
2f12bb9943
Merge branch 'next-minor' into next-major 2023-02-06 12:34:57 +00:00
alvin0319
981385cf4a
GeneratorManager: Removed redundant Closure wrapping (#5551) 2023-02-04 14:04:31 +00:00
Dylan K. Taylor
da5302ca86
BlockStateData: introduce and use current() 2023-02-02 16:21:50 +00:00
Dylan K. Taylor
6b7a4e2c41
Split up ItemDataUpgrader (preparing for code backport) 2023-02-02 16:08:49 +00:00
Dylan K. Taylor
e9b994cbc3
Allow limiting max schema ID loaded for item ID upgrading 2023-02-02 15:29:45 +00:00
Dylan K. Taylor
0e15a8698a
BlockStateUpgrader: do not use blockstate version to manage internal schemas
these are no longer reliable.
2023-02-01 22:35:59 +00:00
Dylan K. Taylor
2b987b450b
always the CS... 2023-01-26 14:58:32 +00:00
Dylan K. Taylor
f56339c306
Fix build 2023-01-26 14:48:43 +00:00
Dylan K. Taylor
0a3ecfdae9
Clean up terminology around block state IDs and their handling 2023-01-25 19:01:15 +00:00
Dylan K. Taylor
cbaff1caec
BlockPlaceEvent: use BlockTransaction, closes #1760
BlockPlaceEvent no longer extends BlockEvent, since it's now a multi-block event
getBlockReplaced() is removed
getTransaction() is added

to be honest, BlockPlaceEvent should be something like PlayerBlockPlaceEvent...
2023-01-24 15:49:42 +00:00
Dylan K. Taylor
7314151c47
LevelDB: code cleanup 2023-01-17 22:47:43 +00:00
Dylan K. Taylor
7abfc46567
First look at 3D biome support 2023-01-17 21:41:30 +00:00
Dylan K. Taylor
5c2ed210fc
Merge branch 'next-minor' into next-major 2023-01-14 20:53:41 +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
0132ff47cb
Merge branch 'next-minor' into next-major 2023-01-13 17:46:35 +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
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 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
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