Commit Graph

93 Commits

Author SHA1 Message Date
Dylan K. Taylor
352cd4f9fd Merge branch 'minor-next' of github.com:pmmp/PocketMine-MP into major-next 2025-09-20 18:09:32 +01:00
Dylan K. Taylor
bbcc0c08b5 Updated NBT library to get new ListTag handling features 2025-09-19 23:40:04 +01:00
Dylan K. Taylor
6f6b23d4e4 Integrate dev-major-next version of pocketmine/math
this is a reduced version compared to the original, due to the difficulty of getting rid of Facing values internally.
2025-08-29 21:47:20 +01:00
pmmp-admin-bot[bot]
24795eef0e Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17223908234
2025-08-26 00:03:10 +00:00
Dylan K. Taylor
de234d1f38 Improved placement logic 2025-08-26 00:10:50 +01:00
ipad54
db54c481aa Fixed hanging signs placement criteria (#6775) 2025-08-25 23:27:17 +01:00
Dylan K. Taylor
e8eda19ae5 Merge remote-tracking branch 'origin/minor-next' into major-next 2025-08-24 23:18:21 +01:00
Dylan K. Taylor
00d6171463 Implement hanging signs 2025-08-24 20:07:59 +01:00
João
05eda887b1 Item: make setter methods fluent (#6678)
- `Item::clearCustomBlockData` previously, the instance was returned, but the return type has been changed
- `Item::setCanPlaceOn`, `Item::setCanDestroy` and `Item::setKeepOnDeath` now return `$this`
2025-05-25 10:35:26 +02:00
ipad54
f6e6f15c63 Implemented a proper way to handle items cooldown (#6405) 2024-09-25 13:28:17 -05:00
Dylan K. Taylor
ae564e445d Start migrating EnumTrait enums to PHP 8.1 native enums 2023-09-07 17:20:52 +01:00
S3v3Nice
39867b97c5 Implement enchanting using enchanting tables (#5953)
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2023-08-15 17:28:26 +01:00
Dylan K. Taylor
c9bb4335a1 Item: added getStateId(), removed state data from public API
state data was only used for indexing stuff along with state ID anyway, so it makes more sense to lock it away in here instead.
2023-05-16 14:14:18 +01:00
Dylan K. Taylor
015c668885 Change confusing 'type data' and 'state data' terminology for blocks and items
For blocks, we now use 'block-item state' and 'block-only state', which should be much clearer for people implementing custom stuff.
'block-item state', as the name suggests, sticks to the item when the block is acquired as an item.
'block-only state' applies only to the block and is discarded when the block is acquired as an item.

'type data' for items was also renamed, since 'type' is too ambiguous to be anything but super confusing.
2023-05-16 14:07:29 +01:00
Dylan K. Taylor
c878bd8289 Merge remote-tracking branch 'origin/minor-next' into major-next 2023-04-20 00:18:19 +01:00
Dylan K. Taylor
674b65f789 Item: optimise serializeCompoundTag() a little 2023-04-18 16:18:34 +01:00
Dylan K. Taylor
fff8f0f815 Use Item->canStackWith() instead of Item->equals() wherever possible 2023-03-07 17:08:35 +00:00
Dylan K. Taylor
c2f6d8139a Added interface RuntimeDataDescriber 2023-02-16 16:23:32 +00:00
Dylan K. Taylor
6e2685cbbb Merge branch 'next-minor' into next-major 2022-12-18 22:25:32 +00:00
Dylan K. Taylor
bf44edd179 Constify a bunch of NBT keys, pass 1 2022-12-18 22:12:15 +00:00
Dylan K. Taylor
ffa88aff67 Merge branch 'next-minor' into next-major 2022-12-18 21:05:26 +00:00
Javier León
c5d716dc9d Added keep on death methods for items (#5395) 2022-12-15 20:10:20 +00:00
Dylan K. Taylor
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
Dylan K. Taylor
95d0a3bf41 Merge branch 'stable' into next-minor 2022-12-15 19:38:22 +00:00
Dylan K. Taylor
cf707e15c2 fix 2022-12-15 19:36:16 +00:00
! Bryan
1308cda5c2 Implemented hook method Item::onInteractEntity() (#5432)
this is called when the player right-clicks on an entity to do some action, such as shearing, naming etc.
2022-12-15 19:30:52 +00:00
Dylan K. Taylor
99996b62d6 Align PhpDoc @param tags according to PHP-CS-Fixer 2022-12-06 13:21:20 +00:00
IvanCraft623
1366a43c22 Implement Turtle Shell (#5235) 2022-09-28 18:19:15 +01:00
Dylan K. Taylor
d5762d3f44 Item: allow describing type data to a reader as well as a writer
we don't currently need this, but it's better to have it in case we need it after PM5 release.

This is also now consistent with blocks.
2022-08-27 19:18:30 +01:00
Dylan K. Taylor
d0ff6d2e36 Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks
it became glaringly obvious that this was needed because of #4827 and #4868.

this is further needed with the addition of cauldrons.
2022-07-16 19:50:33 +01:00
Dylan K. Taylor
ba2baba7cc Added netherite blocks and items 2022-07-14 20:39:09 +01:00
Dylan K. Taylor
dea0207e4e Merge branch 'next-minor' into next-major 2022-07-13 17:06:04 +01:00
Dylan K. Taylor
66d655731a Don't barf on air itemstacks found on disk
closes #5143

this is caused by bugs in PM4, where it saved air itemstacks when it wasn't supposed to.

These issues are now all addressed in PM5, since ItemSerializer won't accept air itemstacks.
2022-07-08 18:19:46 +01:00
Dylan K. Taylor
0ad2985247 Update documentation for Item::__construct() 2022-07-06 23:54:29 +01:00
Dylan K. Taylor
d40e864821 Item: update documentation of legacyJsonDeserialize() 2022-07-06 21:15:27 +01:00
Dylan K. Taylor
68cbe46600 Exterminate legacy item IDs 2022-07-05 15:12:55 +01:00
Dylan K. Taylor
323c563684 Break Block's dependence on ItemFactory, and item legacy IDs
let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
2022-07-02 17:29:28 +01:00
Dylan K. Taylor
db2b523762 Item is no longer JsonSerializable
before anyone starts screaming:

1) it's easy to create your own wrapper that converts items to arrays
2) there is no longer a single standard way to encode items.
3) the way that item serialization now works requires an ItemSerializer, which, barring singleton use, must be dependency-injected. Since there's no way to inject dependencies into jsonSerialize(), this means that its behaviour cannot be customized.
2022-06-30 19:16:49 +01:00
Dylan K. Taylor
dd63681f94 Assign auto-generated runtime type IDs to all items 2022-06-29 13:50:58 +01:00
Dylan K. Taylor
541a624d48 ItemFactory::get() now consistently throws SavedDataLoadingException on any error, including unknown items 2022-06-27 17:14:43 +01:00
Dylan K. Taylor
bedc9cf518 Item::jsonDeserialize(): remove bogus phpdoc (we don't actually know if this is even valid) 2022-06-27 14:30:12 +01:00
Dylan K. Taylor
65ed7d7794 Remove Item::hasAnyDamageValue() 2022-06-27 13:35:43 +01:00
Dylan K. Taylor
55cb68e5b5 Burn meta wildcards from Item, allow more dynamic recipe inputs
this was an obstacle for getting rid of legacy item IDs.
2022-06-27 13:33:26 +01:00
Dylan K. Taylor
bc5a600d59 Added item stack serialize/deserialize methods 2022-06-26 17:02:55 +01:00
Dylan K. Taylor
6964012464 fix a bunch of bugs 2022-06-23 19:34:08 +01:00
Dylan K. Taylor
5ed75731f2 First (untested) look at hooking all the itemstack serializer/deserializer stuff together
this should address #5063 and related issues, if it works correctly.
2022-06-23 19:02:16 +01:00
Dylan K. Taylor
1ff69136a3 Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
Dylan K. Taylor
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
Dylan K. Taylor
dab7686656 Merge branch 'next-major' into modern-world-support 2022-06-04 18:43:11 +01:00
Dylan K. Taylor
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00