Permalink
Browse files

Merge branch master

  • Loading branch information...
1 parent 012d46d commit 292a212827eb8b2fef7c0a5b4db86bdf34f9f49b @iksaku iksaku committed May 18, 2016
View
@@ -7,7 +7,7 @@ timings/*
*.txt
*.phar
server.properties
-pocketmine.yml
+/pocketmine.yml
# Common IDEs
.idea/*
@@ -1177,6 +1177,8 @@ public function sendSettings(){
$pk = new AdventureSettingsPacket();
$pk->flags = $flags;
+ $pk->userPermission = 2;
+ $pk->globalPermission = 2;
$this->dataPacket($pk);
}
@@ -75,8 +75,8 @@ function dummy(){
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,22 +43,20 @@ public function getHardness(){
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;
}
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 @@ protected function parseTranslation($text, $onlyPrefix = null){
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 @@ public function decode(){
public function encode(){
$this->reset();
$this->putInt($this->flags);
+ $this->putInt($this->userPermission);
+ $this->putInt($this->globalPermission);
}
}
@@ -30,7 +30,7 @@
/**
* 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 @@ public function encode(){
$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 @@ public function getPluginDescription($file){
$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 @@ public function disablePlugin(Plugin $plugin){
$plugin->setEnabled(false);
}
}
-}
+}

0 comments on commit 292a212

Please sign in to comment.