From 89eb7097a3e219c5567362551094674a3fa15a46 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sat, 17 Aug 2024 16:21:02 +0300 Subject: [PATCH] hopefully replaced spaces with tabs everywhere --- src/API/LevelAPI.php | 10 ++++---- src/API/PlayerAPI.php | 24 +++++++++---------- src/entity/ai/tasks/TaskAttackPlayer.php | 2 +- src/material/Item.php | 16 ++++++------- src/material/block/nonfull/IronDoorBlock.php | 16 ++++++------- src/material/block/nonfull/SlabBlock.php | 18 +++++++------- src/material/block/nonfull/WoodSlabBlock.php | 18 +++++++------- .../block/nonfull/stairs/WoodStairsBlock.php | 18 +++++++------- src/material/block/ore/CoalOreBlock.php | 18 +++++++------- src/material/block/ore/DiamondOreBlock.php | 12 +++++----- .../block/ore/GlowingRedstoneOreBlock.php | 12 +++++----- src/material/block/ore/GoldOreBlock.php | 12 +++++----- src/material/block/ore/IronOreBlock.php | 14 +++++------ src/material/block/ore/LapisOreBlock.php | 14 +++++------ src/material/block/solid/BricksBlock.php | 18 +++++++------- .../block/solid/BurningFurnaceBlock.php | 18 +++++++------- src/material/block/solid/CoalBlock.php | 18 +++++++------- src/material/block/solid/CobblestoneBlock.php | 18 +++++++------- src/material/block/solid/DiamondBlock.php | 12 +++++----- src/material/block/solid/DoubleSlabBlock.php | 16 ++++++------- .../block/solid/DoubleWoodSlabBlock.php | 18 +++++++------- src/material/block/solid/GoldBlock.php | 12 +++++----- src/material/block/solid/IceBlock.php | 16 ++++++------- src/material/block/solid/IronBlock.php | 14 +++++------ src/material/block/solid/LapisBlock.php | 14 +++++------ src/material/block/solid/MossStoneBlock.php | 18 +++++++------- .../block/solid/NetherBricksBlock.php | 18 +++++++------- src/material/block/solid/NetherrackBlock.php | 18 +++++++------- src/material/block/solid/QuartzBlock.php | 18 +++++++------- src/material/block/solid/SandstoneBlock.php | 18 +++++++------- src/material/block/solid/StoneBlock.php | 18 +++++++------- src/material/block/solid/StoneBricksBlock.php | 18 +++++++------- src/material/item/base/ItemAxe.php | 16 ++++++------- src/material/item/base/ItemHoe.php | 16 ++++++------- src/material/item/base/ItemPickaxe.php | 16 ++++++------- src/material/item/base/ItemShovel.php | 16 ++++++------- src/material/item/base/ItemSword.php | 16 ++++++------- src/math/Matrix.php | 16 ++++++------- src/math/Vector3.php | 20 ++++++++-------- src/network/raknet/RakNetInfo.php | 10 ++++---- src/recipes/CraftingRecipes.php | 4 ++-- src/utils/Utils.php | 14 +++++------ 42 files changed, 324 insertions(+), 324 deletions(-) diff --git a/src/API/LevelAPI.php b/src/API/LevelAPI.php index 380c3884..30515e7a 100644 --- a/src/API/LevelAPI.php +++ b/src/API/LevelAPI.php @@ -145,11 +145,11 @@ class LevelAPI{ if($generator !== false and class_exists($generator)){ $generator = new $generator($options); }else{ - $generator = match (strtoupper($this->server->api->getProperty("level-type"))) { - "FLAT" => new SuperflatGenerator($options), - "VANILLA" => new VanillaGenerator($options), - default => new TemporalGenerator($options), - }; + $generator = match (strtoupper($this->server->api->getProperty("level-type"))) { + "FLAT" => new SuperflatGenerator($options), + "VANILLA" => new VanillaGenerator($options), + default => new TemporalGenerator($options), + }; } $gen = new WorldGenerator($generator, $name, $seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)) : (int) $seed); $gen->generate(); diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index e817e90c..0e7ac1ab 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -57,18 +57,18 @@ class PlayerAPI{ } } }else{ - $message = match ($data["cause"]) { - "cactus" => " was pricked to death", - "lava" => " tried to swim in lava", - "fire" => " went up in flames", - "burning" => " burned to death", - "suffocation" => " suffocated in a wall", - "water" => " drowned", - "void" => " fell out of the world", - "fall" => " hit the ground too hard", - "explosion" => " blew up", - default => " died", - }; + $message = match ($data["cause"]) { + "cactus" => " was pricked to death", + "lava" => " tried to swim in lava", + "fire" => " went up in flames", + "burning" => " burned to death", + "suffocation" => " suffocated in a wall", + "water" => " drowned", + "void" => " fell out of the world", + "fall" => " hit the ground too hard", + "explosion" => " blew up", + default => " died", + }; } $this->server->api->chat->broadcast($data["player"]->username . $message); return true; diff --git a/src/entity/ai/tasks/TaskAttackPlayer.php b/src/entity/ai/tasks/TaskAttackPlayer.php index 7615dbf3..8760cd11 100644 --- a/src/entity/ai/tasks/TaskAttackPlayer.php +++ b/src/entity/ai/tasks/TaskAttackPlayer.php @@ -87,7 +87,7 @@ class TaskAttackPlayer extends TaskBase } public function onEnd(EntityAI $ai) - { + { $ai->entity->target = false; } diff --git a/src/material/Item.php b/src/material/Item.php index 13f8e350..49a1a80b 100755 --- a/src/material/Item.php +++ b/src/material/Item.php @@ -259,14 +259,14 @@ class Item{ //TODO remove? public function getPickaxeLevel(){ //Returns false or level of the pickaxe - return match ($this->id) { - WOODEN_PICKAXE => 1, - GOLDEN_PICKAXE => 2, - STONE_PICKAXE => 3, - IRON_PICKAXE => 4, - DIAMOND_PICKAXE => 5, - default => false, - }; + return match ($this->id) { + WOODEN_PICKAXE => 1, + GOLDEN_PICKAXE => 2, + STONE_PICKAXE => 3, + IRON_PICKAXE => 4, + DIAMOND_PICKAXE => 5, + default => false, + }; } public function isAxe(){ diff --git a/src/material/block/nonfull/IronDoorBlock.php b/src/material/block/nonfull/IronDoorBlock.php index e394b325..5ac59aae 100644 --- a/src/material/block/nonfull/IronDoorBlock.php +++ b/src/material/block/nonfull/IronDoorBlock.php @@ -12,14 +12,14 @@ class IronDoorBlock extends DoorBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.95, - 4 => 1.25, - 3 => 1.9, - 2 => 0.65, - 1 => 3.75, - default => 25, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.95, + 4 => 1.25, + 3 => 1.9, + 2 => 0.65, + 1 => 3.75, + default => 25, + }; } public function getDrops(Item $item, Player $player){ diff --git a/src/material/block/nonfull/SlabBlock.php b/src/material/block/nonfull/SlabBlock.php index 89ab5e4c..3319bb7b 100644 --- a/src/material/block/nonfull/SlabBlock.php +++ b/src/material/block/nonfull/SlabBlock.php @@ -94,14 +94,14 @@ class SlabBlock extends TransparentBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 10, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 10, + }; } public function getDrops(Item $item, Player $player){ @@ -113,4 +113,4 @@ class SlabBlock extends TransparentBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/nonfull/WoodSlabBlock.php b/src/material/block/nonfull/WoodSlabBlock.php index 0b4a0615..d39f0931 100644 --- a/src/material/block/nonfull/WoodSlabBlock.php +++ b/src/material/block/nonfull/WoodSlabBlock.php @@ -90,14 +90,14 @@ class WoodSlabBlock extends TransparentBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->isAxe()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 3, - }; + return match ($item->isAxe()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 3, + }; } public function getDrops(Item $item, Player $player){ @@ -105,4 +105,4 @@ class WoodSlabBlock extends TransparentBlock{ array($this->id, $this->meta & 0x07, 1), ); } -} \ No newline at end of file +} diff --git a/src/material/block/nonfull/stairs/WoodStairsBlock.php b/src/material/block/nonfull/stairs/WoodStairsBlock.php index 07463e56..0421dac4 100644 --- a/src/material/block/nonfull/stairs/WoodStairsBlock.php +++ b/src/material/block/nonfull/stairs/WoodStairsBlock.php @@ -10,14 +10,14 @@ class WoodStairsBlock extends StairBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->isAxe()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 3, - }; + return match ($item->isAxe()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 3, + }; } public function getDrops(Item $item, Player $player){ @@ -25,4 +25,4 @@ class WoodStairsBlock extends StairBlock{ array($this->id, 0, 1), ); } -} \ No newline at end of file +} diff --git a/src/material/block/ore/CoalOreBlock.php b/src/material/block/ore/CoalOreBlock.php index df21d9a2..12e5c262 100644 --- a/src/material/block/ore/CoalOreBlock.php +++ b/src/material/block/ore/CoalOreBlock.php @@ -11,14 +11,14 @@ class CoalOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - 3 => 1.15, - 2 => 0.4, - 1 => 2.25, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + 3 => 1.15, + 2 => 0.4, + 1 => 2.25, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -31,4 +31,4 @@ class CoalOreBlock extends SolidBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/block/ore/DiamondOreBlock.php b/src/material/block/ore/DiamondOreBlock.php index b1ceb706..dec08e78 100644 --- a/src/material/block/ore/DiamondOreBlock.php +++ b/src/material/block/ore/DiamondOreBlock.php @@ -11,11 +11,11 @@ class DiamondOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -27,4 +27,4 @@ class DiamondOreBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/ore/GlowingRedstoneOreBlock.php b/src/material/block/ore/GlowingRedstoneOreBlock.php index a75848b6..33dd8e0c 100644 --- a/src/material/block/ore/GlowingRedstoneOreBlock.php +++ b/src/material/block/ore/GlowingRedstoneOreBlock.php @@ -19,11 +19,11 @@ class GlowingRedstoneOreBlock extends SolidBlock implements LightingBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -36,4 +36,4 @@ class GlowingRedstoneOreBlock extends SolidBlock implements LightingBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/block/ore/GoldOreBlock.php b/src/material/block/ore/GoldOreBlock.php index 45f9a49d..c835dbc1 100644 --- a/src/material/block/ore/GoldOreBlock.php +++ b/src/material/block/ore/GoldOreBlock.php @@ -11,11 +11,11 @@ class GoldOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -27,4 +27,4 @@ class GoldOreBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/ore/IronOreBlock.php b/src/material/block/ore/IronOreBlock.php index 33ac4c35..d8d001ff 100644 --- a/src/material/block/ore/IronOreBlock.php +++ b/src/material/block/ore/IronOreBlock.php @@ -11,12 +11,12 @@ class IronOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - 3 => 1.15, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + 3 => 1.15, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -28,4 +28,4 @@ class IronOreBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/ore/LapisOreBlock.php b/src/material/block/ore/LapisOreBlock.php index ff7cd6c6..ecb3e83f 100644 --- a/src/material/block/ore/LapisOreBlock.php +++ b/src/material/block/ore/LapisOreBlock.php @@ -11,12 +11,12 @@ class LapisOreBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - 3 => 1.15, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + 3 => 1.15, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -29,4 +29,4 @@ class LapisOreBlock extends SolidBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/BricksBlock.php b/src/material/block/solid/BricksBlock.php index 7e83f362..97f448b2 100644 --- a/src/material/block/solid/BricksBlock.php +++ b/src/material/block/solid/BricksBlock.php @@ -11,14 +11,14 @@ class BricksBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 10, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 10, + }; } public function getDrops(Item $item, Player $player){ @@ -30,4 +30,4 @@ class BricksBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/BurningFurnaceBlock.php b/src/material/block/solid/BurningFurnaceBlock.php index 625a7e5a..0adb007c 100644 --- a/src/material/block/solid/BurningFurnaceBlock.php +++ b/src/material/block/solid/BurningFurnaceBlock.php @@ -56,14 +56,14 @@ class BurningFurnaceBlock extends SolidBlock implements LightingBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.7, - 4 => 0.9, - 3 => 1.35, - 2 => 0.45, - 1 => 2.65, - default => 17.5, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.7, + 4 => 0.9, + 3 => 1.35, + 2 => 0.45, + 1 => 2.65, + default => 17.5, + }; } public function getDrops(Item $item, Player $player){ @@ -82,4 +82,4 @@ class BurningFurnaceBlock extends SolidBlock implements LightingBlock{ } return $drops; } -} \ No newline at end of file +} diff --git a/src/material/block/solid/CoalBlock.php b/src/material/block/solid/CoalBlock.php index 4fba5e46..cf7a252e 100644 --- a/src/material/block/solid/CoalBlock.php +++ b/src/material/block/solid/CoalBlock.php @@ -11,14 +11,14 @@ class CoalBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.95, - 4 => 1.25, - 3 => 1.9, - 2 => 0.65, - 1 => 3.75, - default => 25, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.95, + 4 => 1.25, + 3 => 1.9, + 2 => 0.65, + 1 => 3.75, + default => 25, + }; } public function getDrops(Item $item, Player $player){ @@ -30,4 +30,4 @@ class CoalBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/CobblestoneBlock.php b/src/material/block/solid/CobblestoneBlock.php index 23e51283..895953d1 100644 --- a/src/material/block/solid/CobblestoneBlock.php +++ b/src/material/block/solid/CobblestoneBlock.php @@ -11,14 +11,14 @@ class CobblestoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 10, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 10, + }; } public function getDrops(Item $item, Player $player){ @@ -30,4 +30,4 @@ class CobblestoneBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/DiamondBlock.php b/src/material/block/solid/DiamondBlock.php index f0e7efde..2ffeed39 100644 --- a/src/material/block/solid/DiamondBlock.php +++ b/src/material/block/solid/DiamondBlock.php @@ -11,11 +11,11 @@ class DiamondBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.95, - 4 => 1.25, - default => 25, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.95, + 4 => 1.25, + default => 25, + }; } public function getDrops(Item $item, Player $player){ @@ -27,4 +27,4 @@ class DiamondBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/DoubleSlabBlock.php b/src/material/block/solid/DoubleSlabBlock.php index 74351687..4b6f28db 100755 --- a/src/material/block/solid/DoubleSlabBlock.php +++ b/src/material/block/solid/DoubleSlabBlock.php @@ -22,14 +22,14 @@ class DoubleSlabBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 10, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 10, + }; } public function getDrops(Item $item, Player $player){ diff --git a/src/material/block/solid/DoubleWoodSlabBlock.php b/src/material/block/solid/DoubleWoodSlabBlock.php index 2a278272..7ff69ef1 100644 --- a/src/material/block/solid/DoubleWoodSlabBlock.php +++ b/src/material/block/solid/DoubleWoodSlabBlock.php @@ -18,14 +18,14 @@ class DoubleWoodSlabBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->isAxe()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 3, - }; + return match ($item->isAxe()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 3, + }; } public function getDrops(Item $item, Player $player){ @@ -34,4 +34,4 @@ class DoubleWoodSlabBlock extends SolidBlock{ ); } -} \ No newline at end of file +} diff --git a/src/material/block/solid/GoldBlock.php b/src/material/block/solid/GoldBlock.php index df7c80a7..80006170 100644 --- a/src/material/block/solid/GoldBlock.php +++ b/src/material/block/solid/GoldBlock.php @@ -11,11 +11,11 @@ class GoldBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -27,4 +27,4 @@ class GoldBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/IceBlock.php b/src/material/block/solid/IceBlock.php index 82c2b896..e5e7860d 100644 --- a/src/material/block/solid/IceBlock.php +++ b/src/material/block/solid/IceBlock.php @@ -58,14 +58,14 @@ class IceBlock extends TransparentBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.1, - 4 => 0.15, - 3 => 0.2, - 2 => 0.1, - 1 => 0.4, - default => 0.75, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.1, + 4 => 0.15, + 3 => 0.2, + 2 => 0.1, + 1 => 0.4, + default => 0.75, + }; } public function getDrops(Item $item, Player $player){ diff --git a/src/material/block/solid/IronBlock.php b/src/material/block/solid/IronBlock.php index 7601854e..504b94a1 100644 --- a/src/material/block/solid/IronBlock.php +++ b/src/material/block/solid/IronBlock.php @@ -11,12 +11,12 @@ class IronBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.95, - 4 => 1.25, - 3 => 1.9, - default => 25, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.95, + 4 => 1.25, + 3 => 1.9, + default => 25, + }; } public function getDrops(Item $item, Player $player){ @@ -28,4 +28,4 @@ class IronBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/LapisBlock.php b/src/material/block/solid/LapisBlock.php index 5227b504..1d4c4dc6 100644 --- a/src/material/block/solid/LapisBlock.php +++ b/src/material/block/solid/LapisBlock.php @@ -11,12 +11,12 @@ class LapisBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.6, - 4 => 0.75, - 3 => 1.15, - default => 15, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.6, + 4 => 0.75, + 3 => 1.15, + default => 15, + }; } public function getDrops(Item $item, Player $player){ @@ -29,4 +29,4 @@ class LapisBlock extends SolidBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/MossStoneBlock.php b/src/material/block/solid/MossStoneBlock.php index 8d5743a8..495de40d 100644 --- a/src/material/block/solid/MossStoneBlock.php +++ b/src/material/block/solid/MossStoneBlock.php @@ -11,14 +11,14 @@ class MossStoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 10, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 10, + }; } public function getDrops(Item $item, Player $player){ @@ -30,4 +30,4 @@ class MossStoneBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/NetherBricksBlock.php b/src/material/block/solid/NetherBricksBlock.php index 0cefb228..bf1c7947 100644 --- a/src/material/block/solid/NetherBricksBlock.php +++ b/src/material/block/solid/NetherBricksBlock.php @@ -11,14 +11,14 @@ class NetherBricksBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 10, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 10, + }; } public function getDrops(Item $item, Player $player){ @@ -30,4 +30,4 @@ class NetherBricksBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/NetherrackBlock.php b/src/material/block/solid/NetherrackBlock.php index 518a446d..4700a083 100644 --- a/src/material/block/solid/NetherrackBlock.php +++ b/src/material/block/solid/NetherrackBlock.php @@ -11,14 +11,14 @@ class NetherrackBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.1, - 4 => 0.1, - 3 => 0.15, - 2 => 0.05, - 1 => 0.3, - default => 2, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.1, + 4 => 0.1, + 3 => 0.15, + 2 => 0.05, + 1 => 0.3, + default => 2, + }; } public function getDrops(Item $item, Player $player){ @@ -30,4 +30,4 @@ class NetherrackBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/QuartzBlock.php b/src/material/block/solid/QuartzBlock.php index ed9a047f..1c7bcfb7 100644 --- a/src/material/block/solid/QuartzBlock.php +++ b/src/material/block/solid/QuartzBlock.php @@ -17,14 +17,14 @@ class QuartzBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.15, - 4 => 0.2, - 3 => 0.3, - 2 => 0.1, - 1 => 0.6, - default => 4, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.15, + 4 => 0.2, + 3 => 0.3, + 2 => 0.1, + 1 => 0.6, + default => 4, + }; } public function getDrops(Item $item, Player $player){ @@ -36,4 +36,4 @@ class QuartzBlock extends SolidBlock{ return array(); } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/SandstoneBlock.php b/src/material/block/solid/SandstoneBlock.php index 4d681022..c6533998 100644 --- a/src/material/block/solid/SandstoneBlock.php +++ b/src/material/block/solid/SandstoneBlock.php @@ -17,14 +17,14 @@ class SandstoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.15, - 4 => 0.2, - 3 => 0.3, - 2 => 0.1, - 1 => 0.6, - default => 4, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.15, + 4 => 0.2, + 3 => 0.3, + 2 => 0.1, + 1 => 0.6, + default => 4, + }; } public function getDrops(Item $item, Player $player){ @@ -37,4 +37,4 @@ class SandstoneBlock extends SolidBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/StoneBlock.php b/src/material/block/solid/StoneBlock.php index 562d3d1c..51504b66 100644 --- a/src/material/block/solid/StoneBlock.php +++ b/src/material/block/solid/StoneBlock.php @@ -11,14 +11,14 @@ class StoneBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 7.5, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 7.5, + }; } public function getDrops(Item $item, Player $player){ @@ -31,4 +31,4 @@ class StoneBlock extends SolidBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/block/solid/StoneBricksBlock.php b/src/material/block/solid/StoneBricksBlock.php index 429c7fd1..58299703 100644 --- a/src/material/block/solid/StoneBricksBlock.php +++ b/src/material/block/solid/StoneBricksBlock.php @@ -18,14 +18,14 @@ class StoneBricksBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0x01){ return 0.20; } - return match ($item->getPickaxeLevel()) { - 5 => 0.4, - 4 => 0.5, - 3 => 0.75, - 2 => 0.25, - 1 => 1.5, - default => 7.5, - }; + return match ($item->getPickaxeLevel()) { + 5 => 0.4, + 4 => 0.5, + 3 => 0.75, + 2 => 0.25, + 1 => 1.5, + default => 7.5, + }; } public function getDrops(Item $item, Player $player){ @@ -38,4 +38,4 @@ class StoneBricksBlock extends SolidBlock{ } } -} \ No newline at end of file +} diff --git a/src/material/item/base/ItemAxe.php b/src/material/item/base/ItemAxe.php index 4c3d140f..5efc1d5b 100644 --- a/src/material/item/base/ItemAxe.php +++ b/src/material/item/base/ItemAxe.php @@ -7,14 +7,14 @@ abstract class ItemAxe extends ItemTool } public function getLevel(){ - return match ($this->id) { - WOODEN_AXE => 1, - GOLDEN_AXE => 2, - STONE_AXE => 3, - IRON_AXE => 4, - DIAMOND_AXE => 5, - default => false, - }; + return match ($this->id) { + WOODEN_AXE => 1, + GOLDEN_AXE => 2, + STONE_AXE => 3, + IRON_AXE => 4, + DIAMOND_AXE => 5, + default => false, + }; } } diff --git a/src/material/item/base/ItemHoe.php b/src/material/item/base/ItemHoe.php index 56bccf02..277b75fb 100644 --- a/src/material/item/base/ItemHoe.php +++ b/src/material/item/base/ItemHoe.php @@ -16,14 +16,14 @@ abstract class ItemHoe extends ItemTool } public function getLevel(){ - return match ($this->id) { - WOODEN_HOE => 1, - GOLDEN_HOE => 2, - STONE_HOE => 3, - IRON_HOE => 4, - DIAMOND_HOE => 5, - default => false, - }; + return match ($this->id) { + WOODEN_HOE => 1, + GOLDEN_HOE => 2, + STONE_HOE => 3, + IRON_HOE => 4, + DIAMOND_HOE => 5, + default => false, + }; } } diff --git a/src/material/item/base/ItemPickaxe.php b/src/material/item/base/ItemPickaxe.php index e2b0928b..91666c54 100644 --- a/src/material/item/base/ItemPickaxe.php +++ b/src/material/item/base/ItemPickaxe.php @@ -12,14 +12,14 @@ abstract class ItemPickaxe extends ItemTool } public function getLevel(){ - return match ($this->id) { - WOODEN_PICKAXE => 1, - GOLDEN_PICKAXE => 2, - STONE_PICKAXE => 3, - IRON_PICKAXE => 4, - DIAMOND_PICKAXE => 5, - default => false, - }; + return match ($this->id) { + WOODEN_PICKAXE => 1, + GOLDEN_PICKAXE => 2, + STONE_PICKAXE => 3, + IRON_PICKAXE => 4, + DIAMOND_PICKAXE => 5, + default => false, + }; } } diff --git a/src/material/item/base/ItemShovel.php b/src/material/item/base/ItemShovel.php index c8ac6e9c..20b61eba 100644 --- a/src/material/item/base/ItemShovel.php +++ b/src/material/item/base/ItemShovel.php @@ -7,14 +7,14 @@ class ItemShovel extends ItemTool } public function getLevel(){ - return match ($this->id) { - WOODEN_SHOVEL => 1, - GOLDEN_SHOVEL => 2, - STONE_SHOVEL => 3, - IRON_SHOVEL => 4, - DIAMOND_SHOVEL => 5, - default => false, - }; + return match ($this->id) { + WOODEN_SHOVEL => 1, + GOLDEN_SHOVEL => 2, + STONE_SHOVEL => 3, + IRON_SHOVEL => 4, + DIAMOND_SHOVEL => 5, + default => false, + }; } } diff --git a/src/material/item/base/ItemSword.php b/src/material/item/base/ItemSword.php index ccfb5393..6bd725e0 100644 --- a/src/material/item/base/ItemSword.php +++ b/src/material/item/base/ItemSword.php @@ -8,14 +8,14 @@ abstract class ItemSword extends ItemTool } public function getLevel(){ - return match ($this->id) { - WOODEN_SWORD => 1, - GOLDEN_SWORD => 2, - STONE_SWORD => 3, - IRON_SWORD => 4, - DIAMOND_SWORD => 5, - default => false, - }; + return match ($this->id) { + WOODEN_SWORD => 1, + GOLDEN_SWORD => 2, + STONE_SWORD => 3, + IRON_SWORD => 4, + DIAMOND_SWORD => 5, + default => false, + }; } } diff --git a/src/math/Matrix.php b/src/math/Matrix.php index e88f26fe..d2f3b245 100644 --- a/src/math/Matrix.php +++ b/src/math/Matrix.php @@ -140,13 +140,13 @@ class Matrix implements ArrayAccess{ if($this->isSquare() !== true){ return false; } - return match ($this->rows) { - 1 => 0, - 2 => $this->matrix[0][0] * $this->matrix[1][1] - $this->matrix[0][1] * $this->matrix[1][0], - 3 => $this->matrix[0][0] * $this->matrix[1][1] * $this->matrix[2][2] + $this->matrix[0][1] * $this->matrix[1][2] * $this->matrix[2][0] + $this->matrix[0][2] * $this->matrix[1][0] * $this->matrix[2][1] - $this->matrix[2][0] * $this->matrix[1][1] * $this->matrix[0][2] - $this->matrix[2][1] * $this->matrix[1][2] * $this->matrix[0][0] - $this->matrix[2][2] * $this->matrix[1][0] * $this->matrix[0][1], - default => false, - }; - } + return match ($this->rows) { + 1 => 0, + 2 => $this->matrix[0][0] * $this->matrix[1][1] - $this->matrix[0][1] * $this->matrix[1][0], + 3 => $this->matrix[0][0] * $this->matrix[1][1] * $this->matrix[2][2] + $this->matrix[0][1] * $this->matrix[1][2] * $this->matrix[2][0] + $this->matrix[0][2] * $this->matrix[1][0] * $this->matrix[2][1] - $this->matrix[2][0] * $this->matrix[1][1] * $this->matrix[0][2] - $this->matrix[2][1] * $this->matrix[1][2] * $this->matrix[0][0] - $this->matrix[2][2] * $this->matrix[1][0] * $this->matrix[0][1], + default => false, + }; + } //Computation of the determinant of 2x2 and 3x3 matrices @@ -163,4 +163,4 @@ class Matrix implements ArrayAccess{ return "Matrix({$this->rows}x{$this->columns};" . substr($s, 0, -1) . ")"; } -} \ No newline at end of file +} diff --git a/src/math/Vector3.php b/src/math/Vector3.php index 5d670618..03dcb015 100644 --- a/src/math/Vector3.php +++ b/src/math/Vector3.php @@ -104,15 +104,15 @@ class Vector3{ } public function getSide($side, $step = 1){ - return match ((int)$side) { - 0 => new Vector3($this->x, $this->y - $step, $this->z), - 1 => new Vector3($this->x, $this->y + $step, $this->z), - 2 => new Vector3($this->x, $this->y, $this->z - $step), - 3 => new Vector3($this->x, $this->y, $this->z + $step), - 4 => new Vector3($this->x - $step, $this->y, $this->z), - 5 => new Vector3($this->x + $step, $this->y, $this->z), - default => $this, - }; + return match ((int)$side) { + 0 => new Vector3($this->x, $this->y - $step, $this->z), + 1 => new Vector3($this->x, $this->y + $step, $this->z), + 2 => new Vector3($this->x, $this->y, $this->z - $step), + 3 => new Vector3($this->x, $this->y, $this->z + $step), + 4 => new Vector3($this->x - $step, $this->y, $this->z), + 5 => new Vector3($this->x + $step, $this->y, $this->z), + default => $this, + }; } public function distance($x = 0, $y = 0, $z = 0){ @@ -270,4 +270,4 @@ class Vector3{ public function getIntermediateWithZValue(Vector3 $v, $y){ return $this->clipZ($v, $y); } -} \ No newline at end of file +} diff --git a/src/network/raknet/RakNetInfo.php b/src/network/raknet/RakNetInfo.php index 99fd2d73..634e2e76 100644 --- a/src/network/raknet/RakNetInfo.php +++ b/src/network/raknet/RakNetInfo.php @@ -38,9 +38,9 @@ abstract class RakNetInfo{ const ACK = 0xc0; public static function isValid($pid){ - return match ((int)$pid) { - RakNetInfo::UNCONNECTED_PING, RakNetInfo::UNCONNECTED_PING_OPEN_CONNECTIONS, RakNetInfo::OPEN_CONNECTION_REQUEST_1, RakNetInfo::OPEN_CONNECTION_REPLY_1, RakNetInfo::OPEN_CONNECTION_REQUEST_2, RakNetInfo::OPEN_CONNECTION_REPLY_2, RakNetInfo::INCOMPATIBLE_PROTOCOL_VERSION, RakNetInfo::UNCONNECTED_PONG, RakNetInfo::ADVERTISE_SYSTEM, RakNetInfo::DATA_PACKET_0, RakNetInfo::DATA_PACKET_1, RakNetInfo::DATA_PACKET_2, RakNetInfo::DATA_PACKET_3, RakNetInfo::DATA_PACKET_4, RakNetInfo::DATA_PACKET_5, RakNetInfo::DATA_PACKET_6, RakNetInfo::DATA_PACKET_7, RakNetInfo::DATA_PACKET_8, RakNetInfo::DATA_PACKET_9, RakNetInfo::DATA_PACKET_A, RakNetInfo::DATA_PACKET_B, RakNetInfo::DATA_PACKET_C, RakNetInfo::DATA_PACKET_D, RakNetInfo::DATA_PACKET_E, RakNetInfo::DATA_PACKET_F, RakNetInfo::NACK, RakNetInfo::ACK => true, - default => false, - }; + return match ((int)$pid) { + RakNetInfo::UNCONNECTED_PING, RakNetInfo::UNCONNECTED_PING_OPEN_CONNECTIONS, RakNetInfo::OPEN_CONNECTION_REQUEST_1, RakNetInfo::OPEN_CONNECTION_REPLY_1, RakNetInfo::OPEN_CONNECTION_REQUEST_2, RakNetInfo::OPEN_CONNECTION_REPLY_2, RakNetInfo::INCOMPATIBLE_PROTOCOL_VERSION, RakNetInfo::UNCONNECTED_PONG, RakNetInfo::ADVERTISE_SYSTEM, RakNetInfo::DATA_PACKET_0, RakNetInfo::DATA_PACKET_1, RakNetInfo::DATA_PACKET_2, RakNetInfo::DATA_PACKET_3, RakNetInfo::DATA_PACKET_4, RakNetInfo::DATA_PACKET_5, RakNetInfo::DATA_PACKET_6, RakNetInfo::DATA_PACKET_7, RakNetInfo::DATA_PACKET_8, RakNetInfo::DATA_PACKET_9, RakNetInfo::DATA_PACKET_A, RakNetInfo::DATA_PACKET_B, RakNetInfo::DATA_PACKET_C, RakNetInfo::DATA_PACKET_D, RakNetInfo::DATA_PACKET_E, RakNetInfo::DATA_PACKET_F, RakNetInfo::NACK, RakNetInfo::ACK => true, + default => false, + }; } -} \ No newline at end of file +} diff --git a/src/recipes/CraftingRecipes.php b/src/recipes/CraftingRecipes.php index 2db3ef96..204fb77d 100644 --- a/src/recipes/CraftingRecipes.php +++ b/src/recipes/CraftingRecipes.php @@ -3,7 +3,7 @@ class CraftingRecipes{ private static $small = [ // Probably means craftable on crafting bench and in inventory. Name it better! - // Building + // Building "CLAY:?x4=>CLAY_BLOCK:0x1", "WOODEN_PLANKS:?x4=>WORKBENCH:0x1", "GLOWSTONE_DUST:?x4=>GLOWSTONE_BLOCK:0x1", @@ -73,7 +73,7 @@ class CraftingRecipes{ ]; private static $big = [ // Probably means only craftable on crafting bench. Name it better! - // Building + // Building "WOOL:?x3,WOODEN_PLANKS:?x3=>BED:0x1", "WOODEN_PLANKS:?x8=>CHEST:0x1", "STICK:?x6=>FENCE:0x2", diff --git a/src/utils/Utils.php b/src/utils/Utils.php index c2cfb754..a6f8a08c 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -14,13 +14,13 @@ class Utils{ }*/ const emojiRegex = "([*#0-9](?>\\xEF\\xB8\\x8F)?\\xE2\\x83\\xA3|\\xC2[\\xA9\\xAE]|\\xE2..(\\xF0\\x9F\\x8F[\\xBB-\\xBF])?(?>\\xEF\\xB8\\x8F)?|\\xE3(?>\\x80[\\xB0\\xBD]|\\x8A[\\x97\\x99])(?>\\xEF\\xB8\\x8F)?|\\xF0\\x9F(?>[\\x80-\\x86].(?>\\xEF\\xB8\\x8F)?|\\x87.\\xF0\\x9F\\x87.|..(\\xF0\\x9F\\x8F[\\xBB-\\xBF])?|(((?\\xE2\\x80\\x8D)\\xE2\\x9D\\xA4\\xEF\\xB8\\x8F\k\\xF0\\x9F..(\k\\xF0\\x9F\\x91.)?|(\\xE2\\x80\\x8D\\xF0\\x9F\\x91.){2,3}))?))"; public static function getEntityTypeByID($id){ - return match ($id) { - 10, 11, 12, 13, 32, 33, 34, 35, 36 => ENTITY_MOB, - 62, 65, 80, 81, 82, 83, 84 => ENTITY_OBJECT, - 66 => FALLING_SAND, - default => $id, - }; - } + return match ($id) { + 10, 11, 12, 13, 32, 33, 34, 35, 36 => ENTITY_MOB, + 62, 65, 80, 81, 82, 83, 84 => ENTITY_OBJECT, + 66 => FALLING_SAND, + default => $id, + }; + } public static function wrapAngleTo360($angle) {