mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
rewrite of interact system, bugfixes, ai tweaks
This commit is contained in:
parent
f5222be9d2
commit
ac1a1b2449
62 changed files with 649 additions and 491 deletions
11
src/material/item/base/ItemAxe.php
Normal file
11
src/material/item/base/ItemAxe.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
abstract class ItemAxe extends ItemTool
|
||||
{
|
||||
public function isAxe(){
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
18
src/material/item/base/ItemHoe.php
Normal file
18
src/material/item/base/ItemHoe.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
abstract class ItemHoe extends ItemTool
|
||||
{
|
||||
public function isHoe(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public function useOn($object, $force = false){
|
||||
if(($object instanceof Block) and ($object->getID() === GRASS or $object->getID() === DIRT)){
|
||||
$this->meta++;
|
||||
return true;
|
||||
}else{
|
||||
return parent::useOn($object, $force);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
src/material/item/base/ItemPickaxe.php
Normal file
13
src/material/item/base/ItemPickaxe.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
abstract class ItemPickaxe extends ItemTool
|
||||
{
|
||||
public function isTool(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isPickaxe(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
9
src/material/item/base/ItemShovel.php
Normal file
9
src/material/item/base/ItemShovel.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
class ItemShovel extends ItemTool
|
||||
{
|
||||
public function isShovel(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
10
src/material/item/base/ItemSword.php
Normal file
10
src/material/item/base/ItemSword.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
abstract class ItemSword extends ItemTool
|
||||
{
|
||||
|
||||
public function isSword(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
17
src/material/item/base/ItemTool.php
Normal file
17
src/material/item/base/ItemTool.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
abstract class ItemTool extends Item
|
||||
{
|
||||
public function isTool(){
|
||||
return true;
|
||||
}
|
||||
public function useOn($object, $force = false){
|
||||
if(($object instanceof Entity) and !$this->isSword()){
|
||||
$this->meta += 2;
|
||||
}else{
|
||||
$this->meta++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue