Fixed CPU leak

This commit is contained in:
Shoghi Cervantes
2014-10-31 21:05:37 +01:00
parent ae06681b60
commit 8601405a88
73 changed files with 304 additions and 564 deletions

View File

@ -44,7 +44,7 @@ class Cactus extends Transparent{
protected function recalculateBoundingBox(){
return AxisAlignedBB::getBoundingBoxFromPool(
return new AxisAlignedBB(
$this->x + 0.0625,
$this->y,
$this->z + 0.0625,
@ -55,7 +55,7 @@ class Cactus extends Transparent{
}
public function onEntityCollide(Entity $entity){
$ev = EntityDamageByBlockEvent::createEvent($this, $entity, EntityDamageEvent::CAUSE_CONTACT, 1);
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_CONTACT, 1);
$entity->attack($ev->getFinalDamage(), $ev);
}
@ -76,9 +76,9 @@ class Cactus extends Transparent{
if($this->getSide(0)->getID() !== self::CACTUS){
if($this->meta == 0x0F){
for($y = 1; $y < 3; ++$y){
$b = $this->getLevel()->getBlock(Vector3::createVector($this->x, $this->y + $y, $this->z));
$b = $this->getLevel()->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
if($b->getID() === self::AIR){
Server::getInstance()->getPluginManager()->callEvent($ev = BlockGrowEvent::createEvent($b, new Cactus()));
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($b, new Cactus()));
if(!$ev->isCancelled()){
$this->getLevel()->setBlock($b, $ev->getNewState(), true);
}