mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
Small fixes
Fixed pumpkins face direction Added drop snowballs from snow Added mobs spawn from his spawn eggs
This commit is contained in:
parent
680ce226cd
commit
86cfb923f4
4 changed files with 29 additions and 7 deletions
|
|
@ -20,17 +20,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LitPumpkinBlock extends SolidBlock{
|
class LitPumpkinBlock extends SolidBlock{
|
||||||
public function __construct(){
|
public function __construct($meta = 0){
|
||||||
parent::__construct(LIT_PUMPKIN, "Jack o'Lantern");
|
parent::__construct(LIT_PUMPKIN, $meta, "Jack o'Lantern");
|
||||||
$this->hardness = 5;
|
$this->hardness = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
$faces = array(
|
$faces = array(
|
||||||
0 => 4,
|
0 => 1,
|
||||||
1 => 2,
|
1 => 2,
|
||||||
2 => 5,
|
2 => 3,
|
||||||
3 => 3,
|
3 => 0,
|
||||||
);
|
);
|
||||||
$this->meta = $faces[$player->entity->getDirection()];
|
$this->meta = $faces[$player->entity->getDirection()];
|
||||||
$this->level->setBlock($block, $this, true, false, true);
|
$this->level->setBlock($block, $this, true, false, true);
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,20 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class PumpkinBlock extends SolidBlock{
|
class PumpkinBlock extends SolidBlock{
|
||||||
public function __construct(){
|
public function __construct($meta = 0){
|
||||||
parent::__construct(PUMPKIN, "Pumpkin");
|
parent::__construct(PUMPKIN, $meta, "Pumpkin");
|
||||||
$this->hardness = 5;
|
$this->hardness = 5;
|
||||||
}
|
}
|
||||||
|
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
|
$faces = array(
|
||||||
|
0 => 1,
|
||||||
|
1 => 2,
|
||||||
|
2 => 3,
|
||||||
|
3 => 0,
|
||||||
|
);
|
||||||
|
$this->meta = $faces[$player->entity->getDirection()];
|
||||||
|
$this->level->setBlock($block, $this, true, false, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -25,4 +25,10 @@ class SnowBlock extends SolidBlock{
|
||||||
$this->hardness = 1;
|
$this->hardness = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
return array(
|
||||||
|
array(SNOWBALL, 0, 4),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -32,6 +32,11 @@ class SpawnEggItem extends Item{
|
||||||
case MOB_SHEEP:
|
case MOB_SHEEP:
|
||||||
case MOB_COW:
|
case MOB_COW:
|
||||||
case MOB_PIG:
|
case MOB_PIG:
|
||||||
|
case MOB_ZOMBIE:
|
||||||
|
case MOB_CREEPER:
|
||||||
|
case MOB_SKELETON:
|
||||||
|
case MOB_SPIDER:
|
||||||
|
case MOB_PIGMAN:
|
||||||
$data = array(
|
$data = array(
|
||||||
"x" => $block->x + 0.5,
|
"x" => $block->x + 0.5,
|
||||||
"y" => $block->y,
|
"y" => $block->y,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue