mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
Fixed entities getting OnGround default to true
This commit is contained in:
parent
69fb7ae525
commit
f8378c09ba
@ -1171,7 +1171,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$hasUpdate = $this->entityBaseTick();
|
$hasUpdate = $this->entityBaseTick();
|
||||||
foreach($this->getLevel()->getNearbyEntities($this->boundingBox->grow(1, 1, 1), $this) as $entity){
|
foreach($this->getLevel()->getNearbyEntities($this->boundingBox->grow(1, 1, 1), $this) as $entity){
|
||||||
if($entity instanceof Arrow and $entity->onGround){
|
if($entity instanceof Arrow and $entity->onGround and $this->motionX == 0 and $this->motionY == 0 and $this->motionZ == 0){
|
||||||
if($entity->dead !== true){
|
if($entity->dead !== true){
|
||||||
$item = Item::get(Item::ARROW, 0, 1);
|
$item = Item::get(Item::ARROW, 0, 1);
|
||||||
if($this->isSurvival() and !$this->inventory->canAddItem($item)){
|
if($this->isSurvival() and !$this->inventory->canAddItem($item)){
|
||||||
|
@ -1526,7 +1526,7 @@ class Server{
|
|||||||
$this->logger->info("Advanced cache enabled");
|
$this->logger->info("Advanced cache enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
Level::$COMPRESSION_LEVEL = $this->getProperty("chunk-sending.compression-level", 7);
|
Level::$COMPRESSION_LEVEL = $this->getProperty("chunk-sending.compression-level", 8);
|
||||||
|
|
||||||
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0){
|
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0){
|
||||||
@cli_set_process_title($this->getName() . " " . $this->getPocketMineVersion());
|
@cli_set_process_title($this->getName() . " " . $this->getPocketMineVersion());
|
||||||
|
@ -130,16 +130,6 @@ class Arrow extends Projectile{
|
|||||||
|
|
||||||
$this->move($this->motionX, $this->motionY, $this->motionZ);
|
$this->move($this->motionX, $this->motionY, $this->motionZ);
|
||||||
|
|
||||||
$friction = 1 - $this->drag;
|
|
||||||
|
|
||||||
if($this->onGround){
|
|
||||||
$friction = $this->getLevel()->getBlock(new Vector3($this->getFloorX(), $this->getFloorY() - 1, $this->getFloorZ()))->frictionFactor * $friction;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->motionX *= $friction;
|
|
||||||
$this->motionY *= 1 - $this->drag;
|
|
||||||
$this->motionZ *= $friction;
|
|
||||||
|
|
||||||
if($this->onGround){
|
if($this->onGround){
|
||||||
$this->motionX = 0;
|
$this->motionX = 0;
|
||||||
$this->motionY = 0;
|
$this->motionY = 0;
|
||||||
|
@ -198,7 +198,7 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
$this->airTicks = $this->namedtag["Air"];
|
$this->airTicks = $this->namedtag["Air"];
|
||||||
|
|
||||||
if(!isset($this->namedtag->OnGround)){
|
if(!isset($this->namedtag->OnGround)){
|
||||||
$this->namedtag->OnGround = new Byte("OnGround", 1);
|
$this->namedtag->OnGround = new Byte("OnGround", 0);
|
||||||
}
|
}
|
||||||
$this->onGround = $this->namedtag["OnGround"] > 0 ? true : false;
|
$this->onGround = $this->namedtag["OnGround"] > 0 ? true : false;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
class Level implements ChunkManager, Metadatable{
|
class Level implements ChunkManager, Metadatable{
|
||||||
|
|
||||||
private static $levelIdCounter = 1;
|
private static $levelIdCounter = 1;
|
||||||
public static $COMPRESSION_LEVEL = 7;
|
public static $COMPRESSION_LEVEL = 8;
|
||||||
|
|
||||||
|
|
||||||
const BLOCK_UPDATE_NORMAL = 1;
|
const BLOCK_UPDATE_NORMAL = 1;
|
||||||
@ -433,7 +433,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$pk->time = (int) $this->time;
|
$pk->time = (int) $this->time;
|
||||||
$pk->started = $this->stopTime == false;
|
$pk->started = $this->stopTime == false;
|
||||||
foreach($this->players as $player){
|
foreach($this->players as $player){
|
||||||
$player->directDataPacket($pk);
|
$player->dataPacket($pk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -920,7 +920,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
foreach($this->getUsingChunk($pos->x >> 4, $pos->z >> 4) as $player){
|
foreach($this->getUsingChunk($pos->x >> 4, $pos->z >> 4) as $player){
|
||||||
/** @var Player $player */
|
/** @var Player $player */
|
||||||
$player->directDataPacket($pk);
|
$player->dataPacket($pk);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(!($pos instanceof Position)){
|
if(!($pos instanceof Position)){
|
||||||
|
@ -33,7 +33,7 @@ chunk-sending:
|
|||||||
#Amount of chunks sent to players per tick
|
#Amount of chunks sent to players per tick
|
||||||
per-tick: 4
|
per-tick: 4
|
||||||
#Compression level used when sending chunks. Higher = more CPU, less bandwidth usage
|
#Compression level used when sending chunks. Higher = more CPU, less bandwidth usage
|
||||||
compression-level: 7
|
compression-level: 8
|
||||||
#Amount of chunks loaded around a player by the server, min. 56 as MC: PE 0.9.5
|
#Amount of chunks loaded around a player by the server, min. 56 as MC: PE 0.9.5
|
||||||
#Increasing this more than 96 (as of MC: PE 0.9.5) can cause issues with the client ignoring chunks
|
#Increasing this more than 96 (as of MC: PE 0.9.5) can cause issues with the client ignoring chunks
|
||||||
max-chunks: 96
|
max-chunks: 96
|
||||||
|
Loading…
x
Reference in New Issue
Block a user