diff --git a/src/Player.php b/src/Player.php index 2447a06c..790495cb 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1520,16 +1520,7 @@ class Player{ } } $speed = $this->entity->getSpeedMeasure(); - if($this->blocked === true or ($this->server->api->getProperty("allow-flight") !== true and (($speed > 9 and ($this->gamemode & 0x01) === 0x00) or $speed > 20 or $this->entity->distance($newPos) > 7)) or $this->server->api->handle("player.move", $this->entity) === false){ - if($this->lastCorrect instanceof Vector3){ - $this->teleport($this->lastCorrect, $this->entity->yaw, $this->entity->pitch, false); - } - if($this->blocked !== true){ - console("[WARNING] ".$this->username." moved too quickly!"); - } - }else{ - $this->entity->setPosition($newPos, $packet->yaw, $packet->pitch); - } + $this->entity->setPosition($newPos, $packet->yaw, $packet->pitch); } break; case ProtocolInfo::PLAYER_EQUIPMENT_PACKET: diff --git a/src/entity/Attachable.php b/src/entity/Attachable.php index e69de29b..b3600271 100644 --- a/src/entity/Attachable.php +++ b/src/entity/Attachable.php @@ -0,0 +1,5 @@ +setHealth(1, "generic"); //$this->setName((isset($objects[$this->type]) ? $objects[$this->type]:$this->type)); $this->size = 1; - if($this->type === OBJECT_PAINTING){ - $this->isStatic = true; - }elseif($this->type === OBJECT_SNOWBALL){ + if($this->type === OBJECT_SNOWBALL){ $this->server->schedule(1210, array($this, "update")); //Despawn $this->update(); }elseif($this->type == OBJECT_MINECART){ @@ -161,10 +159,6 @@ class Entity extends Position{ return $inv; }elseif($this->class === ENTITY_OBJECT){ switch($this->type){ - case OBJECT_PAINTING: - return array( - array(PAINTING, 0, 1), - ); case OBJECT_MINECART: return array( array(MINECART, 0, 1), @@ -672,16 +666,7 @@ class Entity extends Position{ $player->dataPacket($pk); break; case ENTITY_OBJECT: - if($this->type === OBJECT_PAINTING){ - $pk = new AddPaintingPacket; - $pk->eid = $this->eid; - $pk->x = (int) $this->x; - $pk->y = (int) $this->y; - $pk->z = (int) $this->z; - $pk->direction = $this->getDirection(); - $pk->title = $this->data["Motive"]; - $player->dataPacket($pk); - }elseif($this->type === OBJECT_MINECART){ + if($this->type === OBJECT_MINECART){ $pk = new AddEntityPacket; $pk->eid = $this->eid; $pk->type = $this->type; @@ -698,7 +683,6 @@ class Entity extends Position{ $pk->speedY = $this->speedY; $pk->speedZ = $this->speedZ; $player->dataPacket($pk); - } break; case ENTITY_FALLING: diff --git a/src/entity/EntityRegistry.php b/src/entity/EntityRegistry.php index 7a3237f2..233f156f 100644 --- a/src/entity/EntityRegistry.php +++ b/src/entity/EntityRegistry.php @@ -48,6 +48,7 @@ class EntityRegistry{ self::registerEntity(Zombie::class); self::registerEntity(Arrow::class); self::registerEntity(PrimedTNT::class); + self::registerEntity(Painting::class); } /*Register an Entity*/ diff --git a/src/entity/Hanging.php b/src/entity/Hanging.php index e69de29b..554abb69 100644 --- a/src/entity/Hanging.php +++ b/src/entity/Hanging.php @@ -0,0 +1,5 @@ +x = isset($this->data["TileX"]) ? $this->data["TileX"]:$this->x; + $this->y = isset($this->data["TileY"]) ? $this->data["TileY"]:$this->y; + $this->z = isset($this->data["TileZ"]) ? $this->data["TileZ"]:$this->z; + $this->setHealth(1, "generic"); + $this->size = 1; + $this->isStatic = true; + } + + public function getDrops(){ + return array(array(PAINTING, 0, 1)); + } + public function spawn($player){ + $pk = new AddPaintingPacket; + $pk->eid = $this->eid; + $pk->x = (int) $this->x; + $pk->y = (int) $this->y; + $pk->z = (int) $this->z; + $pk->direction = $this->getDirection(); + $pk->title = $this->data["Motive"]; + $player->dataPacket($pk); + } +} \ No newline at end of file diff --git a/src/material/item/generic/Bucket.php b/src/material/item/generic/Bucket.php index ce34a40d..529b4744 100644 --- a/src/material/item/generic/Bucket.php +++ b/src/material/item/generic/Bucket.php @@ -20,10 +20,17 @@ */ class BucketItem extends Item{ + private static $possiblenames = array( + 0 => "Bucket", + 1 => "Milk Bucket", + 8 => "Water Bucket", + 10 => "Lava Bucket" + ); public function __construct($meta = 0, $count = 1){ parent::__construct(BUCKET, $meta, $count, "Bucket"); $this->isActivable = true; $this->maxStackSize = 1; + $this->name = BucketItem::$possiblenames[$this->meta]; } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){