hopefully replaced spaces with tabs everywhere

This commit is contained in:
GameHerobrine 2024-08-17 16:21:02 +03:00
parent ed4f820ff3
commit 89eb7097a3
42 changed files with 324 additions and 324 deletions

View file

@ -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();

View file

@ -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;

View file

@ -87,7 +87,7 @@ class TaskAttackPlayer extends TaskBase
}
public function onEnd(EntityAI $ai)
{
{
$ai->entity->target = false;
}

View file

@ -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(){

View file

@ -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){

View file

@ -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();
}
}
}
}

View file

@ -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),
);
}
}
}

View file

@ -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),
);
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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;
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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){

View file

@ -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{
);
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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){

View file

@ -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();
}
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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{
}
}
}
}

View file

@ -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,
};
}
}

View file

@ -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,
};
}
}

View file

@ -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,
};
}
}

View file

@ -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,
};
}
}

View file

@ -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,
};
}
}

View file

@ -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) . ")";
}
}
}

View file

@ -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);
}
}
}

View file

@ -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,
};
}
}
}

View file

@ -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",

View file

@ -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])?|(((?<zwj>\\xE2\\x80\\x8D)\\xE2\\x9D\\xA4\\xEF\\xB8\\x8F\k<zwj>\\xF0\\x9F..(\k<zwj>\\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)
{