mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
changes
This commit is contained in:
parent
320dc1af88
commit
72bc35a219
@ -95,7 +95,7 @@ class PlayerAPI{
|
|||||||
$message .= " hit the ground too hard";
|
$message .= " hit the ground too hard";
|
||||||
break;
|
break;
|
||||||
case "flying":
|
case "flying":
|
||||||
$message .= " tried to get up to the sky";
|
$message .= " tried to fly up to the sky";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$message .= " died";
|
$message .= " died";
|
||||||
@ -176,6 +176,7 @@ class PlayerAPI{
|
|||||||
if($player !== false){
|
if($player !== false){
|
||||||
$player->entity->setPosition($x, $y, $z, 0, 0);
|
$player->entity->setPosition($x, $y, $z, 0, 0);
|
||||||
$player->fallY = false;
|
$player->fallY = false;
|
||||||
|
$player->fallStart = false;
|
||||||
$player->dataPacket(MC_MOVE_PLAYER, array(
|
$player->dataPacket(MC_MOVE_PLAYER, array(
|
||||||
"eid" => 0,
|
"eid" => 0,
|
||||||
"x" => $x,
|
"x" => $x,
|
||||||
@ -185,6 +186,7 @@ class PlayerAPI{
|
|||||||
"pitch" => 0,
|
"pitch" => 0,
|
||||||
));
|
));
|
||||||
$player->fallY = false;
|
$player->fallY = false;
|
||||||
|
$player->fallStart = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -276,8 +276,3 @@ define("QUARTZ", 406);
|
|||||||
define("NETHER_QUARTZ", 406);
|
define("NETHER_QUARTZ", 406);
|
||||||
|
|
||||||
define("CAMERA", 456);
|
define("CAMERA", 456);
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
define("", );
|
|
||||||
*/
|
|
@ -33,11 +33,19 @@ class PaintingItem extends Item{
|
|||||||
|
|
||||||
public function onActivate(BlockAPI $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
public function onActivate(BlockAPI $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
if($target->isTransparent === false and $face > 1){
|
if($target->isTransparent === false and $face > 1){
|
||||||
|
$faces = array(
|
||||||
|
2 => 1,
|
||||||
|
3 => 3,
|
||||||
|
4 => 0,
|
||||||
|
5 => 2,
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
"x" => $target->x,
|
"x" => $target->x,
|
||||||
"y" => $target->y,
|
"y" => $target->y,
|
||||||
"z" => $target->z,
|
"z" => $target->z,
|
||||||
"yaw" => ($face % 4) * 90,
|
"yaw" => $faces[$face] * 90,
|
||||||
);
|
);
|
||||||
$server = ServerAPI::request();
|
$server = ServerAPI::request();
|
||||||
$e = $server->api->entity->add(ENTITY_OBJECT, OBJECT_PAINTING, $data);
|
$e = $server->api->entity->add(ENTITY_OBJECT, OBJECT_PAINTING, $data);
|
||||||
|
@ -281,7 +281,9 @@ class Entity extends stdClass{
|
|||||||
}
|
}
|
||||||
if($this->fallY !== false and ($this->fallStart + 8) < microtime(true)){ //Flying
|
if($this->fallY !== false and ($this->fallStart + 8) < microtime(true)){ //Flying
|
||||||
$this->harm(1, "flying");
|
$this->harm(1, "flying");
|
||||||
$this->fallY = $y;
|
if($y > $this->fallY){
|
||||||
|
$this->fallY = $y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}elseif($this->fallY !== false){ //Fall damage!
|
}elseif($this->fallY !== false){ //Fall damage!
|
||||||
if($y < $this->fallY){
|
if($y < $this->fallY){
|
||||||
@ -548,6 +550,8 @@ class Entity extends stdClass{
|
|||||||
$this->air = 300;
|
$this->air = 300;
|
||||||
$this->fire = 0;
|
$this->fire = 0;
|
||||||
$this->crouched = false;
|
$this->crouched = false;
|
||||||
|
$this->fallY = false;
|
||||||
|
$this->fallStart = false;
|
||||||
$this->updateMetadata();
|
$this->updateMetadata();
|
||||||
$this->dead = true;
|
$this->dead = true;
|
||||||
$this->server->api->dhandle("entity.event", array("entity" => $this, "event" => 3)); //Entity dead
|
$this->server->api->dhandle("entity.event", array("entity" => $this, "event" => 3)); //Entity dead
|
||||||
|
Loading…
x
Reference in New Issue
Block a user