mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Added handling for punch-block player action, added block punch particles
This commit is contained in:
parent
49eb0eb050
commit
18f1376c65
@ -2775,6 +2775,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
case PlayerActionPacket::ACTION_START_GLIDE:
|
case PlayerActionPacket::ACTION_START_GLIDE:
|
||||||
case PlayerActionPacket::ACTION_STOP_GLIDE:
|
case PlayerActionPacket::ACTION_STOP_GLIDE:
|
||||||
break; //TODO
|
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:
|
default:
|
||||||
$this->server->getLogger()->debug("Unhandled/unknown player action type " . $packet->action . " from " . $this->getName());
|
$this->server->getLogger()->debug("Unhandled/unknown player action type " . $packet->action . " from " . $this->getName());
|
||||||
return false;
|
return false;
|
||||||
|
@ -71,6 +71,8 @@ class LevelEventPacket extends DataPacket{
|
|||||||
|
|
||||||
const EVENT_PARTICLE_BLOCK_FORCE_FIELD = 2008;
|
const EVENT_PARTICLE_BLOCK_FORCE_FIELD = 2008;
|
||||||
|
|
||||||
|
const EVENT_PARTICLE_PUNCH_BLOCK = 2014;
|
||||||
|
|
||||||
const EVENT_START_RAIN = 3001;
|
const EVENT_START_RAIN = 3001;
|
||||||
const EVENT_START_THUNDER = 3002;
|
const EVENT_START_THUNDER = 3002;
|
||||||
const EVENT_STOP_RAIN = 3003;
|
const EVENT_STOP_RAIN = 3003;
|
||||||
|
@ -47,6 +47,8 @@ class PlayerActionPacket extends DataPacket{
|
|||||||
const ACTION_START_GLIDE = 15;
|
const ACTION_START_GLIDE = 15;
|
||||||
const ACTION_STOP_GLIDE = 16;
|
const ACTION_STOP_GLIDE = 16;
|
||||||
|
|
||||||
|
const ACTION_CONTINUE_BREAK = 18;
|
||||||
|
|
||||||
public $eid;
|
public $eid;
|
||||||
public $action;
|
public $action;
|
||||||
public $x;
|
public $x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user