mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
small changes to armor system + maxstacksize of armor is fixed
This commit is contained in:
parent
f2da48c7e3
commit
81d46e71aa
2 changed files with 25 additions and 0 deletions
9
src/material/Material.php
Normal file
9
src/material/Material.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/*value - durability*/
|
||||
class Material{
|
||||
const LEATHER = 5; //when enums
|
||||
const CHAIN = 15;
|
||||
const GOLD = 7;
|
||||
const IRON = 15;
|
||||
const DIAMOND = 33;
|
||||
}
|
||||
16
src/material/item/armor/ArmorItem.php
Normal file
16
src/material/item/armor/ArmorItem.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
abstract class ArmorItem extends Item{ //abstract to avoid making instances of it
|
||||
|
||||
public function isArmor(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract function getMaterialDurability();
|
||||
|
||||
public abstract function getBaseDurability();
|
||||
|
||||
public function getMaxDurability(){
|
||||
return $this->getMaterialDurability() * $this->getBaseDurability();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue