Commit Graph

37 Commits

Author SHA1 Message Date
a2543ff80d Position: add getLevelNonNull()
this allows assuming that a position has a valid world in places where it's never expected to not be valid. Since this is the vast majority of usages, it eliminates a lot of possible null-pointer warnings given by static analysers.
TODO: Consider whether we can make Position->getLevel/World use this behaviour out of the box in the next major version.
2020-04-14 11:08:37 +01:00
c4793241f5 Mass removal of useless @param/@return PHPDoc annotations, pass 1 2020-01-21 15:10:18 +00:00
ccbcc14600 Block: populate missing return type info 2020-01-19 17:02:03 +00:00
cba8d86c4f Fixed Fire Aspect not working on TNT 2019-02-18 13:11:08 +00:00
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
860c20109b TNT can now be ignited by burning arrows 2018-06-23 12:54:21 +01:00
b21572774a Tool: cleanup durability handling, closes #379
long overdue... this isn't quite as extensible as the original api3/blocks system was, but this is primarily intended to replace Item->useOn(). If plugins want to use it it can be extended later on.
2018-05-10 19:48:51 +01:00
9a1d3aec6b Flammable blocks adjacent to fire now burn away
There are some strange bugs with blockupdating causing invisible client-side-only fires that need to be investigated.
2018-04-10 09:59:10 +01:00
e66b1953de Block: added flame encouragement and flammability properties 2018-04-10 09:58:08 +01:00
e850f34d76 Fix TNT block not setting fuse NBT correctly (#1917) 2018-01-14 18:10:57 +00:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
50be26958a Added a helper function Entity->createBaseNBT() to cut down on boilerplate code 2017-10-19 17:36:51 +01:00
02f42eba48 Move block registration to its own class 2017-08-20 18:05:01 +01:00
0e24596aed Changed block construction calls to Block::get() 2017-08-19 13:46:17 +01:00
83af4dcd59 Block API typehints 2017-08-17 13:50:19 +01:00
6ae24c5c19 Removed unnecessary methods Block->canBeActivated() and Item->canBeActivated() (needless extra confusion) 2017-07-30 18:14:43 +01:00
a4b8dd43e6 Removed useless confusing array indices in CompoundTag constructors (#1116) 2017-06-20 12:11:24 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
61d354a4ea Block constructor mass-replace to fix #963 and related issues 2017-06-05 10:02:27 +01:00
13fd8b681e Added some sounds, fixed DestroyBlockParticle wrong particles for blocks with different meta values 2017-05-04 16:50:13 +01:00
c21197ef17 Removed entanglement between chunks and providers. WARNING: BREAKING API CHANGES.
- All entity and tile constructors now require a \pocketmine\level\Level instead of a \pocketmine\level\format\Chunk.
- Chunk->getProvider() and Chunk->setProvider() have been removed.
- Chunk::__construct() has had the $provider parameter removed.
- Chunk->unload() has had the unused $save parameter removed.
- ChunkEvents now take a Level parameter instead of going through the Chunk

API bump to 3.0.0-ALPHA4
2017-02-21 17:08:45 +00:00
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
6fc435da0e Imports rearrangement 2016-10-03 00:43:46 +08:00
7f8b39a63c Renamed NBT tags to have Tag in the name 2015-08-23 00:25:29 +02:00
747f7685e7 Fix formatting issues due to bad IDE settings 2014-12-07 16:30:04 +01:00
a98da3bab1 Renamed old getID() calls to getId() 2014-12-07 15:21:32 +01:00
a0d4bff385 Block creating and property handling rewrite, part1 2014-12-07 01:53:27 +01:00
78f8d0280d Removed unused imports 2014-10-29 01:14:09 +01:00
34ae760def New way to spawn entities/tiles using a global register table, allow overriding default entity/tile classes via classes 2014-10-28 13:09:27 +01:00
fec387d2ec Fixed entities not being pushed out of blocks 2014-10-20 12:37:17 +02:00
883f93cc8c Improved item drop spawning 2014-10-13 22:45:04 +02:00
ebb844fa52 Removed unused code, fixed undefined variables 2014-10-11 22:22:51 +02:00
62af784d37 Removed unused imports 2014-10-08 17:00:23 +02:00
582c165479 Implemented Explosion and PrimedTNT, closes #2139 2014-10-07 17:46:01 +02:00
eab86f5f90 Replaced array() with [] 2014-08-28 17:04:22 +02:00
c1546aac9c Updated Position to use Weak / strong references for Level objects 2014-05-22 04:14:06 +02:00
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00