Commit Graph

203 Commits

Author SHA1 Message Date
6424dc9c82 Merge branch '3.6' 2019-02-14 16:04:32 +00:00
e1bacb5c6d Human: fixed hunger underflow when value is a fraction, closes #2761 2019-02-14 16:01:25 +00:00
c872b120d0 Entity->entityBaseTick() is now protected 2019-02-04 19:54:06 +00:00
c3bbb8905c Human: simplify setFood() 2019-01-28 17:33:58 +00:00
78dfcc5f2d Move Effect and EffectInstance to entity\effect namespace 2019-01-28 15:41:07 +00:00
61e04d5284 Merge branch '3.5' 2019-01-23 16:48:12 +00:00
dc89b48354 Human: Fixed XP drop amount to match vanilla
In vanilla it doesn't drop the exact number of points you collected. Rather, you lose a little for every level above 1 you had (1 level requires 7 points, later levels require +2 per level), and can recover at most 100 points. Hence, if you had 10 levels, you get back enough points to fill 5 levels and most of a 6th. 14-15 levels gets you the upper bound of about 7.5 levels.
2019-01-23 12:39:25 +00:00
9c53b41851 Added PlayerInfo, Player is no longer accessible during PlayerPreLoginEvent 2019-01-13 19:32:30 +00:00
adc1069ed2 Merge branch '3.5' 2019-01-04 23:28:44 +00:00
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
ffa733fe0c Merge branch 'release/3.5' 2018-12-12 19:51:41 +00:00
30f5a8fac6 Protocol changes for 1.8.0 release 2018-12-11 21:05:03 +00:00
b50e29085e Remove InventoryEventProcessor, use closures instead 2018-12-04 19:02:26 +00:00
90482e79bc Merge branch 'release/3.4' 2018-10-21 18:23:54 +01:00
6dd2597934 Merge branch 'release/3.3' into release/3.4 2018-10-21 18:17:07 +01:00
5e68858ebf Merge branch 'release/3.2' into release/3.3 2018-10-21 18:16:59 +01:00
45c9caa38c Fixup some formatting issues 2018-10-21 18:15:25 +01:00
39808dd94f Actually merge branch 'release/3.4' this time 2018-10-19 15:35:23 +01:00
4221e274d6 Merge branch 'release/3.3' into release/3.4 2018-10-16 18:20:14 +01:00
839d5eab7b Protocol changes for 1.7
there's also some new cases in stats, but we don't care about those anyway.
2018-10-16 17:13:52 +01:00
495a0b1dc2 Merge branch 'release/3.3' 2018-10-05 18:11:33 +01:00
1dd6591ac1 Migrate a bunch of PluginManager->callEvent() usages to Event->call
This has the triple bonus effect of a) making a lot of code easier to read, b) reducing Server::getInstance() usages, and c) removing a whole bunch of Server dependencies.

The network and block namespaces are untouched by this commit due to potential for merge conflicts. These should be dealt with separately on master.
2018-10-05 17:30:06 +01:00
2ee0436f46 Continued cleanup of runtime entity NBT removal
it's no longer necessary to force-write these, since the NBT is now ephemeral. Any tag type mismatches should be dealt with on read, after which the original tag will be discarded anyway.
2018-08-15 14:50:58 +01:00
0273e2484e Kill entity runtime NBT (#2361) 2018-08-14 13:33:02 +01:00
c1843ac2d4 Player: remove dataPacket() and directDataPacket()
I considered renaming sendDataPacket() to dataPacket() to reduce the BC breaks, but the parameter set has changed, which might cause astonishing behaviour, so it's better to break it in a loud way. Also, this has a clearer name.
2018-07-22 12:04:53 +01:00
527d8e9374 Merge branch 'release/3.1' into release/3.2 2018-07-17 18:35:16 +01:00
4a5ff32d2e hacks for NPC and floating text
I didn't think mojang could break this fucking game any worse
2018-07-11 19:45:48 +01:00
32574118ea Implemented Mending enchantment (#2257) 2018-07-06 13:28:33 +01:00
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
fbf760bafe Enchantment: implemented Vanishing 2018-05-23 17:23:56 +01:00
acf29711c2 Implemented Totems, close #2198
Totem usage can be detected using the MODIFIER_TOTEM constant of EntityDamageEvent.

This does not currently support using the totem in the offhand because offhand is not implemented yet.
2018-05-23 10:06:35 +01:00
6111ce7df1 Human: don't hardcode max food 2018-05-19 16:48:21 +01:00
1f73c08762 Human: fix possible bug with food ticking
it updates it but doesn't take note of the updated value, which could cause the code below to be erroneously triggered.
2018-05-19 16:47:04 +01:00
2900167ffa Human: removed redundant isSprinting() check from doFoodTick()
this is checked in setSprinting() anyway.
2018-05-19 16:33:13 +01:00
11cc9f19ad Human: replace hardcoded difficulty values with constants in doFoodTick() 2018-05-19 16:32:30 +01:00
807af2e6fb Human: change doFoodTick() visibility to protected 2018-05-19 16:30:41 +01:00
0bb5e88b5c Hinting up Entity API to PHP 7.2 standards 2018-05-19 10:46:47 +01:00
d8dc89e7c8 EnderChestInventory: Removed unnecessary owner parameter 2018-05-18 16:46:48 +01:00
47faf5a994 Human: Add support for 128x128 skins in isValidSkin() (#2140) 2018-04-07 09:00:08 +01:00
c06c1c7ce0 Human: Added a hack for nametags
Apparently NAMETAG metadata is useless in AddPlayerPacket now, so it has to be sent separately.
2018-04-05 11:56:44 +01:00
5b7b2dd0e2 Merge changes from ALPHA11 for 1.2.13 2018-04-04 11:31:39 +01:00
526f05631e fix metadata properties for new beta
there are more things than this, but I don't have time to figure them all out.
2018-04-04 11:03:05 +01:00
d4d57aa9ea Merge branch 'feature/xp-event' 2018-03-30 12:46:53 +01:00
ddc9dca8b4 Player: fixed being able to eat cake in creative
closes #2070
2018-03-13 18:32:08 +00:00
d09a43cfef Added PlayerExperienceChangeEvent 2018-03-10 20:04:36 +00:00
b39bbffdc5 Entity: Moved and renamed entity\Item to entity\object\ItemEntity 2018-03-10 12:36:46 +00:00
9abfd54cc1 Updated with ListTag changes from PocketMine-NBT 2018-02-13 16:50:49 +00:00
b7bd8dc7f1 Human: fixed NPC skin crash after ByteArray change 2018-02-12 09:56:02 +00:00
b75d121c7e Human: remove obsolete TODO 2018-02-11 17:08:59 +00:00
88bbb03f12 Human: store cape & geometry data in NBT 2018-02-11 17:08:01 +00:00