Fixed effect entity id

This commit is contained in:
Shoghi Cervantes 2015-06-19 15:34:33 +02:00
parent 5796784442
commit ef738ef299
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 3 additions and 3 deletions

View File

@ -1228,7 +1228,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
public function setDataProperty($id, $type, $value){ public function setDataProperty($id, $type, $value){
if(parent::setDataProperty($id, $type, $value)){ if(parent::setDataProperty($id, $type, $value)){
$this->sendData([$this], [$id => $this->dataProperties[$id]]); $this->sendData($this, [$id => $this->dataProperties[$id]]);
return true; return true;
} }

View File

@ -238,7 +238,7 @@ class Effect{
public function add(Entity $entity, $modify = false){ public function add(Entity $entity, $modify = false){
if($entity instanceof Player){ if($entity instanceof Player){
$pk = new MobEffectPacket(); $pk = new MobEffectPacket();
$pk->eid = $entity->getId(); $pk->eid = 0;
$pk->effectId = $this->getId(); $pk->effectId = $this->getId();
$pk->amplifier = $this->getAmplifier(); $pk->amplifier = $this->getAmplifier();
$pk->particles = $this->isVisible(); $pk->particles = $this->isVisible();
@ -261,7 +261,7 @@ class Effect{
public function remove(Entity $entity){ public function remove(Entity $entity){
if($entity instanceof Player){ if($entity instanceof Player){
$pk = new MobEffectPacket(); $pk = new MobEffectPacket();
$pk->eid = $entity->getId(); $pk->eid = 0;
$pk->eventId = MobEffectPacket::EVENT_REMOVE; $pk->eventId = MobEffectPacket::EVENT_REMOVE;
$pk->effectId = $this->getId(); $pk->effectId = $this->getId();