mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
reduce boilerplate around attribute handling
This commit is contained in:
@@ -189,7 +189,7 @@ class AddActorPacket extends DataPacket implements ClientboundPacket{
|
||||
$min = $this->getLFloat();
|
||||
$current = $this->getLFloat();
|
||||
$max = $this->getLFloat();
|
||||
$attr = Attribute::getAttribute($id);
|
||||
$attr = Attribute::get($id);
|
||||
|
||||
if($attr !== null){
|
||||
try{
|
||||
|
@@ -299,7 +299,7 @@ class NetworkBinaryStream extends BinaryStream{
|
||||
$default = $this->getLFloat();
|
||||
$id = $this->getString();
|
||||
|
||||
$attr = Attribute::getAttribute($id);
|
||||
$attr = Attribute::get($id);
|
||||
if($attr !== null){
|
||||
$attr->setMinValue($min);
|
||||
$attr->setMaxValue($max);
|
||||
|
Reference in New Issue
Block a user