Added all block hardness

This commit is contained in:
Shoghi Cervantes 2015-05-31 17:25:02 +02:00
parent f3c46b12c5
commit 26c9eed82e
86 changed files with 131 additions and 676 deletions

View File

@ -1083,15 +1083,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
return false;
}
if(($this->gamemode & 0x01) === ($gm & 0x01)){
$this->gamemode = $gm;
}else{
$this->gamemode = $gm;
$this->inventory->clearAll();
$this->inventory->sendContents($this);
$this->inventory->sendContents($this->getViewers());
$this->inventory->sendHeldItem($this->hasSpawned);
}
$this->gamemode = $gm;
$this->allowFlight = $this->isCreative();
@ -1132,6 +1125,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
}
$this->inventory->sendContents($this);
$this->inventory->sendContents($this->getViewers());
$this->inventory->sendHeldItem($this->hasSpawned);
return true;
}

View File

@ -159,6 +159,8 @@ class Block extends Position implements Metadatable{
const CAKE_BLOCK = 92;
const TRAPDOOR = 96;
const WOODEN_TRAPDOOR = 96;
const WOOD_TRAPDOOR = 96;
const STONE_BRICKS = 98;
const STONE_BRICK = 98;

View File

@ -116,23 +116,6 @@ class BurningFurnace extends Solid{
return true;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.7;
case 4:
return 0.9;
case 3:
return 1.35;
case 2:
return 0.45;
case 1:
return 2.65;
default:
return 17.5;
}
}
public function getDrops(Item $item){
$drops = [];
if($item->isPickaxe() >= 1){

View File

@ -41,7 +41,7 @@ class Cake extends Transparent{
}
public function getHardness(){
return 2.5;
return 0.5;
}
public function getName(){

View File

@ -34,6 +34,10 @@ class Carpet extends Flowable{
$this->meta = $meta;
}
public function getHardness(){
return 0.1;
}
public function isSolid(){
return true;
}

View File

@ -45,7 +45,7 @@ class Chest extends Transparent{
}
public function getHardness(){
return 15;
return 2.5;
}
public function getName(){

View File

@ -32,7 +32,7 @@ class Clay extends Solid{
}
public function getHardness(){
return 3;
return 0.6;
}
public function getName(){

View File

@ -32,30 +32,13 @@ class Coal extends Solid{
}
public function getHardness(){
return 30;
return 5;
}
public function getName(){
return "Coal Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -32,30 +32,13 @@ class CoalOre extends Solid{
}
public function getHardness(){
return 15;
return 3;
}
public function getName(){
return "Coal Ore";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
case 2:
return 0.4;
case 1:
return 2.25;
default:
return 15;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -22,6 +22,7 @@
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
class Cobblestone extends Solid{
@ -31,29 +32,16 @@ class Cobblestone extends Solid{
}
public function getToolType(){
return Tool::TYPE_PICKAXE;
}
public function getName(){
return "Cobblestone";
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
return 2;
}
public function getDrops(Item $item){

View File

@ -30,6 +30,10 @@ class CobblestoneStairs extends Stair{
$this->meta = $meta;
}
public function getHardness(){
return 2;
}
public function getName(){
return "Cobblestone Stairs";
}

View File

@ -41,7 +41,7 @@ class Cobweb extends Flowable{
}
public function getHardness(){
return 25;
return 4;
}
public function onEntityCollide(Entity $entity){

View File

@ -32,24 +32,13 @@ class Diamond extends Solid{
}
public function getHardness(){
return 30;
return 5;
}
public function getName(){
return "Diamond Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
default:
return 25;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 4){
return [

View File

@ -32,24 +32,13 @@ class DiamondOre extends Solid{
}
public function getHardness(){
return 15;
return 3;
}
public function getName(){
return "Diamond Ore";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 4){
return [

View File

@ -32,7 +32,7 @@ class DoubleSlab extends Solid{
}
public function getHardness(){
return 30;
return 2;
}
public function getName(){
@ -49,23 +49,6 @@ class DoubleSlab extends Solid{
return "Double " . $names[$this->meta & 0x07] . " Slab";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -32,7 +32,7 @@ class DoubleWoodSlab extends Solid{
}
public function getHardness(){
return 15;
return 2;
}
public function getName(){
@ -49,23 +49,6 @@ class DoubleWoodSlab extends Solid{
return "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
}
public function getBreakTime(Item $item){
switch($item->isAxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 3;
}
}
public function getDrops(Item $item){
return [
[Item::WOOD_SLAB, $this->meta & 0x07, 2],

View File

@ -32,24 +32,13 @@ class Emerald extends Solid{
}
public function getHardness(){
return 30;
return 5;
}
public function getName(){
return "Emerald Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
default:
return 25;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 4){
return [

View File

@ -36,18 +36,7 @@ class EmeraldOre extends Solid{
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
return 3;
}
public function getDrops(Item $item){

View File

@ -41,6 +41,10 @@ class EndPortalFrame extends Solid{
}
public function getHardness(){
return -1;
}
public function getResistance(){
return 18000000;
}

View File

@ -36,23 +36,6 @@ class EndStone extends Solid{
}
public function getHardness(){
return 45;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
case 2:
return 0.4;
case 1:
return 2.25;
default:
return 15;
}
return 3;
}
}

View File

@ -37,7 +37,7 @@ class Farmland extends Solid{
}
public function getHardness(){
return 3;
return 0.6;
}
protected function recalculateBoundingBox(){

View File

@ -33,7 +33,7 @@ class Fence extends Transparent{
}
public function getHardness(){
return 15;
return 2;
}

View File

@ -38,7 +38,7 @@ class FenceGate extends Transparent{
}
public function getHardness(){
return 15;
return 2;
}
public function canBeActivated(){

View File

@ -36,7 +36,7 @@ class Glass extends Transparent{
}
public function getHardness(){
return 1.5;
return 0.3;
}
public function getDrops(Item $item){

View File

@ -37,7 +37,7 @@ class GlassPane extends Thin{
}
public function getHardness(){
return 1.5;
return 0.3;
}
public function getDrops(Item $item){

View File

@ -54,18 +54,6 @@ class GlowingRedstoneOre extends Solid{
return false;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 4){
return [

View File

@ -36,7 +36,7 @@ class Glowstone extends Transparent{
}
public function getHardness(){
return 1.5;
return 0.3;
}
public function getLightLevel(){

View File

@ -36,18 +36,7 @@ class Gold extends Solid{
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
return 3;
}
public function getDrops(Item $item){

View File

@ -36,18 +36,7 @@ class GoldOre extends Solid{
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
default:
return 15;
}
return 3;
}
public function getDrops(Item $item){

View File

@ -55,7 +55,7 @@ class GrassPath extends Transparent{
}
public function getHardness(){
return 3;
return 0.6;
}
public function getDrops(Item $item){

View File

@ -36,7 +36,7 @@ class Gravel extends Fallable{
}
public function getHardness(){
return 3;
return 0.6;
}
public function getDrops(Item $item){

View File

@ -36,24 +36,6 @@ class HardenedClay extends Solid{
}
public function getHardness(){
return 30;
return 1.25;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.25;
case 4:
return 0.35;
case 3:
return 0.5;
case 2:
return 0.2;
case 1:
return 0.95;
default:
return 6.25;
}
}
}

View File

@ -37,7 +37,7 @@ class HayBale extends Solid{
}
public function getHardness(){
return 10;
return 0.5;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){

View File

@ -36,7 +36,7 @@ class Ice extends Transparent{
}
public function getHardness(){
return 2.5;
return 0.5;
}
public function onBreak(Item $item){
@ -45,23 +45,6 @@ class Ice extends Transparent{
return true;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.1;
case 4:
return 0.15;
case 3:
return 0.2;
case 2:
return 0.1;
case 1:
return 0.4;
default:
return 0.75;
}
}
public function getDrops(Item $item){
return [];
}

View File

@ -36,20 +36,7 @@ class Iron extends Solid{
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
default:
return 25;
}
return 5;
}
public function getDrops(Item $item){

View File

@ -38,23 +38,6 @@ class IronBars extends Thin{
return 5;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 5;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -36,24 +36,7 @@ class IronDoor extends Door{
}
public function getHardness(){
return 25;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
return 5;
}
public function getDrops(Item $item){

View File

@ -36,20 +36,7 @@ class IronOre extends Solid{
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
default:
return 15;
}
return 3;
}
public function getDrops(Item $item){

View File

@ -48,7 +48,7 @@ class Ladder extends Transparent{
}
public function getHardness(){
return 2;
return 0.4;
}
public function onEntityCollide(Entity $entity){

View File

@ -32,24 +32,11 @@ class Lapis extends Solid{
}
public function getName(){
return "Lapis Block";
return "Lapis Lazuli Block";
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
default:
return 15;
}
return 3;
}
public function getDrops(Item $item){

View File

@ -32,25 +32,11 @@ class LapisOre extends Solid{
}
public function getHardness(){
return 15;
return 3;
}
public function getName(){
return "Lapis Ore";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.6;
case 4:
return 0.75;
case 3:
return 1.15;
default:
return 15;
}
return "Lapis Lazuli Ore";
}
public function getDrops(Item $item){

View File

@ -46,10 +46,6 @@ class Lava extends Liquid{
return "Lava";
}
public function getHardness(){
return 0;
}
public function onEntityCollide(Entity $entity){
$entity->fallDistance *= 0.5;
if(!$entity->hasEffect(Effect::FIRE_RESISTANCE)){

View File

@ -42,7 +42,7 @@ class Leaves extends Transparent{
}
public function getHardness(){
return 1;
return 0.2;
}
public function getName(){

View File

@ -363,6 +363,10 @@ abstract class Liquid extends Transparent{
return $cost;
}
public function getHardness(){
return 100;
}
private function getOptimalFlowDirections(){
if($this->temporalVector === null){
$this->temporalVector = new Vector3(0, 0, 0);

View File

@ -33,7 +33,7 @@ class LitPumpkin extends Solid{
}
public function getHardness(){
return 5;
return 1;
}
public function getName(){

View File

@ -36,7 +36,7 @@ class Melon extends Transparent{
}
public function getHardness(){
return 5;
return 1;
}
public function getDrops(Item $item){

View File

@ -32,30 +32,13 @@ class MonsterSpawner extends Solid{
}
public function getHardness(){
return 25;
return 5;
}
public function getName(){
return "Monster Spawner";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
}
public function getDrops(Item $item){
return [];
}

View File

@ -36,25 +36,7 @@ class MossStone extends Solid{
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
return 2;
}
public function getDrops(Item $item){

View File

@ -40,7 +40,7 @@ class Mycelium extends Solid{
}
public function getHardness(){
return 2.5;
return 0.6;
}
public function getDrops(Item $item){

View File

@ -36,25 +36,7 @@ class NetherBrick extends Solid{
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
return 2;
}
public function getDrops(Item $item){

View File

@ -30,6 +30,10 @@ class NetherBrickStairs extends Stair{
return "Nether Bricks Stairs";
}
public function getHardness(){
return 2;
}
public function __construct($meta = 0){
$this->meta = $meta;
}

View File

@ -39,24 +39,6 @@ class Netherrack extends Solid{
return 2;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.1;
case 4:
return 0.1;
case 3:
return 0.15;
case 2:
return 0.05;
case 1:
return 0.3;
default:
return 2;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -36,16 +36,7 @@ class Obsidian extends Solid{
}
public function getHardness(){
return 6000;
}
public function getBreakTime(Item $item){
if($item->isPickaxe() >= 5){
return 9.4;
}else{
return 250;
}
return 50;
}
public function getDrops(Item $item){

View File

@ -37,7 +37,7 @@ class Planks extends Solid{
}
public function getHardness(){
return 15;
return 2;
}
public function getName(){

View File

@ -33,7 +33,7 @@ class Pumpkin extends Solid{
}
public function getHardness(){
return 5;
return 1;
}
public function getName(){

View File

@ -31,6 +31,10 @@ class Quartz extends Solid{
$this->meta = $meta;
}
public function getHardness(){
return 0.8;
}
public function getName(){
static $names = [
0 => "Quartz Block",
@ -41,24 +45,6 @@ class Quartz extends Solid{
return $names[$this->meta & 0x03];
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.15;
case 4:
return 0.2;
case 3:
return 0.3;
case 2:
return 0.1;
case 1:
return 0.6;
default:
return 4;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -30,6 +30,10 @@ class QuartzStairs extends Stair{
$this->meta = $meta;
}
public function getHardness(){
return 0.8;
}
public function getName(){
return "Quartz Stairs";
}

View File

@ -32,30 +32,13 @@ class Redstone extends Transparent{
}
public function getHardness(){
return 30;
return 5;
}
public function getName(){
return "Redstone Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -37,12 +37,12 @@ class RedstoneOre extends Solid{
}
public function getHardness(){
return 15;
return 3;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta), false, false, true);
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta), false, true);
return Level::BLOCK_UPDATE_WEAK;
}

View File

@ -31,7 +31,7 @@ class Sand extends Fallable{
}
public function getHardness(){
return 2.5;
return 0.5;
}
public function getName(){

View File

@ -32,7 +32,7 @@ class Sandstone extends Solid{
}
public function getHardness(){
return 4;
return 0.8;
}
public function getName(){
@ -45,24 +45,6 @@ class Sandstone extends Solid{
return $names[$this->meta & 0x03];
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.15;
case 4:
return 0.2;
case 3:
return 0.3;
case 2:
return 0.1;
case 1:
return 0.6;
default:
return 4;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -30,6 +30,10 @@ class SandstoneStairs extends Stair{
$this->meta = $meta;
}
public function getHardness(){
return 0.8;
}
public function getName(){
return "Sandstone Stairs";
}

View File

@ -34,7 +34,7 @@ class SignPost extends Transparent{
}
public function getHardness(){
return 5;
return 1;
}
public function isSolid(){

View File

@ -34,7 +34,7 @@ class Slab extends Transparent{
}
public function getHardness(){
return 30;
return 2;
}
public function getName(){
@ -123,24 +123,6 @@ class Slab extends Transparent{
return true;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 10;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -31,7 +31,7 @@ class Snow extends Solid{
}
public function getHardness(){
return 1;
return 0.2;
}
public function getName(){

View File

@ -42,7 +42,7 @@ class SnowLayer extends Flowable{
}
public function getHardness(){
return 0.5;
return 0.1;
}

View File

@ -37,7 +37,7 @@ class SoulSand extends Solid{
}
public function getHardness(){
return 2.5;
return 0.5;
}
protected function recalculateBoundingBox(){

View File

@ -31,7 +31,7 @@ class Sponge extends Solid{
}
public function getHardness(){
return 3;
return 0.6;
}
public function getName(){

View File

@ -32,7 +32,7 @@ class StainedClay extends Solid{
}
public function getHardness(){
return 30;
return 1.25;
}
public function getName(){
@ -57,21 +57,4 @@ class StainedClay extends Solid{
return $names[$this->meta & 0x0f];
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.25;
case 4:
return 0.35;
case 3:
return 0.5;
case 2:
return 0.2;
case 1:
return 0.95;
default:
return 6.25;
}
}
}

View File

@ -29,8 +29,4 @@ class StillLava extends Lava{
return "Still Lava";
}
public function getHardness(){
return 500;
}
}

View File

@ -41,7 +41,11 @@ class Stone extends Solid{
}
public function getHardness(){
return 30;
return 1.5;
}
public function getToolType(){
return Tool::TYPE_PICKAXE;
}
public function getName(){
@ -58,23 +62,6 @@ class Stone extends Solid{
return $names[$this->meta & 0x07];
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 7.5;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= Tool::TIER_WOODEN){
return [

View File

@ -30,6 +30,10 @@ class StoneBrickStairs extends Stair{
$this->meta = $meta;
}
public function getHardness(){
return 1.5;
}
public function getName(){
return "Stone Brick Stairs";
}

View File

@ -32,7 +32,7 @@ class StoneBricks extends Solid{
}
public function getHardness(){
return 30;
return 1.5;
}
public function getName(){
@ -44,25 +44,7 @@ class StoneBricks extends Solid{
];
return $names[$this->meta & 0x03];
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 7.5;
}
}
public function getDrops(Item $item){
if($item->isPickaxe() >= 1){
return [

View File

@ -38,7 +38,7 @@ class StoneWall extends Transparent{
}
public function getHardness(){
return 30;
return 2;
}
public function getName(){
@ -83,4 +83,4 @@ class StoneWall extends Transparent{
return ($block->getId() !== self::COBBLE_WALL and $block->getId() !== self::FENCE_GATE) ? $block->isSolid() and !$block->isTransparent() : true;
}
}
}

View File

@ -34,11 +34,11 @@ class Trapdoor extends Transparent{
}
public function getName(){
return "Trapdoor";
return "Wooden Trapdoor";
}
public function getHardness(){
return 15;
return 3;
}
public function canBeActivated(){

View File

@ -45,7 +45,7 @@ class Vine extends Transparent{
}
public function getHardness(){
return 1;
return 0.2;
}
public function canPassThrough(){
@ -142,29 +142,6 @@ class Vine extends Transparent{
return false;
}
public function getBreakTime(Item $item){
if($item->isShears()){
return 0.02;
}elseif($item->isSword()){
return 0.2;
}elseif($item->isAxe()){
switch($item->isAxe()){
case Tool::TIER_WOODEN:
return 0.15;
case Tool::TIER_STONE:
return 0.075;
case Tool::TIER_IRON:
return 0.05;
case Tool::TIER_DIAMOND:
return 0.0375;
case Tool::TIER_GOLD:
return 0.025;
}
}
return 0.3;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
/*if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method

View File

@ -37,10 +37,6 @@ class Water extends Liquid{
return "Water";
}
public function getHardness(){
return 500;
}
public function onEntityCollide(Entity $entity){
$entity->resetFallDistance();
if($entity->fireTicks > 0){

View File

@ -39,7 +39,7 @@ class Wood extends Solid{
}
public function getHardness(){
return 10;
return 2;
}
public function getName(){

View File

@ -40,7 +40,7 @@ class WoodDoor extends Door{
}
public function getHardness(){
return 15;
return 3;
}
public function getDrops(Item $item){

View File

@ -34,7 +34,7 @@ class WoodSlab extends Transparent{
}
public function getHardness(){
return 15;
return 2;
}
public function getName(){
@ -122,24 +122,6 @@ class WoodSlab extends Transparent{
return true;
}
public function getBreakTime(Item $item){
switch($item->isAxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 3;
}
}
public function getDrops(Item $item){
return [
[$this->id, $this->meta & 0x07, 1],

View File

@ -35,27 +35,13 @@ class WoodStairs extends Stair{
return "Wood Stairs";
}
public function getBreakTime(Item $item){
switch($item->isAxe()){
case 5:
return 0.4;
case 4:
return 0.5;
case 3:
return 0.75;
case 2:
return 0.25;
case 1:
return 1.5;
default:
return 3;
}
}
public function getDrops(Item $item){
return [
[$this->id, 0, 1],
];
}
public function getHardness(){
return 2;
}
}

View File

@ -31,7 +31,7 @@ class Wool extends Solid{
}
public function getHardness(){
return 4;
return 0.8;
}
public function getName(){

View File

@ -38,7 +38,7 @@ class Workbench extends Solid{
}
public function getHardness(){
return 15;
return 2.5;
}
public function getName(){

View File

@ -110,7 +110,7 @@ class Explosion{
$block = $this->level->getBlock($vBlock);
if($block->getId() !== 0){
$blastForce -= ($block->getHardness() / 5 + 0.3) * $this->stepLen;
$blastForce -= ($block->getResistance() / 5 + 0.3) * $this->stepLen;
if($blastForce > 0){
if(!isset($this->affectedBlocks[$index = Level::blockHash($block->x, $block->y, $block->z)])){
$this->affectedBlocks[$index] = $block;

View File

@ -1538,7 +1538,7 @@ class Level implements ChunkManager, Metadatable{
$drops[$k] = Item::get($i[0], $i[1], $i[2]);
}
}
$above = $this->getBlock(new Vector3($target->x, $target->y + 1, $target->z));
if($above !== null){
if($above->getId() === Item::FIRE){

View File

@ -116,9 +116,9 @@ LICENSE;
}
}while($port <= 0 or $port > 65535);
$config->set("server-port", $port);
echo "[*] " . $this->lang->ram_warning . "\n";
/*echo "[*] " . $this->lang->ram_warning . "\n";
echo "[?] " . $this->lang->server_ram . " (" . self::DEFAULT_MEMORY . "): ";
$config->set("memory-limit", ((int) $this->getInput(self::DEFAULT_MEMORY)) . "M");
$config->set("memory-limit", ((int) $this->getInput(self::DEFAULT_MEMORY)) . "M");*/
echo "[*] " . $this->lang->gamemode_info . "\n";
do{
echo "[?] " . $this->lang->default_gamemode . ": (" . self::DEFAULT_GAMEMODE . "): ";