mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Merge remote-tracking branch 'origin/mcpe-0.12' into php7
This commit is contained in:
commit
29a5012c02
@ -1691,7 +1691,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
if($this->isCreative()){
|
if($this->isCreative()){
|
||||||
$this->inventory->setHeldItemSlot(0);
|
$this->inventory->setHeldItemSlot(0);
|
||||||
}else{
|
}else{
|
||||||
$this->inventory->setHeldItemSlot(0);
|
$this->inventory->setHeldItemSlot($this->inventory->getHotbarSlotIndex(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
$pk = new PlayStatusPacket();
|
$pk = new PlayStatusPacket();
|
||||||
|
@ -28,5 +28,5 @@ namespace pocketmine\event;
|
|||||||
interface Cancellable{
|
interface Cancellable{
|
||||||
public function isCancelled();
|
public function isCancelled();
|
||||||
|
|
||||||
public function setCancelled($forceCancel = false);
|
public function setCancelled($value = true);
|
||||||
}
|
}
|
||||||
|
@ -872,7 +872,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(count($this->blockCache) > 2048){
|
if(count($this->blockCache) > 2048){
|
||||||
$this->chunkCache = [];
|
$this->blockCache = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2340,7 +2340,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->server->getPluginManager()->callEvent(new SpawnChangeEvent($this, $previousSpawn));
|
$this->server->getPluginManager()->callEvent(new SpawnChangeEvent($this, $previousSpawn));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function requestChunk($x, $z, Player $player, $order = LevelProvider::ORDER_ZXY){
|
public function requestChunk($x, $z, Player $player){
|
||||||
$index = Level::chunkHash($x, $z);
|
$index = Level::chunkHash($x, $z);
|
||||||
if(!isset($this->chunkSendQueue[$index])){
|
if(!isset($this->chunkSendQueue[$index])){
|
||||||
$this->chunkSendQueue[$index] = [];
|
$this->chunkSendQueue[$index] = [];
|
||||||
|
31
src/pocketmine/level/sound/EndermanTeleportSound.php
Normal file
31
src/pocketmine/level/sound/EndermanTeleportSound.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* @author PocketMine Team
|
||||||
|
* @link http://www.pocketmine.net/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace pocketmine\level\sound;
|
||||||
|
|
||||||
|
use pocketmine\math\Vector3;
|
||||||
|
use pocketmine\network\protocol\LevelEventPacket;
|
||||||
|
|
||||||
|
class EndermanTeleportSound extends GenericSound{
|
||||||
|
public function __construct(Vector3 $pos){
|
||||||
|
parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ENDERMAN_TELEPORT);
|
||||||
|
}
|
||||||
|
}
|
@ -43,6 +43,7 @@ class LevelEventPacket extends DataPacket{
|
|||||||
const EVENT_SOUND_BAT_FLY = 1015;
|
const EVENT_SOUND_BAT_FLY = 1015;
|
||||||
const EVENT_SOUND_ZOMBIE_INFECT = 1016;
|
const EVENT_SOUND_ZOMBIE_INFECT = 1016;
|
||||||
const EVENT_SOUND_ZOMBIE_HEAL = 1017;
|
const EVENT_SOUND_ZOMBIE_HEAL = 1017;
|
||||||
|
const EVENT_SOUND_ENDERMAN_TELEPORT = 1018;
|
||||||
|
|
||||||
const EVENT_SOUND_ANVIL_BREAK = 1020;
|
const EVENT_SOUND_ANVIL_BREAK = 1020;
|
||||||
const EVENT_SOUND_ANVIL_USE = 1021;
|
const EVENT_SOUND_ANVIL_USE = 1021;
|
||||||
|
@ -105,14 +105,22 @@ class BinaryStream extends \stdClass{
|
|||||||
$this->buffer .= Binary::writeLInt($v);
|
$this->buffer .= Binary::writeLInt($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShort($signed = true){
|
public function getSignedShort(){
|
||||||
return $signed ? Binary::readSignedShort($this->get(2)) : Binary::readShort($this->get(2));
|
return Binary::readSignedShort($this->get(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function putShort($v){
|
public function putShort($v){
|
||||||
$this->buffer .= Binary::writeShort($v);
|
$this->buffer .= Binary::writeShort($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getShort(){
|
||||||
|
return Binary::readShort($this->get(2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function putSignedShort($v){
|
||||||
|
$this->buffer .= Binary::writeShort($v);
|
||||||
|
}
|
||||||
|
|
||||||
public function getFloat(){
|
public function getFloat(){
|
||||||
return Binary::readFloat($this->get(4));
|
return Binary::readFloat($this->get(4));
|
||||||
}
|
}
|
||||||
@ -188,7 +196,7 @@ class BinaryStream extends \stdClass{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getSlot(){
|
public function getSlot(){
|
||||||
$id = $this->getShort(true);
|
$id = $this->getSignedShort();
|
||||||
|
|
||||||
if($id <= 0){
|
if($id <= 0){
|
||||||
return Item::get(0, 0, 0);
|
return Item::get(0, 0, 0);
|
||||||
|
@ -33,11 +33,11 @@ class ServerKiller extends Thread{
|
|||||||
|
|
||||||
public function run(){
|
public function run(){
|
||||||
sleep($this->time);
|
sleep($this->time);
|
||||||
echo "\nTook to long to stop, server was killed forcefully!\n";
|
echo "\nTook too long to stop, server was killed forcefully!\n";
|
||||||
@\pocketmine\kill(getmypid());
|
@\pocketmine\kill(getmypid());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getThreadName(){
|
public function getThreadName(){
|
||||||
return "Server Killer";
|
return "Server Killer";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user