6656 Commits

Author SHA1 Message Date
Dylan K. Taylor
6a94c8183c NetworkBinaryStream: Add clarification on array structure for gamerules
we need objects for this really
2018-02-28 18:10:47 +00:00
Dylan K. Taylor
629a254639 Server: stop reporting exceptions as "notice" in crashdumps 2018-02-28 10:57:25 +00:00
Dylan K. Taylor
732b931556 BatchPacket: use PacketPool::getPacket() instead of getPacketById()
this is what getPacket() is for.
2018-02-27 21:43:40 +00:00
Dylan K. Taylor
2dd1878d57 Entity: remove dead field isPlayer 2018-02-27 17:01:28 +00:00
Dylan K. Taylor
3104a312b2 ConsoleCommandSender: Remove useless function isPlayer()
This function is not declared in any useful places (like the CommandSender interface) and it is not present in Player (!!!). Additionally, an is-player check is better done with an instanceof so that type safety is enforced and IDEs can give auto-complete.

This is a BC break, but this is such a pointless function that it's probably not even worth mentioning.
2018-02-27 16:43:40 +00:00
Dylan K. Taylor
d6d47feda9 Query: Send responses to the source interface only, instead of all the things
who the fuck wrote this shitty code?
2018-02-27 13:23:01 +00:00
Dylan K. Taylor
0ba1b58ee0 always takes 2 commits to do one simple thing...
I really love Golang being so strict on this.
2018-02-27 12:34:28 +00:00
Dylan K. Taylor
ab2df8b11b Removed Server->addRecipe()
This method is pointless extra bloat in Server. Use CraftingManager->registerRecipe() instead.
2018-02-27 12:33:32 +00:00
Dylan K. Taylor
eb01dcaf60 Player: don't save data to disk on login
this is pointless, and it will get saved on disk on quit anyway.
2018-02-27 12:26:30 +00:00
Dylan K. Taylor
f0535df96d Remove deprecated things 2018-02-27 11:59:16 +00:00
Dylan K. Taylor
f903dbfe00 Server: Removed identifiers array
This is completely unnecessary and adds extra complexity for no good reason. Maybe it was used historically, but nowadays it is only used to identify players to send async-prepared batch packets to.

There are two alternative ways to do that:
1. use spl_object_hash() as the targets array in CompressBatchedTask
2. use ServerScheduler's object storage to retain references to the Player[] array.

I've opted for the second method.

Removing these identifiers allows great code simplification in removePlayer() and removes the need for those old stupid hacks.

This also includes a backwards-compatibility break by removing the $identifier parameter of Server->addPlayer().
2018-02-27 11:43:02 +00:00
Dylan K. Taylor
e0d5c79848 Scheduler: Catch exceptions thrown from AsyncTask->onCompletion() 2018-02-27 11:33:16 +00:00
Dylan K. Taylor
e024f381c9 Living: fixed cycle between armor inventory and holder not getting cleaned up on close
this was getting collected by the cycle GC, but it should have been dealt with properly like other inventories.
2018-02-27 11:08:09 +00:00
Dylan K. Taylor
0ad8ea6e92 Remove unused imports 2018-02-24 19:01:09 +00:00
TheNewHEROBRINEX
bd47852ca4 Allow Command::getPermissionMessage() to return null (#2057) 2018-02-24 18:15:27 +00:00
Oreo Oreoniv
2b036b1a5c Added API method Living::hasEffects() (#2054) 2018-02-24 13:48:15 +00:00
Dylan K. Taylor
e5ec8fa603 Entity: Use MoveEntityPacket teleport flag for teleporting
fixes entities getting movement interpolation between origin and destination
2018-02-24 12:25:25 +00:00
Dylan K. Taylor
abe5d94d5b Entity: fixed teleport() not updating movement to players
cc @CortexPE
2018-02-24 12:22:03 +00:00
Dylan K. Taylor
da5febc34a fix crash report 127835 2018-02-24 11:46:36 +00:00
Dylan K. Taylor
3de5e132a2 CrashDump: fixed broken argv reporting 2018-02-22 22:05:35 +00:00
Dylan K. Taylor
37e8c8d324 BanEntry: work around stupid bug in ext/date
https://bugs.php.net/bug.php?id=75992

When plugins do time-limited bans and users enter stupid time values, a shitty bug in ext/date gets triggered, but only when reading the ban entries from disk. DateTime->format() is able to produce formatted strings which have more than 4 digits in the year, which are then considered invalid. This works around it by trying to parse a formatted version on the fly to ensure that it is valid.

This also cleans up and improves ban list loading and handling.
2018-02-22 14:48:53 +00:00
Dylan K. Taylor
aa11dbb928 Player: Add warnings for messing with movement checks 2018-02-20 13:50:30 +00:00
Dylan K. Taylor
e7adaef2d2 Level: fix syncChunkLoad timer not getting stopped when no chunk is returned 2018-02-20 10:39:41 +00:00
SOFe
6bf9ae0a18 Expose plugin.yml contents to plugins (#2043)
This allows plugins and libraries to rely on values in plugin.yml without parsing it again
2018-02-19 22:16:45 +00:00
Dylan K. Taylor
e7b2dc87d6 Most pointless optimization ever (ServerKiller) 2018-02-19 12:20:31 +00:00
Dylan K. Taylor
d7a02793fa PocketMine.php: update comment 2018-02-19 12:02:27 +00:00
Dylan K. Taylor
6a996611f8 Move functions from PocketMine.php to Utils
This cleans a lot of mess out of the bootstrap file, and also has the added bonus that threads which do not inherit functions can now get access to them by autoloading Utils.
2018-02-19 11:56:22 +00:00
Encritary
ad8d67137e Implemented critical hits (#1929) 2018-02-19 10:14:32 +00:00
Dylan K. Taylor
cbbed6a6c1 Updated RakLib dependency 2018-02-19 10:01:56 +00:00
Dylan K. Taylor
99ef3e6576 RakLibInterface: don't self-unregister from Network on crash
This is already done by the Network itself.
2018-02-18 11:52:55 +00:00
Dylan K. Taylor
eeaf75ac85 Server: add typehint to addPlayer() 2018-02-17 19:54:56 +00:00
Dylan K. Taylor
6954bfac4b Removed RakNet client ID parameters from Player
This is not used anywhere anymore and null is always filled for this, so it's pointless.

Also, this is an API break.
2018-02-17 19:51:04 +00:00
Dylan K. Taylor
f27b62027c McRegion: fix some missed ArrayAccess usages of CompoundTag 2018-02-17 14:58:04 +00:00
Dylan K. Taylor
093cb5b39e Updated PocketMine-NBT dependency 2018-02-17 14:29:20 +00:00
Dylan K. Taylor
3f41628bf3 Merge branch 'legacy/alpha11' 2018-02-17 10:59:19 +00:00
Dylan K. Taylor
a3fa8adf4a Fixed XP orbs trying to track players after teleport
closes #2028

@mal0ne-23, you are today's MVP.
2018-02-17 10:58:54 +00:00
Dylan K. Taylor
08daf655e5 RakLibInterface: Remove useless function 2018-02-16 17:57:43 +00:00
Dylan K. Taylor
61fc090cf2 Player: don't debloat skin geometry twice
This is already done in setSkin(), which is called below.
2018-02-16 14:27:16 +00:00
Dylan K. Taylor
ecd830463c PlayerNetworkSessionAdapter: Remove dead TODO 2018-02-16 11:49:28 +00:00
Dylan K. Taylor
ffe89f5e1b fixed Anvils item/block different logic handling, close #1910 2018-02-16 11:07:50 +00:00
Dylan K. Taylor
88a05845c2 Item: Removed protected block field, items should now override getBlock() 2018-02-16 11:06:29 +00:00
Dylan K. Taylor
2cabdca3f7 ItemFactory: Allow block-items to be overridden
Currently an ItemBlock is created for every Block requested, but this will need to change in the future (for Anvils because they have stupid bitshifts on the meta instead of a nice bitmask). This allows registering items in the ItemFactory with IDs lower than 256 and having them recognized.
2018-02-16 11:03:04 +00:00
Dylan K. Taylor
be1ddb9f5b Item: Added API method getVanillaName()
This allows retrieving the name of an item without the custom name being plastered over the top. This will also allow weird things to have special functions for their names.
2018-02-16 10:57:02 +00:00
Dylan K. Taylor
7fc3eeab00 Level: Remove redundant null checks for Item->getBlock()
this is typehinted to return Block, so these checks are pointless.
2018-02-16 10:45:54 +00:00
Dylan K. Taylor
9395dbf9fa Player: added missing spawn protection check for frame item removal
fixes #2025
2018-02-16 10:35:16 +00:00
Dylan K. Taylor
a7396d7ae9 Player: Cancel interaction on frames in spectator mode before calling the event, not after
This convention is used throughout the code to allow plugin developers to alter the behaviour of the event. In this case, it would instead produce unexpected behaviour when the event is not cancelled by a plugin.
2018-02-16 10:29:46 +00:00
Dylan K. Taylor
3b632c2870 ItemFactory::fromString(): throw an exception on failure to parse meta value 2018-02-16 09:45:38 +00:00
Dylan K. Taylor
7dd834bca0 Fixed API patch version being useless
Plugins will now be able to require a specific minimum patch version, in case they depend on bug fixes or whatever.
2018-02-15 21:45:46 +00:00
Dylan K. Taylor
c26e3aa9fa GiveCommand: Make invalid player checking logic less confusing
some code in this namespace is just total WTF...
2018-02-15 18:19:41 +00:00
Dylan K. Taylor
aeba15c5c6 GiveCommand: don't crash when an invalid item is specified 2018-02-15 18:18:09 +00:00