Commit Graph

32 Commits

Author SHA1 Message Date
Dylan K. Taylor
1111d0d4c7 World: remove dead function getChunkTiles() 2019-07-29 18:00:23 +01:00
Dylan K. Taylor
f3f8cd98de World: fixed scheduled updates causing chunk loading
this probably needs to be backported.
2019-07-29 17:17:05 +01:00
Dylan K. Taylor
80d277f1b5 removed return value of ChunkManager->setBlockAt() and World->setBlock() 2019-07-21 18:55:22 +01:00
Dylan K. Taylor
6fdcb09891 fix PhpStorm's screwup with World->setBlock() doc comment
it's not the first time i've seen it do this, and i still have no idea why it does this.
2019-07-21 18:52:33 +01:00
Dylan K. Taylor
27352486a0 Remove item NBT runtime usage, marginalize to serialize/deserialize
this is a more tame version of my initial attempt to firehose item NBT. It marginalizes the use of item NBT to the places where it's needed on interfaces, leaving the internals clean to operate on whatever they like.
2019-07-16 16:51:45 +01:00
Dylan K. Taylor
6a93eb8361 Merge branch 'stable' 2019-07-13 18:08:45 +01:00
Dylan K. Taylor
5c25f770c2 World: reduce legacy id/meta dependencies 2019-07-06 15:21:45 +01:00
Dylan K. Taylor
a2bb6a41d9 World: some cleanup to random blocktick registry 2019-07-06 15:16:03 +01:00
Dylan K. Taylor
ce77e283ab Revert "fix race condition between chunk generation and light population"
This reverts commit 80747814fb.
2019-07-05 19:56:58 +01:00
Dylan K. Taylor
80747814fb fix race condition between chunk generation and light population 2019-07-05 19:40:33 +01:00
Dylan K. Taylor
ceb6529ee3 encapsulate light recalculation logic inside LightUpdate classes
now we can do a standard light recalculation from anywhere.
2019-07-04 19:55:48 +01:00
Dylan K. Taylor
ee72680f44 Removing "metadata": overengineered useless Bukkit copy-pasta
the intentions of this are good, but the usability is terrible and it's not fit for purpose. Since there are a total of zero plugins on Poggit which use this garbage, it makes more sense to eliminate the technical debt. See #2766 for discussion about replacing this.
2019-06-26 14:43:21 +01:00
Dylan K. Taylor
4448919a8b Consider unknown chunk formats as corrupted
the reasoning for this is that the world version number should have accounted for a chunk format change. If it didn't, then we assume any chunk with a wrong version number is corrupted, since the handling of unknown formats is the same as that of corrupted chunks.
2019-06-26 13:22:45 +01:00
Dylan K. Taylor
6bbae4b2df SetDifficultyPacket: added create() 2019-06-25 18:34:12 +01:00
Dylan K. Taylor
0273bd4f53 Merge branch 'next-minor' 2019-06-22 16:05:17 +01:00
Dylan K. Taylor
ce74549ba3 Use 10 bits for Y coordinate in blockhash
fixes #2553
2019-06-22 15:53:56 +01:00
Dylan K. Taylor
2559f5ec2b Moved Player-related classes to pocketmine\player namespace 2019-06-18 18:51:36 +01:00
Dylan K. Taylor
db3305cb16 Remove Entity->isClosed() checks from places where they don't make sense
in all of these cases, this is just potentially concealing bugs. Closed entities should never appear at these points.
2019-06-17 16:39:46 +01:00
Dylan K. Taylor
211836274f World: remove redundant checks
when entities are added and removed which are savable, the dirty flag is set anyway, so these checks aren't needed.
2019-06-14 17:47:39 +01:00
Dylan K. Taylor
c1f900ab18 Start using transactions for block placement 2019-06-08 18:56:27 +01:00
Dylan K. Taylor
73964e6e2f Always do chunk relighting for unlit chunks on load
this is necessary because we stopped saving light info some time ago, so it has to be calculated on load for things to work properly.
2019-06-08 17:47:55 +01:00
Dylan K. Taylor
43dfc8ae0f Remove update mechanism for tiles, delegate to block instead
block handles triggering tile update on furnace for now.
2019-06-08 15:44:38 +01:00
Dylan K. Taylor
287c8c2dd4 Added static create() functions for many packets
There are a few motivations here:
1) Less boilerplate code (this can be written inline)
2) It's possible to provide multiple constructors for different packet variations to reduce the chance of errors.
3) It makes things catch fire on updates in ways that static analysers can understand.
2019-06-05 15:00:08 +01:00
Dylan K. Taylor
89d4f596bd World: add and use a prefixed logger in some places 2019-06-04 14:23:40 +01:00
Dylan K. Taylor
28f3322337 Block: add onPostPlace() hook 2019-05-27 17:30:57 +01:00
Dylan K. Taylor
b329cac3d2 Move pocketmine\tile\* to pocketmine\block\tile\* 2019-05-25 19:23:43 +01:00
Dylan K. Taylor
3ea8da2dd3 Use EnumTrait->equals() instead of direct comparison
It's not guaranteed that objects provided are the same as those in the enum registry, so they can't be directly compared.

Implementing comparison with === would require some kind of __equals() implementation or an extension to hook into such functionality.
2019-05-24 17:21:44 +01:00
Dylan K. Taylor
db4dac6d45 World: Remove incorrect isSolid() check for placement collision check
isSolid() != can be collided with. That's decided by the collision boxes provided, if any.
2019-05-12 16:00:38 +01:00
Dylan K. Taylor
9e72bc91a2 Separate block break-info to a separate dynamic unit 2019-05-10 16:24:59 +01:00
Dylan K. Taylor
78bb6f4a0c Reduce complexity of chunk sending system 2019-05-07 19:26:01 +01:00
Dylan K. Taylor
51548d1a27 World: remove useless internal function
this just complicates the logic for no reason. It had a purpose once, but no longer.
2019-05-07 18:51:26 +01:00
Dylan T
3cd6e12e71 Renaming "Level" -> "World" (#2907)
This has been a pain point for a long time due to the misleading nature of the name "level". It's also confusing when trying to do things like getting the XP level of the player or such, and also does not translate well to other languages.

This transition was already executed on the UI some time ago (language strings) and now it's time for the same change to occur on the API.

This will burn a lot of plugins, but they'll acclimatize. Despite the scary size of this PR, there isn't actually so many changes to make. Most of this came from renaming `Position->getLevel()` to `Position->getWorld()`, or cosmetic changes like changing variable names or doc comments.
2019-05-07 14:47:28 +01:00