Commit Graph

105 Commits

Author SHA1 Message Date
f6481eab8f Implemented an InventoryEventProcessor, fixes #1986 (#2176)
* Implemented InventoryEventProcessor, fixes #1986
Event processors can now be registered and unregistered at will. Entity inventory/armor change events are now handled by event processors instead of the inventories themselves, which allows enabling/disabling the calling of these events at will.
This now avoids stupid things happening when initializing inventory contents, since the callers for those events are now registered _after_ the contents are initialized.
2018-06-09 17:37:10 +01:00
f0535df96d Remove deprecated things 2018-02-27 11:59:16 +00:00
6543d96910 Inventory: Split up armor and player inventory (#1957)
* Inventory: Split up PlayerInventory and armour handling
* Fixed other players don't see armour changes. This bug also exists on master.
2018-01-23 20:01:26 +00:00
69ddaacc28 Inventory: Add a $send parameter to clearAll() 2018-01-22 18:39:39 +00:00
4d2549b50a PlayerInventory: Fixed $send parameter not working for setting armour slots 2018-01-06 16:24:41 +00:00
f01ce8e994 null and void typehints 2017-09-21 12:54:04 +01:00
38e11aae5e Some cleanup to how EntityInventoryChangeEvents are handled 2017-09-20 10:13:05 +01:00
8728547a11 Remove unused imports 2017-09-19 19:58:53 +01:00
90fb3c5e12 Moved getNetworkType() to ContainerInventory since it's not used anywhere else 2017-09-19 19:57:22 +01:00
1323d89139 Remove redundant duplicated code for sendContents() and sendSlot() 2017-09-19 19:07:12 +01:00
136ab1dba1 Inventory->getItem(): Removed useless clones
this already returns a copy of the item anyway... wtf?
2017-09-19 18:49:08 +01:00
8cae20e818 Removed hotbar slot linking (works like PC now) 2017-09-19 18:36:57 +01:00
297172d111 Send creative inventory for all gamemodes, fixed recipe book 2017-09-12 14:40:16 +01:00
a6c0f1512c Send the hotbar instead of contents when resetting hotbar
This used to be fine before 1.2, but now hotbar is handled separately.
2017-09-02 11:07:14 +01:00
604d8ecf9a Protocol changes for 1.2.0.25 2017-09-02 11:05:49 +01:00
445a67954d Merge changes from master 2017-08-22 14:13:31 +01:00
876659cc73 Item factory refactor and added capability to register custom items 2017-08-21 17:49:26 +01:00
8958b3c51c Many many changes related to inventory transactions, fixed item dropping, fixed creative menu 2017-08-11 19:57:30 +01:00
260179197b Use SplFixedArrays in inventory, added more typehints and cleaned up some duplicated code 2017-08-09 13:12:07 +01:00
98e0a2ecba Removed InventoryType, added new inventory API methods 2017-08-07 11:31:36 +01:00
63d2b341b9 Day 2 2017-08-06 17:21:51 +01:00
77cd8e7799 More broken mess to spawn 1.2 2017-08-06 17:21:51 +01:00
c0e0730923 Fixed PE armor screen glitching when equipping armor items 2017-07-30 17:41:44 +01:00
24bdf330d5 Merge branch 'moar-typehints' 2017-07-15 09:43:43 +01:00
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
3a214b7ce6 Cleaned up isEncoded mess 2017-07-13 12:21:26 +01:00
5283975f20 Move inventory ID constants to their own interface
ContainerSetContentPacket will be removed in 1.2, and these aren't specific to ContainerSetContentPacket anyway.
2017-07-12 20:04:36 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
6ea0eb47ec Fixed PlayerInventory in_array recursion issue, close #1008
This is INTENDED BEHAVIOUR for comparing objects?????
2017-06-05 20:51:12 +01:00
1e9ff44890 New field for MobEquipmentPacket
If anyone wants to play with the off-hand, the window ID is 0x77 ;)
2017-06-05 19:10:00 +01:00
54453d0b0a Refactored entity IDs in packets for consistency and to clarify on types 2017-06-05 15:41:27 +01:00
31e2c1d26c fix stupid bug in PlayerInventory 2017-06-01 20:19:17 +01:00
38b8f14758 Fixed wrong reported slot in PlayerItemHeldEvent, fixed assert failures due to negative slot numbers in the hotbar
fixes some issues reported in #525
2017-05-29 16:33:48 +01:00
2f306c3a38 Fix crash when new players join due to attempting to send negative inventory slot 2017-05-29 15:30:11 +01:00
9c25ec3afd Some protocol changes for 1.1.0.0 2017-04-01 19:20:30 +01:00
8114ceaf68 Merge branch 'master' into api3/network 2017-03-18 16:29:38 +00:00
a8650a241c Removed @deprecated warning from PlayerInventory->setHotbarSlotIndex()
Core uses it, it's just that plugins shouldn't.
2017-03-14 17:37:29 +00:00
6c5dbd7359 Merge branch 'master' into api3/network 2017-03-12 12:22:11 +00:00
132e04fdbb Hotbar/inventory bugfixes (#399)
- Fixed most issues with item equipment in creative
- Added save and restore of currently-held item
- Reset hotbar on death, added API method PlayerInventory->resetHotbar()
- Creative players now have more leeway to get items, alleviates issues with item equipment in desktop GUI
- Fixed creative players wearing armour
- Found unknown field in ContainerSetSlotPacket
- Removed outdated/redundant constants
- Use a case statement in ContainerSetSlotPacket handler, added handling for 0x7a hotbar slot link update
2017-03-09 20:31:55 +00:00
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00
1ee689e759 Fixed mess of entity ID 0 for players, fixed emeralds 2017-03-02 11:04:00 +00:00
ab943a0462 Fix crashes 2017-01-16 14:50:32 +00:00
02ddcef24e Fix calls to undefined method Human->getServer() (#234)
* Fixes sendHeldItem to stop crashes when executing.

* Fix server calling for food consuming.
2017-01-07 13:01:26 +00:00
0bd7ea211d Refactored Server::broadcastPacket() to be non-static
Why the hell was this static at all? Seriously Shoghi?
2017-01-03 22:24:40 +00:00
300a3d5ccd Fix default hotbar mapping for W10 2016-12-20 21:19:25 +00:00
92784054cd Creative inventory fixes 2016-10-05 10:07:00 +01:00
e913b16804 Fixed some lines indented with 4 spaces rather than tabs 2016-10-03 00:58:34 +08:00
6fc435da0e Imports rearrangement 2016-10-03 00:43:46 +08:00
e00176b677 Closes #4181 @ PM
https://github.com/PocketMine/PocketMine-MP/issues/4181
2016-09-28 13:59:51 +01:00
f14a8e46be Inventory: Fix creative/spectator inventory sending 2016-09-28 13:59:46 +01:00