mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 22:45:28 +00:00
Merge branch master
This commit is contained in:
parent
012d46dfd8
commit
292a212827
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,7 +7,7 @@ timings/*
|
||||
*.txt
|
||||
*.phar
|
||||
server.properties
|
||||
pocketmine.yml
|
||||
/pocketmine.yml
|
||||
|
||||
# Common IDEs
|
||||
.idea/*
|
||||
|
@ -1177,6 +1177,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
|
||||
$pk = new AdventureSettingsPacket();
|
||||
$pk->flags = $flags;
|
||||
$pk->userPermission = 2;
|
||||
$pk->globalPermission = 2;
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
|
@ -75,8 +75,8 @@ namespace pocketmine {
|
||||
const VERSION = "1.6dev";
|
||||
const API_VERSION = "2.0.0";
|
||||
const CODENAME = "[REDACTED]";
|
||||
const MINECRAFT_VERSION = "v0.14.0.0 alpha";
|
||||
const MINECRAFT_VERSION_NETWORK = "0.14.0.0";
|
||||
const MINECRAFT_VERSION = "v0.14.2.0 alpha";
|
||||
const MINECRAFT_VERSION_NETWORK = "0.14.2.0";
|
||||
|
||||
/*
|
||||
* Startup code. Do not look at it, it may harm you.
|
||||
|
@ -22,51 +22,27 @@
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\Tool;
|
||||
use pocketmine\level\Level;
|
||||
|
||||
class GlowingRedstoneOre extends Solid{
|
||||
class GlowingRedstoneOre extends RedstoneOre{
|
||||
|
||||
protected $id = self::GLOWING_REDSTONE_ORE;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
}
|
||||
|
||||
public function getHardness(){
|
||||
return 15;
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
return "Glowing Redstone Ore";
|
||||
}
|
||||
|
||||
public function getToolType(){
|
||||
return Tool::TYPE_PICKAXE;
|
||||
}
|
||||
|
||||
public function getLightLevel(){
|
||||
return 9;
|
||||
}
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_SCHEDULED or $type === Level::BLOCK_UPDATE_RANDOM){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::REDSTONE_ORE, $this->meta), false, false, true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::REDSTONE_ORE, $this->meta), false, false);
|
||||
|
||||
return Level::BLOCK_UPDATE_WEAK;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::REDSTONE_DUST, 0, mt_rand(4, 5)],
|
||||
];
|
||||
}else{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -43,7 +43,7 @@ class RedstoneOre extends Solid{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta), false, true);
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta));
|
||||
|
||||
return Level::BLOCK_UPDATE_WEAK;
|
||||
}
|
||||
@ -51,14 +51,12 @@ class RedstoneOre extends Solid{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getToolType(){
|
||||
return Tool::TYPE_PICKAXE;
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= Tool::TIER_GOLD){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::REDSTONE_DUST, 0, mt_rand(4, 5)],
|
||||
];
|
||||
|
@ -139,7 +139,13 @@ class BaseLang{
|
||||
for($i = 0; $i < $len; ++$i){
|
||||
$c = $text{$i};
|
||||
if($replaceString !== null){
|
||||
if((ord($c) >= 0x30 and ord($c) <= 0x39) or (ord($c) >= 0x41 and ord($c) <= 0x5a) or (ord($c) >= 0x61 and ord($c) <= 0x7a) or $c === "."){
|
||||
$ord = ord($c);
|
||||
if(
|
||||
($ord >= 0x30 and $ord <= 0x39) // 0-9
|
||||
or ($ord >= 0x41 and $ord <= 0x5a) // A-Z
|
||||
or ($ord >= 0x61 and $ord <= 0x7a) or // a-z
|
||||
$c === "." or $c === "-"
|
||||
){
|
||||
$replaceString .= $c;
|
||||
}else{
|
||||
if(($t = $this->internalGet(substr($replaceString, 1))) !== null and ($onlyPrefix === null or strpos($replaceString, $onlyPrefix) === 1)){
|
||||
|
@ -28,6 +28,8 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
const NETWORK_ID = Info::ADVENTURE_SETTINGS_PACKET;
|
||||
|
||||
public $flags;
|
||||
public $userPermission;
|
||||
public $globalPermission;
|
||||
|
||||
public function decode(){
|
||||
|
||||
@ -36,6 +38,8 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->flags);
|
||||
$this->putInt($this->userPermission);
|
||||
$this->putInt($this->globalPermission);
|
||||
}
|
||||
|
||||
}
|
@ -30,7 +30,7 @@ interface Info{
|
||||
/**
|
||||
* Actual Minecraft: PE protocol version
|
||||
*/
|
||||
const CURRENT_PROTOCOL = 45;
|
||||
const CURRENT_PROTOCOL = 60;
|
||||
|
||||
const LOGIN_PACKET = 0x8f;
|
||||
const PLAY_STATUS_PACKET = 0x90;
|
||||
|
@ -38,6 +38,7 @@ class StartGamePacket extends DataPacket{
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $unknown;
|
||||
|
||||
public function decode(){
|
||||
|
||||
@ -56,7 +57,10 @@ class StartGamePacket extends DataPacket{
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte(1);
|
||||
$this->putByte(1);
|
||||
$this->putByte(0);
|
||||
$this->putString($this->unknown);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class PluginManager{
|
||||
protected $defaultPermsOp = [];
|
||||
|
||||
/**
|
||||
* @var Permissible[]
|
||||
* @var Permissible[][]
|
||||
*/
|
||||
protected $permSubs = [];
|
||||
|
||||
|
@ -94,9 +94,13 @@ class ScriptPluginLoader implements PluginLoader{
|
||||
$insideHeader = true;
|
||||
}
|
||||
|
||||
if(preg_match("/^[ \t]+\\*[ \t]+@([a-zA-Z]+)[ \t]+(.*)$/", $line, $matches) > 0){
|
||||
if(preg_match("/^[ \t]+\\*[ \t]+@([a-zA-Z]+)([ \t]+(.*))?$/", $line, $matches) > 0){
|
||||
$key = $matches[1];
|
||||
$content = trim($matches[2]);
|
||||
$content = trim($matches[3] ?? "");
|
||||
|
||||
if($key === "notscript"){
|
||||
return null;
|
||||
}
|
||||
|
||||
$data[$key] = $content;
|
||||
}
|
||||
@ -157,4 +161,4 @@ class ScriptPluginLoader implements PluginLoader{
|
||||
$plugin->setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user