mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
hopefully fixed hoe durability
This commit is contained in:
parent
5bd7825736
commit
4df64523f6
3 changed files with 5 additions and 1 deletions
|
|
@ -232,7 +232,7 @@ class Item{
|
|||
}
|
||||
|
||||
public function getMaxDurability(){
|
||||
if(!$this->isTool() and $this->isHoe() === false and $this->id !== BOW){
|
||||
if(!$this->isTool() and $this->id !== BOW){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ class DirtBlock extends SolidBlock{
|
|||
if($this->getSide(1)->isTransparent === false) return false;
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$item->useOn($this);
|
||||
if($item->getMetadata() >= $item->getMaxDurability()) $player->setSlot($player->slot, new Item(AIR, 0, 0), false);
|
||||
else $player->setSlot($player->slot, $item, true);
|
||||
}
|
||||
$this->level->setBlock($this, BlockAPI::get(FARMLAND, 0), true, false, true);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ class GrassBlock extends SolidBlock{
|
|||
if($this->getSide(1)->isTransparent === false) return false;
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$item->useOn($this);
|
||||
if($item->getMetadata() >= $item->getMaxDurability()) $player->setSlot($player->slot, new Item(AIR, 0, 0), false);
|
||||
else $player->setSlot($player->slot, $item, true);
|
||||
}
|
||||
$this->level->setBlock($this, new FarmlandBlock());
|
||||
$this->seedsDrop();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue