Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor 2019-09-18 13:30:58 +01:00
commit 15694279c7
3 changed files with 5 additions and 17 deletions

View File

@ -23,13 +23,8 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile; namespace pocketmine\entity\projectile;
use pocketmine\block\Block;
use pocketmine\block\BlockLegacyIds;
use pocketmine\event\entity\EntityDamageEvent; use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\ProjectileHitEvent; use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\RayTraceResult;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds; use pocketmine\network\mcpe\protocol\types\entity\EntityLegacyIds;
use pocketmine\world\particle\EndermanTeleportParticle; use pocketmine\world\particle\EndermanTeleportParticle;
use pocketmine\world\sound\EndermanTeleportSound; use pocketmine\world\sound\EndermanTeleportSound;
@ -37,16 +32,6 @@ use pocketmine\world\sound\EndermanTeleportSound;
class EnderPearl extends Throwable{ class EnderPearl extends Throwable{
public const NETWORK_ID = EntityLegacyIds::ENDER_PEARL; public const NETWORK_ID = EntityLegacyIds::ENDER_PEARL;
protected function calculateInterceptWithBlock(Block $block, Vector3 $start, Vector3 $end) : ?RayTraceResult{
if($block->getId() !== BlockLegacyIds::AIR and empty($block->getCollisionBoxes())){
//TODO: remove this once block collision boxes are fixed properly
$pos = $block->getPos();
return AxisAlignedBB::one()->offset($pos->x, $pos->y, $pos->z)->calculateIntercept($start, $end);
}
return parent::calculateInterceptWithBlock($block, $start, $end);
}
protected function onHit(ProjectileHitEvent $event) : void{ protected function onHit(ProjectileHitEvent $event) : void{
$owner = $this->getOwningEntity(); $owner = $this->getOwningEntity();
if($owner !== null){ if($owner !== null){

View File

@ -105,7 +105,9 @@ class ZippedResourcePack implements ResourcePack{
}catch(\RuntimeException $e){ }catch(\RuntimeException $e){
throw new ResourcePackException("Failed to parse manifest.json: " . $e->getMessage(), $e->getCode(), $e); throw new ResourcePackException("Failed to parse manifest.json: " . $e->getMessage(), $e->getCode(), $e);
} }
if(!($manifest instanceof \stdClass)){
throw new ResourcePackException("manifest.json should contain a JSON object, not " . gettype($manifest));
}
if(!self::verifyManifest($manifest)){ if(!self::verifyManifest($manifest)){
throw new ResourcePackException("manifest.json is missing required fields"); throw new ResourcePackException("manifest.json is missing required fields");
} }

View File

@ -34,7 +34,8 @@ class StupidJsonDecodeTest extends TestCase{
["false", false], ["false", false],
["NULL", null], ["NULL", null],
['["\",,\"word","a\",,\"word2",]', ['",,"word', 'a",,"word2', '']], ['["\",,\"word","a\",,\"word2",]', ['",,"word', 'a",,"word2', '']],
['["\",,\"word","a\",,\"word2",""]', ['",,"word', 'a",,"word2', '']] ['["\",,\"word","a\",,\"word2",""]', ['",,"word', 'a",,"word2', '']],
['["Hello,, PocketMine"]', ['Hello,, PocketMine']]
]; ];
} }