Added handling for punch-block player action, added block punch particles

This commit is contained in:
Dylan K. Taylor 2017-05-04 21:11:47 +01:00
parent 49eb0eb050
commit 18f1376c65
3 changed files with 8 additions and 0 deletions

View File

@ -2775,6 +2775,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
case PlayerActionPacket::ACTION_START_GLIDE:
case PlayerActionPacket::ACTION_STOP_GLIDE:
break; //TODO
case PlayerActionPacket::ACTION_CONTINUE_BREAK:
$block = $this->level->getBlock($pos);
$this->level->broadcastLevelEvent($pos, LevelEventPacket::EVENT_PARTICLE_PUNCH_BLOCK, $block->getId() | ($block->getDamage() << 8) | ($packet->face << 16));
break;
default:
$this->server->getLogger()->debug("Unhandled/unknown player action type " . $packet->action . " from " . $this->getName());
return false;

View File

@ -71,6 +71,8 @@ class LevelEventPacket extends DataPacket{
const EVENT_PARTICLE_BLOCK_FORCE_FIELD = 2008;
const EVENT_PARTICLE_PUNCH_BLOCK = 2014;
const EVENT_START_RAIN = 3001;
const EVENT_START_THUNDER = 3002;
const EVENT_STOP_RAIN = 3003;

View File

@ -47,6 +47,8 @@ class PlayerActionPacket extends DataPacket{
const ACTION_START_GLIDE = 15;
const ACTION_STOP_GLIDE = 16;
const ACTION_CONTINUE_BREAK = 18;
public $eid;
public $action;
public $x;