Skip to content

Instantly share code, notes, and snippets.

@PJZ9n
Created June 11, 2020 14:38
Show Gist options
  • Save PJZ9n/5964966a2ea35d840fcf64c1f40be659 to your computer and use it in GitHub Desktop.
Save PJZ9n/5964966a2ea35d840fcf64c1f40be659 to your computer and use it in GitHub Desktop.
<?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