Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
3.7.2
Browse files Browse the repository at this point in the history
Merge commit 'b4a8f8391b0fba26ed99bc5de0b3aaedcad4472f' into pmmp_3

# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	src/pocketmine/PocketMine.php
  • Loading branch information
haniokasai committed Apr 18, 2019
2 parents f3ff60b + b4a8f83 commit e17f106
Show file tree
Hide file tree
Showing 30 changed files with 343 additions and 138 deletions.
48 changes: 0 additions & 48 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/api-change-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: API change request
about: Suggest a change, addition or removal to the plugin API
title: ''
labels: ''
assignees: ''

---

<!--- tell us what you want -->
## Description


<!--- explain why you want this and why it's a good idea -->
## Justification


<!--- (optional) describe alternative methods you've explored to achieve your goal -->
## Alternative methods
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
---
name: Bug report
<<<<<<< HEAD
about: Report a bug in PocketMine-MP (not plugins)
=======
about: Unexpected non-crash behaviour (except missing gameplay features)
title: ''
labels: ''
assignees: ''
>>>>>>> b4a8f8391b0fba26ed99bc5de0b3aaedcad4472f

---

### Issue description
<<<<<<< HEAD
<!---
THIS ISSUE TRACKER IS FOR BUG REPORTING, NOT FOR HELP & SUPPORT. If you need help, use the links below.
- http://pmmp.readthedocs.io/en/rtfd/ - Documentation
Expand All @@ -22,15 +30,22 @@ Please do not create issues for missing/un-implemented gameplay features - they
<!--- Write a short description about the issue -->

<!--- If you are reporting a regression or unexpected behaviour, please include the below information: -->
=======

>>>>>>> b4a8f8391b0fba26ed99bc5de0b3aaedcad4472f
- Expected result: What were you expecting to happen?
- Actual result: What actually happened?

### Steps to reproduce the issue
<<<<<<< HEAD
<!--- help us find the problem by adding steps to reproduce the issue -->
=======
>>>>>>> b4a8f8391b0fba26ed99bc5de0b3aaedcad4472f
1. ...
2. ...

### OS and versions
<<<<<<< HEAD
<!--- use the 'version' command in PocketMine-MP
NOTE: LATEST is not a valid version. PocketMine-MP version should include Jenkins build number and/or git commit hash.
Expand All @@ -40,11 +55,16 @@ NO support whatsoever will be provided for third-party modified variants of Pock
Note that 32-bit platforms are no longer supported by PocketMine-MP and issues concerning 32-bit platforms will be closed.
-->
* PocketMine-MP: <!-- LATEST IS NOT A VALID VERSION -->
=======
<!-- try the `version` command | LATEST IS NOT A VALID VERSION -->
* PocketMine-MP:
>>>>>>> b4a8f8391b0fba26ed99bc5de0b3aaedcad4472f
* PHP:
* Server OS:
* Game version: PE/Win10 (delete as appropriate)

### Plugins
<<<<<<< HEAD
- Test on a clean server without plugins: is the issue reproducible without any plugins loaded?

If the issue is **not** reproducible without plugins:
Expand All @@ -57,3 +77,15 @@ If the issue is **not** reproducible without plugins:
- Please use gist or anything else to add other files and add links here

* ...
=======
<!--- use the `plugins` command and paste the output below -->

- If you remove all plugins, does the issue still occur?
- If the issue is **not** reproducible without plugins:
- Have you asked for help on our forums before creating an issue?
- Can you provide sample, *minimal* reproducing code for the issue? If so, paste it in the bottom section

### Crashdump, backtrace or other files
<!--- Submit crashdumps at https://crash.pmmp.io and paste a link -->
<!--- Use gist or anything else to add other files and add links here -->
>>>>>>> b4a8f8391b0fba26ed99bc5de0b3aaedcad4472f
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Crash
about: Report a crash in PocketMine-MP (not plugins)
title: Server crashed
labels: ''
assignees: ''

---

<!--- submit crashdump files to https://crash.pmmp.io -->
<!--- or, copy the data between ===BEGIN CRASH DUMP=== and ===END CRASH DUMP and paste it on a site like https://pastebin.com -->
Link to crashdump:

<!--- write additional information about the crash to help us find the problem -->
### Additional comments (optional)
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/help---support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Help & support
about: We don't accept support requests here. Try the links on the README.
title: ''
labels: Support request
assignees: ''

---

We don't accept support requests on the issue tracker. Please try the following links instead:

Documentation: http://pmmp.rtfd.io
Forums: https://forums.pmmp.io
Discord: https://discord.gg/bge7dYQ
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/security-dos-vulnerability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Security/DoS vulnerability
about: 'Bug or exploit that can be used to attack servers (hint: don''t report it
on a public issue tracker)'
title: ''
labels: 'Auto: Spam'
assignees: ''

---

Please DO NOT report security vulnerabilities here.
Instead, send an email to [email protected] or contact a developer directly, IN PRIVATE.
6 changes: 5 additions & 1 deletion .github/support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ supportLabel: "Support request"
# Comment to post on issues marked as support requests. Add a link
# to a support page, or set to `false` to disable
supportComment: >
This issue tracker is not a support forum. Please use the [forums](https://forums.pmmp.io) for support.
Thanks, but this issue tracker not intended for support requests. Please read the guidelines on [submitting an issue](https://github.com/pmmp/PocketMine-MP/blob/master/CONTRIBUTING.md#creating-an-issue).
[Docs](https://pmmp.rtfd.io) | [Discord](https://discord.gg/bge7dYQ) | [Forums](https://forums.pmmp.io)
# Whether to close issues marked as support requests
close: true
# Whether to lock issues marked as support requests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ server.properties
/pocketmine.yml
memory_dumps/*
resource_packs/
server.lock

# Common IDEs
.idea/
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ If you don't find what you're looking for there, [talk to a human](#discussion).

### Discussion
- [Forums](https://forums.pmmp.io/)
- [Community Discord](https://discord.gg/bge7dYQ)

### Plugins
There are a very wide range of already-written plugins available which you can use to customise your server. Check out [Poggit](https://poggit.pmmp.io), or just search GitHub.

### For developers
* [Latest API documentation](https://jenkins.pmmp.io/job/PocketMine-MP-doc/doxygen/) - Doxygen documentation generated from development
* [DevTools](https://github.com/pmmp/PocketMine-DevTools/) - A development tools plugin for creating plugins.
* [DevTools](https://github.com/pmmp/PocketMine-DevTools/) - Development tools plugin for creating plugins
* [ExamplePlugin](https://github.com/pmmp/ExamplePlugin/) - Example plugin demonstrating some basic API features

### Can I contribute?
Yes you can! Contributions are welcomed provided that they comply with our [Contributing Guidelines](CONTRIBUTING.md). Please ensure you read the relevant sections of the guidelines carefully before making a Pull Request or opening an Issue.
Expand All @@ -27,6 +29,12 @@ Yes you can! Contributions are welcomed provided that they comply with our [Cont

**Note: Please avoid development builds unless there is no other alternative for what you need.** Development builds are subject to changes at any time without notice, and it is likely that your server or plugins might break without warning.

### Donate
Donations help support the development of the project and pay for our expenses.
- Bitcoin Cash (BCH): `qz9p8dqkv0r7aahdatu5uewqfkvstrglv58f8yle07`
- Bitcoin (BTC): `1PVAyDJ2g7kcjCxAC3C89oxpV2ZYcLad8T`
- [Patreon](https://www.patreon.com/pocketminemp)

## Licensing information

This program is free software: you can redistribute it and/or modify
Expand Down
8 changes: 4 additions & 4 deletions doxygen.conf → doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,9 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.

INPUT = ./src \
./vendor/pocketmine \
./README.md
INPUT = ../src \
../vendor/pocketmine \
./index.md

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -881,7 +881,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE = ./README.md
USE_MDFILE_AS_MAINPAGE = ./index.md

#---------------------------------------------------------------------------
# Configuration options related to source browsing
Expand Down
10 changes: 10 additions & 0 deletions doxygen/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## PocketMine-MP API Documentation

This site contains auto-generated API documentation for PocketMine-MP (and dependencies which are not outsourced). Documentation here is regenerated for every release.

This site can be accessed via https://apidoc.pmmp.io.

### Additional developer resources
- [DevTools](https://github.com/pmmp/PocketMine-DevTools/) - Development tools plugin for creating plugins
- [ExamplePlugin](https://github.com/pmmp/ExamplePlugin/) - Example plugin demonstrating some basic API features
- [DeveloperDocs](https://github.com/pmmp/DeveloperDocs/) - Reference, guides and specifications for the PocketMine-MP API
4 changes: 3 additions & 1 deletion src/pocketmine/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,7 @@ protected function completeLoginSequence(){
/** @var float[] $pos */
$pos = $this->namedtag->getListTag("Pos")->getAllValues();
$this->level->registerChunkLoader($this, ((int) floor($pos[0])) >> 4, ((int) floor($pos[2])) >> 4, true);
$this->usedChunks[Level::chunkHash(((int) floor($pos[0])) >> 4, ((int) floor($pos[2])) >> 4)] = false;

parent::__construct($this->level, $this->namedtag);
$ev = new PlayerLoginEvent($this, "Plugin reason");
Expand Down Expand Up @@ -2968,7 +2969,8 @@ public function handleBlockEntityData(BlockEntityDataPacket $packet) : bool{
$t = $this->level->getTile($pos);
if($t instanceof Spawnable){
$nbt = new NetworkLittleEndianNBTStream();
$compound = $nbt->read($packet->namedtag);
$_ = 0;
$compound = $nbt->read($packet->namedtag, false, $_, 512);

if(!($compound instanceof CompoundTag)){
throw new \InvalidArgumentException("Expected " . CompoundTag::class . " in block entity NBT, got " . (is_object($compound) ? get_class($compound) : gettype($compound)));
Expand Down
10 changes: 9 additions & 1 deletion src/pocketmine/PocketMine.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
use pocketmine\wizard\SetupWizard;

const NAME = "PocketMine-MP";
const BASE_VERSION = "3.7.1";
const BASE_VERSION = "3.7.2";
const IS_DEVELOPMENT_BUILD = false;
const BUILD_NUMBER = 0;

Expand Down Expand Up @@ -182,6 +182,14 @@ function check_platform_dependencies(){
mkdir(\pocketmine\DATA, 0777, true);
}

define('pocketmine\LOCK_FILE_PATH', \pocketmine\DATA . 'server.lock');
define('pocketmine\LOCK_FILE', fopen(\pocketmine\LOCK_FILE_PATH, "cb"));
if(!flock(\pocketmine\LOCK_FILE, LOCK_EX | LOCK_NB)){
critical_error("Another " . \pocketmine\NAME . " instance is already using this folder (" . realpath(\pocketmine\DATA) . ").");
critical_error("Please stop the other server first before running a new one.");
exit(1);
}

//Logger has a dependency on timezone
$tzError = Timezone::init();

Expand Down
15 changes: 12 additions & 3 deletions src/pocketmine/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1078,9 +1078,19 @@ public function loadLevel(string $name) : bool{

return false;
}
/**
* @var LevelProvider $provider
* @see LevelProvider::__construct()
*/
$provider = new $providerClass($path);
try{
GeneratorManager::getGenerator($provider->getGenerator(), true);
}catch(\InvalidArgumentException $e){
$this->logger->error($this->getLanguage()->translateString("pocketmine.level.loadError", [$name, "Unknown generator \"" . $provider->getGenerator() . "\""]));
return false;
}

/** @see LevelProvider::__construct() */
$level = new Level($this, $name, new $providerClass($path));
$level = new Level($this, $name, $provider);

$this->levels[$level->getId()] = $level;

Expand Down Expand Up @@ -1662,7 +1672,6 @@ public function __construct(\ClassLoader $autoloader, \AttachableThreadedLogger
Entity::init();
Tile::init();
BlockFactory::init();
BlockFactory::registerStaticRuntimeIdMappings();
Enchantment::init();
ItemFactory::init();
Item::initCreativeItems();
Expand Down
3 changes: 2 additions & 1 deletion src/pocketmine/block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use pocketmine\math\Vector3;
use pocketmine\metadata\Metadatable;
use pocketmine\metadata\MetadataValue;
use pocketmine\network\mcpe\protocol\types\RuntimeBlockMapping;
use pocketmine\Player;
use pocketmine\plugin\Plugin;
use function array_merge;
Expand Down Expand Up @@ -117,7 +118,7 @@ public function getItemId() : int{
* @return int
*/
public function getRuntimeId() : int{
return BlockFactory::toStaticRuntimeId($this->getId(), $this->getDamage());
return RuntimeBlockMapping::toStaticRuntimeId($this->getId(), $this->getDamage());
}

/**
Expand Down
Loading

0 comments on commit e17f106

Please sign in to comment.