mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Spawning blocks/items using its name
This commit is contained in:
parent
cdb05f0695
commit
65280d85d1
4 changed files with 18 additions and 8 deletions
|
|
@ -30,6 +30,8 @@ require_once("classes/material/IDs.php");
|
|||
class Item{
|
||||
public static $class = array(
|
||||
SUGARCANE => "SugarcaneItem",
|
||||
WHEAT_SEEDS => "WheatSeedsItem",
|
||||
MELON_SEEDS => "MelonSeedsItem",
|
||||
);
|
||||
protected $block;
|
||||
protected $id;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class SugarcaneBlock extends TransparentBlock{
|
|||
$down = $level->getBlockFace($block, 0);
|
||||
if($down->getID() === SUGARCANE_BLOCK){
|
||||
$level->setBlock($block, $this->id, 0);
|
||||
return true;
|
||||
return true;
|
||||
}elseif($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 12){
|
||||
$block0 = $level->getBlockFace($down, 2);
|
||||
$block1 = $level->getBlockFace($down, 3);
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ class Entity extends stdClass{
|
|||
if($this->speedZ != 0){
|
||||
$this->z += $this->speedZ * 5;
|
||||
}
|
||||
if(isset($blockDown->isFlowable === true){
|
||||
if($blockDown->isFlowable === true){
|
||||
$this->speedY -= 0.04 * 5;
|
||||
//$this->server->api->handle("entity.motion", $this);
|
||||
}elseif($this->speedY < 0){
|
||||
|
|
@ -271,7 +271,7 @@ class Entity extends stdClass{
|
|||
//$this->server->api->handle("entity.motion", $this);
|
||||
}
|
||||
}else{
|
||||
if(isset($blockDown->isFlowable === true){
|
||||
if($blockDown->isFlowable === true){
|
||||
if($this->fallY === false or $y > $this->fallY){
|
||||
$this->fallY = $y;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue