This commit is contained in:
GameHerobrine 2023-01-10 00:55:15 +03:00
parent 44728d21dc
commit 38d4bd6644
4 changed files with 8 additions and 37 deletions

View file

@ -570,9 +570,9 @@ class Entity extends Position
$y1 = $y1 > 128 ? 128 : $y1;
$z1 = $z1 > 256 ? 256 : $z1;
$waterDone = false;
for($x = $x0 - 1; $x < $x1 + 1; ++ $x){
for($y = $y0; $y < $y1; ++ $y){
for($z = $z0 - 1; $z < $z1 + 1; ++ $z){
for($x = $x0; $x < $x1; ++$x){
for($y = $y0; $y < $y1; ++$y){
for($z = $z0; $z < $z1; ++$z){
$pos = new Vector3($x, $y, $z);
$b = $this->level->getBlock($pos);
switch($b->getID()) {
@ -637,37 +637,9 @@ class Entity extends Position
}
}
}
if(!$support){
for($z = $startZ; $z <= $endZ; ++ $z){
for($x = $startX; $x <= $endX; ++ $x){
$v = new Vector3($x, $y, $z);
$v1 = new Vector3($x, $yC, $z);
if($this->isSupport($v, $this->width)){
$b = $this->level->getBlock($v);
if($b->isSolid === true){
$support = true;
$isFlying = false;
break;
} elseif(($b instanceof LiquidBlock) or $b->getID() === COBWEB or $b->getID() === LADDER or $b->getID() === FENCE or $b->getID() === STONE_WALL or $b->getID() === IRON_BARS){
$isFlying = false;
}
} elseif($this->isSupport($v1, $this->width)){
$b = $this->level->getBlock($v1);
if($b->isSolid === true){
$support = true;
$isFlying = false;
break;
} elseif(($b instanceof LiquidBlock) or $b->getID() === COBWEB or $b->getID() === LADDER or $b->getID() === FENCE or $b->getID() === STONE_WALL or $b->getID() === IRON_BARS){
$isFlying = false;
}
}
}
if($support === true){
break;
}
}
}
if($this->speedX != 0){
$this->x += $this->speedX;
$this->speedX -= $this->speedX * $drag;
@ -1524,7 +1496,7 @@ class Entity extends Position
if($this->speedY > 0.40000000596046448){
$this->speedY = 0.40000000596046448;
}
$this->speedY /= 2;
//$this->speedY /= 2;
}
public function getHealth()

View file

@ -16,7 +16,7 @@ class RedstoneOreBlock extends SolidBlock{
}
public function getDrops(Item $item, Player $player){
if($item->getPickaxeLevel() >= 2){
if($item->getPickaxeLevel() >= 4){
return array(
array(REDSTONE_DUST, 0, mt_rand(4, 5)),
);

View file

@ -271,7 +271,6 @@ class Level{
$e->update();
}
}
if(Entity::$updateOnTick && $server->ticks % 40 === 0){ //40 ticks delay
$this->mobSpawner->handle();
}

View file

@ -11,7 +11,7 @@ class MobSpawner{
public function countEntities(){
$ents = 0;
foreach($this->level->entityList as $e){
foreach($this->level->entityList as $e){ //TODO no for loop
if(!$e->isPlayer() && $e->class === ENTITY_MOB){
++$ents;
}