Commit Graph

733 Commits

Author SHA1 Message Date
a9f8afa077 Banner: remove Deque usages
originally I introduced this to make it easier to implement the various APIs addPattern removePattern etc, but those were later removed in favour of simple getPatterns() and setPatterns(), allowing plugin developers to use ext-ds APIs to manipulate patterns.
However, ds poses a number of headaches because of mutability combined with by-ref semantics, which make it a pain to use these on the APIs because we can't guarantee that they won't be modified.
As much as arrays suck, they have two significant advantages over ext-ds: 1) they have copy-on-write semantics, and 2) they support PHP 8.0 without any extra work from me.
2021-01-15 00:17:56 +00:00
5392ddf0b9 Fixed TNT broadcasting ignition sound (#3996)
closes #3952
2021-01-07 21:18:18 +00:00
9228f006d4 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	composer.json
#	composer.lock
#	resources/vanilla
#	src/CrashDump.php
#	src/PocketMine.php
#	src/pocketmine/Server.php
#	src/pocketmine/item/Bucket.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	src/pocketmine/network/mcpe/protocol/BatchPacket.php
#	src/pocketmine/tile/Furnace.php
#	src/pocketmine/utils/UUID.php
#	src/utils/ServerKiller.php
2020-12-20 20:54:13 +00:00
2af15557b9 Merge branch 'stable'
# Conflicts:
#	.travis.yml
#	resources/vanilla
#	src/block/BlockToolType.php
#	src/network/mcpe/protocol/types/entity/MetadataProperty.php
#	tests/travis/setup-php.yml
2020-12-11 22:44:04 +00:00
870d237260 BlockFactory::get() second parameter is now mandatory 2020-11-18 00:50:01 +00:00
6a1f551aab [ci skip] update TileFactory TODOs (#3912) 2020-11-17 11:04:26 +00:00
16b71a265f Barrel: added missing function import 2020-11-16 19:09:59 +00:00
a9faed7171 [ci skip] update BlockFactory TODOs 2020-11-16 18:23:01 +00:00
563336cdc9 CoralType: remove unused magicNumber stuff 2020-11-16 18:12:38 +00:00
1eee24f1fa Implemented coral blocks
there are some complications with coral plants due to the fact we're stuck with R12 worlds right now - and also coral fans are a major pain to implement due to how messed up the metadata is.
2020-11-16 18:05:39 +00:00
55a9ce46b9 VanillaBlocks: added BARREL 2020-11-16 17:56:13 +00:00
d7c6a20b34 Barrel: added @return $this to setOpen() 2020-11-16 17:29:24 +00:00
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
1cf3a500f8 Clean up ChestInventory handling
longer term I want to rip this crap out completely, but right now this provides minor maintainability benefits, while also making it slightly less nasty to deal with other containers which animate their blocks, such as barrels and shulker boxes.
2020-11-16 16:59:19 +00:00
4ade7b6225 added CoralType enum 2020-11-14 16:24:13 +00:00
06efad94b6 Separated metadata handling from PillarRotationTrait 2020-11-14 16:21:50 +00:00
8e0cba56b8 Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/tile/Tile.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/l7-baseline.neon
2020-11-12 22:10:47 +00:00
518a7827a6 BlockFactory: make slab registration slightly less awful to look at 2020-11-03 19:28:32 +00:00
32929925aa Block: added a bunch of state manipulation APIs 2020-11-03 19:13:32 +00:00
0a8dc3edd3 Fixed users of ColorInMetadataTrait having uninitialized default colours 2020-11-03 18:42:40 +00:00
bcedbc364b BlockDataSerializer: added methods to read/write coral facing 2020-11-03 18:41:12 +00:00
5cc2a9c3dd World: rename getChunkAtPosition() to getOrLoadChunkAtPosition()
this more accurately reflects what it does.
2020-11-03 14:12:47 +00:00
3e21e47b7a Liquid: make getFlowVector() slightly less cancerous to read 2020-11-01 14:39:59 +00:00
241a50387b World: added getHighestAdjacentRealBlockSkyLight()
this is the same as its 'non-real' counterpart, but it accounts for time of day.
2020-10-31 16:44:42 +00:00
014317381f Sugarcane: deduplicate growth code
this also fixes sugarcane attempting to grow past the top of the world (closes #3883).
2020-10-27 18:05:41 +00:00
4c0c2ebd24 CS cleanup 2020-10-26 15:56:30 +00:00
a01c086481 Introduced VanillaEnchantments registry 2020-10-23 20:48:19 +01:00
de6d260b76 Fixed cactus and sugarcane trying to grow past the top of the world 2020-10-17 15:05:55 +01:00
792f38f474 Carpet and Wool now have dynamic colours 2020-10-15 14:45:28 +01:00
0ef0848c44 Concrete and ConcretePowder colour is now dynamic 2020-10-15 14:30:07 +01:00
df7bafe2bc TileFactory: fixed missing Beacon tile registration
I had this locally but forgot to commit it ...
2020-10-07 15:16:27 +01:00
78bddac823 Player: remove removeFormat, chat formatting is now unconditionally available
This change was made after exploring turning this into a permission. It occurred to me that this feature is entirely superfluous because it's non-vanilla, can be done by plugins, and is usually considered as a bug. In addition, disabling this behaviour required third party code just for this one thing because it was not able to be managed by a permissions plugin.
Instead, it's better to produce a plugin which implements this behaviour if it's desired, by making use of SignChangeEvent and PlayerChatEvent/PlayerCommandPreprocessEvent.

close #3856, close #2288
2020-10-06 14:00:23 +01:00
e39d2c4621 Beacon: fixed crash in PC worlds 2020-10-06 13:40:49 +01:00
dfee8b7fa5 Added SignLikeRotationTrait 2020-10-04 21:09:45 +01:00
fc1084d65c Sponge: fixed wet/dry state not persisting in inventory 2020-10-04 19:42:29 +01:00
7f9c4355f0 Revert back to floor/wall banner variants
this code largely duplicates the same code in FloorSign/WallSign and needs to be de-duplicated.
2020-10-04 19:05:43 +01:00
7ef794d725 imports cleanup 2020-10-04 18:22:07 +01:00
d3a3a41d2b Revert back to separated floor/wall sign
the conditionally useless properties are problematic.
2020-10-04 17:52:23 +01:00
e6bf7278fc Sign: remove obsolete clone hook
this is no longer required because SignText is not mutable anymore.
2020-10-04 17:24:40 +01:00
388a19ef5d Persistent block metadata may now have mutable parts
Not allowing this makes stuff like anvil damage, colour, wood type, live/dead bit, wet/dry etc all too much hassle to deal with.
Naturally I want to get rid of this shit altogether, but first it's necessary to construct a new system that we can shift into before all this bullshit can be addressed fully, so for now we have to work within the bounds of the old system.
This change will permit dynamic colours for concrete/concrete powder etc, dynamic wood types where the wood type isn't embedded in the legacy ID, and so forth. Allowing full flexibility requires either more old system hacks or completing the migration to a new system which doesn't have these limitations. I prefer to do the latter, but this change will make it somewhat easier to do.
2020-10-04 11:40:05 +01:00
5807a385cc Added stub classes for Beacon
this doesn't do anything yet, it's intended solely to prevent further loss of data.
2020-10-02 00:59:53 +01:00
84feec954f BlockLegacyMetadata: Added constants for mushroom block variants 2020-10-01 21:41:46 +01:00
14c156b162 Added ChemicalHeat block stub 2020-10-01 14:46:14 +01:00
12087c9850 Wall: use facing as value as well as key in connections 2020-09-26 17:41:00 +01:00
9e3ff21aea Wall: remove unused import 2020-09-26 17:26:54 +01:00
ec7c5fd669 Added a BrewingStandSlot enum 2020-09-26 17:20:02 +01:00
7b02cc3efd Implemented #3836: Replace setCancelled() in events with cancel() and uncancel()
The motivation for this is to prevent passing a dynamic argument to cancellation, which in almost all cases is a bug in user code. This same mistake also appears in a few places in the PM core (as seen in this commit), but in those cases the mistakes were mostly harmless since they were taking place before the event was actually called.
closes #3836
2020-09-26 14:31:56 +01:00
8e12693494 Entity: Invalid blocksAround cache when something happens during onEntityInside()
this fixes TNT spawning multiple entities when lit by flaming arrows.
The problem here is a bit more complex (entities aren't immediately notified when local block updates happen, so they cache stuff that becomes unusable). The simplest option would be to just lose the cache, but that would have some impacts on performance.
Barring a rethink of the block updating mechanism, this solution seems usable for now.
2020-09-25 16:35:59 +01:00
c7070788f9 Rename and repurpose Block->diffusesSkyLight to blocksDirectSkyLight
this new form allows skipping some useless checks during sky light calculation and also allows getting rid of the last hard dependency on core Block classes.
We're getting real close to native light now.
2020-09-08 22:40:05 +01:00
205617f29e Untether LightUpdate and children from BlockFactory 2020-09-08 18:14:35 +01:00