mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-16 06:15:09 +00:00
Compare commits
295 Commits
api/2.1.0
...
api/3.0.0-
Author | SHA1 | Date | |
---|---|---|---|
c21197ef17 | |||
0a8826b21f | |||
dac6c49bce | |||
9f7dc32650 | |||
9195375af4 | |||
c6cf3458de | |||
e2cdd9eddc | |||
f933107af0 | |||
408f63f8fa | |||
68998bac48 | |||
2ff565afe5 | |||
20c7e51077 | |||
89216c3bd4 | |||
834dc343b0 | |||
91907485b4 | |||
ee523eb5cc | |||
f2f51a88e5 | |||
abffe1297d | |||
f8b9a13440 | |||
5c281c6435 | |||
1908ed5812 | |||
2d5567d9dd | |||
b3beb9f71d | |||
14a0ff5caa | |||
119e458ac8 | |||
01a07a0b09 | |||
903534572d | |||
8a3c30ee7e | |||
91fd99d76a | |||
27f2aec160 | |||
8f9c52507a | |||
5a12f40074 | |||
b89a17ffe2 | |||
6dc6e32656 | |||
d430ad50be | |||
06de85fd33 | |||
ffadc34691 | |||
f5e39ea9ad | |||
595fffc432 | |||
c4d0fdb436 | |||
2a4fb93a92 | |||
50bf671c28 | |||
4a2b83ab47 | |||
f332d3647c | |||
0c35c16727 | |||
7c8586684e | |||
6999388dd1 | |||
662652f745 | |||
987d492c1c | |||
80920a1673 | |||
613226c661 | |||
06dd410340 | |||
cf83143bbd | |||
28baae8154 | |||
7701555005 | |||
38937fc4cc | |||
bf6e8db941 | |||
06c399fa05 | |||
82cf38d46c | |||
eb1ec2df05 | |||
17102058ca | |||
f881cea8e0 | |||
8beefabbbc | |||
4cca3b866a | |||
0535acf211 | |||
478a62e17b | |||
9661d845bb | |||
69d6d24a38 | |||
713ee753e4 | |||
740a8ad436 | |||
ccef0455ab | |||
755f4d232f | |||
09a6776674 | |||
661f17b6e0 | |||
77456702e9 | |||
75a38699e2 | |||
9c36e0cd1c | |||
21f5be27b6 | |||
4dd0a13511 | |||
904c52bb0f | |||
3ab9722a9f | |||
08ed2cd353 | |||
06f0534d65 | |||
b22232730e | |||
50b9034e16 | |||
8bf8e2e22f | |||
52748fcf64 | |||
19572b8c51 | |||
496061ba54 | |||
2488d6e957 | |||
8ea03524ff | |||
e4aa3d72fe | |||
26fc21d56c | |||
e4c889ae16 | |||
7de7593b89 | |||
162b993e65 | |||
cb187be1a1 | |||
ab943a0462 | |||
2290c33143 | |||
9869aaa46a | |||
bcf049a660 | |||
0114cb8399 | |||
b72218ac5b | |||
6b9c2b961b | |||
8ba0b49022 | |||
74c9ed04a0 | |||
b28e38ab26 | |||
4577f3ee22 | |||
3b82a5fddf | |||
2d3b8845fd | |||
9004417456 | |||
946d301bc7 | |||
39c3b16e49 | |||
3daa2723bf | |||
085d1a1359 | |||
3bbf2c245a | |||
8f797442b3 | |||
57f3f9b4ed | |||
058468104a | |||
b566c4e609 | |||
0428894cc6 | |||
41d36e4e7a | |||
4bf8f00b0f | |||
6e87a48100 | |||
441961b199 | |||
92b85e0f15 | |||
6fbb9b6083 | |||
67940ad6ab | |||
0a3fd8737a | |||
8902992473 | |||
2e865a3af9 | |||
ed13f7f8e7 | |||
02ddcef24e | |||
3c9db45cf8 | |||
16e7eaaaa4 | |||
4ace4b9542 | |||
86dc8c48b9 | |||
aaf549a469 | |||
ad0553fbf8 | |||
d8908676ac | |||
598e7aac8f | |||
07f18d8f6c | |||
1cb96d24ce | |||
40600be4c1 | |||
096836faaa | |||
b68df2da5c | |||
e2dc1a3bc6 | |||
8a29e77f5e | |||
0bd7ea211d | |||
55791e0819 | |||
69369c8998 | |||
c36fc8c027 | |||
7e15c6638a | |||
88e36eda59 | |||
40d1394e3c | |||
69061ba4ad | |||
e85d6d134e | |||
0e10a149ef | |||
736ec6edac | |||
25b9581254 | |||
b263d81baf | |||
0c3780de40 | |||
850afed2c6 | |||
efc6d429f6 | |||
b082bec150 | |||
2e1f572356 | |||
18ebc64ea0 | |||
4f4bdea104 | |||
c556ec84a2 | |||
a3a07ca847 | |||
227e1c42ea | |||
cb55cefa44 | |||
10c8632417 | |||
942b35ee4c | |||
440d66bd59 | |||
747aae94ec | |||
6d2a57f83a | |||
a63020d6e5 | |||
e2bbb76900 | |||
f180167955 | |||
1eaf7c5431 | |||
3672d60bf4 | |||
7e1557dc94 | |||
3848f6f39c | |||
00158d4805 | |||
3dcfa7b3ce | |||
acd141e5aa | |||
8ee3723588 | |||
29c27993ad | |||
8bdfe0d297 | |||
669af6f7b3 | |||
f4065dd411 | |||
a99d7f93d9 | |||
363b24c663 | |||
9e938baea0 | |||
fb0c8c2c97 | |||
772abc609d | |||
5feff79875 | |||
7190f6a4ca | |||
6a066cdf31 | |||
77b3cd71a3 | |||
5443b10257 | |||
300a3d5ccd | |||
17a418f133 | |||
e2b143a7cf | |||
a1c3ca18ce | |||
8c772fe671 | |||
c4d4277a6c | |||
2987c7a80c | |||
4063bc4ffb | |||
90957cd908 | |||
50d59619a6 | |||
8db4b7116c | |||
4b21e35d6e | |||
76a1165c0e | |||
35fbf78a77 | |||
b86185519a | |||
3433a931c1 | |||
d9eb767420 | |||
71704228a9 | |||
a122ea9e75 | |||
a8694dcbf7 | |||
1ec83420c8 | |||
bb7263beac | |||
d84f990574 | |||
61e8828f94 | |||
aa8a13c4a3 | |||
0380c78926 | |||
2930cf80b4 | |||
5ce6c6227f | |||
5dca11dafb | |||
252d1988dc | |||
bd722bb85f | |||
e1253db37c | |||
175dd0efa6 | |||
146f5a567f | |||
e790573f2e | |||
6ea45c5c4a | |||
544d99f161 | |||
42b78cfba2 | |||
99e8bcf26b | |||
6224f0cdf6 | |||
5e6d452678 | |||
ae6e0773ef | |||
cc9736314e | |||
adabd7ef65 | |||
5d16ecc003 | |||
288bf0fe6c | |||
e92052c2ab | |||
25560a52b0 | |||
d625a20934 | |||
a0cda3b45a | |||
d74486a64a | |||
aafe0c4f69 | |||
4674d34469 | |||
43b3b41039 | |||
d37afde0dc | |||
fecbdc5ff2 | |||
4d121f7d84 | |||
6a8976c534 | |||
74e31fe712 | |||
28c3a882f8 | |||
ebd2830770 | |||
2e540300d8 | |||
fb74d93e00 | |||
6696b7ed52 | |||
35b3259053 | |||
577dbbce1f | |||
ce289cbe25 | |||
756760a2f0 | |||
d6629d6843 | |||
43a36dba40 | |||
5025b4aba1 | |||
dd01407dd4 | |||
d70be232d8 | |||
ecabe945e6 | |||
2b46794ca2 | |||
0be8fa4157 | |||
b1ce19856f | |||
252afde06f | |||
039d6a488a | |||
15f7cfb4f7 | |||
4c49db6036 | |||
60260a294b | |||
18c0567944 | |||
367fa41161 | |||
439f418b0d | |||
fa5624f87e | |||
c79077cbed | |||
995d0847f9 | |||
aa713c4e4a | |||
3b3abab3ad | |||
5f5f71cfbe | |||
363431dac2 | |||
1b543b2c16 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,7 +11,7 @@ server.properties
|
|||||||
memoryDump_*/*
|
memoryDump_*/*
|
||||||
|
|
||||||
# Common IDEs
|
# Common IDEs
|
||||||
.idea/*
|
.idea/
|
||||||
nbproject/*
|
nbproject/*
|
||||||
|
|
||||||
# Windows image file caches
|
# Windows image file caches
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -11,3 +11,6 @@
|
|||||||
[submodule "tests/preprocessor"]
|
[submodule "tests/preprocessor"]
|
||||||
path = tests/preprocessor
|
path = tests/preprocessor
|
||||||
url = https://github.com/pmmp/preprocessor.git
|
url = https://github.com/pmmp/preprocessor.git
|
||||||
|
[submodule "tests/plugins/PocketMine-DevTools"]
|
||||||
|
path = tests/plugins/PocketMine-DevTools
|
||||||
|
url = https://github.com/pmmp/PocketMine-DevTools.git
|
||||||
|
@ -4,15 +4,12 @@ php:
|
|||||||
- 7.0
|
- 7.0
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- mkdir plugins
|
|
||||||
- wget -O plugins/DevTools.phar https://github.com/PocketMine/DevTools/releases/download/v1.11.0/DevTools_v1.11.0.phar
|
|
||||||
- pecl install channel://pecl.php.net/pthreads-3.1.6
|
- pecl install channel://pecl.php.net/pthreads-3.1.6
|
||||||
- pecl install channel://pecl.php.net/weakref-0.3.2
|
- pecl install channel://pecl.php.net/weakref-0.3.3
|
||||||
- echo | pecl install channel://pecl.php.net/yaml-2.0.0
|
- echo | pecl install channel://pecl.php.net/yaml-2.0.0
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./tests/lint.sh && ./tests/run.sh
|
- ./tests/travis.sh
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
#webhooks: http://n.tkte.ch/h/214/wsNvmG43-ncxUVRrFPwSM-r0
|
|
||||||
|
193
CONTRIBUTING.md
193
CONTRIBUTING.md
@ -2,69 +2,103 @@
|
|||||||
|
|
||||||
# PocketMine-MP Contribution Guidelines
|
# PocketMine-MP Contribution Guidelines
|
||||||
|
|
||||||
You must follow these guidelines if you wish to contribute to the PocketMine-MP code base, or participate in issue tracking.
|
|
||||||
|
|
||||||
## I have a question
|
|
||||||
* For questions, please refer to the _#pmmp_ or _#pocketmine_ IRC channel on Freenode. There is a [WebIRC](http://webchat.freenode.net?channels=pmmp,pocketmine&uio=d4) if you do not want to install an IRC client.
|
|
||||||
* You can ask directly to _[@PocketMine](https://twitter.com/PocketMine)_ in Twitter, but don't expect an immediate reply.
|
|
||||||
* You may use our [Forum](https://forums.pmmp.io) to ask questions.
|
|
||||||
* We do not accept questions or support requests in our issue tracker.
|
|
||||||
|
|
||||||
## Creating an Issue
|
## Creating an Issue
|
||||||
* First, use the [Issue Search](https://github.com/pmmp/PocketMine-MP/search?ref=cmdform&type=Issues) to check if anyone has reported it. Check also closed issues, as an issue you think is valid may actually be invalid.
|
- If you are reporting a bug:
|
||||||
* If an issue has been _fixed_ and closed, create another issue.
|
- **make sure that you are using the latest supported version** before opening an issue.
|
||||||
* If your issue is related to a plugin, do **not** report here. Contact the plugin's original author instead.
|
- **test it on a clean test server, WITHOUT PLUGINS**, to see if the issue still occurs. If not then it may be a plugin issue. Please also indicate the result of such tests.
|
||||||
* **Support requests are not bugs.** Issues such as "How do I do this" are not bugs and are closed as soon as a collaborator spots it. They are referred to our Forum to seek assistance. Please refer to the section [I have a quesetion](#i-have-a-question) instead.
|
|
||||||
* **No generic titles** such as "Question", "Help", "Crash Report" etc.
|
- [Search the issue tracker](https://github.com/pmmp/PocketMine-MP/issues?utf8=%E2%9C%93&q=is%3Aissue) to check if anyone has already reported it, to avoid needlessly creating duplicate issues. Make sure you also check closed issues, as an issue you think is valid may already have been resolved.
|
||||||
* If you just got a crash report but you don't understand it, please look for a line starting with `Message`. It summarizes the bug.
|
|
||||||
* Information must be provided in the issue body, not in the title. No tags like `[BUG]` are allowed in the title, including `[SOLVED]` for solved issues.
|
- If your issue is related to a plugin, **do not report here, contact the plugin's original author** instead.
|
||||||
* Similarly, no generic issue reports. For bugs, it is the issue author's responsibility to provide us an issue that is **trackable, debuggable, reproducible, reported professionally and is an actual bug**. If you do not provide us with a summary or instructions on how to reproduce the issue, it is a support request until the actual bug has been found and therefore the issue is closed.
|
|
||||||
* In simple words, if your issue does not appear to be a bug or a feature request, or if the issue cannot be properly confirmed to be valid, the issue will be closed until further information is provided.
|
- **Support requests are not bugs.** Issues such as "How do I do this" are not bugs and will be closed. If you need help, please see [here](README.md#discussion) and do not misuse our issue tracker.
|
||||||
* To express appreciation, objection, confusion or other supported reactions on pull requests, issues or comments on them, use GitHub [reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) rather than posting an individual comment with an emoji only. This helps keeping the issue/pull rqeuest conversation clean and readable.
|
|
||||||
* If your issue is related to the Pocketmine-MP website, forums, etc., please [talk to a human directly](#i-have-a-question).
|
- **No generic titles** such as "Question", "Help", "Crash Report" etc. A good issue report provides a quick summary in the title. If you just got a crash report but you don't understand it, please look for a line starting with `Message`. It summarizes the bug.
|
||||||
|
|
||||||
|
- Information must be provided in the issue body, not in the title. No tags like `[BUG]` are allowed in the title, including `[SOLVED]` for solved issues.
|
||||||
|
|
||||||
|
- Similarly, no generic issue reports. For bugs, it is the issue author's responsibility to provide us an issue that is **trackable, debuggable, reproducible, reported professionally and is an actual bug**. If you do not provide us with a summary or instructions on how to reproduce the issue, it will be treated as spam and will therefore be closed.
|
||||||
|
<br>In simple words, if your issue does not appear to be a bug or a feature request, or if the issue cannot be properly confirmed to be valid, the issue will be closed until further information is provided.
|
||||||
|
|
||||||
|
- To express appreciation, objection, confusion or other supported reactions on pull requests, issues or comments on them, use GitHub [reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) rather than posting an individual comment with an emoji only. This helps keeping the issue/pull request conversation clean and readable.
|
||||||
|
|
||||||
|
- If your issue is related to the PocketMine-MP website, forums, etc., please [talk to a human directly](README.md#discussion).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Contributing Code
|
## Contributing Code
|
||||||
* Use the [Pull Request](https://github.com/pmmp/PocketMine-MP/pull/new) system, your request will be checked and discussed.
|
- To contribute code to the repository, [fork it on GitHub](https://github.com/pmmp/PocketMine-MP/fork), create a branch on your fork, and make your changes on your fork. You can then make a [pull request](https://github.com/pmmp/PocketMine-MP/pull/new) to the project to compare your branch to ours and propose your changes to our repository. We use the Pull Request system to allow members of the team to review changes before they are merged.
|
||||||
* Create each pull request on a new branch. Do not create a pull request on commits that exist in another pull request.
|
|
||||||
* Code should use the same syntax as in PocketMine-MP. See below for an example.
|
- By proposing a pull request to the project, you agree to your code being distributed within PocketMine-MP under the [LGPL license](LICENSE).
|
||||||
* The code must be clear and written in English, comments included.
|
|
||||||
* Use descriptive commit titles
|
- At PocketMine, **we enforce a very high standard for contributions**. This is because PocketMine-MP and its related projects are used very widely in production. While this might seem like we are being mean at times, **our priority is what is best for PocketMine-MP itself**. We try to ensure that our project's codebase is as clean as possible and ensure that only top-quality material makes it through to PocketMine-MP itself. **If a contribution does not live up to our standards, changes may be requested or the pull request may be closed.**
|
||||||
* **Keep each pull request only contain one feature**. The only exception is when all features in the pull request are related to each other, and share the same core changes.
|
|
||||||
* **Do not create pull requests that only bump the MCPE version**. If it is ready to be updated, the team will update the values directly. Do not change the MCPE version or protocol version in a pull request, unless you have updated the protocol (all packets) entirely.
|
- **Your pull request will be checked and discussed in due time.** Since the team is scattered all around the world, your PR may not receive any attention for some time.
|
||||||
|
|
||||||
|
- **Avoid using GitHub Web Editor**. The web editor lacks most useful GIT features and **should only be used for very minor changes**. It is immediately clear if the web editor has been used, and if so the PR is more likely to be rejected. If you want to make serious contributions, **please learn how to use [GIT version control](https://git-scm.com/)**.
|
||||||
|
|
||||||
|
- **Do not copy-paste code**. There are potential license issues implicit with copy-pasting, and copy-paste usually indicates a lack of understanding of the actual code. Copy-pasted code is obvious a mile off and **any PR like this is likely to be closed**. If you want to use somebody else's code from a Git repository, **use [GIT's cherry-pick feature](https://git-scm.com/docs/git-cherry-pick)** to cherry-pick the commit. **Cherry-picking is the politer way to copy somebody's changes** and retains all the original accreditation, so there is no need for copy-pasted commits with descriptions like `Some code, thanks @exampleperson`.
|
||||||
|
|
||||||
|
- In addition to the above, **make sure you can explain your changes**. If you can't provide a good explanation of changes, your PR may be rejected.
|
||||||
|
|
||||||
|
- **Create a new branch for each pull request.** Do not create a pull request with commits that exist in another pull request.
|
||||||
|
|
||||||
|
- **Code should use the same style as in PocketMine-MP.** See [below](#code-syntax) for an example.
|
||||||
|
|
||||||
|
- **The code must be clear** and written in English, comments included.
|
||||||
|
|
||||||
|
- **Use descriptive commit titles.** You can see an example [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
||||||
|
|
||||||
|
- **Try to stick to one change per commit.** This ensures that if you create a PR with several changes, we can decide which ones we wish to include and which ones not to include.
|
||||||
|
|
||||||
|
- **It is inadvisable to create pull requests with large commits** unless this has been discussed with the team beforehand. Large pull requests are difficult to review, and such pull requests may end up being closed. The only exception is when all features in the pull request are related to each other, and share the same core changes.
|
||||||
|
|
||||||
|
- **You may be asked to rebase your pull request** if the branch becomes outdated and/or if possibly conflicting changes are made to the target branch. To see how to do this, read [this page](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request).
|
||||||
|
|
||||||
|
|
||||||
**Thanks for contributing to PocketMine-MP!**
|
**Thanks for contributing to PocketMine-MP!**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Code Syntax
|
### Code Syntax
|
||||||
|
|
||||||
It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) with a few exceptions.
|
It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) with a few exceptions.
|
||||||
|
|
||||||
* Opening braces MUST go on the same line, and MUST NOT have spaces before.
|
- Opening braces MUST go on the same line, and MUST NOT have spaces before.
|
||||||
* `else if` MUST be written as `elseif`. _(It is in PSR-2, but using a SHOULD)_
|
- `else if` MUST be written as `elseif`. _(It is in PSR-2, but using a SHOULD)_
|
||||||
* Control structure keywords or opening braces MUST NOT have one space before or after them.
|
- Control structure keywords or opening braces MUST NOT have one space before or after them.
|
||||||
* Code MUST use tabs for indenting.
|
- Code MUST use tabs for indenting.
|
||||||
* Long arrays MAY be split across multiple lines, where each subsequent line is indented once.
|
- Long arrays MAY be split across multiple lines, where each subsequent line is indented once.
|
||||||
* Files MUST use only the `<?php` tag.
|
- Files MUST use only the `<?php` tag.
|
||||||
* Files MUST NOT have an ending `?>` tag.
|
- Files MUST NOT have an ending `?>` tag.
|
||||||
* Code MUST use namespaces.
|
- Code MUST use namespaces.
|
||||||
* Strings SHOULD use the double quote `"` except when the single quote is required.
|
- Strings SHOULD use the double quote `"` except when the single quote is required.
|
||||||
|
- All code SHOULD have parameter and type declarations where possible.
|
||||||
|
- Strict types SHOULD be enabled on new files where it is sensible to do so.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
namespace pocketmine\example;
|
namespace pocketmine\example;
|
||||||
|
|
||||||
class ExampleClass{
|
class ExampleClass{
|
||||||
|
|
||||||
const EXAMPLE_CLASS_CONSTANT = 1;
|
const EXAMPLE_CLASS_CONSTANT = 1;
|
||||||
|
|
||||||
public $examplePublicVariable = "defaultValue";
|
public $examplePublicVariable = "defaultValue";
|
||||||
private $examplePrivateVariable;
|
private $examplePrivateVariable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of ExampleClass
|
* Creates an instance of ExampleClass
|
||||||
|
*
|
||||||
* @param string $firstArgument the first argument
|
* @param string $firstArgument the first argument
|
||||||
* @param string|null $secondArgument default null
|
* @param string|null $secondArgument default null
|
||||||
*/
|
*/
|
||||||
public function __construct($firstArgument, &$secondArgument = null){
|
public function __construct(string $firstArgument, &$secondArgument = null){
|
||||||
if($firstArgument === "exampleValue"){ //Remember to use === instead == when possible
|
if($firstArgument === "exampleValue"){ //Remember to use === instead of == when possible
|
||||||
//do things
|
//do things
|
||||||
}elseif($firstArgument === "otherValue"){
|
}elseif($firstArgument === "otherValue"){
|
||||||
$secondArgument = function(){
|
$secondArgument = function(){
|
||||||
@ -76,10 +110,14 @@ class ExampleClass{
|
|||||||
4 => "value5",
|
4 => "value5",
|
||||||
5 => "value6",
|
5 => "value6",
|
||||||
];
|
];
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function doStuff(string $stuff) : string{
|
||||||
|
return $stuff;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -93,79 +131,4 @@ class ExampleClass{
|
|||||||
* After voting has been closed, no further votes will be counted.
|
* After voting has been closed, no further votes will be counted.
|
||||||
* An RFC will be rejected if less than 50% + 1 (simple majority) has voted Yes.
|
* An RFC will be rejected if less than 50% + 1 (simple majority) has voted Yes.
|
||||||
* If the RFC is approved, Team Members have the final word on its implementation or rejection.
|
* If the RFC is approved, Team Members have the final word on its implementation or rejection.
|
||||||
* RFCs with complex voting options will specify the vote percentage or other details.
|
* RFCs with complex voting options will specify the vote percentage or other details.
|
||||||
|
|
||||||
|
|
||||||
## Bug Tracking for Collaborators
|
|
||||||
|
|
||||||
### Labels
|
|
||||||
To provide a concise bug tracking environment, prevent the issue tracker from over flowing and to keep support requests out of the bug tracker, PocketMine-MP uses a label scheme a bit different from the default GitHub Issues labels.
|
|
||||||
|
|
||||||
Labels are used to identify the type and status of issues and pull requests.
|
|
||||||
|
|
||||||
#### Categories
|
|
||||||
Multiple category labels may be applied to a single issue (but try to keep this to a minimum and do not overuse category labels).
|
|
||||||
These labels may be applied to issues with bugs related to these, or pull requests that alter the behaviour of these or fix an issue with the same label applied.
|
|
||||||
- `Category: Core` - Related to PocketMine-MP's core functionality, but not gameplay or API.
|
|
||||||
- `Category: Gameplay` - Related to gameplay.
|
|
||||||
- `Category: API` - Related to plugin API.
|
|
||||||
- `Category: Client` - Related to client functionality or behaviour. This label may be applied to issues reporting client-related bugs, or PRs related to the client such as a protocol update. There are several sub-labels to account for the differences between supported clients.
|
|
||||||
- `all`: Related to all versions of the client.
|
|
||||||
- `W10`: Related only to Windows 10 Edition Beta.
|
|
||||||
- `PE`: Related only to the Pocket Edition
|
|
||||||
- `beta`: Related only to a beta version of the game.
|
|
||||||
- `other`: Related only to an uncommon PE-compatible version of the client, such as VR Edition.
|
|
||||||
- `Category: PHP` - Applied to issues caused by the PHP interpreter or its extensions.
|
|
||||||
- `Category: Other` - Applied to issues which cannot be categorized with any of the above labels.
|
|
||||||
|
|
||||||
#### Pull Requests
|
|
||||||
Pull Request labels are prefixed by `PR:`. Only one label may be applied for a Pull Request.
|
|
||||||
- `PR: Bug Fix` - The Pull Request fixes a bug.
|
|
||||||
- `PR: Contribution` - The Pull Request contributes new features or improvements, but does not fix a bug, nor controversial enough to be an RFC.
|
|
||||||
- `PR: RFC` - Request for Comments. Refer to [RFC and Voting](#rfc-and-voting).
|
|
||||||
|
|
||||||
#### Status
|
|
||||||
Status labels show the status of the issue. Multiple status labels may be applied.
|
|
||||||
|
|
||||||
*Issues*
|
|
||||||
- `Status: Unconfirmed` - reported issues that have yet to be reproduced by a developer successfully.
|
|
||||||
- `Status: Reproduced` - a bug that has been reproduced by a developer, or that multiple people are reporting the same issue and symptoms in which case it is automatically assumed that the bug has been reproduced in different environments.
|
|
||||||
- `Status: Debugged` - the cause of the bug has been found, but has not yet been fixed.
|
|
||||||
- `Status: Resolved` - applied to *valid* issues which have been fixed. *This label may only be applied to a closed issue.*
|
|
||||||
|
|
||||||
*Pull requests*
|
|
||||||
- `Status: Insufficiently tested` - applied for pull requests that have not undergone tests strict enough.
|
|
||||||
|
|
||||||
#### Resolution
|
|
||||||
Resolution labels show the resolution of an issue or pull request. These labels may only be applied to closed issues.
|
|
||||||
- `Resolution: Invalid` - Applied to support request issues or issues not related to PocketMine.
|
|
||||||
- `Resolution: Duplicate` - Applied to issues reporting the same problems as another issue.
|
|
||||||
- `Resolution: Fixed` - Applied to an issue reporting a bug which has been fixed.
|
|
||||||
- `Resolution: Works As Intended` - Applied to issues reporting false bugs which work the way they are intended to.
|
|
||||||
- `Resolution: Won't Fix` - Applied to issues reporting bugs which will not be fixed, for example if the bug is beneficial.
|
|
||||||
- `Resolution: Obsolete` - Applied to pull requests which are rendered unnecessary by other changes, such as another, similar pull request being merged.
|
|
||||||
|
|
||||||
#### Miscellaneous
|
|
||||||
- `Enhancement` - Applied to issues with viable feature requests or TODO lists.
|
|
||||||
- `High priority` - Applied to issues or PRs related to critical bugs.
|
|
||||||
|
|
||||||
### Closing Issues
|
|
||||||
To keep the bug tracker clear of non-related issues and to prevent it from overflowing, **issues must be closed as soon as possible** (This may sound unethical, but it is MUCH better than having the BUG TRACKER filled with SUPPORT REQUESTS and "I NEED HELP").
|
|
||||||
|
|
||||||
If an issue does not conform to the "Creating an Issue" guidelines above, the issue should be closed.
|
|
||||||
<!--
|
|
||||||
### Milestones
|
|
||||||
PocketMine-MP uses GitHub Milestones to set a goal for a new release. A milestone is set on the following occasions.
|
|
||||||
|
|
||||||
- A new Beta release
|
|
||||||
- A new Stable release
|
|
||||||
|
|
||||||
A milestone must use the following format:
|
|
||||||
```
|
|
||||||
<version_number> [release_title][release_version]
|
|
||||||
```
|
|
||||||
For example:
|
|
||||||
```
|
|
||||||
1.6.1b1
|
|
||||||
```
|
|
||||||
-->
|
|
82
README.md
82
README.md
@ -1,6 +1,45 @@
|
|||||||
# 
|
# [](https://pmmp.io)
|
||||||
|
|
||||||
|
__A highly customisable, open source server software for Minecraft: Pocket Edition written in PHP__
|
||||||
|
|
||||||
[](https://travis-ci.org/pmmp/PocketMine-MP)
|
[](https://travis-ci.org/pmmp/PocketMine-MP)
|
||||||
|
|
||||||
|
### Setup, help & support, FAQs
|
||||||
|
Head over to the [documentation site](http://pmmp.readthedocs.org/).
|
||||||
|
If you don't find what you're looking for there, [talk to a human](#discussion). Please do not use our issue tracker for support requests.
|
||||||
|
|
||||||
|
### Discussion
|
||||||
|
- [Forums](https://forums.pmmp.io/)
|
||||||
|
- [#pmmp + #pocketmine channel IRC](http://webchat.freenode.net/?channels=pmmp,pocketmine)
|
||||||
|
|
||||||
|
### Plugins
|
||||||
|
There are a very wide range of already-written plugins available which you can use to customise your server. Check out the [old plugin repository](http://plugins.pocketmine.net/), [Poggit](https://poggit.pmmp.io) or just search GitHub.
|
||||||
|
|
||||||
|
### For developers
|
||||||
|
* [Latest API documentation](https://jenkins.pmmp.io/job/PocketMine-MP%20Docs/doxygen/) - Doxygen documentation generated from development
|
||||||
|
* [DevTools](https://github.com/pmmp/PocketMine-DevTools/) - A development tools plugin for creating plugins.
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
<!-- TODO uncomment this when Jenkins is fixed
|
||||||
|
### Where can I get the latest .phar?
|
||||||
|
Head over to our [official Jenkins server](https://jenkins.pmmp.io/)
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Third-party Libraries/Protocols Used
|
||||||
|
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
|
||||||
|
* __[PHP mbstring](http://php.net/manual/en/book.mbstring.php)__
|
||||||
|
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__
|
||||||
|
* __[PHP pthreads](http://pthreads.org/)__ by _[krakjoe](https://github.com/krakjoe)_: Threading for PHP - Share Nothing, Do Everything.
|
||||||
|
* __[PHP YAML](https://code.google.com/p/php-yaml/)__ by _Bryan Davis_: The Yaml PHP Extension provides a wrapper to the LibYAML library.
|
||||||
|
* __[LibYAML](http://pyyaml.org/wiki/LibYAML)__ by _Kirill Simonov_: A YAML 1.1 parser and emitter written in C.
|
||||||
|
* __[cURL](http://curl.haxx.se/)__: cURL is a command line tool for transferring data with URL syntax
|
||||||
|
* __[Zlib](http://www.zlib.net/)__: A Massively Spiffy Yet Delicately Unobtrusive Compression Library
|
||||||
|
* __[Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)__
|
||||||
|
* __[UT3 Query Protocol](http://wiki.unrealadmin.org/UT3_query_protocol)__
|
||||||
|
|
||||||
|
## Licensing information
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,43 +54,4 @@
|
|||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
pmmp/PocketMine are not affiliated with Mojang. All brands and trademarks belong to their respective owners. PocketMine-MP is not a Mojang-approved software, nor is it associated with Mojang.
|
||||||
__PocketMine-MP is a free, open-source software that creates Minecraft: Pocket Edition servers and allows extending its functionalities__
|
|
||||||
|
|
||||||
### [Homepage](https://pmmp.io/)
|
|
||||||
|
|
||||||
### [Forums](https://forums.pmmp.io/)
|
|
||||||
|
|
||||||
### [Documentation](http://pmmp.readthedocs.org/)
|
|
||||||
|
|
||||||
### [Plugin Repository](http://plugins.pocketmine.net/)
|
|
||||||
|
|
||||||
<!--## [FAQ: Frequently Asked Questions](https://github.com/PocketMine/PocketMine-MP/wiki/Frequently-Asked-Questions)-->
|
|
||||||
|
|
||||||
### [Official Jenkins server](https://jenkins.pmmp.io/)
|
|
||||||
|
|
||||||
### API Documentation
|
|
||||||
* [Official Doxygen-generated documentation](http://docs.pocketmine.net/)
|
|
||||||
* [Latest Doxygen generated from development](https://jenkins.pmmp.io/job/PocketMine-MP%20Docs/doxygen/)
|
|
||||||
|
|
||||||
### [Twitter @PocketMine](https://twitter.com/PocketMine)
|
|
||||||
|
|
||||||
### IRC Chat #pmmp (or #pocketmine) @ irc.freenode.net
|
|
||||||
[#pmmp + #pocketmine channel WebIRC](http://webchat.freenode.net/?channels=pmmp,pocketmine)
|
|
||||||
|
|
||||||
### Want to contribute?
|
|
||||||
* Check the [Contributing Guidelines](CONTRIBUTING.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Third-party Libraries/Protocols Used
|
|
||||||
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
|
|
||||||
* __[PHP mbstring](http://php.net/manual/en/book.mbstring.php)__
|
|
||||||
* __[PHP SQLite3](http://php.net/manual/en/book.sqlite3.php)__
|
|
||||||
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__
|
|
||||||
* __[PHP pthreads](http://pthreads.org/)__ by _[krakjoe](https://github.com/krakjoe)_: Threading for PHP - Share Nothing, Do Everything.
|
|
||||||
* __[PHP YAML](https://code.google.com/p/php-yaml/)__ by _Bryan Davis_: The Yaml PHP Extension provides a wrapper to the LibYAML library.
|
|
||||||
* __[LibYAML](http://pyyaml.org/wiki/LibYAML)__ by _Kirill Simonov_: A YAML 1.1 parser and emitter written in C.
|
|
||||||
* __[cURL](http://curl.haxx.se/)__: cURL is a command line tool for transferring data with URL syntax
|
|
||||||
* __[Zlib](http://www.zlib.net/)__: A Massively Spiffy Yet Delicately Unobtrusive Compression Library
|
|
||||||
* __[Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)__
|
|
||||||
* __[UT3 Query Protocol](http://wiki.unrealadmin.org/UT3_query_protocol)__
|
|
||||||
|
@ -41,7 +41,10 @@ class CrashDump{
|
|||||||
public function __construct(Server $server){
|
public function __construct(Server $server){
|
||||||
$this->time = time();
|
$this->time = time();
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->path = $this->server->getDataPath() . "CrashDump_" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
|
if(!is_dir($this->server->getDataPath() . "crashdumps")){
|
||||||
|
mkdir($this->server->getDataPath() . "crashdumps");
|
||||||
|
}
|
||||||
|
$this->path = $this->server->getDataPath() . "crashdumps/" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
|
||||||
$this->fp = @fopen($this->path, "wb");
|
$this->fp = @fopen($this->path, "wb");
|
||||||
if(!is_resource($this->fp)){
|
if(!is_resource($this->fp)){
|
||||||
throw new \RuntimeException("Could not create Crash Dump");
|
throw new \RuntimeException("Could not create Crash Dump");
|
||||||
@ -160,7 +163,7 @@ class CrashDump{
|
|||||||
];
|
];
|
||||||
$error["fullFile"] = $error["file"];
|
$error["fullFile"] = $error["file"];
|
||||||
$error["file"] = cleanPath($error["file"]);
|
$error["file"] = cleanPath($error["file"]);
|
||||||
$error["type"] = isset($errorConversion[$error["type"]]) ? $errorConversion[$error["type"]] : $error["type"];
|
$error["type"] = $errorConversion[$error["type"]] ?? $error["type"];
|
||||||
if(($pos = strpos($error["message"], "\n")) !== false){
|
if(($pos = strpos($error["message"], "\n")) !== false){
|
||||||
$error["message"] = substr($error["message"], 0, $pos);
|
$error["message"] = substr($error["message"], 0, $pos);
|
||||||
}
|
}
|
||||||
|
@ -284,6 +284,8 @@ class MemoryManager{
|
|||||||
|
|
||||||
echo "[Dump] Wrote " . count($objects) . " objects\n";
|
echo "[Dump] Wrote " . count($objects) . " objects\n";
|
||||||
}while($continue);
|
}while($continue);
|
||||||
|
|
||||||
|
fclose($obData);
|
||||||
|
|
||||||
file_put_contents($outputFolder . "/staticProperties.js", json_encode($staticProperties, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
file_put_contents($outputFolder . "/staticProperties.js", json_encode($staticProperties, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||||
file_put_contents($outputFolder . "/serverEntry.js", json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
file_put_contents($outputFolder . "/serverEntry.js", json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||||
@ -292,8 +294,6 @@ class MemoryManager{
|
|||||||
echo "[Dump] Finished!\n";
|
echo "[Dump] Finished!\n";
|
||||||
|
|
||||||
gc_enable();
|
gc_enable();
|
||||||
|
|
||||||
$this->server->forceShutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function continueDump($from, &$data, &$objects, &$refCounts, $recursion, $maxNesting, $maxStringSize){
|
private function continueDump($from, &$data, &$objects, &$refCounts, $recursion, $maxNesting, $maxStringSize){
|
||||||
@ -323,11 +323,11 @@ class MemoryManager{
|
|||||||
$this->continueDump($value, $data[$key], $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize);
|
$this->continueDump($value, $data[$key], $objects, $refCounts, $recursion + 1, $maxNesting, $maxStringSize);
|
||||||
}
|
}
|
||||||
}elseif(is_string($from)){
|
}elseif(is_string($from)){
|
||||||
$data = sprintf("(string) len(%d) " . substr(Utils::printable($from), 0, $maxStringSize), strlen($from));
|
$data = "(string) len(". strlen($from) .") " . substr(Utils::printable($from), 0, $maxStringSize);
|
||||||
}elseif(is_resource($from)){
|
}elseif(is_resource($from)){
|
||||||
$data = "(resource) " . print_r($from, true);
|
$data = "(resource) " . print_r($from, true);
|
||||||
}else{
|
}else{
|
||||||
$data = $from;
|
$data = $from;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ use pocketmine\entity\Human;
|
|||||||
use pocketmine\entity\Item as DroppedItem;
|
use pocketmine\entity\Item as DroppedItem;
|
||||||
use pocketmine\entity\Living;
|
use pocketmine\entity\Living;
|
||||||
use pocketmine\entity\Projectile;
|
use pocketmine\entity\Projectile;
|
||||||
use pocketmine\event\block\SignChangeEvent;
|
|
||||||
use pocketmine\event\entity\EntityDamageByBlockEvent;
|
use pocketmine\event\entity\EntityDamageByBlockEvent;
|
||||||
use pocketmine\event\entity\EntityDamageByEntityEvent;
|
use pocketmine\event\entity\EntityDamageByEntityEvent;
|
||||||
use pocketmine\event\entity\EntityDamageEvent;
|
use pocketmine\event\entity\EntityDamageEvent;
|
||||||
@ -42,6 +41,7 @@ use pocketmine\event\inventory\CraftItemEvent;
|
|||||||
use pocketmine\event\inventory\InventoryCloseEvent;
|
use pocketmine\event\inventory\InventoryCloseEvent;
|
||||||
use pocketmine\event\inventory\InventoryPickupArrowEvent;
|
use pocketmine\event\inventory\InventoryPickupArrowEvent;
|
||||||
use pocketmine\event\inventory\InventoryPickupItemEvent;
|
use pocketmine\event\inventory\InventoryPickupItemEvent;
|
||||||
|
use pocketmine\event\player\cheat\PlayerIllegalMoveEvent;
|
||||||
use pocketmine\event\player\PlayerAchievementAwardedEvent;
|
use pocketmine\event\player\PlayerAchievementAwardedEvent;
|
||||||
use pocketmine\event\player\PlayerAnimationEvent;
|
use pocketmine\event\player\PlayerAnimationEvent;
|
||||||
use pocketmine\event\player\PlayerBedEnterEvent;
|
use pocketmine\event\player\PlayerBedEnterEvent;
|
||||||
@ -81,7 +81,7 @@ use pocketmine\inventory\ShapelessRecipe;
|
|||||||
use pocketmine\inventory\SimpleTransactionGroup;
|
use pocketmine\inventory\SimpleTransactionGroup;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\ChunkLoader;
|
use pocketmine\level\ChunkLoader;
|
||||||
use pocketmine\level\format\FullChunk;
|
use pocketmine\level\format\Chunk;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\level\Location;
|
use pocketmine\level\Location;
|
||||||
use pocketmine\level\Position;
|
use pocketmine\level\Position;
|
||||||
@ -119,7 +119,6 @@ use pocketmine\network\protocol\PlayerActionPacket;
|
|||||||
use pocketmine\network\protocol\PlayStatusPacket;
|
use pocketmine\network\protocol\PlayStatusPacket;
|
||||||
use pocketmine\network\protocol\ResourcePacksInfoPacket;
|
use pocketmine\network\protocol\ResourcePacksInfoPacket;
|
||||||
use pocketmine\network\protocol\RespawnPacket;
|
use pocketmine\network\protocol\RespawnPacket;
|
||||||
use pocketmine\network\protocol\SetDifficultyPacket;
|
|
||||||
use pocketmine\network\protocol\SetEntityMotionPacket;
|
use pocketmine\network\protocol\SetEntityMotionPacket;
|
||||||
use pocketmine\network\protocol\SetHealthPacket;
|
use pocketmine\network\protocol\SetHealthPacket;
|
||||||
use pocketmine\network\protocol\SetPlayerGameTypePacket;
|
use pocketmine\network\protocol\SetPlayerGameTypePacket;
|
||||||
@ -134,10 +133,8 @@ use pocketmine\network\SourceInterface;
|
|||||||
use pocketmine\permission\PermissibleBase;
|
use pocketmine\permission\PermissibleBase;
|
||||||
use pocketmine\permission\PermissionAttachment;
|
use pocketmine\permission\PermissionAttachment;
|
||||||
use pocketmine\plugin\Plugin;
|
use pocketmine\plugin\Plugin;
|
||||||
use pocketmine\tile\Sign;
|
use pocketmine\tile\ItemFrame;
|
||||||
use pocketmine\tile\Spawnable;
|
use pocketmine\tile\Spawnable;
|
||||||
use pocketmine\tile\Tile;
|
|
||||||
use pocketmine\utils\Binary;
|
|
||||||
use pocketmine\utils\TextFormat;
|
use pocketmine\utils\TextFormat;
|
||||||
use pocketmine\utils\UUID;
|
use pocketmine\utils\UUID;
|
||||||
|
|
||||||
@ -174,27 +171,20 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
protected $messageCounter = 2;
|
protected $messageCounter = 2;
|
||||||
|
|
||||||
protected $sendIndex = 0;
|
|
||||||
|
|
||||||
private $clientSecret;
|
private $clientSecret;
|
||||||
|
|
||||||
/** @var Vector3 */
|
/** @var Vector3 */
|
||||||
public $speed = null;
|
public $speed = null;
|
||||||
|
|
||||||
public $blocked = false;
|
|
||||||
public $achievements = [];
|
public $achievements = [];
|
||||||
public $lastCorrect;
|
|
||||||
/** @var SimpleTransactionGroup */
|
/** @var SimpleTransactionGroup */
|
||||||
protected $currentTransaction = null;
|
protected $currentTransaction = null;
|
||||||
public $craftingType = 0; //0 = 2x2 crafting, 1 = 3x3 crafting, 2 = stonecutter
|
public $craftingType = 0; //0 = 2x2 crafting, 1 = 3x3 crafting, 2 = stonecutter
|
||||||
|
|
||||||
protected $isCrafting = false;
|
|
||||||
|
|
||||||
public $creationTime = 0;
|
public $creationTime = 0;
|
||||||
|
|
||||||
protected $randomClientId;
|
protected $randomClientId;
|
||||||
|
|
||||||
protected $lastMovement = 0;
|
|
||||||
/** @var Vector3 */
|
/** @var Vector3 */
|
||||||
protected $forceMovement = null;
|
protected $forceMovement = null;
|
||||||
/** @var Vector3 */
|
/** @var Vector3 */
|
||||||
@ -240,6 +230,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
protected $allowFlight = false;
|
protected $allowFlight = false;
|
||||||
protected $flying = false;
|
protected $flying = false;
|
||||||
|
|
||||||
|
protected $allowMovementCheats = false;
|
||||||
|
protected $allowInstaBreak = false;
|
||||||
|
|
||||||
private $needACK = [];
|
private $needACK = [];
|
||||||
|
|
||||||
private $batchedPackets = [];
|
private $batchedPackets = [];
|
||||||
@ -337,6 +330,22 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
return $this->autoJump;
|
return $this->autoJump;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function allowMovementCheats() : bool{
|
||||||
|
return $this->allowMovementCheats;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAllowMovementCheats(bool $value = false){
|
||||||
|
$this->allowMovementCheats = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function allowInstaBreak() : bool{
|
||||||
|
return $this->allowInstaBreak;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setAllowInstaBreak(bool $value = false){
|
||||||
|
$this->allowInstaBreak = $value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Player $player
|
* @param Player $player
|
||||||
*/
|
*/
|
||||||
@ -507,20 +516,18 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function sendCommandData(){
|
public function sendCommandData(){
|
||||||
$pk = new AvailableCommandsPacket();
|
|
||||||
$data = new \stdClass();
|
$data = new \stdClass();
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach($this->server->getCommandMap()->getCommands() as $command){
|
foreach($this->server->getCommandMap()->getCommands() as $command){
|
||||||
//TODO: fix command permission checks on join
|
if(($cmdData = $command->generateCustomCommandData($this)) !== null){
|
||||||
/*if(!$command->testPermissionSilent($this)){
|
++$count;
|
||||||
continue;
|
$data->{$command->getName()}->versions[0] = $cmdData;
|
||||||
}*/
|
}
|
||||||
++$count;
|
|
||||||
$data->{$command->getName()}->versions[0] = $command->generateCustomCommandData($this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($count > 0){
|
if($count > 0){
|
||||||
//TODO: structure checking
|
//TODO: structure checking
|
||||||
|
$pk = new AvailableCommandsPacket();
|
||||||
$pk->commands = json_encode($data);
|
$pk->commands = json_encode($data);
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
@ -530,7 +537,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
* @param SourceInterface $interface
|
* @param SourceInterface $interface
|
||||||
* @param null $clientID
|
* @param null $clientID
|
||||||
* @param string $ip
|
* @param string $ip
|
||||||
* @param integer $port
|
* @param int $port
|
||||||
*/
|
*/
|
||||||
public function __construct(SourceInterface $interface, $clientID, $ip, $port){
|
public function __construct(SourceInterface $interface, $clientID, $ip, $port){
|
||||||
$this->interface = $interface;
|
$this->interface = $interface;
|
||||||
@ -556,6 +563,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->rawUUID = null;
|
$this->rawUUID = null;
|
||||||
|
|
||||||
$this->creationTime = microtime(true);
|
$this->creationTime = microtime(true);
|
||||||
|
|
||||||
|
$this->allowMovementCheats = (bool) $this->server->getProperty("player.anti-cheat.allow-movement-cheats", false);
|
||||||
|
$this->allowInstaBreak = (bool) $this->server->getProperty("player.anti-cheat.allow-instabreak", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -666,12 +676,21 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$level = $level === null ? $this->level : $level;
|
$level = $level === null ? $this->level : $level;
|
||||||
$index = Level::chunkHash($x, $z);
|
$index = Level::chunkHash($x, $z);
|
||||||
if(isset($this->usedChunks[$index])){
|
if(isset($this->usedChunks[$index])){
|
||||||
foreach($level->getChunkEntities($x, $z) as $entity){
|
$chunk = $level->getChunk($x, $z);
|
||||||
|
foreach($chunk->getEntities() as $entity){
|
||||||
if($entity !== $this){
|
if($entity !== $this){
|
||||||
$entity->despawnFrom($this);
|
$entity->despawnFrom($this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($level !== $this->level){
|
||||||
|
$pk = new FullChunkDataPacket();
|
||||||
|
$pk->chunkX = $x;
|
||||||
|
$pk->chunkZ = $z;
|
||||||
|
$pk->data = chr($chunk->getSubChunkSendCount());
|
||||||
|
$this->dataPacket($pk);
|
||||||
|
}
|
||||||
|
|
||||||
unset($this->usedChunks[$index]);
|
unset($this->usedChunks[$index]);
|
||||||
}
|
}
|
||||||
$level->unregisterChunkLoader($this, $x, $z);
|
$level->unregisterChunkLoader($this, $x, $z);
|
||||||
@ -698,7 +717,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
return $this->spawnPosition instanceof WeakPosition and $this->spawnPosition->isValid();
|
return $this->spawnPosition instanceof WeakPosition and $this->spawnPosition->isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendChunk($x, $z, $payload, $ordering = FullChunkDataPacket::ORDER_COLUMNS){
|
public function sendChunk($x, $z, $payload){
|
||||||
if($this->connected === false){
|
if($this->connected === false){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -712,7 +731,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk = new FullChunkDataPacket();
|
$pk = new FullChunkDataPacket();
|
||||||
$pk->chunkX = $x;
|
$pk->chunkX = $x;
|
||||||
$pk->chunkZ = $z;
|
$pk->chunkZ = $z;
|
||||||
$pk->order = $ordering;
|
|
||||||
$pk->data = $payload;
|
$pk->data = $payload;
|
||||||
$this->batchDataPacket($pk);
|
$this->batchDataPacket($pk);
|
||||||
}
|
}
|
||||||
@ -1079,8 +1097,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
*/
|
*/
|
||||||
public function awardAchievement($achievementId){
|
public function awardAchievement($achievementId){
|
||||||
if(isset(Achievement::$list[$achievementId]) and !$this->hasAchievement($achievementId)){
|
if(isset(Achievement::$list[$achievementId]) and !$this->hasAchievement($achievementId)){
|
||||||
foreach(Achievement::$list[$achievementId]["requires"] as $requerimentId){
|
foreach(Achievement::$list[$achievementId]["requires"] as $requirementId){
|
||||||
if(!$this->hasAchievement($requerimentId)){
|
if(!$this->hasAchievement($requirementId)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1154,11 +1172,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk = new SetPlayerGameTypePacket();
|
$pk = new SetPlayerGameTypePacket();
|
||||||
$pk->gamemode = $this->gamemode & 0x01;
|
$pk->gamemode = $this->gamemode & 0x01;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
$this->sendSettings();
|
|
||||||
}else{
|
}else{
|
||||||
Command::broadcastCommandMessage($this, new TranslationContainer("commands.gamemode.success.self", [Server::getGamemodeString($gm)]));
|
Command::broadcastCommandMessage($this, new TranslationContainer("commands.gamemode.success.self", [Server::getGamemodeString($gm)]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->sendSettings();
|
||||||
|
|
||||||
$this->inventory->sendContents($this);
|
$this->inventory->sendContents($this);
|
||||||
$this->inventory->sendContents($this->getViewers());
|
$this->inventory->sendContents($this->getViewers());
|
||||||
$this->inventory->sendHeldItem($this->hasSpawned);
|
$this->inventory->sendHeldItem($this->hasSpawned);
|
||||||
@ -1185,28 +1204,62 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WARNING: This method does NOT return literal gamemode is survival, it will also return true for adventure mode players.
|
* NOTE: Because Survival and Adventure Mode share some similar behaviour, this method will also return true if the player is
|
||||||
|
* in Adventure Mode. Supply the $literal parameter as true to force a literal Survival Mode check.
|
||||||
|
*
|
||||||
|
* @param bool $literal whether a literal check should be performed
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isSurvival() : bool{
|
public function isSurvival(bool $literal = false) : bool{
|
||||||
return ($this->gamemode & 0x01) === 0;
|
if($literal){
|
||||||
|
return $this->gamemode === Player::SURVIVAL;
|
||||||
|
}else{
|
||||||
|
return ($this->gamemode & 0x01) === 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WARNING: This method does NOT return literal gamemode is creative, it will also return true for spectator mode players.
|
* NOTE: Because Creative and Spectator Mode share some similar behaviour, this method will also return true if the player is
|
||||||
|
* in Spectator Mode. Supply the $literal parameter as true to force a literal Creative Mode check.
|
||||||
|
*
|
||||||
|
* @param bool $literal whether a literal check should be performed
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isCreative() : bool{
|
public function isCreative(bool $literal = false) : bool{
|
||||||
return ($this->gamemode & 0x01) === 1;
|
if($literal){
|
||||||
|
return $this->gamemode === Player::CREATIVE;
|
||||||
|
}else{
|
||||||
|
return ($this->gamemode & 0x01) === 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WARNING: This method does NOT return literal gamemode is adventure, it will also return true for spectator mode players.
|
* NOTE: Because Adventure and Spectator Mode share some similar behaviour, this method will also return true if the player is
|
||||||
|
* in Spectator Mode. Supply the $literal parameter as true to force a literal Adventure Mode check.
|
||||||
|
*
|
||||||
|
* @param bool $literal whether a literal check should be performed
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isAdventure() : bool{
|
public function isAdventure(bool $literal = false) : bool{
|
||||||
return ($this->gamemode & 0x02) > 0;
|
if($literal){
|
||||||
|
return $this->gamemode === Player::ADVENTURE;
|
||||||
|
}else{
|
||||||
|
return ($this->gamemode & 0x02) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function isSpectator() : bool{
|
public function isSpectator() : bool{
|
||||||
return $this->gamemode === 3;
|
return $this->gamemode === Player::SPECTATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isFireProof() : bool{
|
||||||
|
return $this->isCreative();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(){
|
public function getDrops(){
|
||||||
@ -1259,7 +1312,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk = new TakeItemEntityPacket();
|
$pk = new TakeItemEntityPacket();
|
||||||
$pk->eid = $this->getId();
|
$pk->eid = $this->getId();
|
||||||
$pk->target = $entity->getId();
|
$pk->target = $entity->getId();
|
||||||
Server::broadcastPacket($entity->getViewers(), $pk);
|
$this->server->broadcastPacket($entity->getViewers(), $pk);
|
||||||
|
|
||||||
$pk = new TakeItemEntityPacket();
|
$pk = new TakeItemEntityPacket();
|
||||||
$pk->eid = 0;
|
$pk->eid = 0;
|
||||||
@ -1294,7 +1347,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk = new TakeItemEntityPacket();
|
$pk = new TakeItemEntityPacket();
|
||||||
$pk->eid = $this->getId();
|
$pk->eid = $this->getId();
|
||||||
$pk->target = $entity->getId();
|
$pk->target = $entity->getId();
|
||||||
Server::broadcastPacket($entity->getViewers(), $pk);
|
$this->server->broadcastPacket($entity->getViewers(), $pk);
|
||||||
|
|
||||||
$pk = new TakeItemEntityPacket();
|
$pk = new TakeItemEntityPacket();
|
||||||
$pk->eid = 0;
|
$pk->eid = 0;
|
||||||
@ -1310,7 +1363,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function processMovement($tickDiff){
|
protected function processMovement($tickDiff){
|
||||||
if(!$this->isAlive() or !$this->spawned or $this->newPosition === null or $this->teleportPosition !== null){
|
if(!$this->isAlive() or !$this->spawned or $this->newPosition === null or $this->teleportPosition !== null or $this->isSleeping()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1319,7 +1372,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
$revert = false;
|
$revert = false;
|
||||||
|
|
||||||
if(($distanceSquared / ($tickDiff ** 2)) > 100){
|
if(($distanceSquared / ($tickDiff ** 2)) > 100 and !$this->allowMovementCheats){
|
||||||
|
$this->server->getLogger()->warning($this->getName() . " moved too fast, reverting movement");
|
||||||
$revert = true;
|
$revert = true;
|
||||||
}else{
|
}else{
|
||||||
if($this->chunk === null or !$this->chunk->isGenerated()){
|
if($this->chunk === null or !$this->chunk->isGenerated()){
|
||||||
@ -1347,19 +1401,17 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$diffY = $this->y - $newPos->y;
|
$diffY = $this->y - $newPos->y;
|
||||||
$diffZ = $this->z - $newPos->z;
|
$diffZ = $this->z - $newPos->z;
|
||||||
|
|
||||||
$yS = 0.5 + $this->ySize;
|
|
||||||
if($diffY >= -$yS or $diffY <= $yS){
|
|
||||||
$diffY = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$diff = ($diffX ** 2 + $diffY ** 2 + $diffZ ** 2) / ($tickDiff ** 2);
|
$diff = ($diffX ** 2 + $diffY ** 2 + $diffZ ** 2) / ($tickDiff ** 2);
|
||||||
|
|
||||||
if($this->isSurvival()){
|
if($this->isSurvival() and !$revert and $diff > 0.0625){
|
||||||
if(!$revert and !$this->isSleeping()){
|
$ev = new PlayerIllegalMoveEvent($this, $newPos);
|
||||||
if($diff > 0.0625){
|
$ev->setCancelled($this->allowMovementCheats);
|
||||||
$revert = true;
|
|
||||||
$this->server->getLogger()->warning($this->getServer()->getLanguage()->translateString("pocketmine.player.invalidMove", [$this->getName()]));
|
$this->server->getPluginManager()->callEvent($ev);
|
||||||
}
|
|
||||||
|
if(!$ev->isCancelled()){
|
||||||
|
$revert = true;
|
||||||
|
$this->server->getLogger()->warning($this->getServer()->getLanguage()->translateString("pocketmine.player.invalidMove", [$this->getName()]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1407,7 +1459,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->checkNearEntities($tickDiff);
|
$this->checkNearEntities($tickDiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->speed = $from->subtract($to);
|
$this->speed = ($to->subtract($from))->divide($tickDiff);
|
||||||
}elseif($distanceSquared == 0){
|
}elseif($distanceSquared == 0){
|
||||||
$this->speed = new Vector3(0, 0, 0);
|
$this->speed = new Vector3(0, 0, 0);
|
||||||
}
|
}
|
||||||
@ -1421,7 +1473,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->lastYaw = $from->yaw;
|
$this->lastYaw = $from->yaw;
|
||||||
$this->lastPitch = $from->pitch;
|
$this->lastPitch = $from->pitch;
|
||||||
|
|
||||||
$this->sendPosition($from, $from->yaw, $from->pitch, 1);
|
$this->sendPosition($from, $from->yaw, $from->pitch, MovePlayerPacket::MODE_RESET);
|
||||||
$this->forceMovement = new Vector3($from->x, $from->y, $from->z);
|
$this->forceMovement = new Vector3($from->x, $from->y, $from->z);
|
||||||
}else{
|
}else{
|
||||||
$this->forceMovement = null;
|
$this->forceMovement = null;
|
||||||
@ -1499,9 +1551,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->timings->startTiming();
|
$this->timings->startTiming();
|
||||||
|
|
||||||
if($this->spawned){
|
if($this->spawned){
|
||||||
if(!$this->isSleeping()){
|
$this->processMovement($tickDiff);
|
||||||
$this->processMovement($tickDiff);
|
|
||||||
}
|
|
||||||
$this->entityBaseTick($tickDiff);
|
$this->entityBaseTick($tickDiff);
|
||||||
|
|
||||||
if(!$this->isSpectator() and $this->speed !== null){
|
if(!$this->isSpectator() and $this->speed !== null){
|
||||||
@ -1534,6 +1584,15 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
$this->timings->stopTiming();
|
$this->timings->stopTiming();
|
||||||
|
|
||||||
|
//TODO: remove this workaround (broken client MCPE 1.0.0)
|
||||||
|
if(count($this->messageQueue) > 0){
|
||||||
|
$pk = new TextPacket();
|
||||||
|
$pk->type = TextPacket::TYPE_RAW;
|
||||||
|
$pk->message = implode("\n", $this->messageQueue);
|
||||||
|
$this->dataPacket($pk);
|
||||||
|
$this->messageQueue = [];
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1667,7 +1726,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->server->saveOfflinePlayerData($this->username, $nbt, true);
|
$this->server->saveOfflinePlayerData($this->username, $nbt, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct($this->level->getChunk($nbt["Pos"][0] >> 4, $nbt["Pos"][2] >> 4, true), $nbt);
|
parent::__construct($this->level, $nbt);
|
||||||
$this->loggedIn = true;
|
$this->loggedIn = true;
|
||||||
$this->server->addOnlinePlayer($this);
|
$this->server->addOnlinePlayer($this);
|
||||||
|
|
||||||
@ -1861,13 +1920,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::MOVE_PLAYER_PACKET:
|
case ProtocolInfo::MOVE_PLAYER_PACKET:
|
||||||
if($this->teleportPosition !== null){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$newPos = new Vector3($packet->x, $packet->y - $this->getEyeHeight(), $packet->z);
|
$newPos = new Vector3($packet->x, $packet->y - $this->getEyeHeight(), $packet->z);
|
||||||
|
|
||||||
if($newPos->distanceSquared($this) < 0.01){ //player hasn't moved, just client spamming packets
|
if($newPos->distanceSquared($this) == 0 and ($packet->yaw % 360) === $this->yaw and ($packet->pitch % 360) === $this->pitch){ //player hasn't moved, just client spamming packets
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1877,8 +1932,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->forceMovement = new Vector3($this->x, $this->y, $this->z);
|
$this->forceMovement = new Vector3($this->x, $this->y, $this->z);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->forceMovement instanceof Vector3 and (($dist = $newPos->distanceSquared($this->forceMovement)) > 0.1 or $revert)){
|
if($this->teleportPosition !== null or ($this->forceMovement instanceof Vector3 and ($newPos->distanceSquared($this->forceMovement) > 0.1 or $revert))){
|
||||||
$this->sendPosition($this->forceMovement, $packet->yaw, $packet->pitch);
|
$this->sendPosition($this->forceMovement, $packet->yaw, $packet->pitch, MovePlayerPacket::MODE_RESET);
|
||||||
}else{
|
}else{
|
||||||
$packet->yaw %= 360;
|
$packet->yaw %= 360;
|
||||||
$packet->pitch %= 360;
|
$packet->pitch %= 360;
|
||||||
@ -1889,13 +1944,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
$this->setRotation($packet->yaw, $packet->pitch);
|
$this->setRotation($packet->yaw, $packet->pitch);
|
||||||
$this->newPosition = $newPos;
|
$this->newPosition = $newPos;
|
||||||
|
$this->forceMovement = null;
|
||||||
}
|
}
|
||||||
$this->forceMovement = null;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::ADVENTURE_SETTINGS_PACKET:
|
case ProtocolInfo::ADVENTURE_SETTINGS_PACKET:
|
||||||
//TODO: player abilities, check for other changes
|
//TODO: player abilities, check for other changes
|
||||||
if($packet->isFlying and !$this->allowFlight){
|
if($packet->isFlying and !$this->allowFlight and !$this->server->getAllowFlight()){
|
||||||
$this->kick("Flying is not enabled on this server");
|
$this->kick("Flying is not enabled on this server");
|
||||||
break;
|
break;
|
||||||
}else{
|
}else{
|
||||||
@ -1974,7 +2029,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->setDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION, false);
|
$this->setDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION, false);
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::USE_ITEM_PACKET:
|
case ProtocolInfo::USE_ITEM_PACKET:
|
||||||
if($this->spawned === false or !$this->isAlive() or $this->blocked){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2060,7 +2115,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$f = 1.5;
|
$f = 1.5;
|
||||||
$snowball = Entity::createEntity("Snowball", $this->chunk, $nbt, $this);
|
$snowball = Entity::createEntity("Snowball", $this->getLevel(), $nbt, $this);
|
||||||
$snowball->setMotion($snowball->getMotion()->multiply($f));
|
$snowball->setMotion($snowball->getMotion()->multiply($f));
|
||||||
if($this->isSurvival()){
|
if($this->isSurvival()){
|
||||||
$item->setCount($item->getCount() - 1);
|
$item->setCount($item->getCount() - 1);
|
||||||
@ -2084,7 +2139,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::PLAYER_ACTION_PACKET:
|
case ProtocolInfo::PLAYER_ACTION_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or (!$this->isAlive() and $packet->action !== PlayerActionPacket::ACTION_RESPAWN and $packet->action !== PlayerActionPacket::ACTION_DIMENSION_CHANGE)){
|
if($this->spawned === false or (!$this->isAlive() and $packet->action !== PlayerActionPacket::ACTION_RESPAWN and $packet->action !== PlayerActionPacket::ACTION_DIMENSION_CHANGE)){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2106,12 +2161,15 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$block = $target->getSide($packet->face);
|
$block = $target->getSide($packet->face);
|
||||||
if($block->getId() === Block::FIRE){
|
if($block->getId() === Block::FIRE){
|
||||||
$this->level->setBlock($block, new Air());
|
$this->level->setBlock($block, new Air());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$this->lastBreak = microtime(true);
|
$this->lastBreak = microtime(true);
|
||||||
break;
|
break;
|
||||||
case PlayerActionPacket::ACTION_ABORT_BREAK:
|
case PlayerActionPacket::ACTION_ABORT_BREAK:
|
||||||
$this->lastBreak = PHP_INT_MAX;
|
$this->lastBreak = PHP_INT_MAX;
|
||||||
break;
|
break;
|
||||||
|
case PlayerActionPacket::ACTION_STOP_BREAK:
|
||||||
|
break;
|
||||||
case PlayerActionPacket::ACTION_RELEASE_ITEM:
|
case PlayerActionPacket::ACTION_RELEASE_ITEM:
|
||||||
if($this->startAction > -1 and $this->getDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION)){
|
if($this->startAction > -1 and $this->getDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION)){
|
||||||
if($this->inventory->getItemInHand()->getId() === Item::BOW){
|
if($this->inventory->getItemInHand()->getId() === Item::BOW){
|
||||||
@ -2142,7 +2200,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$diff = ($this->server->getTick() - $this->startAction);
|
$diff = ($this->server->getTick() - $this->startAction);
|
||||||
$p = $diff / 20;
|
$p = $diff / 20;
|
||||||
$f = min((($p ** 2) + $p * 2) / 3, 1) * 2;
|
$f = min((($p ** 2) + $p * 2) / 3, 1) * 2;
|
||||||
$ev = new EntityShootBowEvent($this, $bow, Entity::createEntity("Arrow", $this->chunk, $nbt, $this, $f == 2 ? true : false), $f);
|
$ev = new EntityShootBowEvent($this, $bow, Entity::createEntity("Arrow", $this->getLevel(), $nbt, $this, $f == 2 ? true : false), $f);
|
||||||
|
|
||||||
if($f < 0.1 or $diff < 5){
|
if($f < 0.1 or $diff < 5){
|
||||||
$ev->setCancelled();
|
$ev->setCancelled();
|
||||||
@ -2188,7 +2246,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk->eid = $this->getId();
|
$pk->eid = $this->getId();
|
||||||
$pk->event = EntityEventPacket::USE_ITEM;
|
$pk->event = EntityEventPacket::USE_ITEM;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
Server::broadcastPacket($this->getViewers(), $pk);
|
$this->server->broadcastPacket($this->getViewers(), $pk);
|
||||||
|
|
||||||
if($this->isSurvival()){
|
if($this->isSurvival()){
|
||||||
$slot = $this->inventory->getItemInHand();
|
$slot = $this->inventory->getItemInHand();
|
||||||
@ -2238,11 +2296,11 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->inventory->sendContents($this);
|
$this->inventory->sendContents($this);
|
||||||
$this->inventory->sendArmorContents($this);
|
$this->inventory->sendArmorContents($this);
|
||||||
|
|
||||||
$this->blocked = false;
|
|
||||||
|
|
||||||
$this->spawnToAll();
|
$this->spawnToAll();
|
||||||
$this->scheduleUpdate();
|
$this->scheduleUpdate();
|
||||||
break;
|
break;
|
||||||
|
case PlayerActionPacket::ACTION_JUMP:
|
||||||
|
break 2;
|
||||||
case PlayerActionPacket::ACTION_START_SPRINT:
|
case PlayerActionPacket::ACTION_START_SPRINT:
|
||||||
$ev = new PlayerToggleSprintEvent($this, true);
|
$ev = new PlayerToggleSprintEvent($this, true);
|
||||||
$this->server->getPluginManager()->callEvent($ev);
|
$this->server->getPluginManager()->callEvent($ev);
|
||||||
@ -2269,7 +2327,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}else{
|
}else{
|
||||||
$this->setSneaking(true);
|
$this->setSneaking(true);
|
||||||
}
|
}
|
||||||
break;
|
break 2;
|
||||||
case PlayerActionPacket::ACTION_STOP_SNEAK:
|
case PlayerActionPacket::ACTION_STOP_SNEAK:
|
||||||
$ev = new PlayerToggleSneakEvent($this, false);
|
$ev = new PlayerToggleSneakEvent($this, false);
|
||||||
$this->server->getPluginManager()->callEvent($ev);
|
$this->server->getPluginManager()->callEvent($ev);
|
||||||
@ -2278,7 +2336,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}else{
|
}else{
|
||||||
$this->setSneaking(false);
|
$this->setSneaking(false);
|
||||||
}
|
}
|
||||||
break;
|
break 2;
|
||||||
|
default:
|
||||||
|
assert(false, "Unhandled player action " . $packet->action . " from " . $this->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->startAction = -1;
|
$this->startAction = -1;
|
||||||
@ -2286,7 +2346,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ProtocolInfo::REMOVE_BLOCK_PACKET:
|
case ProtocolInfo::REMOVE_BLOCK_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->craftingType = 0;
|
$this->craftingType = 0;
|
||||||
@ -2301,7 +2361,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
$oldItem = clone $item;
|
$oldItem = clone $item;
|
||||||
|
|
||||||
if($this->canInteract($vector->add(0.5, 0.5, 0.5), $this->isCreative() ? 13 : 6) and $this->level->useBreakOn($vector, $item, $this)){
|
if($this->canInteract($vector->add(0.5, 0.5, 0.5), $this->isCreative() ? 13 : 6) and $this->level->useBreakOn($vector, $item, $this, true)){
|
||||||
if($this->isSurvival()){
|
if($this->isSurvival()){
|
||||||
if(!$item->deepEquals($oldItem) or $item->getCount() !== $oldItem->getCount()){
|
if(!$item->deepEquals($oldItem) or $item->getCount() !== $oldItem->getCount()){
|
||||||
$this->inventory->setItemInHand($item);
|
$this->inventory->setItemInHand($item);
|
||||||
@ -2330,7 +2390,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ProtocolInfo::INTERACT_PACKET:
|
case ProtocolInfo::INTERACT_PACKET:
|
||||||
if($this->spawned === false or !$this->isAlive() or $this->blocked){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2380,7 +2440,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
];
|
];
|
||||||
|
|
||||||
$damage = [
|
$damage = [
|
||||||
EntityDamageEvent::MODIFIER_BASE => isset($damageTable[$item->getId()]) ? $damageTable[$item->getId()] : 1,
|
EntityDamageEvent::MODIFIER_BASE => $damageTable[$item->getId()] ?? 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
if(!$this->canInteract($target, 8)){
|
if(!$this->canInteract($target, 8)){
|
||||||
@ -2469,12 +2529,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk = new AnimatePacket();
|
$pk = new AnimatePacket();
|
||||||
$pk->eid = $this->getId();
|
$pk->eid = $this->getId();
|
||||||
$pk->action = $ev->getAnimationType();
|
$pk->action = $ev->getAnimationType();
|
||||||
Server::broadcastPacket($this->getViewers(), $pk);
|
$this->server->broadcastPacket($this->getViewers(), $pk);
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::SET_HEALTH_PACKET: //Not used
|
case ProtocolInfo::SET_HEALTH_PACKET: //Not used
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::ENTITY_EVENT_PACKET:
|
case ProtocolInfo::ENTITY_EVENT_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->craftingType = 0;
|
$this->craftingType = 0;
|
||||||
@ -2501,9 +2561,15 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::DROP_ITEM_PACKET:
|
case ProtocolInfo::DROP_ITEM_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($packet->item->getId() === Item::AIR){
|
||||||
|
// Windows 10 Edition drops the contents of the crafting grid on container close - including air.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$item = $this->inventory->getItemInHand();
|
$item = $this->inventory->getItemInHand();
|
||||||
$ev = new PlayerDropItemEvent($this, $item);
|
$ev = new PlayerDropItemEvent($this, $item);
|
||||||
$this->server->getPluginManager()->callEvent($ev);
|
$this->server->getPluginManager()->callEvent($ev);
|
||||||
@ -2548,6 +2614,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$packet->message = TextFormat::clean($packet->message, $this->removeFormat);
|
$packet->message = TextFormat::clean($packet->message, $this->removeFormat);
|
||||||
foreach(explode("\n", $packet->message) as $message){
|
foreach(explode("\n", $packet->message) as $message){
|
||||||
if(trim($message) != "" and strlen($message) <= 255 and $this->messageCounter-- > 0){
|
if(trim($message) != "" and strlen($message) <= 255 and $this->messageCounter-- > 0){
|
||||||
|
if(substr($message, 0, 2) === "./"){ //Command (./ = fast hack for old plugins post 0.16)
|
||||||
|
$message = substr($message, 1);
|
||||||
|
}
|
||||||
|
|
||||||
$ev = new PlayerCommandPreprocessEvent($this, $message);
|
$ev = new PlayerCommandPreprocessEvent($this, $message);
|
||||||
|
|
||||||
if(mb_strlen($ev->getMessage(), "UTF-8") > 320){
|
if(mb_strlen($ev->getMessage(), "UTF-8") > 320){
|
||||||
@ -2558,9 +2628,10 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(substr($ev->getMessage(), 0, 2) === "./"){ //Command (./ = fast hack for old plugins post 0.16)
|
|
||||||
|
if(substr($ev->getMessage(), 0, 1) === "/"){
|
||||||
Timings::$playerCommandTimer->startTiming();
|
Timings::$playerCommandTimer->startTiming();
|
||||||
$this->server->dispatchCommand($ev->getPlayer(), substr($ev->getMessage(), 2));
|
$this->server->dispatchCommand($ev->getPlayer(), substr($ev->getMessage(), 1));
|
||||||
Timings::$playerCommandTimer->stopTiming();
|
Timings::$playerCommandTimer->stopTiming();
|
||||||
}else{
|
}else{
|
||||||
$this->server->getPluginManager()->callEvent($ev = new PlayerChatEvent($this, $ev->getMessage()));
|
$this->server->getPluginManager()->callEvent($ev = new PlayerChatEvent($this, $ev->getMessage()));
|
||||||
@ -2604,25 +2675,16 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($packet->input as $i => $item){
|
|
||||||
if($item->getDamage() === -1 or $item->getDamage() === 0xffff){
|
|
||||||
$item->setDamage(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($i < 9 and $item->getId() > 0){
|
|
||||||
$item->setCount(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$canCraft = true;
|
$canCraft = true;
|
||||||
|
|
||||||
if($recipe instanceof ShapedRecipe){
|
if($recipe instanceof ShapedRecipe){
|
||||||
for($x = 0; $x < 3 and $canCraft; ++$x){
|
for($x = 0; $x < 3 and $canCraft; ++$x){
|
||||||
for($y = 0; $y < 3; ++$y){
|
for($y = 0; $y < 3; ++$y){
|
||||||
|
/** @var Item $item */
|
||||||
$item = $packet->input[$y * 3 + $x];
|
$item = $packet->input[$y * 3 + $x];
|
||||||
$ingredient = $recipe->getIngredient($x, $y);
|
$ingredient = $recipe->getIngredient($x, $y);
|
||||||
if($item->getCount() > 0){
|
if($item->getCount() > 0){
|
||||||
if($ingredient === null or !$ingredient->deepEquals($item, $ingredient->getDamage() !== null, $ingredient->getCompoundTag() !== null)){
|
if($ingredient === null or !$ingredient->deepEquals($item, !$ingredient->hasAnyDamageValue(), $ingredient->hasCompoundTag())){
|
||||||
$canCraft = false;
|
$canCraft = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2634,10 +2696,11 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
for($x = 0; $x < 3 and $canCraft; ++$x){
|
for($x = 0; $x < 3 and $canCraft; ++$x){
|
||||||
for($y = 0; $y < 3; ++$y){
|
for($y = 0; $y < 3; ++$y){
|
||||||
|
/** @var Item $item */
|
||||||
$item = clone $packet->input[$y * 3 + $x];
|
$item = clone $packet->input[$y * 3 + $x];
|
||||||
|
|
||||||
foreach($needed as $k => $n){
|
foreach($needed as $k => $n){
|
||||||
if($n->deepEquals($item, $n->getDamage() !== null, $n->getCompoundTag() !== null)){
|
if($n->deepEquals($item, !$n->hasAnyDamageValue(), $n->hasCompoundTag())){
|
||||||
$remove = min($n->getCount(), $item->getCount());
|
$remove = min($n->getCount(), $item->getCount());
|
||||||
$n->setCount($n->getCount() - $remove);
|
$n->setCount($n->getCount() - $remove);
|
||||||
$item->setCount($item->getCount() - $remove);
|
$item->setCount($item->getCount() - $remove);
|
||||||
@ -2676,8 +2739,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
foreach($ingredients as $ingredient){
|
foreach($ingredients as $ingredient){
|
||||||
$slot = -1;
|
$slot = -1;
|
||||||
foreach($this->inventory->getContents() as $index => $i){
|
foreach($this->inventory->getContents() as $index => $item){
|
||||||
if($ingredient->getId() !== 0 and $ingredient->deepEquals($i, $ingredient->getDamage() !== null) and ($i->getCount() - $used[$index]) >= 1){
|
if($ingredient->getId() !== 0 and $ingredient->equals($item, !$ingredient->hasAnyDamageValue(), $ingredient->hasCompoundTag()) and ($item->getCount() - $used[$index]) >= 1){
|
||||||
$slot = $index;
|
$slot = $index;
|
||||||
$used[$index]++;
|
$used[$index]++;
|
||||||
break;
|
break;
|
||||||
@ -2765,7 +2828,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ProtocolInfo::CONTAINER_SET_SLOT_PACKET:
|
case ProtocolInfo::CONTAINER_SET_SLOT_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2843,7 +2906,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::BLOCK_ENTITY_DATA_PACKET:
|
case ProtocolInfo::BLOCK_ENTITY_DATA_PACKET:
|
||||||
if($this->spawned === false or $this->blocked === true or !$this->isAlive()){
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->craftingType = 0;
|
$this->craftingType = 0;
|
||||||
@ -2854,28 +2917,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
|
|
||||||
$t = $this->level->getTile($pos);
|
$t = $this->level->getTile($pos);
|
||||||
if($t instanceof Sign){
|
if($t instanceof Spawnable){
|
||||||
$nbt = new NBT(NBT::LITTLE_ENDIAN);
|
$nbt = new NBT(NBT::LITTLE_ENDIAN);
|
||||||
$nbt->read($packet->namedtag, false, true);
|
$nbt->read($packet->namedtag, false, true);
|
||||||
$nbt = $nbt->getData();
|
$nbt = $nbt->getData();
|
||||||
if($nbt["id"] !== Tile::SIGN){
|
if(!$t->updateCompoundTag($nbt, $this)){
|
||||||
$t->spawnTo($this);
|
$t->spawnTo($this);
|
||||||
}else{
|
|
||||||
$ev = new SignChangeEvent($t->getBlock(), $this, [
|
|
||||||
TextFormat::clean($nbt["Text1"], $this->removeFormat), TextFormat::clean($nbt["Text2"], $this->removeFormat), TextFormat::clean($nbt["Text3"], $this->removeFormat), TextFormat::clean($nbt["Text4"], $this->removeFormat)
|
|
||||||
]);
|
|
||||||
|
|
||||||
if(!isset($t->namedtag->Creator) or $t->namedtag["Creator"] !== $this->getRawUniqueId()){
|
|
||||||
$ev->setCancelled();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->server->getPluginManager()->callEvent($ev);
|
|
||||||
|
|
||||||
if(!$ev->isCancelled()){
|
|
||||||
$t->setText($ev->getLine(0), $ev->getLine(1), $ev->getLine(2), $ev->getLine(3));
|
|
||||||
}else{
|
|
||||||
$t->spawnTo($this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2888,16 +2935,33 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
break;
|
break;
|
||||||
case ProtocolInfo::SET_PLAYER_GAME_TYPE_PACKET:
|
case ProtocolInfo::SET_PLAYER_GAME_TYPE_PACKET:
|
||||||
if($packet->gamemode !== $this->gamemode){
|
if($packet->gamemode !== ($this->gamemode & 0x01)){
|
||||||
if(!$this->hasPermission("pocketmine.command.gamemode")){
|
//GUI gamemode change, set it back to original for now (only possible through client bug or hack with current allowed client permissions)
|
||||||
$pk = new SetPlayerGameTypePacket();
|
$pk = new SetPlayerGameTypePacket();
|
||||||
$pk->gamemode = $this->gamemode & 0x01;
|
$pk->gamemode = $this->gamemode & 0x01;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
$this->sendSettings();
|
$this->sendSettings();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ProtocolInfo::ITEM_FRAME_DROP_ITEM_PACKET:
|
||||||
|
if($this->spawned === false or !$this->isAlive()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tile = $this->level->getTile($this->temporalVector->setComponents($packet->x, $packet->y, $packet->z));
|
||||||
|
if($tile instanceof ItemFrame){
|
||||||
|
if($this->isSpectator()){
|
||||||
|
$tile->spawnTo($this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->setGamemode($packet->gamemode, true);
|
|
||||||
|
if(lcg_value() <= $tile->getItemDropChance()){
|
||||||
|
$this->level->dropItem($tile->getBlock(), $tile->getItem());
|
||||||
|
}
|
||||||
|
$tile->setItem(null);
|
||||||
|
$tile->setItemRotation(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -2938,6 +3002,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var string[] */
|
||||||
|
private $messageQueue = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a direct chat message to a player
|
* Sends a direct chat message to a player
|
||||||
*
|
*
|
||||||
@ -2952,15 +3019,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$message = $message->getText();
|
$message = $message->getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
$mes = explode("\n", $this->server->getLanguage()->translateString($message));
|
//TODO: Remove this workaround (broken client MCPE 1.0.0)
|
||||||
foreach($mes as $m){
|
$this->messageQueue[] = $this->server->getLanguage()->translateString($message);
|
||||||
if($m !== ""){
|
/*
|
||||||
$pk = new TextPacket();
|
$pk = new TextPacket();
|
||||||
$pk->type = TextPacket::TYPE_RAW;
|
$pk->type = TextPacket::TYPE_RAW;
|
||||||
$pk->message = $m;
|
$pk->message = $this->server->getLanguage()->translateString($message);
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
*/
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendTranslation($message, array $parameters = []){
|
public function sendTranslation($message, array $parameters = []){
|
||||||
@ -2993,7 +3059,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk->message = $message;
|
$pk->message = $message;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sender
|
* @param string $sender
|
||||||
* @param string $message
|
* @param string $message
|
||||||
@ -3076,7 +3142,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->loadQueue = [];
|
$this->loadQueue = [];
|
||||||
$this->hasSpawned = [];
|
$this->hasSpawned = [];
|
||||||
$this->spawnPosition = null;
|
$this->spawnPosition = null;
|
||||||
unset($this->buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->perm !== null){
|
if($this->perm !== null){
|
||||||
@ -3100,6 +3165,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles player data saving
|
* Handles player data saving
|
||||||
|
*
|
||||||
|
* @param bool $async
|
||||||
*/
|
*/
|
||||||
public function save($async = false){
|
public function save($async = false){
|
||||||
if($this->closed){
|
if($this->closed){
|
||||||
@ -3108,9 +3175,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
parent::saveNBT();
|
parent::saveNBT();
|
||||||
if($this->level instanceof Level){
|
if($this->level instanceof Level){
|
||||||
$this->namedtag->Level = new StringTag("Level", $this->level->getName());
|
$this->namedtag->Level = new StringTag("Level", $this->level->getFolderName());
|
||||||
if($this->hasValidSpawnPosition()){
|
if($this->hasValidSpawnPosition()){
|
||||||
$this->namedtag["SpawnLevel"] = $this->spawnPosition->getLevel()->getName();
|
$this->namedtag["SpawnLevel"] = $this->spawnPosition->getLevel()->getFolderName();
|
||||||
$this->namedtag["SpawnX"] = (int) $this->spawnPosition->x;
|
$this->namedtag["SpawnX"] = (int) $this->spawnPosition->x;
|
||||||
$this->namedtag["SpawnY"] = (int) $this->spawnPosition->y;
|
$this->namedtag["SpawnY"] = (int) $this->spawnPosition->y;
|
||||||
$this->namedtag["SpawnZ"] = (int) $this->spawnPosition->z;
|
$this->namedtag["SpawnZ"] = (int) $this->spawnPosition->z;
|
||||||
@ -3320,7 +3387,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendPosition(Vector3 $pos, $yaw = null, $pitch = null, $mode = 0, array $targets = null){
|
public function sendPosition(Vector3 $pos, $yaw = null, $pitch = null, $mode = MovePlayerPacket::MODE_NORMAL, array $targets = null){
|
||||||
$yaw = $yaw === null ? $this->yaw : $yaw;
|
$yaw = $yaw === null ? $this->yaw : $yaw;
|
||||||
$pitch = $pitch === null ? $this->pitch : $pitch;
|
$pitch = $pitch === null ? $this->pitch : $pitch;
|
||||||
|
|
||||||
@ -3335,11 +3402,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$pk->mode = $mode;
|
$pk->mode = $mode;
|
||||||
|
|
||||||
if($targets !== null){
|
if($targets !== null){
|
||||||
Server::broadcastPacket($targets, $pk);
|
$this->server->broadcastPacket($targets, $pk);
|
||||||
}else{
|
}else{
|
||||||
$pk->eid = 0;
|
$pk->eid = 0;
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->newPosition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkChunks(){
|
protected function checkChunks(){
|
||||||
@ -3390,7 +3459,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sendPosition($this, null, null, 1);
|
$this->sendPosition($this, null, null, MovePlayerPacket::MODE_RESET);
|
||||||
$this->spawnToAll();
|
$this->spawnToAll();
|
||||||
$this->forceMovement = $this->teleportPosition;
|
$this->forceMovement = $this->teleportPosition;
|
||||||
$this->teleportPosition = null;
|
$this->teleportPosition = null;
|
||||||
@ -3459,7 +3528,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->forceMovement = new Vector3($this->x, $this->y, $this->z);
|
$this->forceMovement = new Vector3($this->x, $this->y, $this->z);
|
||||||
$this->sendPosition($this, $this->yaw, $this->pitch, 1);
|
$this->sendPosition($this, $this->yaw, $this->pitch, MovePlayerPacket::MODE_RESET);
|
||||||
|
|
||||||
$this->resetFallDistance();
|
$this->resetFallDistance();
|
||||||
$this->orderChunks();
|
$this->orderChunks();
|
||||||
@ -3535,20 +3604,24 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$this->server->getPlayerMetadata()->removeMetadata($this, $metadataKey, $plugin);
|
$this->server->getPlayerMetadata()->removeMetadata($this, $metadataKey, $plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onChunkChanged(FullChunk $chunk){
|
public function onChunkChanged(Chunk $chunk){
|
||||||
$this->loadQueue[Level::chunkHash($chunk->getX(), $chunk->getZ())] = abs(($this->x >> 4) - $chunk->getX()) + abs(($this->z >> 4) - $chunk->getZ());
|
unset($this->usedChunks[Level::chunkHash($chunk->getX(), $chunk->getZ())]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onChunkLoaded(FullChunk $chunk){
|
public function onChunkLoaded(Chunk $chunk){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onChunkPopulated(FullChunk $chunk){
|
public function onChunkPopulated(Chunk $chunk){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onChunkUnloaded(FullChunk $chunk){
|
public function onChunkUnloaded(Chunk $chunk){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onBlockChanged(Vector3 $block){
|
public function onBlockChanged(Vector3 $block){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLoaderId(){
|
public function getLoaderId(){
|
||||||
@ -3558,29 +3631,4 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
public function isLoaderActive(){
|
public function isLoaderActive(){
|
||||||
return $this->isConnected();
|
return $this->isConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $chunkX
|
|
||||||
* @param int $chunkZ
|
|
||||||
* @param string $payload
|
|
||||||
* @param int $ordering
|
|
||||||
*
|
|
||||||
* @return DataPacket
|
|
||||||
*/
|
|
||||||
public static function getChunkCacheFromData($chunkX, $chunkZ, $payload, $ordering = FullChunkDataPacket::ORDER_COLUMNS){
|
|
||||||
$pk = new FullChunkDataPacket();
|
|
||||||
$pk->chunkX = $chunkX;
|
|
||||||
$pk->chunkZ = $chunkZ;
|
|
||||||
$pk->order = $ordering;
|
|
||||||
$pk->data = $payload;
|
|
||||||
$pk->encode();
|
|
||||||
|
|
||||||
$batch = new BatchPacket();
|
|
||||||
$batch->payload = zlib_encode(Binary::writeUnsignedVarInt(strlen($pk->getBuffer())) . $pk->getBuffer(), ZLIB_ENCODING_DEFLATE, Server::getInstance()->networkCompressionLevel);
|
|
||||||
|
|
||||||
$batch->encode();
|
|
||||||
$batch->isEncoded = true;
|
|
||||||
return $batch;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace {
|
|||||||
case is_array($var):
|
case is_array($var):
|
||||||
echo str_repeat(" ", $cnt) . "array(" . count($var) . ") {" . PHP_EOL;
|
echo str_repeat(" ", $cnt) . "array(" . count($var) . ") {" . PHP_EOL;
|
||||||
foreach($var as $key => $value){
|
foreach($var as $key => $value){
|
||||||
echo str_repeat(" ", $cnt + 1) . "[" . (is_integer($key) ? $key : '"' . $key . '"') . "]=>" . PHP_EOL;
|
echo str_repeat(" ", $cnt + 1) . "[" . (is_int($key) ? $key : '"' . $key . '"') . "]=>" . PHP_EOL;
|
||||||
++$cnt;
|
++$cnt;
|
||||||
safe_var_dump($value);
|
safe_var_dump($value);
|
||||||
--$cnt;
|
--$cnt;
|
||||||
@ -70,14 +70,12 @@ namespace pocketmine {
|
|||||||
use pocketmine\utils\ServerKiller;
|
use pocketmine\utils\ServerKiller;
|
||||||
use pocketmine\utils\Terminal;
|
use pocketmine\utils\Terminal;
|
||||||
use pocketmine\utils\Utils;
|
use pocketmine\utils\Utils;
|
||||||
use pocketmine\wizard\Installer;
|
use pocketmine\wizard\SetupWizard;
|
||||||
use raklib\RakLib;
|
use raklib\RakLib;
|
||||||
|
|
||||||
const VERSION = "1.6.1dev";
|
const VERSION = "1.6.2dev";
|
||||||
const API_VERSION = "2.1.0";
|
const API_VERSION = "3.0.0-ALPHA4";
|
||||||
const CODENAME = "Unleashed";
|
const CODENAME = "Unleashed";
|
||||||
const MINECRAFT_VERSION = "v0.16.0.5 alpha";
|
|
||||||
const MINECRAFT_VERSION_NETWORK = "0.16.0.5";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Startup code. Do not look at it, it may harm you.
|
* Startup code. Do not look at it, it may harm you.
|
||||||
@ -112,10 +110,9 @@ namespace pocketmine {
|
|||||||
}
|
}
|
||||||
require_once(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
require_once(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
||||||
require_once(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
require_once(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
||||||
require_once(\pocketmine\PATH . "src/pocketmine/CompatibleClassLoader.php");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$autoloader = new CompatibleClassLoader();
|
$autoloader = new \BaseClassLoader();
|
||||||
$autoloader->addPath(\pocketmine\PATH . "src");
|
$autoloader->addPath(\pocketmine\PATH . "src");
|
||||||
$autoloader->addPath(\pocketmine\PATH . "src" . DIRECTORY_SEPARATOR . "spl");
|
$autoloader->addPath(\pocketmine\PATH . "src" . DIRECTORY_SEPARATOR . "spl");
|
||||||
$autoloader->register(true);
|
$autoloader->register(true);
|
||||||
@ -444,11 +441,6 @@ namespace pocketmine {
|
|||||||
++$errors;
|
++$errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!extension_loaded("sqlite3")){
|
|
||||||
$logger->critical("Unable to find the SQLite3 extension.");
|
|
||||||
++$errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!extension_loaded("zlib")){
|
if(!extension_loaded("zlib")){
|
||||||
$logger->critical("Unable to find the Zlib extension.");
|
$logger->critical("Unable to find the Zlib extension.");
|
||||||
++$errors;
|
++$errors;
|
||||||
@ -461,9 +453,18 @@ namespace pocketmine {
|
|||||||
exit(1); //Exit with error
|
exit(1); //Exit with error
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists(\pocketmine\PATH . ".git/refs/heads/master")){ //Found Git information!
|
if(file_exists(\pocketmine\PATH . ".git/HEAD")){ //Found Git information!
|
||||||
define('pocketmine\GIT_COMMIT', strtolower(trim(file_get_contents(\pocketmine\PATH . ".git/refs/heads/master"))));
|
$ref = trim(file_get_contents(\pocketmine\PATH . ".git/HEAD"));
|
||||||
}else{ //Unknown :(
|
if(preg_match('/^[0-9a-f]{40}$/i', $ref)){
|
||||||
|
define('pocketmine\GIT_COMMIT', strtolower($ref));
|
||||||
|
}elseif(substr($ref, 0, 5) === "ref: "){
|
||||||
|
$refFile = \pocketmine\PATH . ".git/" . substr($ref, 5);
|
||||||
|
if(is_file($refFile)){
|
||||||
|
define('pocketmine\GIT_COMMIT', strtolower(trim(file_get_contents($refFile))));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!defined('pocketmine\GIT_COMMIT')){ //Unknown :(
|
||||||
define('pocketmine\GIT_COMMIT', str_repeat("00", 20));
|
define('pocketmine\GIT_COMMIT', str_repeat("00", 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,32 +472,53 @@ namespace pocketmine {
|
|||||||
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
|
@define("INT32_MASK", is_int(0xffffffff) ? 0xffffffff : -1);
|
||||||
@ini_set("opcache.mmap_base", bin2hex(random_bytes(8))); //Fix OPCache address errors
|
@ini_set("opcache.mmap_base", bin2hex(random_bytes(8))); //Fix OPCache address errors
|
||||||
|
|
||||||
|
|
||||||
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
|
if(!file_exists(\pocketmine\DATA . "server.properties") and !isset($opts["no-wizard"])){
|
||||||
new Installer();
|
$installer = new SetupWizard();
|
||||||
|
if(!$installer->run()){
|
||||||
|
$logger->shutdown();
|
||||||
|
$logger->join();
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(\Phar::running(true) === ""){
|
if(\Phar::running(true) === ""){
|
||||||
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
|
$logger->warning("Non-packaged PocketMine-MP installation detected, do not use on production.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadManager::init();
|
ThreadManager::init();
|
||||||
$server = new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
||||||
|
|
||||||
$logger->info("Stopping other threads");
|
$logger->info("Stopping other threads");
|
||||||
|
|
||||||
$killer = new ServerKiller(8);
|
$killer = new ServerKiller(8);
|
||||||
$killer->start();
|
$killer->start();
|
||||||
|
|
||||||
|
$erroredThreads = 0;
|
||||||
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
||||||
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
$logger->debug("Stopping " . $thread->getThreadName() . " thread");
|
||||||
$thread->quit();
|
try{
|
||||||
|
$thread->quit();
|
||||||
|
$logger->debug($thread->getThreadName() . " thread stopped successfully.");
|
||||||
|
}catch(\ThreadException $e){
|
||||||
|
++$erroredThreads;
|
||||||
|
$logger->debug("Could not stop " . $thread->getThreadName() . " thread: " . $e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$logger->shutdown();
|
$logger->shutdown();
|
||||||
$logger->join();
|
$logger->join();
|
||||||
|
|
||||||
echo Terminal::$FORMAT_RESET . "\n";
|
echo Terminal::$FORMAT_RESET . PHP_EOL;
|
||||||
|
|
||||||
exit(0);
|
if($erroredThreads > 0){
|
||||||
|
if(\pocketmine\DEBUG > 1){
|
||||||
|
echo "Some threads could not be stopped, performing a force-kill" . PHP_EOL . PHP_EOL;
|
||||||
|
}
|
||||||
|
kill(getmypid());
|
||||||
|
}else{
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,18 +31,9 @@ use pocketmine\command\CommandSender;
|
|||||||
use pocketmine\command\ConsoleCommandSender;
|
use pocketmine\command\ConsoleCommandSender;
|
||||||
use pocketmine\command\PluginIdentifiableCommand;
|
use pocketmine\command\PluginIdentifiableCommand;
|
||||||
use pocketmine\command\SimpleCommandMap;
|
use pocketmine\command\SimpleCommandMap;
|
||||||
use pocketmine\entity\Arrow;
|
|
||||||
use pocketmine\entity\Attribute;
|
use pocketmine\entity\Attribute;
|
||||||
use pocketmine\entity\Effect;
|
use pocketmine\entity\Effect;
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\entity\FallingSand;
|
|
||||||
use pocketmine\entity\Human;
|
|
||||||
use pocketmine\entity\Item as DroppedItem;
|
|
||||||
use pocketmine\entity\PrimedTNT;
|
|
||||||
use pocketmine\entity\Snowball;
|
|
||||||
use pocketmine\entity\Squid;
|
|
||||||
use pocketmine\entity\Villager;
|
|
||||||
use pocketmine\entity\Zombie;
|
|
||||||
use pocketmine\event\HandlerList;
|
use pocketmine\event\HandlerList;
|
||||||
use pocketmine\event\level\LevelInitEvent;
|
use pocketmine\event\level\LevelInitEvent;
|
||||||
use pocketmine\event\level\LevelLoadEvent;
|
use pocketmine\event\level\LevelLoadEvent;
|
||||||
@ -54,21 +45,21 @@ use pocketmine\event\TranslationContainer;
|
|||||||
use pocketmine\inventory\CraftingManager;
|
use pocketmine\inventory\CraftingManager;
|
||||||
use pocketmine\inventory\InventoryType;
|
use pocketmine\inventory\InventoryType;
|
||||||
use pocketmine\inventory\Recipe;
|
use pocketmine\inventory\Recipe;
|
||||||
use pocketmine\inventory\ShapedRecipe;
|
|
||||||
use pocketmine\inventory\ShapelessRecipe;
|
|
||||||
use pocketmine\item\enchantment\Enchantment;
|
use pocketmine\item\enchantment\Enchantment;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\lang\BaseLang;
|
use pocketmine\lang\BaseLang;
|
||||||
use pocketmine\level\format\anvil\Anvil;
|
use pocketmine\level\format\io\LevelProviderManager;
|
||||||
use pocketmine\level\format\leveldb\LevelDB;
|
use pocketmine\level\format\io\leveldb\LevelDB;
|
||||||
use pocketmine\level\format\LevelProviderManager;
|
use pocketmine\level\format\io\region\Anvil;
|
||||||
use pocketmine\level\format\mcregion\McRegion;
|
use pocketmine\level\format\io\region\McRegion;
|
||||||
|
use pocketmine\level\format\io\region\PMAnvil;
|
||||||
use pocketmine\level\generator\biome\Biome;
|
use pocketmine\level\generator\biome\Biome;
|
||||||
use pocketmine\level\generator\Flat;
|
use pocketmine\level\generator\Flat;
|
||||||
use pocketmine\level\generator\Generator;
|
use pocketmine\level\generator\Generator;
|
||||||
use pocketmine\level\generator\hell\Nether;
|
use pocketmine\level\generator\hell\Nether;
|
||||||
use pocketmine\level\generator\normal\Normal;
|
use pocketmine\level\generator\normal\Normal;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\level\LevelException;
|
||||||
use pocketmine\metadata\EntityMetadataStore;
|
use pocketmine\metadata\EntityMetadataStore;
|
||||||
use pocketmine\metadata\LevelMetadataStore;
|
use pocketmine\metadata\LevelMetadataStore;
|
||||||
use pocketmine\metadata\PlayerMetadataStore;
|
use pocketmine\metadata\PlayerMetadataStore;
|
||||||
@ -85,8 +76,8 @@ use pocketmine\nbt\tag\StringTag;
|
|||||||
use pocketmine\network\CompressBatchedTask;
|
use pocketmine\network\CompressBatchedTask;
|
||||||
use pocketmine\network\Network;
|
use pocketmine\network\Network;
|
||||||
use pocketmine\network\protocol\BatchPacket;
|
use pocketmine\network\protocol\BatchPacket;
|
||||||
use pocketmine\network\protocol\CraftingDataPacket;
|
|
||||||
use pocketmine\network\protocol\DataPacket;
|
use pocketmine\network\protocol\DataPacket;
|
||||||
|
use pocketmine\network\protocol\Info as ProtocolInfo;
|
||||||
use pocketmine\network\protocol\PlayerListPacket;
|
use pocketmine\network\protocol\PlayerListPacket;
|
||||||
use pocketmine\network\query\QueryHandler;
|
use pocketmine\network\query\QueryHandler;
|
||||||
use pocketmine\network\RakLibInterface;
|
use pocketmine\network\RakLibInterface;
|
||||||
@ -102,17 +93,10 @@ use pocketmine\plugin\ScriptPluginLoader;
|
|||||||
use pocketmine\scheduler\FileWriteTask;
|
use pocketmine\scheduler\FileWriteTask;
|
||||||
use pocketmine\scheduler\SendUsageTask;
|
use pocketmine\scheduler\SendUsageTask;
|
||||||
use pocketmine\scheduler\ServerScheduler;
|
use pocketmine\scheduler\ServerScheduler;
|
||||||
use pocketmine\tile\Chest;
|
|
||||||
use pocketmine\tile\EnchantTable;
|
|
||||||
use pocketmine\tile\FlowerPot;
|
|
||||||
use pocketmine\tile\Furnace;
|
|
||||||
use pocketmine\tile\Sign;
|
|
||||||
use pocketmine\tile\Skull;
|
|
||||||
use pocketmine\tile\Tile;
|
use pocketmine\tile\Tile;
|
||||||
use pocketmine\updater\AutoUpdater;
|
use pocketmine\updater\AutoUpdater;
|
||||||
use pocketmine\utils\Binary;
|
use pocketmine\utils\Binary;
|
||||||
use pocketmine\utils\Config;
|
use pocketmine\utils\Config;
|
||||||
use pocketmine\utils\LevelException;
|
|
||||||
use pocketmine\utils\MainLogger;
|
use pocketmine\utils\MainLogger;
|
||||||
use pocketmine\utils\Terminal;
|
use pocketmine\utils\Terminal;
|
||||||
use pocketmine\utils\TextFormat;
|
use pocketmine\utils\TextFormat;
|
||||||
@ -170,8 +154,8 @@ class Server{
|
|||||||
private $nextTick = 0;
|
private $nextTick = 0;
|
||||||
private $tickAverage = [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20];
|
private $tickAverage = [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20];
|
||||||
private $useAverage = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
private $useAverage = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
private $maxTick = 20;
|
private $currentTPS = 20;
|
||||||
private $maxUse = 0;
|
private $currentUse = 0;
|
||||||
|
|
||||||
private $sendUsageTicker = 0;
|
private $sendUsageTicker = 0;
|
||||||
|
|
||||||
@ -185,7 +169,6 @@ class Server{
|
|||||||
|
|
||||||
/** @var CommandReader */
|
/** @var CommandReader */
|
||||||
private $console = null;
|
private $console = null;
|
||||||
private $consoleThreaded;
|
|
||||||
|
|
||||||
/** @var SimpleCommandMap */
|
/** @var SimpleCommandMap */
|
||||||
private $commandMap = null;
|
private $commandMap = null;
|
||||||
@ -302,7 +285,7 @@ class Server{
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getVersion(){
|
public function getVersion(){
|
||||||
return \pocketmine\MINECRAFT_VERSION;
|
return ProtocolInfo::MINECRAFT_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -620,7 +603,7 @@ class Server{
|
|||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
public function getTicksPerSecond(){
|
public function getTicksPerSecond(){
|
||||||
return round($this->maxTick, 2);
|
return round($this->currentTPS, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -638,7 +621,7 @@ class Server{
|
|||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
public function getTickUsage(){
|
public function getTickUsage(){
|
||||||
return round($this->maxUse * 100, 2);
|
return round($this->currentUse * 100, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1021,13 +1004,13 @@ class Server{
|
|||||||
$generator = Generator::getGenerator($this->getLevelType());
|
$generator = Generator::getGenerator($this->getLevelType());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($provider = LevelProviderManager::getProviderByName($providerName = $this->getProperty("level-settings.default-format", "mcregion"))) === null){
|
if(($provider = LevelProviderManager::getProviderByName($providerName = $this->getProperty("level-settings.default-format", "pmanvil"))) === null){
|
||||||
$provider = LevelProviderManager::getProviderByName($providerName = "mcregion");
|
$provider = LevelProviderManager::getProviderByName($providerName = "pmanvil");
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$path = $this->getDataPath() . "worlds/" . $name . "/";
|
$path = $this->getDataPath() . "worlds/" . $name . "/";
|
||||||
/** @var \pocketmine\level\format\LevelProvider $provider */
|
/** @var \pocketmine\level\format\io\LevelProvider $provider */
|
||||||
$provider::generate($path, $name, $seed, $generator, $options);
|
$provider::generate($path, $name, $seed, $generator, $options);
|
||||||
|
|
||||||
$level = new Level($this, $name, $path, $provider);
|
$level = new Level($this, $name, $path, $provider);
|
||||||
@ -1466,7 +1449,11 @@ class Server{
|
|||||||
|
|
||||||
define('pocketmine\DEBUG', (int) $this->getProperty("debug.level", 1));
|
define('pocketmine\DEBUG', (int) $this->getProperty("debug.level", 1));
|
||||||
|
|
||||||
ini_set('assert.exception', 1);
|
if(((int) ini_get('zend.assertions')) > 0 and ((bool) $this->getProperty("debug.assertions.warn-if-enabled", true)) !== false){
|
||||||
|
$this->logger->warning("Debugging assertions are enabled, this may impact on performance. To disable them, set `zend.assertions = -1` in php.ini.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ini_set('assert.exception', (bool) $this->getProperty("debug.assertions.throw-exception", 0));
|
||||||
|
|
||||||
if($this->logger instanceof MainLogger){
|
if($this->logger instanceof MainLogger){
|
||||||
$this->logger->setLogDebug(\pocketmine\DEBUG > 1);
|
$this->logger->setLogDebug(\pocketmine\DEBUG > 1);
|
||||||
@ -1500,9 +1487,8 @@ class Server{
|
|||||||
$this->consoleSender = new ConsoleCommandSender();
|
$this->consoleSender = new ConsoleCommandSender();
|
||||||
$this->commandMap = new SimpleCommandMap($this);
|
$this->commandMap = new SimpleCommandMap($this);
|
||||||
|
|
||||||
$this->registerEntities();
|
Entity::init();
|
||||||
$this->registerTiles();
|
Tile::init();
|
||||||
|
|
||||||
InventoryType::init();
|
InventoryType::init();
|
||||||
Block::init();
|
Block::init();
|
||||||
Enchantment::init();
|
Enchantment::init();
|
||||||
@ -1530,11 +1516,12 @@ class Server{
|
|||||||
|
|
||||||
$this->enablePlugins(PluginLoadOrder::STARTUP);
|
$this->enablePlugins(PluginLoadOrder::STARTUP);
|
||||||
|
|
||||||
LevelProviderManager::addProvider($this, Anvil::class);
|
LevelProviderManager::addProvider(Anvil::class);
|
||||||
LevelProviderManager::addProvider($this, McRegion::class);
|
LevelProviderManager::addProvider(McRegion::class);
|
||||||
|
LevelProviderManager::addProvider(PMAnvil::class);
|
||||||
if(extension_loaded("leveldb")){
|
if(extension_loaded("leveldb")){
|
||||||
$this->logger->debug($this->getLanguage()->translateString("pocketmine.debug.enable"));
|
$this->logger->debug($this->getLanguage()->translateString("pocketmine.debug.enable"));
|
||||||
LevelProviderManager::addProvider($this, LevelDB::class);
|
LevelProviderManager::addProvider(LevelDB::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1704,11 +1691,11 @@ class Server{
|
|||||||
* @param Player[] $players
|
* @param Player[] $players
|
||||||
* @param DataPacket $packet
|
* @param DataPacket $packet
|
||||||
*/
|
*/
|
||||||
public static function broadcastPacket(array $players, DataPacket $packet){
|
public function broadcastPacket(array $players, DataPacket $packet){
|
||||||
$packet->encode();
|
$packet->encode();
|
||||||
$packet->isEncoded = true;
|
$packet->isEncoded = true;
|
||||||
if(Network::$BATCH_THRESHOLD >= 0 and strlen($packet->buffer) >= Network::$BATCH_THRESHOLD){
|
if(Network::$BATCH_THRESHOLD >= 0 and strlen($packet->buffer) >= Network::$BATCH_THRESHOLD){
|
||||||
Server::getInstance()->batchPackets($players, [$packet->buffer], false);
|
$this->batchPackets($players, [$packet->buffer], false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1818,8 +1805,6 @@ class Server{
|
|||||||
* @param string $commandLine
|
* @param string $commandLine
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
*/
|
||||||
public function dispatchCommand(CommandSender $sender, $commandLine){
|
public function dispatchCommand(CommandSender $sender, $commandLine){
|
||||||
if($this->commandMap->dispatch($sender, $commandLine)){
|
if($this->commandMap->dispatch($sender, $commandLine)){
|
||||||
@ -2100,7 +2085,7 @@ class Server{
|
|||||||
$next = $this->nextTick - 0.0001;
|
$next = $this->nextTick - 0.0001;
|
||||||
if($next > microtime(true)){
|
if($next > microtime(true)){
|
||||||
try{
|
try{
|
||||||
time_sleep_until($next);
|
@time_sleep_until($next);
|
||||||
}catch(\Throwable $e){
|
}catch(\Throwable $e){
|
||||||
//Sometimes $next is less than the current time. High load?
|
//Sometimes $next is less than the current time. High load?
|
||||||
}
|
}
|
||||||
@ -2114,7 +2099,7 @@ class Server{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->sendFullPlayerListData($player);
|
$this->sendFullPlayerListData($player);
|
||||||
$this->sendRecipeList($player);
|
$player->dataPacket($this->craftingManager->getCraftingDataPacket());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addPlayer($identifier, Player $player){
|
public function addPlayer($identifier, Player $player){
|
||||||
@ -2135,7 +2120,7 @@ class Server{
|
|||||||
$pk = new PlayerListPacket();
|
$pk = new PlayerListPacket();
|
||||||
$pk->type = PlayerListPacket::TYPE_REMOVE;
|
$pk->type = PlayerListPacket::TYPE_REMOVE;
|
||||||
$pk->entries[] = [$player->getUniqueId()];
|
$pk->entries[] = [$player->getUniqueId()];
|
||||||
Server::broadcastPacket($this->playerList, $pk);
|
$this->broadcastPacket($this->playerList, $pk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2143,14 +2128,14 @@ class Server{
|
|||||||
$pk = new PlayerListPacket();
|
$pk = new PlayerListPacket();
|
||||||
$pk->type = PlayerListPacket::TYPE_ADD;
|
$pk->type = PlayerListPacket::TYPE_ADD;
|
||||||
$pk->entries[] = [$uuid, $entityId, $name, $skinId, $skinData];
|
$pk->entries[] = [$uuid, $entityId, $name, $skinId, $skinData];
|
||||||
Server::broadcastPacket($players === null ? $this->playerList : $players, $pk);
|
$this->broadcastPacket($players === null ? $this->playerList : $players, $pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removePlayerListData(UUID $uuid, array $players = null){
|
public function removePlayerListData(UUID $uuid, array $players = null){
|
||||||
$pk = new PlayerListPacket();
|
$pk = new PlayerListPacket();
|
||||||
$pk->type = PlayerListPacket::TYPE_REMOVE;
|
$pk->type = PlayerListPacket::TYPE_REMOVE;
|
||||||
$pk->entries[] = [$uuid];
|
$pk->entries[] = [$uuid];
|
||||||
Server::broadcastPacket($players === null ? $this->playerList : $players, $pk);
|
$this->broadcastPacket($players === null ? $this->playerList : $players, $pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendFullPlayerListData(Player $p){
|
public function sendFullPlayerListData(Player $p){
|
||||||
@ -2166,25 +2151,6 @@ class Server{
|
|||||||
$p->dataPacket($pk);
|
$p->dataPacket($pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendRecipeList(Player $p){
|
|
||||||
$pk = new CraftingDataPacket();
|
|
||||||
$pk->cleanRecipes = true;
|
|
||||||
|
|
||||||
foreach($this->getCraftingManager()->getRecipes() as $recipe){
|
|
||||||
if($recipe instanceof ShapedRecipe){
|
|
||||||
$pk->addShapedRecipe($recipe);
|
|
||||||
}elseif($recipe instanceof ShapelessRecipe){
|
|
||||||
$pk->addShapelessRecipe($recipe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($this->getCraftingManager()->getFurnaceRecipes() as $recipe){
|
|
||||||
$pk->addFurnaceRecipe($recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
$p->dataPacket($pk);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function checkTickUpdates($currentTick, $tickTime){
|
private function checkTickUpdates($currentTick, $tickTime){
|
||||||
foreach($this->players as $p){
|
foreach($this->players as $p){
|
||||||
if(!$p->loggedIn and ($tickTime - $p->creationTime) >= 10){
|
if(!$p->loggedIn and ($tickTime - $p->creationTime) >= 10){
|
||||||
@ -2298,8 +2264,8 @@ class Server{
|
|||||||
" | Memory " . $usage .
|
" | Memory " . $usage .
|
||||||
" | U " . round($this->network->getUpload() / 1024, 2) .
|
" | U " . round($this->network->getUpload() / 1024, 2) .
|
||||||
" D " . round($this->network->getDownload() / 1024, 2) .
|
" D " . round($this->network->getDownload() / 1024, 2) .
|
||||||
" kB/s | TPS " . $this->getTicksPerSecond() .
|
" kB/s | TPS " . $this->getTicksPerSecondAverage() .
|
||||||
" | Load " . $this->getTickUsage() . "%\x07";
|
" | Load " . $this->getTickUsageAverage() . "%\x07";
|
||||||
|
|
||||||
$this->network->resetStatistics();
|
$this->network->resetStatistics();
|
||||||
}
|
}
|
||||||
@ -2363,8 +2329,8 @@ class Server{
|
|||||||
|
|
||||||
if(($this->tickCounter & 0b1111) === 0){
|
if(($this->tickCounter & 0b1111) === 0){
|
||||||
$this->titleTick();
|
$this->titleTick();
|
||||||
$this->maxTick = 20;
|
$this->currentTPS = 20;
|
||||||
$this->maxUse = 0;
|
$this->currentUse = 0;
|
||||||
|
|
||||||
if(($this->tickCounter & 0b111111111) === 0){
|
if(($this->tickCounter & 0b111111111) === 0){
|
||||||
try{
|
try{
|
||||||
@ -2409,23 +2375,15 @@ class Server{
|
|||||||
Timings::$serverTickTimer->stopTiming();
|
Timings::$serverTickTimer->stopTiming();
|
||||||
|
|
||||||
$now = microtime(true);
|
$now = microtime(true);
|
||||||
$tick = min(20, 1 / max(0.001, $now - $tickTime));
|
$this->currentTPS = min(20, 1 / max(0.001, $now - $tickTime));
|
||||||
$use = min(1, ($now - $tickTime) / 0.05);
|
$this->currentUse = min(1, ($now - $tickTime) / 0.05);
|
||||||
|
|
||||||
TimingsHandler::tick($tick <= $this->profilingTickRate);
|
TimingsHandler::tick($this->currentTPS <= $this->profilingTickRate);
|
||||||
|
|
||||||
if($this->maxTick > $tick){
|
|
||||||
$this->maxTick = $tick;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->maxUse < $use){
|
|
||||||
$this->maxUse = $use;
|
|
||||||
}
|
|
||||||
|
|
||||||
array_shift($this->tickAverage);
|
array_shift($this->tickAverage);
|
||||||
$this->tickAverage[] = $tick;
|
$this->tickAverage[] = $this->currentTPS;
|
||||||
array_shift($this->useAverage);
|
array_shift($this->useAverage);
|
||||||
$this->useAverage[] = $use;
|
$this->useAverage[] = $this->currentUse;
|
||||||
|
|
||||||
if(($this->nextTick - $tickTime) < -1){
|
if(($this->nextTick - $tickTime) < -1){
|
||||||
$this->nextTick = $tickTime;
|
$this->nextTick = $tickTime;
|
||||||
@ -2435,27 +2393,4 @@ class Server{
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function registerEntities(){
|
|
||||||
Entity::registerEntity(Arrow::class);
|
|
||||||
Entity::registerEntity(DroppedItem::class);
|
|
||||||
Entity::registerEntity(FallingSand::class);
|
|
||||||
Entity::registerEntity(PrimedTNT::class);
|
|
||||||
Entity::registerEntity(Snowball::class);
|
|
||||||
Entity::registerEntity(Villager::class);
|
|
||||||
Entity::registerEntity(Zombie::class);
|
|
||||||
Entity::registerEntity(Squid::class);
|
|
||||||
|
|
||||||
Entity::registerEntity(Human::class, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function registerTiles(){
|
|
||||||
Tile::registerTile(Chest::class);
|
|
||||||
Tile::registerTile(EnchantTable::class);
|
|
||||||
Tile::registerTile(FlowerPot::class);
|
|
||||||
Tile::registerTile(Furnace::class);
|
|
||||||
Tile::registerTile(Sign::class);
|
|
||||||
Tile::registerTile(Skull::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,6 @@ abstract class Thread extends \Thread{
|
|||||||
if(!interface_exists("ClassLoader", false)){
|
if(!interface_exists("ClassLoader", false)){
|
||||||
require(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
require(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
||||||
require(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
require(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
||||||
require(\pocketmine\PATH . "src/pocketmine/CompatibleClassLoader.php");
|
|
||||||
}
|
}
|
||||||
if($this->classLoader !== null){
|
if($this->classLoader !== null){
|
||||||
$this->classLoader->register(true);
|
$this->classLoader->register(true);
|
||||||
|
@ -46,7 +46,6 @@ abstract class Worker extends \Worker{
|
|||||||
if(!interface_exists("ClassLoader", false)){
|
if(!interface_exists("ClassLoader", false)){
|
||||||
require(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
require(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
||||||
require(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
require(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
||||||
require(\pocketmine\PATH . "src/pocketmine/CompatibleClassLoader.php");
|
|
||||||
}
|
}
|
||||||
if($this->classLoader !== null){
|
if($this->classLoader !== null){
|
||||||
$this->classLoader->register(true);
|
$this->classLoader->register(true);
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
class ActivatorRail extends Solid{
|
class ActivatorRail extends Rail{
|
||||||
|
|
||||||
protected $id = self::ACTIVATOR_RAIL;
|
protected $id = self::ACTIVATOR_RAIL;
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,12 +15,13 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\event\TranslationContainer;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
@ -65,7 +66,7 @@ class Bed extends Transparent{
|
|||||||
$isNight = ($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE);
|
$isNight = ($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE);
|
||||||
|
|
||||||
if($player instanceof Player and !$isNight){
|
if($player instanceof Player and !$isNight){
|
||||||
$player->sendMessage(TextFormat::GRAY . "You can only sleep at night");
|
$player->sendMessage(new TranslationContainer(TextFormat::GRAY . "%tile.bed.noSleep"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +95,7 @@ class Bed extends Transparent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($player instanceof Player and $player->sleepOn($b) === false){
|
if($player instanceof Player and $player->sleepOn($b) === false){
|
||||||
$player->sendMessage(TextFormat::GRAY . "This bed is occupied");
|
$player->sendMessage(new TranslationContainer(TextFormat::GRAY . "%tile.bed.occupied"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -162,4 +163,4 @@ class Bed extends Transparent{
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -221,7 +221,8 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
self::$list[self::WOOD2] = Wood2::class;
|
self::$list[self::WOOD2] = Wood2::class;
|
||||||
self::$list[self::ACACIA_WOOD_STAIRS] = AcaciaWoodStairs::class;
|
self::$list[self::ACACIA_WOOD_STAIRS] = AcaciaWoodStairs::class;
|
||||||
self::$list[self::DARK_OAK_WOOD_STAIRS] = DarkOakWoodStairs::class;
|
self::$list[self::DARK_OAK_WOOD_STAIRS] = DarkOakWoodStairs::class;
|
||||||
|
self::$list[self::PRISMARINE] = Prismarine::class;
|
||||||
|
self::$list[self::SEA_LANTERN] = SeaLantern::class;
|
||||||
self::$list[self::IRON_TRAPDOOR] = IronTrapdoor::class;
|
self::$list[self::IRON_TRAPDOOR] = IronTrapdoor::class;
|
||||||
self::$list[self::HAY_BALE] = HayBale::class;
|
self::$list[self::HAY_BALE] = HayBale::class;
|
||||||
self::$list[self::CARPET] = Carpet::class;
|
self::$list[self::CARPET] = Carpet::class;
|
||||||
@ -236,6 +237,8 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
self::$list[self::FENCE_GATE_DARK_OAK] = FenceGateDarkOak::class;
|
self::$list[self::FENCE_GATE_DARK_OAK] = FenceGateDarkOak::class;
|
||||||
self::$list[self::FENCE_GATE_ACACIA] = FenceGateAcacia::class;
|
self::$list[self::FENCE_GATE_ACACIA] = FenceGateAcacia::class;
|
||||||
|
|
||||||
|
self::$list[self::ITEM_FRAME_BLOCK] = ItemFrame::class;
|
||||||
|
|
||||||
self::$list[self::GRASS_PATH] = GrassPath::class;
|
self::$list[self::GRASS_PATH] = GrassPath::class;
|
||||||
|
|
||||||
self::$list[self::PODZOL] = Podzol::class;
|
self::$list[self::PODZOL] = Podzol::class;
|
||||||
@ -273,7 +276,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
}else{
|
}else{
|
||||||
self::$lightFilter[$id] = 1;
|
self::$lightFilter[$id] = 1;
|
||||||
for($data = 0; $data < 16; ++$data){
|
for($data = 0; $data < 16; ++$data){
|
||||||
self::$fullList[($id << 4) | $data] = new Block($id, $data);
|
self::$fullList[($id << 4) | $data] = new UnknownBlock($id, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,10 +296,10 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
if($block !== null){
|
if($block !== null){
|
||||||
$block = new $block($meta);
|
$block = new $block($meta);
|
||||||
}else{
|
}else{
|
||||||
$block = new Block($id, $meta);
|
$block = new UnknownBlock($id, $meta);
|
||||||
}
|
}
|
||||||
}catch(\RuntimeException $e){
|
}catch(\RuntimeException $e){
|
||||||
$block = new Block($id, $meta);
|
$block = new UnknownBlock($id, $meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($pos !== null){
|
if($pos !== null){
|
||||||
@ -363,10 +366,10 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
*
|
*
|
||||||
* @param int $type
|
* @param int $type
|
||||||
*
|
*
|
||||||
* @return void
|
* @return int|bool
|
||||||
*/
|
*/
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -426,8 +429,6 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AKA: Block->canBeReplaced()
|
|
||||||
*
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function canBeReplaced(){
|
public function canBeReplaced(){
|
||||||
|
@ -161,6 +161,7 @@ interface BlockIds{
|
|||||||
const BIRCH_WOOD_STAIRS = 135, BIRCH_WOODEN_STAIRS = 135;
|
const BIRCH_WOOD_STAIRS = 135, BIRCH_WOODEN_STAIRS = 135;
|
||||||
const JUNGLE_WOOD_STAIRS = 136, JUNGLE_WOODEN_STAIRS = 136;
|
const JUNGLE_WOOD_STAIRS = 136, JUNGLE_WOODEN_STAIRS = 136;
|
||||||
|
|
||||||
|
const BEACON = 138;
|
||||||
const COBBLESTONE_WALL = 139, COBBLE_WALL = 139, STONE_WALL = 139;
|
const COBBLESTONE_WALL = 139, COBBLE_WALL = 139, STONE_WALL = 139;
|
||||||
const FLOWER_POT_BLOCK = 140;
|
const FLOWER_POT_BLOCK = 140;
|
||||||
const CARROT_BLOCK = 141;
|
const CARROT_BLOCK = 141;
|
||||||
@ -190,7 +191,8 @@ interface BlockIds{
|
|||||||
const SLIME_BLOCK = 165;
|
const SLIME_BLOCK = 165;
|
||||||
|
|
||||||
const IRON_TRAPDOOR = 167;
|
const IRON_TRAPDOOR = 167;
|
||||||
|
const PRISMARINE = 168;
|
||||||
|
const SEA_LANTERN = 169;
|
||||||
const HAY_BALE = 170;
|
const HAY_BALE = 170;
|
||||||
const CARPET = 171;
|
const CARPET = 171;
|
||||||
const HARDENED_CLAY = 172;
|
const HARDENED_CLAY = 172;
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ use pocketmine\nbt\tag\IntTag;
|
|||||||
use pocketmine\nbt\tag\ListTag;
|
use pocketmine\nbt\tag\ListTag;
|
||||||
use pocketmine\nbt\tag\StringTag;
|
use pocketmine\nbt\tag\StringTag;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
use pocketmine\tile\Furnace;
|
use pocketmine\tile\Furnace as TileFurnace;
|
||||||
use pocketmine\tile\Tile;
|
use pocketmine\tile\Tile;
|
||||||
|
|
||||||
class BurningFurnace extends Solid{
|
class BurningFurnace extends Solid{
|
||||||
@ -88,7 +88,7 @@ class BurningFurnace extends Solid{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tile::createTile("Furnace", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
|
Tile::createTile("Furnace", $this->getLevel(), $nbt);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -101,11 +101,8 @@ class BurningFurnace extends Solid{
|
|||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null){
|
public function onActivate(Item $item, Player $player = null){
|
||||||
if($player instanceof Player){
|
if($player instanceof Player){
|
||||||
$t = $this->getLevel()->getTile($this);
|
$furnace = $this->getLevel()->getTile($this);
|
||||||
$furnace = false;
|
if(!($furnace instanceof TileFurnace)){
|
||||||
if($t instanceof Furnace){
|
|
||||||
$furnace = $t;
|
|
||||||
}else{
|
|
||||||
$nbt = new CompoundTag("", [
|
$nbt = new CompoundTag("", [
|
||||||
new ListTag("Items", []),
|
new ListTag("Items", []),
|
||||||
new StringTag("id", Tile::FURNACE),
|
new StringTag("id", Tile::FURNACE),
|
||||||
@ -114,7 +111,7 @@ class BurningFurnace extends Solid{
|
|||||||
new IntTag("z", $this->z)
|
new IntTag("z", $this->z)
|
||||||
]);
|
]);
|
||||||
$nbt->Items->setTagType(NBT::TAG_Compound);
|
$nbt->Items->setTagType(NBT::TAG_Compound);
|
||||||
$furnace = Tile::createTile("Furnace", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
|
$furnace = Tile::createTile("Furnace", $this->getLevel(), $nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($furnace->namedtag->Lock) and $furnace->namedtag->Lock instanceof StringTag){
|
if(isset($furnace->namedtag->Lock) and $furnace->namedtag->Lock instanceof StringTag){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ class Chest extends Transparent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tile = Tile::createTile("Chest", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
|
$tile = Tile::createTile("Chest", $this->getLevel(), $nbt);
|
||||||
|
|
||||||
if($chest instanceof TileChest and $tile instanceof TileChest){
|
if($chest instanceof TileChest and $tile instanceof TileChest){
|
||||||
$chest->pairWith($tile);
|
$chest->pairWith($tile);
|
||||||
@ -155,7 +155,7 @@ class Chest extends Transparent{
|
|||||||
new IntTag("z", $this->z)
|
new IntTag("z", $this->z)
|
||||||
]);
|
]);
|
||||||
$nbt->Items->setTagType(NBT::TAG_Compound);
|
$nbt->Items->setTagType(NBT::TAG_Compound);
|
||||||
$chest = Tile::createTile("Chest", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
|
$chest = Tile::createTile("Chest", $this->getLevel(), $nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($chest->namedtag->Lock) and $chest->namedtag->Lock instanceof StringTag){
|
if(isset($chest->namedtag->Lock) and $chest->namedtag->Lock instanceof StringTag){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
class DaylightSensor extends Solid{
|
class DaylightSensor extends Transparent{
|
||||||
|
|
||||||
protected $id = self::DAYLIGHT_SENSOR;
|
protected $id = self::DAYLIGHT_SENSOR;
|
||||||
|
|
||||||
@ -32,4 +32,8 @@ class DaylightSensor extends Solid{
|
|||||||
public function getName(){
|
public function getName(){
|
||||||
return "Daylight Sensor";
|
return "Daylight Sensor";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHardness(){
|
||||||
|
return 0.2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
class DetectorRail extends Solid{
|
class DetectorRail extends Rail{
|
||||||
|
|
||||||
protected $id = self::DETECTOR_RAIL;
|
protected $id = self::DETECTOR_RAIL;
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ class DoublePlant extends Flowable{
|
|||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
if($this->getSide(0)->isTransparent() === true){ //Replace with common break method
|
if($this->getSide(0)->isTransparent() === true){ //Replace with common break method
|
||||||
$this->getLevel()->setBlock($this, new Air(), false, false, true);
|
$this->getLevel()->setBlock($this, new Air(), true, true);
|
||||||
|
|
||||||
return Level::BLOCK_UPDATE_NORMAL;
|
return Level::BLOCK_UPDATE_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ class DoubleSlab extends Solid{
|
|||||||
6 => "Quartz",
|
6 => "Quartz",
|
||||||
7 => "Nether Brick",
|
7 => "Nether Brick",
|
||||||
];
|
];
|
||||||
return "DoubleTag " . $names[$this->meta & 0x07] . " Slab";
|
return "Double " . $names[$this->meta & 0x07] . " Slab";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ class DoubleWoodSlab extends Solid{
|
|||||||
6 => "",
|
6 => "",
|
||||||
7 => ""
|
7 => ""
|
||||||
];
|
];
|
||||||
return "DoubleTag " . $names[$this->meta & 0x07] . " Wooden Slab";
|
return "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class EnchantingTable extends Transparent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tile::createTile(Tile::ENCHANT_TABLE, $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
|
Tile::createTile(Tile::ENCHANT_TABLE, $this->getLevel(), $nbt);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ class EndPortalFrame extends Solid{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "EndTag Portal Frame";
|
return "End Portal Frame";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class EndStone extends Solid{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "EndTag Stone";
|
return "End Stone";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getToolType(){
|
public function getToolType(){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,14 +15,13 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\item\Item;
|
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\nbt\tag\ByteTag;
|
use pocketmine\nbt\tag\ByteTag;
|
||||||
@ -31,21 +30,14 @@ use pocketmine\nbt\tag\DoubleTag;
|
|||||||
use pocketmine\nbt\tag\FloatTag;
|
use pocketmine\nbt\tag\FloatTag;
|
||||||
use pocketmine\nbt\tag\IntTag;
|
use pocketmine\nbt\tag\IntTag;
|
||||||
use pocketmine\nbt\tag\ListTag;
|
use pocketmine\nbt\tag\ListTag;
|
||||||
use pocketmine\Player;
|
|
||||||
|
|
||||||
abstract class Fallable extends Solid{
|
abstract class Fallable extends Solid{
|
||||||
|
|
||||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
|
||||||
$ret = $this->getLevel()->setBlock($this, $this, true, true);
|
|
||||||
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
$down = $this->getSide(Vector3::SIDE_DOWN);
|
$down = $this->getSide(Vector3::SIDE_DOWN);
|
||||||
if($down->getId() === self::AIR or ($down instanceof Liquid)){
|
if($down->getId() === self::AIR or ($down instanceof Liquid)){
|
||||||
$fall = Entity::createEntity("FallingSand", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), new CompoundTag("", [
|
$fall = Entity::createEntity("FallingSand", $this->getLevel(), new CompoundTag("", [
|
||||||
"Pos" => new ListTag("Pos", [
|
"Pos" => new ListTag("Pos", [
|
||||||
new DoubleTag("", $this->x + 0.5),
|
new DoubleTag("", $this->x + 0.5),
|
||||||
new DoubleTag("", $this->y),
|
new DoubleTag("", $this->y),
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -52,14 +52,14 @@ class FlowerPot extends Flowable{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + (5 / 16),
|
$this->x + 0.3125,
|
||||||
$this->y,
|
$this->y,
|
||||||
$this->z + (5 / 16),
|
$this->z + 0.3125,
|
||||||
$this->x + (11 / 16),
|
$this->x + 0.6875,
|
||||||
$this->y + (6 / 16),
|
$this->y + 0.375,
|
||||||
$this->z + (11 / 16)
|
$this->z + 0.6875
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ class FlowerPot extends Flowable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tile::createTile(Tile::FLOWER_POT, $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
|
Tile::createTile(Tile::FLOWER_POT, $this->getLevel(), $nbt);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ class FlowerPot extends Flowable{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!$pot->canAddItem($item)){
|
if(!$pot->canAddItem($item)){
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setDamage(self::STATE_FULL); //specific damage value is unnecessary, it just needs to be non-zero to show an item.
|
$this->setDamage(self::STATE_FULL); //specific damage value is unnecessary, it just needs to be non-zero to show an item.
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
148
src/pocketmine/block/ItemFrame.php
Normal file
148
src/pocketmine/block/ItemFrame.php
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<?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\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\nbt\tag\{
|
||||||
|
ByteTag, CompoundTag, FloatTag, IntTag, StringTag
|
||||||
|
};
|
||||||
|
use pocketmine\Player;
|
||||||
|
use pocketmine\tile\ItemFrame as TileItemFrame;
|
||||||
|
use pocketmine\tile\Tile;
|
||||||
|
|
||||||
|
class ItemFrame extends Flowable{
|
||||||
|
protected $id = Block::ITEM_FRAME_BLOCK;
|
||||||
|
|
||||||
|
public function __construct($meta = 0){
|
||||||
|
$this->meta = $meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(){
|
||||||
|
return "Item Frame";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function canBeActivated(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onActivate(Item $item, Player $player = null){
|
||||||
|
$tile = $this->level->getTile($this);
|
||||||
|
if(!($tile instanceof TileItemFrame)){
|
||||||
|
$nbt = new CompoundTag("", [
|
||||||
|
new StringTag("id", Tile::ITEM_FRAME),
|
||||||
|
new IntTag("x", $this->x),
|
||||||
|
new IntTag("y", $this->y),
|
||||||
|
new IntTag("z", $this->z),
|
||||||
|
new FloatTag("ItemDropChance", 1.0),
|
||||||
|
new ByteTag("ItemRotation", 0)
|
||||||
|
]);
|
||||||
|
$tile = Tile::createTile(Tile::ITEM_FRAME, $this->getLevel(), $nbt);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($tile->hasItem()){
|
||||||
|
$tile->setItemRotation(($tile->getItemRotation() + 1) % 8);
|
||||||
|
}else{
|
||||||
|
if($item->getCount() > 0){
|
||||||
|
$frameItem = clone $item;
|
||||||
|
$frameItem->setCount(1);
|
||||||
|
$item->setCount($item->getCount() - 1);
|
||||||
|
$tile->setItem($frameItem);
|
||||||
|
if($player instanceof Player and $player->isSurvival()){
|
||||||
|
$player->getInventory()->setItemInHand($item->getCount() <= 0 ? Item::get(Item::AIR) : $item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onBreak(Item $item){
|
||||||
|
$tile = $this->level->getTile($this);
|
||||||
|
if($tile instanceof TileItemFrame){
|
||||||
|
//TODO: add events
|
||||||
|
if(lcg_value() <= $tile->getItemDropChance() and $tile->getItem()->getId() !== Item::AIR){
|
||||||
|
$this->level->dropItem($tile->getBlock(), $tile->getItem());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return parent::onBreak($item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onUpdate($type){
|
||||||
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
|
$sides = [
|
||||||
|
0 => 4,
|
||||||
|
1 => 5,
|
||||||
|
2 => 2,
|
||||||
|
3 => 3
|
||||||
|
];
|
||||||
|
if(!$this->getSide($sides[$this->meta])->isSolid()){
|
||||||
|
$this->level->useBreakOn($this);
|
||||||
|
return Level::BLOCK_UPDATE_NORMAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
|
if($face === 0 or $face === 1){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$faces = [
|
||||||
|
2 => 3,
|
||||||
|
3 => 2,
|
||||||
|
4 => 1,
|
||||||
|
5 => 0
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->meta = $faces[$face];
|
||||||
|
$this->level->setBlock($block, $this, true, true);
|
||||||
|
|
||||||
|
$nbt = new CompoundTag("", [
|
||||||
|
new StringTag("id", Tile::ITEM_FRAME),
|
||||||
|
new IntTag("x", $block->x),
|
||||||
|
new IntTag("y", $block->y),
|
||||||
|
new IntTag("z", $block->z),
|
||||||
|
new FloatTag("ItemDropChance", 1.0),
|
||||||
|
new ByteTag("ItemRotation", 0)
|
||||||
|
]);
|
||||||
|
|
||||||
|
if($item->hasCustomBlockData()){
|
||||||
|
foreach($item->getCustomBlockData() as $key => $v){
|
||||||
|
$nbt->{$key} = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tile::createTile(Tile::ITEM_FRAME, $this->getLevel(), $nbt);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item){
|
||||||
|
return [
|
||||||
|
[Item::ITEM_FRAME, 0, 1]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class Ladder extends Transparent{
|
|||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
|
|
||||||
$f = 0.125;
|
$f = 0.1875;
|
||||||
|
|
||||||
if($this->meta === 2){
|
if($this->meta === 2){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
@ -124,11 +124,16 @@ class Ladder extends Transparent{
|
|||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
/*if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method
|
$sides = [
|
||||||
Server::getInstance()->api->entity->drop($this, Item::get(LADDER, 0, 1));
|
2 => 3,
|
||||||
$this->getLevel()->setBlock($this, new Air(), true, true, true);
|
3 => 2,
|
||||||
|
4 => 5,
|
||||||
|
5 => 4
|
||||||
|
];
|
||||||
|
if(!$this->getSide($sides[$this->meta])->isSolid()){ //Replace with common break method
|
||||||
|
$this->level->useBreakOn($this);
|
||||||
return Level::BLOCK_UPDATE_NORMAL;
|
return Level::BLOCK_UPDATE_NORMAL;
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ class Leaves extends Transparent{
|
|||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
if(($this->meta & 0b00001100) === 0){
|
if(($this->meta & 0b00001100) === 0){
|
||||||
$this->meta |= 0x08;
|
$this->meta |= 0x08;
|
||||||
$this->getLevel()->setBlock($this, $this, false, false, true);
|
$this->getLevel()->setBlock($this, $this, true, false);
|
||||||
}
|
}
|
||||||
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
||||||
if(($this->meta & 0b00001100) === 0x08){
|
if(($this->meta & 0b00001100) === 0x08){
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class Leaves2 extends Leaves{
|
|||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
if(($this->meta & 0b00001100) === 0){
|
if(($this->meta & 0b00001100) === 0){
|
||||||
$this->meta |= 0x08;
|
$this->meta |= 0x08;
|
||||||
$this->getLevel()->setBlock($this, $this, false, false, true);
|
$this->getLevel()->setBlock($this, $this, true, false);
|
||||||
}
|
}
|
||||||
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
||||||
if(($this->meta & 0b00001100) === 0x08){
|
if(($this->meta & 0b00001100) === 0x08){
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
class Lever extends Solid{
|
class Lever extends Flowable{
|
||||||
|
|
||||||
protected $id = self::LEVER;
|
protected $id = self::LEVER;
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
* @author PocketMine Team
|
* @author PocketMine Team
|
||||||
* @link http://www.pocketmine.net/
|
* @link http://www.pocketmine.net/
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ use pocketmine\item\Item;
|
|||||||
use pocketmine\item\Tool;
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
class LitPumpkin extends Solid{
|
class LitPumpkin extends Pumpkin{
|
||||||
|
|
||||||
protected $id = self::LIT_PUMPKIN;
|
protected $id = self::LIT_PUMPKIN;
|
||||||
|
|
||||||
@ -33,28 +33,7 @@ class LitPumpkin extends Solid{
|
|||||||
return 15;
|
return 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getToolType(){
|
|
||||||
return Tool::TYPE_AXE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Jack o'Lantern";
|
return "Jack o'Lantern";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct($meta = 0){
|
|
||||||
$this->meta = $meta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
|
||||||
if($player instanceof Player){
|
|
||||||
$this->meta = ((int) $player->getDirection() + 5) % 4;
|
|
||||||
}
|
|
||||||
$this->getLevel()->setBlock($block, $this, true, true);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user