Store attributes as local vars, reduce usage of AttributeMap

ideally we want attribute map to only be used for properties that need synchronization.
This commit is contained in:
Dylan K. Taylor
2020-05-21 19:18:00 +01:00
parent f93bc0739c
commit 74e1f6320a
5 changed files with 33 additions and 51 deletions

View File

@ -185,16 +185,6 @@ parameters:
count: 1
path: ../../../src/entity/Entity.php
-
message: "#^Parameter \\#1 \\$attribute of method pocketmine\\\\entity\\\\AttributeMap\\:\\:add\\(\\) expects pocketmine\\\\entity\\\\Attribute, pocketmine\\\\entity\\\\Attribute\\|null given\\.$#"
count: 1
path: ../../../src/entity/ExperienceManager.php
-
message: "#^Method pocketmine\\\\entity\\\\ExperienceManager\\:\\:fetchAttribute\\(\\) should return pocketmine\\\\entity\\\\Attribute but returns pocketmine\\\\entity\\\\Attribute\\|null\\.$#"
count: 1
path: ../../../src/entity/ExperienceManager.php
-
message: "#^Parameter \\#1 \\$attribute of method pocketmine\\\\entity\\\\AttributeMap\\:\\:add\\(\\) expects pocketmine\\\\entity\\\\Attribute, pocketmine\\\\entity\\\\Attribute\\|null given\\.$#"
count: 1
@ -205,31 +195,6 @@ parameters:
count: 1
path: ../../../src/entity/HungerManager.php
-
message: "#^Parameter \\#1 \\$attribute of method pocketmine\\\\entity\\\\AttributeMap\\:\\:add\\(\\) expects pocketmine\\\\entity\\\\Attribute, pocketmine\\\\entity\\\\Attribute\\|null given\\.$#"
count: 6
path: ../../../src/entity/Living.php
-
message: "#^Cannot call method setValue\\(\\) on pocketmine\\\\entity\\\\Attribute\\|null\\.$#"
count: 2
path: ../../../src/entity/Living.php
-
message: "#^Cannot call method getMaxValue\\(\\) on pocketmine\\\\entity\\\\Attribute\\|null\\.$#"
count: 1
path: ../../../src/entity/Living.php
-
message: "#^Cannot call method setMaxValue\\(\\) on pocketmine\\\\entity\\\\Attribute\\|null\\.$#"
count: 1
path: ../../../src/entity/Living.php
-
message: "#^Cannot call method getValue\\(\\) on pocketmine\\\\entity\\\\Attribute\\|null\\.$#"
count: 2
path: ../../../src/entity/Living.php
-
message: "#^Cannot call method getEffectLevel\\(\\) on pocketmine\\\\entity\\\\effect\\\\EffectInstance\\|null\\.$#"
count: 3