mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
fix utils::chance()
This commit is contained in:
parent
0e11e4c10e
commit
bdbb548ee6
2 changed files with 3 additions and 3 deletions
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class SpawnEggItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(SPAWN_EGG, 0, $count, "Spawn Egg");
|
||||
parent::__construct(SPAWN_EGG, $meta, $count, "Spawn Egg");
|
||||
$this->meta = $meta;
|
||||
$this->isActivable = true;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ class SpawnEggItem extends Item{
|
|||
"x" => $block->x + 0.5,
|
||||
"y" => $block->y,
|
||||
"z" => $block->z + 0.5,
|
||||
"isBaby" => $ageable ? mt_rand(0,20) === 0 ? 1 : 0 : 0,
|
||||
"isBaby" => $ageable ? Utils::chance(5) ? 1 : 0 : 0,
|
||||
);
|
||||
$e = ServerAPI::request()->api->entity->add($block->level, ENTITY_MOB, $this->meta, $data);
|
||||
ServerAPI::request()->api->entity->spawnToAll($e);
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ class Utils{
|
|||
}
|
||||
|
||||
public static function chance($i){//GameHerobrine's code
|
||||
return randomFloat() < $i / 100;
|
||||
return self::randomFloat() < $i / 100;
|
||||
}
|
||||
|
||||
public static function round($number){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue