mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Correct position for gates,doors,stairs,trapdoors
+ corrected cactus bug
This commit is contained in:
@ -2,20 +2,20 @@
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -74,6 +74,26 @@ class Entity extends stdClass{
|
||||
}
|
||||
}
|
||||
|
||||
public function getDirection(){
|
||||
$rotation = ($this->yaw - 90) % 360;
|
||||
if ($rotation < 0) {
|
||||
$rotation += 360.0;
|
||||
}
|
||||
if(0 <= $rotation && $rotation < 45) {
|
||||
return 2;
|
||||
}elseif(45 <= $rotation && $rotation < 135) {
|
||||
return 3;
|
||||
}elseif(135 <= $rotation && $rotation < 225) {
|
||||
return 0;
|
||||
}elseif(225 <= $rotation && $rotation < 315) {
|
||||
return 1;
|
||||
}elseif(315 <= $rotation && $rotation < 360) {
|
||||
return 2;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function spawn($player){
|
||||
if(!is_object($player)){
|
||||
$player = $this->server->api->player->get($player);
|
||||
|
Reference in New Issue
Block a user