Commit Graph

19 Commits

Author SHA1 Message Date
d4fe004375 More consistent fluency in Item API 2019-03-23 12:20:35 +00:00
8de9e61651 Item: Remove get/set/removeNamedTagEntry() 2019-03-17 17:49:09 +00:00
0e1a88f7e5 Armor: Implement right-click to equip, closes #2641 2019-03-12 19:01:36 +00:00
8b9eeb0b7f Clean up Armor classes 2019-03-12 18:53:51 +00:00
7170d9009d Enchantment: more static getters, firehose magic numbers
This is similar in nature to 646fea5a4e.

On a side note: Migrating this way is a pain in the ass due to lack of types. What the heck is int supposed to mean?!?!?!?! At least if we wanted to go _back_ to magic numbers, it would be easy to locate everything with an Enchantment typehint...
2019-02-20 13:45:50 +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
45c9caa38c Fixup some formatting issues 2018-10-21 18:15:25 +01:00
e06b78b0ee Implemented armor durability 2018-03-09 13:21:05 +00:00
0df2064802 Implement armor damage protection enchantments (#1839) 2018-01-24 10:13:24 +00:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
9da19b5f15 Added API methods for getting & setting armour dye colours 2017-11-21 14:10:33 +00:00
697ea55fb7 Another typehint 2017-08-27 20:01:38 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
d34499e67b Revert "Implemented proportional armor modifier, applied armor in other damage types and consume armor when player is damaged" 2015-03-18 17:26:06 +01:00
8aa8ae5094 Implemented proportional armor modifier, applied armor in other damage types and consume armor when player is damaged 2015-03-17 20:04:59 +08:00
074c8b876d Cleaned up code 2015-01-03 16:07:49 +01:00
747f7685e7 Fix formatting issues due to bad IDE settings 2014-12-07 16:30:04 +01:00
7506f01302 Improved Item property handling 2014-12-07 15:51:00 +01:00
294e680d5d Added armor items and max stack size for them. 2014-12-04 00:04:09 +01:00