Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Forgot to add..
Browse files Browse the repository at this point in the history
  • Loading branch information
xwertxy committed Apr 9, 2024
1 parent 6adcb19 commit ba6b637
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"php":"8.1.25","version":"3.22.0","indent":"\t","lineEnding":"\n","rules":{"align_multiline_comment":{"comment_type":"phpdocs_only"},"array_indentation":true,"array_syntax":{"syntax":"short"},"binary_operator_spaces":{"default":"single_space"},"blank_line_after_namespace":true,"blank_line_after_opening_tag":true,"blank_line_before_statement":{"statements":["declare"]},"braces":{"allow_single_line_closure":false,"position_after_anonymous_constructs":"same","position_after_control_structures":"same","position_after_functions_and_oop_constructs":"same"},"cast_spaces":{"space":"single"},"concat_space":{"spacing":"one"},"declare_strict_types":true,"elseif":true,"global_namespace_import":{"import_constants":true,"import_functions":true,"import_classes":null},"header_comment":{"comment_type":"comment","header":"\r\n ____ _ __ _____\r\n| _ \\ ___ (_) _ __ \/ _| _ _ |_ _| ___ __ _ _ __ ___\r\n| |_) | \/ _ \\ | | | '_ \\ | |_ | | | | | | \/ _ \\ \/ _` | | '_ ` _ \\\r\n| _ < | __\/ | | | | | | | _| | |_| | | | | __\/ | (_| | | | | | | |\r\n|_| \\_\\ \\___| |_| |_| |_| |_| \\__, | |_| \\___| \\__,_| |_| |_| |_|\r\n |___\/\r\n\r\nThis program is free software: you can redistribute it and\/or modify\r\nit under the terms of the GNU Lesser General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\n@author ReinfyTeam\r\n@link https:\/\/github.com\/ReinfyTeam\/\r\n\r\n","location":"after_open"},"indentation_type":true,"native_function_invocation":{"scope":"namespaced","include":["@all"]},"no_closing_tag":true,"no_empty_phpdoc":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true},"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"no_whitespace_in_blank_line":true,"no_unused_imports":true,"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"alpha"},"phpdoc_line_span":{"property":"single","method":null,"const":null},"phpdoc_trim":true,"phpdoc_trim_consecutive_blank_line_separation":true,"return_type_declaration":{"space_before":"one"},"single_import_per_statement":true,"strict_param":true,"unary_operator_spaces":true},"hashes":{"src\\checks\\autoclick\\AutoClickA.php":"51a73fc991bf6773f4313b154605d46c","src\\checks\\autoclick\\AutoClickB.php":"857e16a051fcab02a8689a504e25b6ad","src\\checks\\autoclick\\AutoClickC.php":"4299517fd2b2246232f6dec2db733cd9","src\\checks\\behaivor\\AntiBot.php":"235089d17202ad71d9f3053700a5b263","src\\checks\\behaivor\\EditionFaker.php":"67fffcda310b71b3709a728f0b9c5e2a","src\\checks\\behaivor\\FastEat.php":"ce596dbf00732e85afaab950c3120822","src\\checks\\behaivor\\FastThrow.php":"2dbbce213564c064814bde6fe3cfe098","src\\checks\\behaivor\\InstaBreak.php":"d476212684a5279eb9942eb1da4cc2c3","src\\checks\\behaivor\\ProxyBot.php":"b5e299fb0349eb045551a62de00db4d5","src\\checks\\Check.php":"caa2ddabd5010d2e46a7d62dc32c73eb","src\\checks\\fly\\FlyA.php":"60fb3e06ada7bcd72d14fe7de8c472dc","src\\checks\\fly\\FlyB.php":"5dd1e873a338fb291f1cdc10502b2d0b","src\\checks\\fly\\FlyC.php":"e538df009ccff7a19c11b37a24566de2","src\\checks\\killaura\\KillAuraA.php":"f29c8e808cc52916c8bb9f6b2a22f80a","src\\checks\\killaura\\KillAuraB.php":"3cb6155144a3fc0c1be2840ba77eb40f","src\\checks\\killaura\\KillAuraC.php":"340b9b18adadbef18e5b47c6975156ff","src\\checks\\reach\\ReachA.php":"c6759582c5109a730c8ba0698214a35a","src\\checks\\reach\\ReachB.php":"b131179fcbca99f91ba2b0b16429addb","src\\checks\\scaffold\\ScaffoldA.php":"3fa89053decd2cadc8f35f7adb441dbf","src\\checks\\scaffold\\ScaffoldB.php":"608c04c6912145885ab60067fb283b61","src\\checks\\scaffold\\ScaffoldC.php":"baab336fd12d8f2d07fb0e0882050b48","src\\checks\\speed\\SpeedA.php":"c392fd296226543d45b92d42f7710c8c","src\\checks\\speed\\SpeedB.php":"1fe039d2b533c0203e140dc57d8b7495","src\\command\\ZuriLiteCommand.php":"018b09ba9bbf30c7ced34f4ae0746797","src\\config\\ConfigManager.php":"c0029b75e712a8758e8111887ba94d93","src\\config\\ConfigPaths.php":"c9f7f4c13ce8d4b8066d0443eaf649d3","src\\events\\BanEvent.php":"e8ad7d472b0ba27bcd2217b3f3a89c87","src\\events\\KickEvent.php":"84565e8e96f2e33df118fbed7b2343c1","src\\events\\ServerLagEvent.php":"384e815ffd6fa1f48481389e00fc35d9","src\\listener\\PlayerListener.php":"ba315471e7fd325f99478bfe9a575874","src\\listener\\ServerListener.php":"aca2b1040971679deb9d52c018d11380","src\\player\\IPlayerAPI.php":"bcb2a1c1a53d7aa983ffe4b05e31e5c9","src\\player\\PlayerAPI.php":"d63b3767c44d4eae8db694655494167a","src\\task\\ServerTickTask.php":"507a34ad1cd5dbfcac58492265c91d10","src\\task\\UpdateCheckerAsyncTask.php":"55774356243f01221a03ae37be09b202","src\\utils\\BlockUtil.php":"0274ace4de6d27c4b9d8484303b00154","src\\utils\\CharUtil.php":"1d4285b8eb359d09b2c12ee9d87e5f93","src\\utils\\discord\\Discord.php":"f3479af2a7c0dd411dfc9c63fee8655c","src\\utils\\discord\\DiscordWebhookException.php":"dc4a257ab1ce7076136a8cad5f8c9a98","src\\utils\\discord\\Embed.php":"420cc2cb60ab7d2d334860d9c4bfff27","src\\utils\\discord\\Message.php":"561bf1330b018b8f0f62fe402dea54c1","src\\utils\\discord\\Webhook.php":"0603224815ec47de8a65f406b2973eed","src\\utils\\discord\\WebhookSendTask.php":"2098359fd7419ea8f0357457880e0a32","src\\utils\\forms\\CustomForm.php":"56f63a1869073f8675a4163342742bca","src\\utils\\forms\\Form.php":"ea7f4d8e11bcc00993b89d2bc497e5db","src\\utils\\forms\\FormAPI.php":"d6336166f2aaf6702621012094444200","src\\utils\\forms\\FormSender.php":"05863c53c65a7213389c928cae4ad065","src\\utils\\forms\\ModalForm.php":"77aa94a47e5bee7b97b51c46866ce286","src\\utils\\forms\\SimpleForm.php":"7f65eaa6a3260e89ec6446f53548c556","src\\utils\\InternetAddress.php":"ff409d055668d489f7d0d5a355babfe2","src\\utils\\MathUtil.php":"1d8275c1299778a75597b7a6126fe270","src\\utils\\PermissionManager.php":"9051604161a58dcd0d13032d424dbe20","src\\utils\\ReplaceText.php":"ca72d3ba68687f60a25df265eb104f0d","src\\utils\\Utils.php":"68084914a6a6c92fb3ebda4ea3d18f90","src\\ZuriLiteAC.php":"54671e1793e740fb358395782f5b21b2"}}
{"php":"8.1.25","version":"3.22.0","indent":"\t","lineEnding":"\n","rules":{"align_multiline_comment":{"comment_type":"phpdocs_only"},"array_indentation":true,"array_syntax":{"syntax":"short"},"binary_operator_spaces":{"default":"single_space"},"blank_line_after_namespace":true,"blank_line_after_opening_tag":true,"blank_line_before_statement":{"statements":["declare"]},"braces":{"allow_single_line_closure":false,"position_after_anonymous_constructs":"same","position_after_control_structures":"same","position_after_functions_and_oop_constructs":"same"},"cast_spaces":{"space":"single"},"concat_space":{"spacing":"one"},"declare_strict_types":true,"elseif":true,"global_namespace_import":{"import_constants":true,"import_functions":true,"import_classes":null},"header_comment":{"comment_type":"comment","header":"\r\n ____ _ __ _____\r\n| _ \\ ___ (_) _ __ \/ _| _ _ |_ _| ___ __ _ _ __ ___\r\n| |_) | \/ _ \\ | | | '_ \\ | |_ | | | | | | \/ _ \\ \/ _` | | '_ ` _ \\\r\n| _ < | __\/ | | | | | | | _| | |_| | | | | __\/ | (_| | | | | | | |\r\n|_| \\_\\ \\___| |_| |_| |_| |_| \\__, | |_| \\___| \\__,_| |_| |_| |_|\r\n |___\/\r\n\r\nThis program is free software: you can redistribute it and\/or modify\r\nit under the terms of the GNU Lesser General Public License as published by\r\nthe Free Software Foundation, either version 3 of the License, or\r\n(at your option) any later version.\r\n\r\n@author ReinfyTeam\r\n@link https:\/\/github.com\/ReinfyTeam\/\r\n\r\n","location":"after_open"},"indentation_type":true,"native_function_invocation":{"scope":"namespaced","include":["@all"]},"no_closing_tag":true,"no_empty_phpdoc":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true},"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"no_whitespace_in_blank_line":true,"no_unused_imports":true,"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"alpha"},"phpdoc_line_span":{"property":"single","method":null,"const":null},"phpdoc_trim":true,"phpdoc_trim_consecutive_blank_line_separation":true,"return_type_declaration":{"space_before":"one"},"single_import_per_statement":true,"strict_param":true,"unary_operator_spaces":true},"hashes":{"src\\checks\\autoclick\\AutoClickA.php":"51a73fc991bf6773f4313b154605d46c","src\\checks\\autoclick\\AutoClickB.php":"857e16a051fcab02a8689a504e25b6ad","src\\checks\\autoclick\\AutoClickC.php":"4299517fd2b2246232f6dec2db733cd9","src\\checks\\behaivor\\AntiBot.php":"235089d17202ad71d9f3053700a5b263","src\\checks\\behaivor\\EditionFaker.php":"67fffcda310b71b3709a728f0b9c5e2a","src\\checks\\behaivor\\FastEat.php":"ce596dbf00732e85afaab950c3120822","src\\checks\\behaivor\\FastThrow.php":"2dbbce213564c064814bde6fe3cfe098","src\\checks\\behaivor\\InstaBreak.php":"d476212684a5279eb9942eb1da4cc2c3","src\\checks\\behaivor\\ProxyBot.php":"b5e299fb0349eb045551a62de00db4d5","src\\checks\\Check.php":"caa2ddabd5010d2e46a7d62dc32c73eb","src\\checks\\fly\\FlyA.php":"60fb3e06ada7bcd72d14fe7de8c472dc","src\\checks\\fly\\FlyB.php":"5dd1e873a338fb291f1cdc10502b2d0b","src\\checks\\fly\\FlyC.php":"e538df009ccff7a19c11b37a24566de2","src\\checks\\killaura\\KillAuraA.php":"f29c8e808cc52916c8bb9f6b2a22f80a","src\\checks\\killaura\\KillAuraB.php":"3cb6155144a3fc0c1be2840ba77eb40f","src\\checks\\killaura\\KillAuraC.php":"340b9b18adadbef18e5b47c6975156ff","src\\checks\\reach\\ReachA.php":"c6759582c5109a730c8ba0698214a35a","src\\checks\\reach\\ReachB.php":"b131179fcbca99f91ba2b0b16429addb","src\\checks\\scaffold\\ScaffoldA.php":"3fa89053decd2cadc8f35f7adb441dbf","src\\checks\\scaffold\\ScaffoldB.php":"608c04c6912145885ab60067fb283b61","src\\checks\\scaffold\\ScaffoldC.php":"baab336fd12d8f2d07fb0e0882050b48","src\\checks\\speed\\SpeedA.php":"c392fd296226543d45b92d42f7710c8c","src\\checks\\speed\\SpeedB.php":"1fe039d2b533c0203e140dc57d8b7495","src\\command\\ZuriLiteCommand.php":"018b09ba9bbf30c7ced34f4ae0746797","src\\config\\ConfigManager.php":"c0029b75e712a8758e8111887ba94d93","src\\config\\ConfigPaths.php":"c9f7f4c13ce8d4b8066d0443eaf649d3","src\\events\\BanEvent.php":"e8ad7d472b0ba27bcd2217b3f3a89c87","src\\events\\KickEvent.php":"84565e8e96f2e33df118fbed7b2343c1","src\\events\\ServerLagEvent.php":"384e815ffd6fa1f48481389e00fc35d9","src\\listener\\PlayerListener.php":"ba315471e7fd325f99478bfe9a575874","src\\listener\\ServerListener.php":"aca2b1040971679deb9d52c018d11380","src\\player\\IPlayerAPI.php":"bcb2a1c1a53d7aa983ffe4b05e31e5c9","src\\player\\PlayerAPI.php":"d63b3767c44d4eae8db694655494167a","src\\task\\ServerTickTask.php":"507a34ad1cd5dbfcac58492265c91d10","src\\task\\UpdateCheckerAsyncTask.php":"55774356243f01221a03ae37be09b202","src\\utils\\BlockUtil.php":"0274ace4de6d27c4b9d8484303b00154","src\\utils\\CharUtil.php":"1d4285b8eb359d09b2c12ee9d87e5f93","src\\utils\\discord\\Discord.php":"f3479af2a7c0dd411dfc9c63fee8655c","src\\utils\\discord\\DiscordWebhookException.php":"dc4a257ab1ce7076136a8cad5f8c9a98","src\\utils\\discord\\Embed.php":"420cc2cb60ab7d2d334860d9c4bfff27","src\\utils\\discord\\Message.php":"561bf1330b018b8f0f62fe402dea54c1","src\\utils\\discord\\Webhook.php":"0603224815ec47de8a65f406b2973eed","src\\utils\\discord\\WebhookSendTask.php":"2098359fd7419ea8f0357457880e0a32","src\\utils\\forms\\CustomForm.php":"56f63a1869073f8675a4163342742bca","src\\utils\\forms\\Form.php":"ea7f4d8e11bcc00993b89d2bc497e5db","src\\utils\\forms\\FormAPI.php":"d6336166f2aaf6702621012094444200","src\\utils\\forms\\FormSender.php":"05863c53c65a7213389c928cae4ad065","src\\utils\\forms\\ModalForm.php":"77aa94a47e5bee7b97b51c46866ce286","src\\utils\\forms\\SimpleForm.php":"7f65eaa6a3260e89ec6446f53548c556","src\\utils\\InternetAddress.php":"ff409d055668d489f7d0d5a355babfe2","src\\utils\\MathUtil.php":"1d8275c1299778a75597b7a6126fe270","src\\utils\\PermissionManager.php":"9051604161a58dcd0d13032d424dbe20","src\\utils\\ReplaceText.php":"ca72d3ba68687f60a25df265eb104f0d","src\\utils\\Utils.php":"68084914a6a6c92fb3ebda4ea3d18f90","src\\ZuriLiteAC.php":"54671e1793e740fb358395782f5b21b2","src\\checks\\behaivor\\Phase.php":"1a93d6a943bf15b7be9850bc49118d98"}}
154 changes: 154 additions & 0 deletions src/checks/behaivor/Phase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?php

/*
*
* ____ _ __ _____
* | _ \ ___ (_) _ __ / _| _ _ |_ _| ___ __ _ _ __ ___
* | |_) | / _ \ | | | '_ \ | |_ | | | | | | / _ \ / _` | | '_ ` _ \
* | _ < | __/ | | | | | | | _| | |_| | | | | __/ | (_| | | | | | | |
* |_| \_\ \___| |_| |_| |_| |_| \__, | |_| \___| \__,_| |_| |_| |_|
* |___/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author ReinfyTeam
* @link https://github.com/ReinfyTeam/
*
*
*/

declare(strict_types=1);

namespace ReinfyTeam\ZuriLite\checks\behaivor;

use pocketmine\block\BlockTypeIds;
use pocketmine\event\Event;
use pocketmine\event\player\PlayerMoveEvent;
use pocketmine\math\Vector3;
use ReinfyTeam\ZuriLite\checks\Check;
use ReinfyTeam\ZuriLite\player\PlayerAPI;
use ReinfyTeam\ZuriLite\utils\BlockUtil;
use function in_array;
use function intval;

class Phase extends Check {
public function getName() : string {
return "Phase";
}

public function getSubType() : string {
return "A";
}

public function maxViolations() : int {
return 8;
}

public function checkEvent(Event $event, PlayerAPI $playerAPI) : void {
if ($event instanceof PlayerMoveEvent) {
$player = $event->getPlayer();
$world = $player->getWorld();
if (!$player->isConnected() || !$player->spawned) {
return;
}
$id = $world->getBlock($player->getLocation()->add(0, -1, 0))->getTypeId();
if ($world->getBlock($player->getLocation()->add(0, 1, 0))->isSolid() && $world->getBlock($player->getLocation()->add(0, -1, 0))->isSolid()) {
$skip = [
BlockTypeIds::SAND,
BlockTypeIds::GRAVEL,
BlockTypeIds::ANVIL,
BlockTypeIds::AIR,
BlockTypeIds::TORCH,
BlockTypeIds::ACACIA_SIGN,
BlockTypeIds::ACACIA_WALL_SIGN,
BlockTypeIds::REDSTONE_TORCH,
BlockTypeIds::REDSTONE_WIRE,
BlockTypeIds::SEA_PICKLE,
BlockTypeIds::REDSTONE_REPEATER,
BlockTypeIds::LANTERN,
BlockTypeIds::REDSTONE_COMPARATOR,
BlockTypeIds::BIRCH_WALL_SIGN,
BlockTypeIds::DARK_OAK_WALL_SIGN,
BlockTypeIds::JUNGLE_WALL_SIGN,
BlockTypeIds::OAK_WALL_SIGN,
BlockTypeIds::SPRUCE_WALL_SIGN,
BlockTypeIds::MANGROVE_WALL_SIGN,
BlockTypeIds::CRIMSON_WALL_SIGN,
BlockTypeIds::WARPED_WALL_SIGN,
BlockTypeIds::CHERRY_WALL_SIGN,
BlockTypeIds::ACACIA_SIGN,
BlockTypeIds::ACACIA_WALL_SIGN,
BlockTypeIds::BIRCH_SIGN,
BlockTypeIds::BIRCH_WALL_SIGN,
BlockTypeIds::DARK_OAK_SIGN,
BlockTypeIds::DARK_OAK_WALL_SIGN,
BlockTypeIds::JUNGLE_SIGN,
BlockTypeIds::JUNGLE_WALL_SIGN,
BlockTypeIds::OAK_SIGN,
BlockTypeIds::OAK_WALL_SIGN,
BlockTypeIds::SPRUCE_SIGN,
BlockTypeIds::SPRUCE_WALL_SIGN,
BlockTypeIds::MANGROVE_SIGN,
BlockTypeIds::CRIMSON_SIGN,
BlockTypeIds::WARPED_SIGN,
BlockTypeIds::CHERRY_SIGN,
BlockTypeIds::CHERRY_WALL_SIGN,
BlockTypeIds::GLASS_PANE,
BlockTypeIds::HARDENED_GLASS_PANE,
BlockTypeIds::STAINED_GLASS_PANE,
BlockTypeIds::STAINED_HARDENED_GLASS_PANE,
BlockTypeIds::COBWEB,
BlockTypeIds::BED,
BlockTypeIds::BELL,
BlockTypeIds::CACTUS,
BlockTypeIds::CARPET,
BlockTypeIds::COBBLESTONE_WALL,
BlockTypeIds::ACACIA_FENCE,
BlockTypeIds::OAK_FENCE,
BlockTypeIds::BIRCH_FENCE,
BlockTypeIds::DARK_OAK_FENCE,
BlockTypeIds::JUNGLE_FENCE,
BlockTypeIds::NETHER_BRICK_FENCE,
BlockTypeIds::SPRUCE_FENCE,
BlockTypeIds::WARPED_FENCE,
BlockTypeIds::MANGROVE_FENCE,
BlockTypeIds::CRIMSON_FENCE,
BlockTypeIds::CHERRY_FENCE,
BlockTypeIds::ACACIA_FENCE_GATE,
BlockTypeIds::OAK_FENCE_GATE,
BlockTypeIds::BIRCH_FENCE_GATE,
BlockTypeIds::DARK_OAK_FENCE_GATE,
BlockTypeIds::JUNGLE_FENCE_GATE,
BlockTypeIds::SPRUCE_FENCE_GATE,
BlockTypeIds::WARPED_FENCE_GATE,
BlockTypeIds::MANGROVE_FENCE_GATE,
BlockTypeIds::CRIMSON_FENCE_GATE,
BlockTypeIds::CHERRY_FENCE_GATE,
BlockTypeIds::BEETROOTS,
BlockTypeIds::CAKE,
BlockTypeIds::CARROTS,
BlockTypeIds::FIRE
];
if ($player->isSurvival() && !$playerAPI->isOnCarpet() && !$playerAPI->isOnPlate() && !$playerAPI->isOnDoor() && !$playerAPI->isOnSnow() && !$playerAPI->isOnPlant() && !$playerAPI->isOnAdhesion() && !$playerAPI->isOnStairs() && !$playerAPI->isInLiquid() && !$playerAPI->isInWeb() && !in_array($id, $skip, true) && !BlockUtil::isUnderBlock($event->getTo(), $skip, 0)) {
$this->failed($playerAPI);
$x = intval($player->getLocation()->getX());
$z = intval($player->getLocation()->getZ());
$oldZ = $event->getFrom()->getZ();
$oldX = $event->getFrom()->getX();
$newZ = $event->getTo()->getZ();
$newX = $event->getTo()->getX();
if (($y = intval($player->getWorld()->getHighestBlockAt($x, $z))) > intval($player->getLocation()->getY()) && $oldZ === $newZ && $oldX === $newX) {
$world->loadChunk(intval($newX), intval($newZ)); // the best hack thing to do before player teleports at the bottom of the block.
$world->loadChunk(intval($oldX), intval($oldZ)); // the best hack thing to do before player teleports at the bottom of the block.
$player->teleport(new Vector3($x, $y + 1, $z));
}
$event->cancel();
$this->debug($playerAPI, "x=$x, y=" . intval($player->getLocation()->getY()) . ", z=$z, teleportY=$y");
}
}
}
}
}

0 comments on commit ba6b637

Please sign in to comment.