Merge branch 'next-minor'

This commit is contained in:
Dylan K. Taylor 2020-05-19 21:32:44 +01:00
commit 81dff6d4c5
6 changed files with 5 additions and 15 deletions

View File

@ -93,7 +93,7 @@ class ParticleCommand extends VanillaCommand{
if($sender instanceof Player){
$senderPos = $sender->getPosition();
$world = $senderPos->getWorld();
$world = $senderPos->getWorldNonNull();
$pos = new Vector3(
$this->getRelativeDouble($senderPos->getX(), $sender, $args[1]),
$this->getRelativeDouble($senderPos->getY(), $sender, $args[2], 0, World::Y_MAX),

View File

@ -52,7 +52,7 @@ class SetWorldSpawnCommand extends VanillaCommand{
if(count($args) === 0){
if($sender instanceof Player){
$location = $sender->getPosition();
$world = $location->getWorld();
$world = $location->getWorldNonNull();
$pos = $location->asVector3()->round();
}else{
$sender->sendMessage(TextFormat::RED . "You can only perform this command as a player");

View File

@ -83,7 +83,7 @@ class SpawnpointCommand extends VanillaCommand{
}elseif(count($args) <= 1){
if($sender instanceof Player){
$cpos = $sender->getPosition();
$pos = Position::fromObject($cpos->floor(), $cpos->getWorld());
$pos = Position::fromObject($cpos->floor(), $cpos->getWorldNonNull());
$target->setSpawn($pos);
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.spawnpoint.success", [$target->getName(), round($pos->x, 2), round($pos->y, 2), round($pos->z, 2)]));

View File

@ -63,7 +63,7 @@ class Bow extends Tool{
$baseForce = min((($p ** 2) + $p * 2) / 3, 1);
/** @var ArrowEntity $entity */
$entity = EntityFactory::getInstance()->create(ArrowEntity::class, $location->getWorld(), $nbt, $player, $baseForce >= 1);
$entity = EntityFactory::getInstance()->create(ArrowEntity::class, $location->getWorldNonNull(), $nbt, $player, $baseForce >= 1);
$infinity = $this->hasEnchantment(Enchantment::INFINITY());
if($infinity){

View File

@ -60,7 +60,7 @@ abstract class ProjectileItem extends Item{
Utils::testValidInstance($class, Throwable::class);
/** @var Throwable $projectile */
$projectile = EntityFactory::getInstance()->create($class, $location->getWorld(), $nbt, $player);
$projectile = EntityFactory::getInstance()->create($class, $location->getWorldNonNull(), $nbt, $player);
$projectile->setMotion($projectile->getMotion()->multiply($this->getThrowForce()));
$projectileEv = new ProjectileLaunchEvent($projectile);

View File

@ -300,11 +300,6 @@ parameters:
count: 1
path: ../../../src/inventory/transaction/CraftingTransaction.php
-
message: "#^Parameter \\#2 \\$world of method pocketmine\\\\entity\\\\EntityFactory\\:\\:create\\(\\) expects pocketmine\\\\world\\\\World, pocketmine\\\\world\\\\World\\|null given\\.$#"
count: 1
path: ../../../src/item/Bow.php
-
message: "#^Method pocketmine\\\\item\\\\Item\\:\\:getNamedTag\\(\\) should return pocketmine\\\\nbt\\\\tag\\\\CompoundTag but returns pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\|null\\.$#"
count: 1
@ -325,11 +320,6 @@ parameters:
count: 1
path: ../../../src/item/Item.php
-
message: "#^Parameter \\#2 \\$world of method pocketmine\\\\entity\\\\EntityFactory\\:\\:create\\(\\) expects pocketmine\\\\world\\\\World, pocketmine\\\\world\\\\World\\|null given\\.$#"
count: 1
path: ../../../src/item/ProjectileItem.php
-
message: "#^Method pocketmine\\\\item\\\\enchantment\\\\Enchantment\\:\\:BLAST_PROTECTION\\(\\) should return pocketmine\\\\item\\\\enchantment\\\\Enchantment but returns pocketmine\\\\item\\\\enchantment\\\\Enchantment\\|null\\.$#"
count: 1