From df0db014251c793aa493ac22f8f51b4fa7e8f3ef Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Tue, 6 Sep 2022 18:33:08 +0300 Subject: [PATCH] isPickaxe replaced with getPickaxeLevel, reactor drops correct block now --- src/material/Item.php | 4 ++-- src/material/block/StairBlock.php | 2 +- src/material/block/misc/NetherReactor.php | 9 +++++++++ src/material/block/nonfull/IronDoor.php | 4 ++-- src/material/block/nonfull/Rail.php | 2 +- src/material/block/nonfull/Slab.php | 4 ++-- src/material/block/ore/CoalOre.php | 4 ++-- src/material/block/ore/DiamondOre.php | 4 ++-- src/material/block/ore/GlowingRedstoneOre.php | 4 ++-- src/material/block/ore/GoldOre.php | 4 ++-- src/material/block/ore/IronOre.php | 4 ++-- src/material/block/ore/LapisOre.php | 4 ++-- src/material/block/ore/RedstoneOre.php | 2 +- src/material/block/plant/Sapling.php | 2 +- src/material/block/solid/Bricks.php | 4 ++-- src/material/block/solid/BurningFurnace.php | 4 ++-- src/material/block/solid/Coal.php | 4 ++-- src/material/block/solid/Cobblestone.php | 4 ++-- src/material/block/solid/Diamond.php | 4 ++-- src/material/block/solid/DoubleSlab.php | 4 ++-- src/material/block/solid/Gold.php | 4 ++-- src/material/block/solid/Ice.php | 2 +- src/material/block/solid/Iron.php | 4 ++-- src/material/block/solid/Lapis.php | 4 ++-- src/material/block/solid/MossStone.php | 4 ++-- src/material/block/solid/NetherBrick.php | 4 ++-- src/material/block/solid/Netherrack.php | 4 ++-- src/material/block/solid/Obsidian.php | 4 ++-- src/material/block/solid/Quartz.php | 4 ++-- src/material/block/solid/Sandstone.php | 4 ++-- src/material/block/solid/Stone.php | 4 ++-- src/material/block/solid/StoneBricks.php | 4 ++-- src/material/item/food/Cake.php | 2 +- src/material/item/generic/Egg.php | 1 + src/material/item/generic/Minecart.php | 1 + src/material/item/generic/Snowball.php | 1 + src/material/item/tool/Compass.php | 3 ++- src/world/generator/populator/MineshaftPopulator.php | 2 +- 38 files changed, 73 insertions(+), 60 deletions(-) diff --git a/src/material/Item.php b/src/material/Item.php index e4f542ca..2b8af308 100755 --- a/src/material/Item.php +++ b/src/material/Item.php @@ -245,7 +245,7 @@ class Item{ BOW => 385 //x3 ); - if(($type = $this->isPickaxe()) === false){ + if(($type = $this->getPickaxeLevel()) === false){ if(($type = $this->isAxe()) === false){ if(($type = $this->isSword()) === false){ if(($type = $this->isShovel()) === false){ @@ -259,7 +259,7 @@ class Item{ return $levels[$type]; } - public function isPickaxe(){ //Returns false or level of the pickaxe + public function getPickaxeLevel(){ //Returns false or level of the pickaxe switch($this->id){ case IRON_PICKAXE: return 4; diff --git a/src/material/block/StairBlock.php b/src/material/block/StairBlock.php index 4d35747d..66fc8fff 100644 --- a/src/material/block/StairBlock.php +++ b/src/material/block/StairBlock.php @@ -50,7 +50,7 @@ class StairBlock extends TransparentBlock{ * @return array */ public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array($this->id, 0, 1), ); diff --git a/src/material/block/misc/NetherReactor.php b/src/material/block/misc/NetherReactor.php index b692c9fd..99214e2a 100644 --- a/src/material/block/misc/NetherReactor.php +++ b/src/material/block/misc/NetherReactor.php @@ -48,6 +48,15 @@ class NetherReactorBlock extends SolidBlock{ $this->decay($this->x-8, $this->y-3, $this->z-8, 6, 11, 1, 14, 34, 1, 5, 12, 16); } + public function getDrops(Item $item, Player $player){ + if($item->getPickaxeLevel() >= 1){ + return array( + [DIAMOND, 0, 3], + [IRON_INGOT, 0, 6], + ); + } + } + private function decay($x,$y,$z,$aOne,$aTwo,$aThree,$bOne,$bTwo,$bThree,$cOne,$cTwo,$cThree) { for($a = $aOne; $a < $aTwo; $a += $aThree) { //wth those cycles are? for($b = $bOne; $b < $bTwo; $b += $bThree) { diff --git a/src/material/block/nonfull/IronDoor.php b/src/material/block/nonfull/IronDoor.php index ade33789..ab8bb315 100644 --- a/src/material/block/nonfull/IronDoor.php +++ b/src/material/block/nonfull/IronDoor.php @@ -11,7 +11,7 @@ class IronDoorBlock extends DoorBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.95; case 4: @@ -28,7 +28,7 @@ class IronDoorBlock extends DoorBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(IRON_DOOR, 0, 1), ); diff --git a/src/material/block/nonfull/Rail.php b/src/material/block/nonfull/Rail.php index 6e3b1408..78ee223b 100644 --- a/src/material/block/nonfull/Rail.php +++ b/src/material/block/nonfull/Rail.php @@ -34,7 +34,7 @@ class RailBlock extends FlowableBlock{ } private function checkRail($rail){//fixed - if(!($rail instanceof Rail)) return null; + if(!($rail instanceof RailBlock)) return null; $damage = $rail->meta; if ($damage < 0 || $damage > 10) return null; $delta = array( diff --git a/src/material/block/nonfull/Slab.php b/src/material/block/nonfull/Slab.php index 8b9254b2..31098656 100644 --- a/src/material/block/nonfull/Slab.php +++ b/src/material/block/nonfull/Slab.php @@ -68,7 +68,7 @@ class SlabBlock extends TransparentBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -85,7 +85,7 @@ class SlabBlock extends TransparentBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array($this->id, $this->meta & 0x07, 1), ); diff --git a/src/material/block/ore/CoalOre.php b/src/material/block/ore/CoalOre.php index d5ec77cc..ebd90cea 100644 --- a/src/material/block/ore/CoalOre.php +++ b/src/material/block/ore/CoalOre.php @@ -10,7 +10,7 @@ class CoalOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -27,7 +27,7 @@ class CoalOreBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(COAL, 0, 1), ); diff --git a/src/material/block/ore/DiamondOre.php b/src/material/block/ore/DiamondOre.php index 53e8ad7d..03cb0605 100644 --- a/src/material/block/ore/DiamondOre.php +++ b/src/material/block/ore/DiamondOre.php @@ -10,7 +10,7 @@ class DiamondOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -21,7 +21,7 @@ class DiamondOreBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 4){ + if($item->getPickaxeLevel() >= 4){ return array( array(DIAMOND, 0, 1), ); diff --git a/src/material/block/ore/GlowingRedstoneOre.php b/src/material/block/ore/GlowingRedstoneOre.php index 5abc490e..b360c6be 100644 --- a/src/material/block/ore/GlowingRedstoneOre.php +++ b/src/material/block/ore/GlowingRedstoneOre.php @@ -23,7 +23,7 @@ class GlowingRedstoneOreBlock extends SolidBlock implements LightingBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -34,7 +34,7 @@ class GlowingRedstoneOreBlock extends SolidBlock implements LightingBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 4){ + if($item->getPickaxeLevel() >= 4){ return array( array(REDSTONE_DUST, 0, mt_rand(4, 5)), ); diff --git a/src/material/block/ore/GoldOre.php b/src/material/block/ore/GoldOre.php index f3db25ff..f82b8698 100644 --- a/src/material/block/ore/GoldOre.php +++ b/src/material/block/ore/GoldOre.php @@ -10,7 +10,7 @@ class GoldOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -21,7 +21,7 @@ class GoldOreBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 4){ + if($item->getPickaxeLevel() >= 4){ return array( array(GOLD_ORE, 0, 1), ); diff --git a/src/material/block/ore/IronOre.php b/src/material/block/ore/IronOre.php index 126ff7e9..7d173153 100644 --- a/src/material/block/ore/IronOre.php +++ b/src/material/block/ore/IronOre.php @@ -10,7 +10,7 @@ class IronOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -23,7 +23,7 @@ class IronOreBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 3){ + if($item->getPickaxeLevel() >= 3){ return array( array(IRON_ORE, 0, 1), ); diff --git a/src/material/block/ore/LapisOre.php b/src/material/block/ore/LapisOre.php index a17ed194..58782f0c 100644 --- a/src/material/block/ore/LapisOre.php +++ b/src/material/block/ore/LapisOre.php @@ -10,7 +10,7 @@ class LapisOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -23,7 +23,7 @@ class LapisOreBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 3){ + if($item->getPickaxeLevel() >= 3){ return array( array(DYE, 4, mt_rand(4, 8)), ); diff --git a/src/material/block/ore/RedstoneOre.php b/src/material/block/ore/RedstoneOre.php index 2bc0ad8e..7529a6f7 100644 --- a/src/material/block/ore/RedstoneOre.php +++ b/src/material/block/ore/RedstoneOre.php @@ -16,7 +16,7 @@ class RedstoneOreBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 2){ + if($item->getPickaxeLevel() >= 2){ return array( array(REDSTONE_DUST, 0, mt_rand(4, 5)), ); diff --git a/src/material/block/plant/Sapling.php b/src/material/block/plant/Sapling.php index 6e77064c..f969837b 100644 --- a/src/material/block/plant/Sapling.php +++ b/src/material/block/plant/Sapling.php @@ -7,7 +7,7 @@ class SaplingBlock extends FlowableBlock{ const JUNGLE = 3; const BURN_TIME = 5; - public function __construct($meta = Sapling::OAK){ + public function __construct($meta = SaplingBlock::OAK){ parent::__construct(SAPLING, $meta, "Sapling"); $this->isActivable = true; $names = array( diff --git a/src/material/block/solid/Bricks.php b/src/material/block/solid/Bricks.php index acc359e0..f212b494 100644 --- a/src/material/block/solid/Bricks.php +++ b/src/material/block/solid/Bricks.php @@ -10,7 +10,7 @@ class BricksBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -27,7 +27,7 @@ class BricksBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(BRICKS_BLOCK, 0, 1), ); diff --git a/src/material/block/solid/BurningFurnace.php b/src/material/block/solid/BurningFurnace.php index d746fdb1..98f24ec6 100644 --- a/src/material/block/solid/BurningFurnace.php +++ b/src/material/block/solid/BurningFurnace.php @@ -55,7 +55,7 @@ class BurningFurnaceBlock extends SolidBlock implements LightingBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.7; case 4: @@ -73,7 +73,7 @@ class BurningFurnaceBlock extends SolidBlock implements LightingBlock{ public function getDrops(Item $item, Player $player){ $drops = array(); - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ $drops[] = array(FURNACE, 0, 1); } $t = ServerAPI::request()->api->tile->get($this); diff --git a/src/material/block/solid/Coal.php b/src/material/block/solid/Coal.php index 171f73f6..7b488670 100644 --- a/src/material/block/solid/Coal.php +++ b/src/material/block/solid/Coal.php @@ -10,7 +10,7 @@ class CoalBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.95; case 4: @@ -27,7 +27,7 @@ class CoalBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(COAL_BLOCK, 0, 1), ); diff --git a/src/material/block/solid/Cobblestone.php b/src/material/block/solid/Cobblestone.php index e0b3262c..cab26772 100644 --- a/src/material/block/solid/Cobblestone.php +++ b/src/material/block/solid/Cobblestone.php @@ -10,7 +10,7 @@ class CobblestoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -27,7 +27,7 @@ class CobblestoneBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(COBBLESTONE, 0, 1), ); diff --git a/src/material/block/solid/Diamond.php b/src/material/block/solid/Diamond.php index 0fc01727..5d698469 100644 --- a/src/material/block/solid/Diamond.php +++ b/src/material/block/solid/Diamond.php @@ -10,7 +10,7 @@ class DiamondBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.95; case 4: @@ -21,7 +21,7 @@ class DiamondBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 4){ + if($item->getPickaxeLevel() >= 4){ return array( array(DIAMOND_BLOCK, 0, 1), ); diff --git a/src/material/block/solid/DoubleSlab.php b/src/material/block/solid/DoubleSlab.php index 72197d12..054f1fe3 100755 --- a/src/material/block/solid/DoubleSlab.php +++ b/src/material/block/solid/DoubleSlab.php @@ -21,7 +21,7 @@ class DoubleSlabBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -38,7 +38,7 @@ class DoubleSlabBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(SLAB, $this->meta & 0x07, 2), ); diff --git a/src/material/block/solid/Gold.php b/src/material/block/solid/Gold.php index 661faf7f..a4f632dc 100644 --- a/src/material/block/solid/Gold.php +++ b/src/material/block/solid/Gold.php @@ -10,7 +10,7 @@ class GoldBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -21,7 +21,7 @@ class GoldBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 4){ + if($item->getPickaxeLevel() >= 4){ return array( array(GOLD_BLOCK, 0, 1), ); diff --git a/src/material/block/solid/Ice.php b/src/material/block/solid/Ice.php index 15b8b170..44248d7c 100644 --- a/src/material/block/solid/Ice.php +++ b/src/material/block/solid/Ice.php @@ -54,7 +54,7 @@ class IceBlock extends TransparentBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.1; case 4: diff --git a/src/material/block/solid/Iron.php b/src/material/block/solid/Iron.php index 6cd218cf..2cc7d298 100644 --- a/src/material/block/solid/Iron.php +++ b/src/material/block/solid/Iron.php @@ -10,7 +10,7 @@ class IronBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.95; case 4: @@ -23,7 +23,7 @@ class IronBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 3){ + if($item->getPickaxeLevel() >= 3){ return array( array(IRON_BLOCK, 0, 1), ); diff --git a/src/material/block/solid/Lapis.php b/src/material/block/solid/Lapis.php index 893709c7..3b4911cb 100644 --- a/src/material/block/solid/Lapis.php +++ b/src/material/block/solid/Lapis.php @@ -10,7 +10,7 @@ class LapisBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.6; case 4: @@ -23,7 +23,7 @@ class LapisBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 3){ + if($item->getPickaxeLevel() >= 3){ return array( array(LAPIS_BLOCK, 0, 1), ); diff --git a/src/material/block/solid/MossStone.php b/src/material/block/solid/MossStone.php index d07c272b..068a8e7a 100644 --- a/src/material/block/solid/MossStone.php +++ b/src/material/block/solid/MossStone.php @@ -10,7 +10,7 @@ class MossStoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -27,7 +27,7 @@ class MossStoneBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(MOSS_STONE, 0, 1), ); diff --git a/src/material/block/solid/NetherBrick.php b/src/material/block/solid/NetherBrick.php index 937239d6..fa662f0e 100644 --- a/src/material/block/solid/NetherBrick.php +++ b/src/material/block/solid/NetherBrick.php @@ -10,7 +10,7 @@ class NetherBricksBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -27,7 +27,7 @@ class NetherBricksBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(NETHER_BRICKS, 0, 1), ); diff --git a/src/material/block/solid/Netherrack.php b/src/material/block/solid/Netherrack.php index 2ed493b4..9e2f0b9c 100644 --- a/src/material/block/solid/Netherrack.php +++ b/src/material/block/solid/Netherrack.php @@ -10,7 +10,7 @@ class NetherrackBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.1; case 4: @@ -27,7 +27,7 @@ class NetherrackBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(NETHERRACK, 0, 1), ); diff --git a/src/material/block/solid/Obsidian.php b/src/material/block/solid/Obsidian.php index 0efdf664..2f3a45dc 100644 --- a/src/material/block/solid/Obsidian.php +++ b/src/material/block/solid/Obsidian.php @@ -10,7 +10,7 @@ class ObsidianBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - if($item->isPickaxe() >= 5){ + if($item->getPickaxeLevel() >= 5){ return 3.5;//from wiki }else{ return 250; @@ -18,7 +18,7 @@ class ObsidianBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 5){ + if($item->getPickaxeLevel() >= 5){ return array( array(OBSIDIAN, 0, 1), ); diff --git a/src/material/block/solid/Quartz.php b/src/material/block/solid/Quartz.php index 9ffea95b..4c1aaa5f 100644 --- a/src/material/block/solid/Quartz.php +++ b/src/material/block/solid/Quartz.php @@ -16,7 +16,7 @@ class QuartzBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.15; case 4: @@ -33,7 +33,7 @@ class QuartzBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(QUARTZ_BLOCK, $this->meta & 0x03, 1), ); diff --git a/src/material/block/solid/Sandstone.php b/src/material/block/solid/Sandstone.php index 40764d85..766097da 100644 --- a/src/material/block/solid/Sandstone.php +++ b/src/material/block/solid/Sandstone.php @@ -16,7 +16,7 @@ class SandstoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.15; case 4: @@ -33,7 +33,7 @@ class SandstoneBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(SANDSTONE, $this->meta & 0x03, 1), ); diff --git a/src/material/block/solid/Stone.php b/src/material/block/solid/Stone.php index 090b018e..dd154b15 100644 --- a/src/material/block/solid/Stone.php +++ b/src/material/block/solid/Stone.php @@ -10,7 +10,7 @@ class StoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -27,7 +27,7 @@ class StoneBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(COBBLESTONE, 0, 1), ); diff --git a/src/material/block/solid/StoneBricks.php b/src/material/block/solid/StoneBricks.php index 77fdd8b6..1a25f8f1 100644 --- a/src/material/block/solid/StoneBricks.php +++ b/src/material/block/solid/StoneBricks.php @@ -17,7 +17,7 @@ class StoneBricksBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - switch($item->isPickaxe()){ + switch($item->getPickaxeLevel()){ case 5: return 0.4; case 4: @@ -34,7 +34,7 @@ class StoneBricksBlock extends SolidBlock{ } public function getDrops(Item $item, Player $player){ - if($item->isPickaxe() >= 1){ + if($item->getPickaxeLevel() >= 1){ return array( array(STONE_BRICKS, $this->meta & 0x03, 1), ); diff --git a/src/material/item/food/Cake.php b/src/material/item/food/Cake.php index ec8fca66..e85ec97c 100755 --- a/src/material/item/food/Cake.php +++ b/src/material/item/food/Cake.php @@ -2,8 +2,8 @@ class CakeItem extends Item{ public function __construct($meta = 0, $count = 1){ + parent::__construct(CAKE, 0, $count, "Cake"); $this->block = BlockAPI::get(CAKE_BLOCK); $this->maxStackSize = 1; - parent::__construct(CAKE, 0, $count, "Cake"); } } \ No newline at end of file diff --git a/src/material/item/generic/Egg.php b/src/material/item/generic/Egg.php index 72116e50..5188b3c4 100755 --- a/src/material/item/generic/Egg.php +++ b/src/material/item/generic/Egg.php @@ -3,6 +3,7 @@ class EggItem extends Item{ public function __construct($meta = 0, $count = 1){ parent::__construct(EGG, 0, $count, "Egg"); + $this->maxStackSize = 16; } } \ No newline at end of file diff --git a/src/material/item/generic/Minecart.php b/src/material/item/generic/Minecart.php index 14575a6f..a82cee48 100755 --- a/src/material/item/generic/Minecart.php +++ b/src/material/item/generic/Minecart.php @@ -4,6 +4,7 @@ class MinecartItem extends Item{ public function __construct($meta = 0, $count = 1){ parent::__construct(MINECART, 0, $count, "Minecart"); $this->isActivable = true; + $this->maxStackSize = 1; } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ if($target->getID() !== 66 and $target->getID() !== 27){ diff --git a/src/material/item/generic/Snowball.php b/src/material/item/generic/Snowball.php index df857a2e..0534ea4b 100755 --- a/src/material/item/generic/Snowball.php +++ b/src/material/item/generic/Snowball.php @@ -3,6 +3,7 @@ class SnowballItem extends Item{ public function __construct($meta = 0, $count = 1){ parent::__construct(SNOWBALL, 0, $count, "Snowball"); + $this->maxStackSize = 16; } } \ No newline at end of file diff --git a/src/material/item/tool/Compass.php b/src/material/item/tool/Compass.php index 07f5046a..9c2e1f83 100755 --- a/src/material/item/tool/Compass.php +++ b/src/material/item/tool/Compass.php @@ -3,6 +3,7 @@ class CompassItem extends Item{ public function __construct($meta = 0, $count = 1){ parent::__construct(COMPASS, 0, $count, "Compass"); + $this->maxStackSize = 1; } - + } \ No newline at end of file diff --git a/src/world/generator/populator/MineshaftPopulator.php b/src/world/generator/populator/MineshaftPopulator.php index e731a552..8087defc 100644 --- a/src/world/generator/populator/MineshaftPopulator.php +++ b/src/world/generator/populator/MineshaftPopulator.php @@ -10,7 +10,7 @@ class MineshaftPopulator extends Populator{ public function populate(Level $level, $chunkX, $chunkZ, Random $random){ if($random->nextRange(0, MineshaftPopulator::$ODD) === 0){ - $mineshaft = new Mineshaft($random); + //$mineshaft = new Mineshaft($random); } }