mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added __toString() to Player, Block and Item classes & added protocol order enforcement after login
This commit is contained in:
parent
4d05d7da0d
commit
e7d56a837f
3 changed files with 60 additions and 2 deletions
|
|
@ -135,7 +135,6 @@ abstract class Block{
|
|||
);
|
||||
protected $id;
|
||||
protected $meta;
|
||||
protected $shortname = "";
|
||||
protected $name = "";
|
||||
public $isActivable = false;
|
||||
public $breakable = true;
|
||||
|
|
@ -154,7 +153,6 @@ abstract class Block{
|
|||
$this->id = (int) $id;
|
||||
$this->meta = (int) $meta;
|
||||
$this->name = $name;
|
||||
$this->shortname = strtolower(str_replace(" ", "_", $name));
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
|
|
@ -186,6 +184,10 @@ abstract class Block{
|
|||
}
|
||||
}
|
||||
|
||||
final public function __toString(){
|
||||
return $this->name ." (".$this->id.":".$this->meta.")";
|
||||
}
|
||||
|
||||
abstract function isBreakable(Item $item, Player $player);
|
||||
|
||||
abstract function onBreak(BlockAPI $level, Item $item, Player $player);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue