mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-24 05:29:44 +00:00
hopefully replaced spaces with tabs everywhere
This commit is contained in:
parent
ed4f820ff3
commit
89eb7097a3
42 changed files with 324 additions and 324 deletions
|
|
@ -145,11 +145,11 @@ class LevelAPI{
|
||||||
if($generator !== false and class_exists($generator)){
|
if($generator !== false and class_exists($generator)){
|
||||||
$generator = new $generator($options);
|
$generator = new $generator($options);
|
||||||
}else{
|
}else{
|
||||||
$generator = match (strtoupper($this->server->api->getProperty("level-type"))) {
|
$generator = match (strtoupper($this->server->api->getProperty("level-type"))) {
|
||||||
"FLAT" => new SuperflatGenerator($options),
|
"FLAT" => new SuperflatGenerator($options),
|
||||||
"VANILLA" => new VanillaGenerator($options),
|
"VANILLA" => new VanillaGenerator($options),
|
||||||
default => new TemporalGenerator($options),
|
default => new TemporalGenerator($options),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
$gen = new WorldGenerator($generator, $name, $seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)) : (int) $seed);
|
$gen = new WorldGenerator($generator, $name, $seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)) : (int) $seed);
|
||||||
$gen->generate();
|
$gen->generate();
|
||||||
|
|
|
||||||
|
|
@ -57,18 +57,18 @@ class PlayerAPI{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$message = match ($data["cause"]) {
|
$message = match ($data["cause"]) {
|
||||||
"cactus" => " was pricked to death",
|
"cactus" => " was pricked to death",
|
||||||
"lava" => " tried to swim in lava",
|
"lava" => " tried to swim in lava",
|
||||||
"fire" => " went up in flames",
|
"fire" => " went up in flames",
|
||||||
"burning" => " burned to death",
|
"burning" => " burned to death",
|
||||||
"suffocation" => " suffocated in a wall",
|
"suffocation" => " suffocated in a wall",
|
||||||
"water" => " drowned",
|
"water" => " drowned",
|
||||||
"void" => " fell out of the world",
|
"void" => " fell out of the world",
|
||||||
"fall" => " hit the ground too hard",
|
"fall" => " hit the ground too hard",
|
||||||
"explosion" => " blew up",
|
"explosion" => " blew up",
|
||||||
default => " died",
|
default => " died",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
$this->server->api->chat->broadcast($data["player"]->username . $message);
|
$this->server->api->chat->broadcast($data["player"]->username . $message);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class TaskAttackPlayer extends TaskBase
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEnd(EntityAI $ai)
|
public function onEnd(EntityAI $ai)
|
||||||
{
|
{
|
||||||
$ai->entity->target = false;
|
$ai->entity->target = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,14 +259,14 @@ class Item{
|
||||||
|
|
||||||
//TODO remove?
|
//TODO remove?
|
||||||
public function getPickaxeLevel(){ //Returns false or level of the pickaxe
|
public function getPickaxeLevel(){ //Returns false or level of the pickaxe
|
||||||
return match ($this->id) {
|
return match ($this->id) {
|
||||||
WOODEN_PICKAXE => 1,
|
WOODEN_PICKAXE => 1,
|
||||||
GOLDEN_PICKAXE => 2,
|
GOLDEN_PICKAXE => 2,
|
||||||
STONE_PICKAXE => 3,
|
STONE_PICKAXE => 3,
|
||||||
IRON_PICKAXE => 4,
|
IRON_PICKAXE => 4,
|
||||||
DIAMOND_PICKAXE => 5,
|
DIAMOND_PICKAXE => 5,
|
||||||
default => false,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isAxe(){
|
public function isAxe(){
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ class IronDoorBlock extends DoorBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.95,
|
5 => 0.95,
|
||||||
4 => 1.25,
|
4 => 1.25,
|
||||||
3 => 1.9,
|
3 => 1.9,
|
||||||
2 => 0.65,
|
2 => 0.65,
|
||||||
1 => 3.75,
|
1 => 3.75,
|
||||||
default => 25,
|
default => 25,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -94,14 +94,14 @@ class SlabBlock extends TransparentBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 10,
|
default => 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -90,14 +90,14 @@ class WoodSlabBlock extends TransparentBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->isAxe()) {
|
return match ($item->isAxe()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 3,
|
default => 3,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@ class WoodStairsBlock extends StairBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->isAxe()) {
|
return match ($item->isAxe()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 3,
|
default => 3,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class CoalOreBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
3 => 1.15,
|
3 => 1.15,
|
||||||
2 => 0.4,
|
2 => 0.4,
|
||||||
1 => 2.25,
|
1 => 2.25,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@ class DiamondOreBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ class GlowingRedstoneOreBlock extends SolidBlock implements LightingBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@ class GoldOreBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ class IronOreBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
3 => 1.15,
|
3 => 1.15,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ class LapisOreBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
3 => 1.15,
|
3 => 1.15,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class BricksBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 10,
|
default => 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,14 @@ class BurningFurnaceBlock extends SolidBlock implements LightingBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.7,
|
5 => 0.7,
|
||||||
4 => 0.9,
|
4 => 0.9,
|
||||||
3 => 1.35,
|
3 => 1.35,
|
||||||
2 => 0.45,
|
2 => 0.45,
|
||||||
1 => 2.65,
|
1 => 2.65,
|
||||||
default => 17.5,
|
default => 17.5,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class CoalBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.95,
|
5 => 0.95,
|
||||||
4 => 1.25,
|
4 => 1.25,
|
||||||
3 => 1.9,
|
3 => 1.9,
|
||||||
2 => 0.65,
|
2 => 0.65,
|
||||||
1 => 3.75,
|
1 => 3.75,
|
||||||
default => 25,
|
default => 25,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class CobblestoneBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 10,
|
default => 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@ class DiamondBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.95,
|
5 => 0.95,
|
||||||
4 => 1.25,
|
4 => 1.25,
|
||||||
default => 25,
|
default => 25,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@ class DoubleSlabBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 10,
|
default => 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ class DoubleWoodSlabBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->isAxe()) {
|
return match ($item->isAxe()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 3,
|
default => 3,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@ class GoldBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -58,14 +58,14 @@ class IceBlock extends TransparentBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.1,
|
5 => 0.1,
|
||||||
4 => 0.15,
|
4 => 0.15,
|
||||||
3 => 0.2,
|
3 => 0.2,
|
||||||
2 => 0.1,
|
2 => 0.1,
|
||||||
1 => 0.4,
|
1 => 0.4,
|
||||||
default => 0.75,
|
default => 0.75,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ class IronBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.95,
|
5 => 0.95,
|
||||||
4 => 1.25,
|
4 => 1.25,
|
||||||
3 => 1.9,
|
3 => 1.9,
|
||||||
default => 25,
|
default => 25,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ class LapisBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.6,
|
5 => 0.6,
|
||||||
4 => 0.75,
|
4 => 0.75,
|
||||||
3 => 1.15,
|
3 => 1.15,
|
||||||
default => 15,
|
default => 15,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class MossStoneBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 10,
|
default => 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class NetherBricksBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 10,
|
default => 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class NetherrackBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.1,
|
5 => 0.1,
|
||||||
4 => 0.1,
|
4 => 0.1,
|
||||||
3 => 0.15,
|
3 => 0.15,
|
||||||
2 => 0.05,
|
2 => 0.05,
|
||||||
1 => 0.3,
|
1 => 0.3,
|
||||||
default => 2,
|
default => 2,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,14 @@ class QuartzBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.15,
|
5 => 0.15,
|
||||||
4 => 0.2,
|
4 => 0.2,
|
||||||
3 => 0.3,
|
3 => 0.3,
|
||||||
2 => 0.1,
|
2 => 0.1,
|
||||||
1 => 0.6,
|
1 => 0.6,
|
||||||
default => 4,
|
default => 4,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,14 @@ class SandstoneBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.15,
|
5 => 0.15,
|
||||||
4 => 0.2,
|
4 => 0.2,
|
||||||
3 => 0.3,
|
3 => 0.3,
|
||||||
2 => 0.1,
|
2 => 0.1,
|
||||||
1 => 0.6,
|
1 => 0.6,
|
||||||
default => 4,
|
default => 4,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ class StoneBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 7.5,
|
default => 7.5,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ class StoneBricksBlock extends SolidBlock{
|
||||||
if(($player->gamemode & 0x01) === 0x01){
|
if(($player->gamemode & 0x01) === 0x01){
|
||||||
return 0.20;
|
return 0.20;
|
||||||
}
|
}
|
||||||
return match ($item->getPickaxeLevel()) {
|
return match ($item->getPickaxeLevel()) {
|
||||||
5 => 0.4,
|
5 => 0.4,
|
||||||
4 => 0.5,
|
4 => 0.5,
|
||||||
3 => 0.75,
|
3 => 0.75,
|
||||||
2 => 0.25,
|
2 => 0.25,
|
||||||
1 => 1.5,
|
1 => 1.5,
|
||||||
default => 7.5,
|
default => 7.5,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ abstract class ItemAxe extends ItemTool
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLevel(){
|
public function getLevel(){
|
||||||
return match ($this->id) {
|
return match ($this->id) {
|
||||||
WOODEN_AXE => 1,
|
WOODEN_AXE => 1,
|
||||||
GOLDEN_AXE => 2,
|
GOLDEN_AXE => 2,
|
||||||
STONE_AXE => 3,
|
STONE_AXE => 3,
|
||||||
IRON_AXE => 4,
|
IRON_AXE => 4,
|
||||||
DIAMOND_AXE => 5,
|
DIAMOND_AXE => 5,
|
||||||
default => false,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ abstract class ItemHoe extends ItemTool
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLevel(){
|
public function getLevel(){
|
||||||
return match ($this->id) {
|
return match ($this->id) {
|
||||||
WOODEN_HOE => 1,
|
WOODEN_HOE => 1,
|
||||||
GOLDEN_HOE => 2,
|
GOLDEN_HOE => 2,
|
||||||
STONE_HOE => 3,
|
STONE_HOE => 3,
|
||||||
IRON_HOE => 4,
|
IRON_HOE => 4,
|
||||||
DIAMOND_HOE => 5,
|
DIAMOND_HOE => 5,
|
||||||
default => false,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ abstract class ItemPickaxe extends ItemTool
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLevel(){
|
public function getLevel(){
|
||||||
return match ($this->id) {
|
return match ($this->id) {
|
||||||
WOODEN_PICKAXE => 1,
|
WOODEN_PICKAXE => 1,
|
||||||
GOLDEN_PICKAXE => 2,
|
GOLDEN_PICKAXE => 2,
|
||||||
STONE_PICKAXE => 3,
|
STONE_PICKAXE => 3,
|
||||||
IRON_PICKAXE => 4,
|
IRON_PICKAXE => 4,
|
||||||
DIAMOND_PICKAXE => 5,
|
DIAMOND_PICKAXE => 5,
|
||||||
default => false,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ class ItemShovel extends ItemTool
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLevel(){
|
public function getLevel(){
|
||||||
return match ($this->id) {
|
return match ($this->id) {
|
||||||
WOODEN_SHOVEL => 1,
|
WOODEN_SHOVEL => 1,
|
||||||
GOLDEN_SHOVEL => 2,
|
GOLDEN_SHOVEL => 2,
|
||||||
STONE_SHOVEL => 3,
|
STONE_SHOVEL => 3,
|
||||||
IRON_SHOVEL => 4,
|
IRON_SHOVEL => 4,
|
||||||
DIAMOND_SHOVEL => 5,
|
DIAMOND_SHOVEL => 5,
|
||||||
default => false,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@ abstract class ItemSword extends ItemTool
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLevel(){
|
public function getLevel(){
|
||||||
return match ($this->id) {
|
return match ($this->id) {
|
||||||
WOODEN_SWORD => 1,
|
WOODEN_SWORD => 1,
|
||||||
GOLDEN_SWORD => 2,
|
GOLDEN_SWORD => 2,
|
||||||
STONE_SWORD => 3,
|
STONE_SWORD => 3,
|
||||||
IRON_SWORD => 4,
|
IRON_SWORD => 4,
|
||||||
DIAMOND_SWORD => 5,
|
DIAMOND_SWORD => 5,
|
||||||
default => false,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,13 +140,13 @@ class Matrix implements ArrayAccess{
|
||||||
if($this->isSquare() !== true){
|
if($this->isSquare() !== true){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return match ($this->rows) {
|
return match ($this->rows) {
|
||||||
1 => 0,
|
1 => 0,
|
||||||
2 => $this->matrix[0][0] * $this->matrix[1][1] - $this->matrix[0][1] * $this->matrix[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],
|
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,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Computation of the determinant of 2x2 and 3x3 matrices
|
//Computation of the determinant of 2x2 and 3x3 matrices
|
||||||
|
|
|
||||||
|
|
@ -104,15 +104,15 @@ class Vector3{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSide($side, $step = 1){
|
public function getSide($side, $step = 1){
|
||||||
return match ((int)$side) {
|
return match ((int)$side) {
|
||||||
0 => new Vector3($this->x, $this->y - $step, $this->z),
|
0 => new Vector3($this->x, $this->y - $step, $this->z),
|
||||||
1 => 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),
|
2 => new Vector3($this->x, $this->y, $this->z - $step),
|
||||||
3 => 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),
|
4 => new Vector3($this->x - $step, $this->y, $this->z),
|
||||||
5 => new Vector3($this->x + $step, $this->y, $this->z),
|
5 => new Vector3($this->x + $step, $this->y, $this->z),
|
||||||
default => $this,
|
default => $this,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public function distance($x = 0, $y = 0, $z = 0){
|
public function distance($x = 0, $y = 0, $z = 0){
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ abstract class RakNetInfo{
|
||||||
const ACK = 0xc0;
|
const ACK = 0xc0;
|
||||||
|
|
||||||
public static function isValid($pid){
|
public static function isValid($pid){
|
||||||
return match ((int)$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,
|
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,
|
default => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
class CraftingRecipes{
|
class CraftingRecipes{
|
||||||
|
|
||||||
private static $small = [ // Probably means craftable on crafting bench and in inventory. Name it better!
|
private static $small = [ // Probably means craftable on crafting bench and in inventory. Name it better!
|
||||||
// Building
|
// Building
|
||||||
"CLAY:?x4=>CLAY_BLOCK:0x1",
|
"CLAY:?x4=>CLAY_BLOCK:0x1",
|
||||||
"WOODEN_PLANKS:?x4=>WORKBENCH:0x1",
|
"WOODEN_PLANKS:?x4=>WORKBENCH:0x1",
|
||||||
"GLOWSTONE_DUST:?x4=>GLOWSTONE_BLOCK: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!
|
private static $big = [ // Probably means only craftable on crafting bench. Name it better!
|
||||||
// Building
|
// Building
|
||||||
"WOOL:?x3,WOODEN_PLANKS:?x3=>BED:0x1",
|
"WOOL:?x3,WOODEN_PLANKS:?x3=>BED:0x1",
|
||||||
"WOODEN_PLANKS:?x8=>CHEST:0x1",
|
"WOODEN_PLANKS:?x8=>CHEST:0x1",
|
||||||
"STICK:?x6=>FENCE:0x2",
|
"STICK:?x6=>FENCE:0x2",
|
||||||
|
|
|
||||||
|
|
@ -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}))?))";
|
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){
|
public static function getEntityTypeByID($id){
|
||||||
return match ($id) {
|
return match ($id) {
|
||||||
10, 11, 12, 13, 32, 33, 34, 35, 36 => ENTITY_MOB,
|
10, 11, 12, 13, 32, 33, 34, 35, 36 => ENTITY_MOB,
|
||||||
62, 65, 80, 81, 82, 83, 84 => ENTITY_OBJECT,
|
62, 65, 80, 81, 82, 83, 84 => ENTITY_OBJECT,
|
||||||
66 => FALLING_SAND,
|
66 => FALLING_SAND,
|
||||||
default => $id,
|
default => $id,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function wrapAngleTo360($angle)
|
public static function wrapAngleTo360($angle)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue