mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
armor is not resisting damage from anything except players, drop fix, and baby fix
This commit is contained in:
parent
e31546afa7
commit
b73205744e
4 changed files with 69 additions and 68 deletions
|
|
@ -5,6 +5,9 @@ move methods
|
|||
*/
|
||||
abstract class Animal extends Creature implements Ageable, Breedable{
|
||||
public function isBaby(){
|
||||
if(!isset($this->data["IsBaby"])){
|
||||
$this->data["IsBaby"] = false;
|
||||
}
|
||||
return $this->data["IsBaby"];
|
||||
}
|
||||
public function getMetadata(){
|
||||
|
|
|
|||
|
|
@ -960,8 +960,8 @@ class Entity extends Position{
|
|||
);
|
||||
foreach($this->player->armor as $slot=>$part){
|
||||
if($part instanceof Item and isset($values[$part->getID()])){
|
||||
$points += $values[$part->getID()];
|
||||
if(is_numeric($cause)){ //check was entity damage by another entity
|
||||
$points += $values[$part->getID()];
|
||||
$this->player->damageArmorPart($slot, $part);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ class EntityList{
|
|||
$this->entities[$property->getEntityType()] = $property;
|
||||
}
|
||||
|
||||
public function getEntityFromType($type){
|
||||
return isset($this->entities[$type]) ? $this->entities[$type] : 0;
|
||||
public function getEntityFromTypeAndClass($type, $class){
|
||||
return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0;
|
||||
}
|
||||
private $entities = [];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue