mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
mr_rand(1)
This commit is contained in:
parent
f864e4db38
commit
b5b8783d48
2 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ class TaskAttackPlayer extends TaskTempt
|
||||||
}
|
}
|
||||||
public function onUpdate(EntityAI $ai)
|
public function onUpdate(EntityAI $ai)
|
||||||
{
|
{
|
||||||
if(($ai->entity instanceof Spider && $ai->entity->level->isDay()) || ($this->target instanceof Entity && !$this->target->isPlayer()) || $this->target->distanceSquared($ai->entity) > 100 || $this->target->level->getName() != $ai->entity->level->getName()){
|
if(!($this->target instanceof Entity) ($ai->entity instanceof Spider && $ai->entity->level->isDay()) || ($this->target instanceof Entity && !$this->target->isPlayer()) || $this->target->distanceSquared($ai->entity) > 100 || $this->target->level->getName() != $ai->entity->level->getName()){
|
||||||
$this->reset();
|
$this->reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class CarrotBlock extends FlowableBlock{
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
$drops = array();
|
$drops = array();
|
||||||
if($this->meta >= 0x07){
|
if($this->meta >= 0x07){
|
||||||
$drops[] = array(CARROT, 0, mt_rand(1));
|
$drops[] = array(CARROT, 0, mt_rand(1, 4));
|
||||||
}
|
}
|
||||||
for($i = 0; $i < 3; ++$i){
|
for($i = 0; $i < 3; ++$i){
|
||||||
if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7
|
if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue