mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
Some blocks and entity fixes
This commit is contained in:
parent
3ad75fc9b6
commit
406ab32504
5 changed files with 33 additions and 5 deletions
|
|
@ -63,10 +63,13 @@ define("ENTITY_MOB", 2);
|
||||||
define("MOB_PIGMAN", 36);
|
define("MOB_PIGMAN", 36);
|
||||||
|
|
||||||
define("ENTITY_OBJECT", 3);
|
define("ENTITY_OBJECT", 3);
|
||||||
|
define("OBJECT_TRIPOD_CAMERA", 62);
|
||||||
define("OBJECT_PRIMEDTNT", 65);
|
define("OBJECT_PRIMEDTNT", 65);
|
||||||
define("OBJECT_ARROW", 80);
|
define("OBJECT_ARROW", 80);
|
||||||
define("OBJECT_SNOWBALL", 81);
|
define("OBJECT_SNOWBALL", 81);
|
||||||
|
define("OBJECT_EGG", 82);
|
||||||
define("OBJECT_PAINTING", 83);
|
define("OBJECT_PAINTING", 83);
|
||||||
|
define("OBJECT_MINECART", 84);
|
||||||
|
|
||||||
define("ENTITY_ITEM", 4);
|
define("ENTITY_ITEM", 4);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,8 @@ define("SIGN", 323);
|
||||||
define("WOODEN_DOOR", 324);
|
define("WOODEN_DOOR", 324);
|
||||||
define("BUCKET", 325);
|
define("BUCKET", 325);
|
||||||
|
|
||||||
define("MINECART", 329);
|
define("MINECART", 328);
|
||||||
|
define("SADDLE", 329);
|
||||||
define("IRON_DOOR", 330);
|
define("IRON_DOOR", 330);
|
||||||
define("REDSTONE", 331);
|
define("REDSTONE", 331);
|
||||||
define("REDSTONE_DUST", 331);
|
define("REDSTONE_DUST", 331);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,15 @@ class CobwebBlock extends FlowableBlock{
|
||||||
$this->hardness = 25;
|
$this->hardness = 25;
|
||||||
}
|
}
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
return array();
|
if ($item->isSword()){
|
||||||
|
return array(
|
||||||
|
array(287, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
elseif ($item->isShears()){
|
||||||
|
return array(
|
||||||
|
array(COBWEB, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -45,4 +45,11 @@ class DeadBushBlock extends FlowableBlock{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item, Player $player){
|
||||||
|
if($item->isShears()){
|
||||||
|
return array(
|
||||||
|
array(DEAD_BUSH, 0, 1),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +136,7 @@ class Entity extends Position{
|
||||||
$this->setHealth(10000000, "generic");
|
$this->setHealth(10000000, "generic");
|
||||||
$this->server->schedule(5, array($this, "updateFuse"), array(), true);
|
$this->server->schedule(5, array($this, "updateFuse"), array(), true);
|
||||||
$this->update();
|
$this->update();
|
||||||
}elseif($this->type === OBJECT_ARROW){
|
}elseif($this->type === (OBJECT_ARROW or OBJECT_SNOWBALL)){
|
||||||
$this->server->schedule(1210, array($this, "update")); //Despawn
|
$this->server->schedule(1210, array($this, "update")); //Despawn
|
||||||
$this->update();
|
$this->update();
|
||||||
}
|
}
|
||||||
|
|
@ -266,7 +266,7 @@ class Entity extends Position{
|
||||||
$this->close(); //Despawn timer
|
$this->close(); //Despawn timer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}elseif($this->class === ENTITY_OBJECT and ($this->type === OBJECT_ARROW) or ($this->type === OBJECT_SNOWBALL)){
|
}elseif($this->class === ENTITY_OBJECT and ($this->type === OBJECT_ARROW or OBJECT_SNOWBALL)){
|
||||||
if(($time - $this->spawntime) >= 60){
|
if(($time - $this->spawntime) >= 60){
|
||||||
$this->close(); //Despawn timer
|
$this->close(); //Despawn timer
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -750,6 +750,15 @@ class Entity extends Position{
|
||||||
"z" => $this->z,
|
"z" => $this->z,
|
||||||
"did" => 0,
|
"did" => 0,
|
||||||
));
|
));
|
||||||
|
}elseif($this->type === OBJECT_MINECART){
|
||||||
|
$player->dataPacket(MC_ADD_ENTITY, array(
|
||||||
|
"eid" => $this->eid,
|
||||||
|
"type" => $this->type,
|
||||||
|
"x" => $this->x,
|
||||||
|
"y" => $this->y,
|
||||||
|
"z" => $this->z,
|
||||||
|
"did" => 0,
|
||||||
|
));
|
||||||
}elseif($this->type === OBJECT_ARROW){
|
}elseif($this->type === OBJECT_ARROW){
|
||||||
$player->dataPacket(MC_ADD_ENTITY, array(
|
$player->dataPacket(MC_ADD_ENTITY, array(
|
||||||
"eid" => $this->eid,
|
"eid" => $this->eid,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue