mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
ew
This commit is contained in:
parent
b9e19034a4
commit
755276193c
3 changed files with 7 additions and 3 deletions
|
|
@ -1156,7 +1156,7 @@ class Player{
|
|||
$motionSent = false;
|
||||
$moveSent = false;
|
||||
$headSent = false;
|
||||
if($e->speedX != 0 || $e->speedY != 0 || $e->speedZ != 0){
|
||||
if($e->speedX != 0 || $e->speedY != 0 || $e->speedZ != 0 || $e->speedY != $e->lastSpeedY || $e->speedX != $e->lastSpeedX || $e->speedZ != $e->lastSpeedZ){
|
||||
$motion = new SetEntityMotionPacket();
|
||||
$motion->eid = $e->eid;
|
||||
$motion->speedX = $e->speedX;
|
||||
|
|
@ -1171,7 +1171,7 @@ class Player{
|
|||
$move = new MoveEntityPacket_PosRot();
|
||||
$move->eid = $e->eid;
|
||||
$move->x = $e->x;
|
||||
$move->y = $e->y;
|
||||
$move->y = $e instanceof ItemEntity ? $e->boundingBox->maxY : $e->y; //TODO fix items getting into farmland in client side somehow else
|
||||
$move->z = $e->z;
|
||||
$move->yaw = $e->yaw;
|
||||
$move->pitch = $e->pitch;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class ItemEntity extends Entity{
|
|||
public function __construct(Level $level, $eid, $class, $type = 0, $data = array())
|
||||
{
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setSize(0.25, 0.25);
|
||||
if(isset($data["item"]) and ($data["item"] instanceof Item)){
|
||||
$this->meta = $this->data["item"]->getMetadata();
|
||||
$this->stack = $this->data["item"]->count;
|
||||
|
|
@ -18,7 +19,6 @@ class ItemEntity extends Entity{
|
|||
}
|
||||
$this->hasGravity = true;
|
||||
$this->setHealth(5, "generic");
|
||||
$this->setSize(0.25, 0.25);
|
||||
$this->gravity = 0.04;
|
||||
$this->delayBeforePickup = 20;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ class FarmlandBlock extends TransparentBlock{
|
|||
return $b->isTransparent && $b->id != 0;
|
||||
}
|
||||
|
||||
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
|
||||
return [new AxisAlignedBB($x, $y, $z, $x + 1, $y + 0.9375, $z + 1)];
|
||||
}
|
||||
|
||||
public static function fallOn(Level $level, $x, $y, $z, Entity $entity, $fallDistance){
|
||||
$rv = lcg_value();
|
||||
console("rv: $rv, fd: ".($fallDistance - 0.5));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue