Created
June 11, 2020 14:38
-
-
Save PJZ9n/5964966a2ea35d840fcf64c1f40be659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onDataPacketReceive(DataPacketReceiveEvent $event) | |
{ | |
$packet = $event->getPacket(); | |
if ($packet instanceof PlayerActionPacket) { | |
$name = $event->getPlayer()->getName(); | |
switch ($packet->action) { | |
case PlayerActionPacket::ACTION_START_BREAK://破壊開始 | |
$this->isBreaking[$name] = true; | |
break; | |
case PlayerActionPacket::ACTION_ABORT_BREAK://破壊停止 | |
case PlayerActionPacket::ACTION_STOP_BREAK://破壊終了 | |
$this->isBreaking[$name] = false; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment