Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PMMP 3.19.0 #309

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Slapper
author: jojoe77777
version: 1.6.1
version: 1.7.0
description: Slapper, the NPC plugin for PocketMine-MP
main: slapper\Main
api: 3.13.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to bump the minimum required API version to 3.14.0 since ItemStackWrapper::legacy was added there: pmmp/PocketMine-MP@3.13.1...3.14.0#diff-68d4439663f67995bb26425e333d43bbce3d952bbc1df6f26dcdc1173bad458cR41

mcpe-protocol: [361, 388, 389, 390, 407, 408]
website: https://github.com/jojoe77777/Slapper
mcpe-protocols:
- 431

commands:
slapper:
Expand Down
3 changes: 2 additions & 1 deletion src/slapper/entities/SlapperEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use pocketmine\network\mcpe\protocol\MoveActorAbsolutePacket as MoveEntityAbsolutePacket;
use pocketmine\network\mcpe\protocol\RemoveActorPacket as RemoveEntityPacket;
use pocketmine\network\mcpe\protocol\SetActorDataPacket as SetEntityDataPacket;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\Player;
use pocketmine\utils\UUID;
use slapper\SlapperTrait;
Expand Down Expand Up @@ -58,7 +59,7 @@ protected function sendSpawnPacket(Player $player): void {
$pk2->uuid = UUID::fromRandom();
$pk2->username = $this->getDisplayName($player);
$pk2->position = $this->asVector3()->add(0, static::HEIGHT);
$pk2->item = ItemFactory::get(ItemIds::AIR);
$pk2->item = ItemStackWrapper::legacy(ItemFactory::get(ItemIds::AIR));
$pk2->metadata = [self::DATA_SCALE => [self::DATA_TYPE_FLOAT, 0.0]];

$player->dataPacket($pk2);
Expand Down