BrandPVP
c01d2dc718
CreativeInventory per Player ( #5694 )
2023-07-06 11:08:13 +01:00
Dylan K. Taylor
de49910e84
Fix CS
2023-05-31 22:18:25 +01:00
Dylan K. Taylor
0ed5e94a72
Merge branch 'minor-next' into major-next
2023-05-30 16:15:56 +01:00
ShockedPlot7560
db95bf8b9b
Caching creative inventory entries ( #5703 )
...
Due to the high cost of Item::serializeCompoundTag(), it's very costly to rebuild this every time we need it. This is sent during the pre-spawn step, where we need to minimize costs as much as possible.
2023-05-18 14:11:28 +01:00
Dylan K. Taylor
7cdf6b0946
Fixed merge error
2023-05-06 17:29:59 +01:00
Dylan K. Taylor
5c7f4570b4
Merge branch 'minor-next' into major-next
2023-05-06 17:20:37 +01:00
Dylan K. Taylor
84a943bcec
BaseInventory: slap a TODO on isSlotEmpty()
2023-05-05 16:06:37 +01:00
Dylan K. Taylor
eb136e60c8
BaseInventory: added getMatchingItemCount() helper
...
this eliminates the performance issues described by #5719 .
closes #5719
we may want to consider exposing a public API for this in the future, since it might be useful for plugins.
2023-04-27 21:08:35 +01:00
Dylan K. Taylor
4228880509
BaseInventory: change dumb variable names in internalAddItem()
2023-04-27 20:29:02 +01:00
Dylan K. Taylor
709d874204
BaseInventory: clean up max stack size handling
...
we can safely assume that:
- the inventory's max stack size won't change during the operation
- two items which stack together have the same max stack size
- the item's max stack size won't change during the operation
2023-04-27 20:27:05 +01:00
Dylan K. Taylor
7f6269c432
Introduce and use optimised versions of Inventory->isSlotEmpty()
...
this avoids useless cloning, improving the performance of several functions.
2023-04-27 16:52:52 +01:00
Dylan K. Taylor
023460db2c
BaseInventory: fixed internalAddItem() doing useless canStackWith() checks on null items
...
if the item is null, it's never going to stack with anything given to this function, because addItem() already discards null items.
2023-04-27 14:53:54 +01:00
Dylan K. Taylor
499b29b53a
Merge branch 'minor-next' into major-next
2023-04-12 21:04:08 +01:00
Dylan K. Taylor
7e92da126d
DelegateInventory: fixed slots being synced twice and breaking ItemStackRequests
...
the second time the slot is synced, there is no prediction, so the slot update isn't associated with a request anymore. This causes subsequent requests in the same packet to fail, since the dependency request ID isn't associated with the slot anymore.
This change fixes the problem by only allowing the backing inventory to trigger a call to DelegateInventory->on*Change(). While we could have removed and re-added the listener instead, this way is safer since it doesn't assume that the backing inventory won't modify the given item in setItem().
closes #5692
2023-04-12 15:43:51 +01:00
Dylan K. Taylor
7e1467f3f7
Merge branch 'minor-next' into major-next
2023-04-05 20:14:59 +01:00
Dylan K. Taylor
6e8eda4ac1
Fixed creative inventory items getting modified by ItemStackRequests
2023-04-03 22:22:21 +01:00
Dylan K. Taylor
453ad997e9
Merge branch 'item-stack-request' into item-stack-request-pm5
2023-03-20 22:05:12 +00:00
Dylan K. Taylor
7b0816e42f
Properly handle transaction building errors instead of kicking the player
2023-03-20 00:52:26 +00:00
Dylan K. Taylor
dace20ad1f
Merge branch 'item-stack-request' into item-stack-request-pm5
2023-03-14 22:34:47 +00:00
Dylan K. Taylor
a573a279fa
Merge branch 'minor-next' into item-stack-request
2023-03-14 22:25:49 +00:00
Dylan K. Taylor
7608d5f04e
Use BedrockDataFiles in more places
2023-02-23 22:03:35 +00:00
Dylan K. Taylor
cfa1e7486a
Move legacy recipes and creative items in-house
...
having them here allows BedrockData to represent latest versions freely, without being limited by technical limitations of PM4.
2023-02-02 15:25:03 +00:00
Dylan K. Taylor
8633804f15
InventoryManager: disentangle slot tracking from slot syncing
2023-01-06 20:26:19 +00:00
Dylan K. Taylor
2e9a3f9160
Working crafting :woohoo:
2023-01-04 22:29:29 +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
b6982a84ef
Merge branch 'next-minor' into next-major
2022-11-25 14:52:56 +00:00
Dylan K. Taylor
d79e6354a0
Merge branch 'stable' into next-minor
2022-11-25 14:41:05 +00:00
Dylan K. Taylor
a66f966b08
Update API documentation for Inventory methods
2022-11-15 21:00:13 +00:00
Dylan K. Taylor
a205d64732
Merge branch 'next-minor' into next-major
2022-11-12 17:02:56 +00:00
Dylan K. Taylor
824ed0a56a
Merge branch 'stable' into next-minor
2022-11-07 15:04:48 +00:00
alvin0319
1e9d83f014
BaseInventory: validate given array in setContents() ( #5391 )
2022-11-07 13:09:05 +00:00
Dylan K. Taylor
01bad344a0
Merge branch 'next-minor' into next-major
2022-11-04 20:47:26 +00:00
Dylan K. Taylor
cdbdcb5d67
Merge branch 'stable' into next-minor
2022-11-04 20:44:28 +00:00
Dylan K. Taylor
2fdc46c165
PHPStan 1.9 features
2022-11-04 20:23:34 +00:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
...
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
Dylan K. Taylor
f88ae93897
BC break: Replaced webmozart/path-util with symfony/filesystem, closes #5332
2022-10-13 16:43:36 +01:00
Dylan K. Taylor
8c651ce4b4
t Merge remote-tracking branch 'origin/next-minor' into next-major
2022-10-11 22:06:18 +01:00
Dylan K. Taylor
3feaa18f6c
DelegateInventory: use WeakReference and __destruct to clean up inventory listener
...
this is more sane, since it allows the delegate to be reused without unexpected behaviour.
2022-09-30 15:12:37 +01:00
Dylan K. Taylor
f80ffd8de0
Merge branch 'next-minor' into next-major
2022-09-15 13:59:21 +01:00
Dylan K. Taylor
441b06f6c7
Merge branch 'stable' into next-minor
2022-09-15 12:44:53 +01:00
Dylan K. Taylor
6866c86d39
BaseInventory: fix CS
2022-09-02 19:36:45 +01:00
Dylan K. Taylor
a735a69870
BaseInventory: improve type info available to setContents() and internalSetContents()
2022-09-02 19:36:08 +01:00
Dylan K. Taylor
a0ea74c08f
Inventory: Improve quality of type info of arrays
2022-09-02 19:34:12 +01:00
Dylan K. Taylor
d4c4ae3d7a
Merge branch 'next-minor' into next-major
2022-08-25 19:27:29 +01:00
Dylan K. Taylor
c16893cbac
Merge branch 'stable' into next-minor
2022-08-25 19:25:19 +01:00
Dylan K. Taylor
5426b41447
InventoryTransaction: prevent client-authoritative item overstacking
...
this cheat is often used to carry more items in the inventory, wear multiple pieces of armour in one slot, and more.
2022-08-21 20:35:23 +01:00
Dylan K. Taylor
1ecb10acba
Merge branch 'next-minor' into next-major
2022-08-21 19:19:07 +01:00
Dylan K. Taylor
792c1b62b7
Introduce and use TransactionBuilder for inventory evacuations
2022-08-18 17:04:12 +01:00
Dylan K. Taylor
9f0b32e748
Updated creative and crafting data to 1.19
2022-07-04 20:28:07 +01:00
Dylan K. Taylor
8858b16a25
Fucking CS again
2022-06-30 20:18:25 +01:00