Commit Graph

27 Commits

Author SHA1 Message Date
ed88d68fd7 Remove stuff deprecated in 4.19.0 2023-04-11 23:20:58 +01:00
a0dadc6e37 Merge branch 'minor-next' into major-next 2023-04-10 14:38:23 +01:00
d6c923b525 ExperienceOrb: add get/setDespawnDelay
closes #5645

the code for this is borrowed from ItemEntity. I didn't feel like a base class was appropriate, and we can't (yet) declare constants in traits.
2023-04-07 22:33:30 +01:00
6e2685cbbb Merge branch 'next-minor' into next-major 2022-12-18 22:25:32 +00:00
bf44edd179 Constify a bunch of NBT keys, pass 1 2022-12-18 22:12:15 +00:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
7b8eeb42f6 Use typed properties in src/entity package
[bc break]
2022-06-01 21:19:02 +01:00
b7e2b3e94a Entity: Require declaration of gravity and drag via abstract methods
this guarantees that subclasses will actually declare them.

[bc break]
2022-06-01 20:51:18 +01:00
8f525ab399 Replace disallowed operators in src/entity/ 2022-01-20 19:14:28 +00:00
de82424fb2 XpManager: add APIs to prevent owning Human from attracting XP orbs (#4623)
Fixes #4589

The following API methods are added:

- `XpManager->canAttractXpOrbs()`
- `XpManager->setCanAttractXpOrbs()`

Possible future scope: flip this on its head to allow spectator players to attract XP orbs, in case someone wants that for some reason ???

Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2021-12-15 04:40:46 +00:00
c07f3f5e12 fix CS 2021-06-19 19:48:30 +01:00
fc70b625b3 ExperienceOrb: Require providing XP value in constructor 2021-06-19 19:42:13 +01:00
5a14c1cb89 Entity: don't rebuild metadata every tick unless an associated property changed
this should improve performance back to PM3 levels.
2021-05-17 20:05:52 +01:00
e53b57732b Entity: replace separate height/width/eyeHeight fields with an EntitySizeInfo structure
this will make it easier to implement stuff like sleeping (properly), swimming and gliding without needing to duplicate all the fields.
2021-01-08 00:11:01 +00:00
279abb871d Remove all usages of CompoundTag->hasTag()
in pretty much every case, these usages really wanted to read the tag's contents anyway, which can be combined with a getTag() and instanceof call for more concise and static analysis friendly code.
In the few cases where the tag contents wasn't needed, it still wanted to check the type, which, again, can be done in a more static analysis friendly way by just using getTag() and instanceof.
2020-07-10 21:01:43 +01:00
ff00595a48 Remove some more Vector3 mutations 2020-06-27 20:58:02 +01:00
d38c17835d Properly switch to string entity IDs 2020-06-20 13:43:31 +01:00
6257f717b1 Entity: make networkProperties private
this reduces the temptation to use it in high-level code, as well as making syncNetworkData() more useful (now it can export to many data collections, which means we can start to think about having a property cache per network session, which is more flexible)
2020-05-21 20:29:06 +01:00
148228e360 update pocketmine/math, adapt to add() changes 2020-05-19 12:26:18 +01:00
ae6a7b7cc9 imports cleanup 2020-05-16 18:42:08 +01:00
c30dd9f1b6 Entity: add abstract getNetworkTypeId(), remove NETWORK_ID constant
this now requires that subclasses supply a proper NETWORK_ID.
2020-05-16 16:08:12 +01:00
ca909ebc1d Merge branch 'next-minor' 2020-03-10 13:05:37 +00:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
c9cd6ee038 ExperienceOrb: fix passing invalid argument to multi-signature Vector3::subtract()
I knew I should have scrapped these multi-signature functions years ago...
2019-08-24 15:58:06 +01:00
2d4a32fc77 first look at separating Entity and Location 2019-08-19 17:20:34 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00