9802 Commits

Author SHA1 Message Date
Dylan K. Taylor
c29523baf4 added a bunch of new blocks 2019-05-24 19:59:03 +01:00
Dylan K. Taylor
54216c2fee Block: Blow away a bunch of useless classes 2019-05-24 19:38:43 +01:00
Dylan K. Taylor
d25ecbebd4 Merge branch 'stable' 2019-05-24 17:33:51 +01:00
Dylan K. Taylor
f35b43613d IronTrapdoor: fixed fuel time, closes #2914
this should be removed during branch merge.
2019-05-24 17:31:36 +01:00
Dylan K. Taylor
3d0fa10437 Stonecutter: fix hardness, close #2915 2019-05-24 17:30:20 +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
9ce1e29a17 Player: fixed bow shooting, closes #2931 2019-05-24 15:58:00 +01:00
Dylan K. Taylor
1c99602a3f Player: give some inventory vars clearer names 2019-05-20 19:38:53 +01:00
Dylan K. Taylor
297ca25123 remove usage of inventory network IDs for marking permanent windows 2019-05-20 16:45:46 +01:00
Dylan K. Taylor
cd0f0cb66c missed this in previous commit 2019-05-20 16:45:00 +01:00
Dylan K. Taylor
d6ce3f82b1 Inventory: remove redundant return values 2019-05-20 16:30:00 +01:00
Dylan K. Taylor
c21a25efb9 move more rollback handling to network handlers, out of Player 2019-05-20 16:13:14 +01:00
Dylan K. Taylor
04d0b6c054 don't spam listeners with slot-change notifications when doing a content change 2019-05-20 15:45:15 +01:00
Dylan K. Taylor
c13b352b76 fix armour not being set correctly on entity spawn 2019-05-20 15:31:23 +01:00
Dylan K. Taylor
d9bc48bb01 CraftingGrid: Remove redundant overrides
the network session knows not to send this stuff because it's not associated with any window ID.
2019-05-20 15:15:20 +01:00
Dylan K. Taylor
bca0833035 Clean up handling of armour sync 2019-05-19 16:56:10 +01:00
Dylan K. Taylor
cd103cefcc Redesign inventory listening API
given that inventory listeners are no longer allowed to fiddle with the outcome of changing contents, it's now possible to allow having multiple listeners receiving events.

It's likely that this will be used for network inventory sync in the near future.
2019-05-19 16:36:38 +01:00
Dylan K. Taylor
dec6c9f49b Removed EntityInventoryChangeEvent and EntityArmorChangeEvent
there is nothing that these events do that can't be fulfilled by transactions. They complicate the internal implementation and produce unexpected behaviour for plugins when cancelled.

TL;DR: Use transactions. That's what they are there for.
2019-05-19 16:02:03 +01:00
Dylan K. Taylor
67affcea32 move more packet logic to net session
it seems like net session is turning into a giant dumping ground for sending API ... this needs to be cleaned up somehow.
2019-05-19 15:48:01 +01:00
Dylan K. Taylor
57219abc9d fix test failure 2019-05-18 20:20:33 +01:00
Dylan K. Taylor
c3c2dd3988 Rename SimpleSessionHandler -> InGameSessionHandler
the "simple" name comes from the early days of this refactor before I started splitting everything up into their own units. This handler is now in good enough condition to have a proper name.
2019-05-18 19:13:41 +01:00
Dylan K. Taylor
fa9fcea189 SimpleSessionHandler: Do not read blocks from world in onFailedBlockAction()
the world will do this anyway, so we can reduce our code burden here.
2019-05-18 19:11:23 +01:00
Dylan K. Taylor
d44ec702b0 Added BlockDataValidator::read5MinusHorizontalFacing() 2019-05-18 17:42:03 +01:00
Dylan K. Taylor
b11d3b0401 CraftingDataPacket: Fixed uncaught exception in decode
this is not exploitable because it's not a serverbound packet, but it should be fixed nonetheless.
2019-05-18 17:19:44 +01:00
Dylan K. Taylor
cd8645ff20 Removed PalettedBlockArray stub
the SubChunkConverter stub was accidentally removed in dd914e07523c7038c868c9969d88fdd97b00b7cf, but no great harm done ...
2019-05-18 15:15:20 +01:00
Dylan K. Taylor
6de0b48c1f PacketBatch: Always encode packets freshly, never reuse buffers
this causes bugs when a packet is modified during events and then re-sent to a player. Since we can't control this, we can't allow this kind of buffer reuse.

The only notable case where this will cause loss of performance is when broadcasting a series of packet(s) which accumulate to less than 256 bytes, which is reasonably cheap to encode anyway.
In addition, removing this caching is one roadblock to moving this serialization to native code, which will make it vastly faster.
2019-05-17 18:04:51 +01:00
Dylan K. Taylor
64f7f558a4 Merge branch 'stable'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/entity/Human.php
2019-05-17 17:43:30 +01:00
Dylan K. Taylor
76e5ea385b Skin: improved error checking
plugin devs should find this less of a pain in the ass now.
2019-05-17 17:40:27 +01:00
Dylan K. Taylor
0f398bbe66 LevelDB: Added conversion of legacy extradata -> 4D subchunk block layers 2019-05-17 17:15:45 +01:00
Dylan K. Taylor
f7a9da4e92 PillarRotationTrait: Allow axis shift to be defined by the includer 2019-05-16 18:02:03 +01:00
Dylan K. Taylor
dd914e0752 Block: move all legacy metadata constants into a dedicated class
this makes it easier to see what is using metadata (and makes it easier to get rid of later).
2019-05-16 16:55:44 +01:00
Dylan K. Taylor
1898db840d BlockFactory: more collapsible region things 2019-05-16 14:36:02 +01:00
Dylan K. Taylor
642c16dfe7 added some //region ... //endregion 2019-05-16 14:35:34 +01:00
Dylan K. Taylor
ff2600a0d0 Regenerated TODOs for BlockFactory and ItemFactory
also added //region and //endregion for IDE collapsibility
2019-05-16 14:20:51 +01:00
Dylan K. Taylor
5024de38b8 added more types of stone slab 2019-05-15 18:15:25 +01:00
Dylan K. Taylor
9ea684581f Merge remote-tracking branch 'origin/stable' 2019-05-13 18:17:42 +01:00
Dylan K. Taylor
fd413b512e Remove useless Dandelion class
this class is line-for-line identical to the Flower class.
2019-05-12 18:42:49 +01:00
Dylan K. Taylor
10831821be Anvil: fix wrong visibility for recalculateBoundingBox() 2019-05-12 17:58:45 +01:00
Dylan K. Taylor
85c6eb5003 Fence: cleanup some BB handling 2019-05-12 16:22:41 +01:00
Dylan K. Taylor
166d821bcf Stair: some BB handling cleanup 2019-05-12 16:22:20 +01:00
Dylan K. Taylor
d6b720b55d Wall: minor BB calculation cleanup 2019-05-12 16:21:52 +01:00
Dylan K. Taylor
a19651a8dc Painting: reduce complexity of getPaintingBB()
this makes it easier to unit-test.
2019-05-12 16:15:31 +01:00
Dylan K. Taylor
adf4639625 Painting: Clean up painful BB calculation code 2019-05-12 16:10:51 +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
90e6073202 Vine: Clean up awful bounding-box calculation
the logic here is deceptively simple, just obscured by a lot of really nasty code.
2019-05-12 15:58:28 +01:00
Dylan K. Taylor
41d754de5a Vine: fix bug when reading state multiple times 2019-05-12 15:03:44 +01:00
Frago9876543210
5a351d3caf Fix for Server::hasOfflinePlayerData (#2919) 2019-05-12 12:06:05 +01:00
Johnmacro
bb93d4f8de TimeCommand: Fix commands.time.query message (#2917) 2019-05-12 09:21:39 +01:00
Johnmacro
66818e178a DefaultPermissions: Fix typos in permission descriptions (#2918) 2019-05-12 09:20:45 +01:00
Dylan K. Taylor
c99846e069 Unify Item constructor style
this exposed a few more dead classes.
2019-05-11 18:24:21 +01:00