406 Commits

Author SHA1 Message Date
Dylan K. Taylor
2559f5ec2b Moved Player-related classes to pocketmine\player namespace 2019-06-18 18:51:36 +01:00
Dylan K. Taylor
c66af4648c Move thread-related classes from pocketmine to pocketmine\thread namespace 2019-06-18 17:36:25 +01:00
Dylan K. Taylor
3c677bd3ec added PermissibleDelegateTrait to cut down boilerplate in Player and ConsoleCommandSender 2019-06-17 16:10:13 +01:00
Dylan K. Taylor
44c791f03e Thread/Worker run() are now final, to set up common environment things 2019-06-06 16:44:32 +01:00
Dylan K. Taylor
3c3e5a9850 ConsoleCommandSender: Do not hard-depend on MainLogger
this dependency makes it impossible to swap out.
2019-06-04 14:06:45 +01:00
Dylan K. Taylor
3ea8da2dd3 Use EnumTrait->equals() instead of direct comparison
It's not guaranteed that objects provided are the same as those in the enum registry, so they can't be directly compared.

Implementing comparison with === would require some kind of __equals() implementation or an extension to hook into such functionality.
2019-05-24 17:21:44 +01:00
Dylan K. Taylor
9ea684581f Merge remote-tracking branch 'origin/stable' 2019-05-13 18:17:42 +01:00
Johnmacro
bb93d4f8de TimeCommand: Fix commands.time.query message (#2917) 2019-05-12 09:21:39 +01:00
Dylan K. Taylor
ca7c23c137 Player: remove dead functions
these functions belong in the network session, and they are currently just proxies for them. In the future we might have players who don't have IPs at all depending on how they connected (for example Specter) so this stuff shouldn't be in here.
2019-05-08 19:47:25 +01:00
Dylan K. Taylor
cf0c0e72a9 Assume the player is online when they are, uh, assumed to be online
the checks removed here should never be hit under normal circumstances. If they were hit, they'd just conceal bugs which would cause a crash to happen later anyway.
2019-05-07 19:49:06 +01:00
Dylan T
3cd6e12e71
Renaming "Level" -> "World" (#2907)
This has been a pain point for a long time due to the misleading nature of the name "level". It's also confusing when trying to do things like getting the XP level of the player or such, and also does not translate well to other languages.

This transition was already executed on the UI some time ago (language strings) and now it's time for the same change to occur on the API.

This will burn a lot of plugins, but they'll acclimatize. Despite the scary size of this PR, there isn't actually so many changes to make. Most of this came from renaming `Position->getLevel()` to `Position->getWorld()`, or cosmetic changes like changing variable names or doc comments.
2019-05-07 14:47:28 +01:00
Dylan K. Taylor
293311569d Merge branch 'next-minor' 2019-05-01 18:55:49 +01:00
=?UTF-8?q?Fabian=20Fa=C3=9Fbender?=
932c489de1 Rename addTitle/addSubTitle/addActionBarMessage prefixes to "send", deprecated old variants
closes #2896

these deprecated methods will be removed in 4.0.
2019-05-01 18:54:20 +01:00
Dylan K. Taylor
6aa8276532 Revert "Player: removed useless addActionBarMessage()"
This reverts commit 7d22b2a6d7d372a5020b9a2b44a93cdc821565c8.
2019-04-26 15:41:19 +01:00
Dylan K. Taylor
752e398970 AsyncTask: TLS now supports storing multiple values (now requires a key/value pair) 2019-04-18 18:58:31 +01:00
Dylan K. Taylor
209ae51a67 Merge branch 'stable' 2019-04-15 16:11:49 +01:00
Dylan K. Taylor
4c268acc00 Fixed /whitelist on/off permissions, closes #2849 2019-04-14 17:58:53 +01:00
Dylan K. Taylor
5f23fffdda Merge remote-tracking branch 'origin/3.7' 2019-04-12 18:33:13 +01:00
Dylan K. Taylor
e9a87978a6 Fixed usages of commands.generic.permission
apparently this doesn't exist in the client anymore
2019-04-07 15:07:24 +01:00
Dylan K. Taylor
e6a1f0eb8d Command: remove duplicated code 2019-04-03 18:06:22 +01:00
Dylan K. Taylor
7d22b2a6d7 Player: removed useless addActionBarMessage()
this is exactly the same as sendTip().
2019-04-02 18:43:14 +01:00
Dylan K. Taylor
f0b85936cf Improved /tell 2019-03-31 19:08:35 +01:00
Dylan K. Taylor
42a263a9df GameMode is now an enum 2019-03-31 16:19:36 +01:00
Dylan K. Taylor
649ce5080b StatusCommand: don't use config for reading global limit 2019-03-27 19:24:06 +00:00
Dylan K. Taylor
7333e7118e Server: remove useless function 2019-03-26 15:52:34 +00:00
Dylan K. Taylor
23071d257e Extract process-related functions from Utils into a separate Process class 2019-03-24 18:57:32 +00:00
Dylan T
d03f0aab37
Remove /reload (#2823)
For many years, this has been the cause of many users (particularly plugin devs) confusion. The reality is that /reload has little to no practical value. It does not reload plugin source code (contrary to popular belief).
2019-03-22 15:01:11 +00:00
Dylan K. Taylor
ad19696364 Make Effect and Enchantment functions less verbose 2019-03-13 15:26:21 +00:00
Dylan K. Taylor
5c12bee874 Backport other part of 2bffd5cc1c326670c25386ce78e5c690f4c5fd54: Add timer measurements for autosave 2019-03-10 11:20:51 +00:00
Dylan K. Taylor
0659d2fbef Backport 6bd43a8215b9e612478fe789da9a58b36f0f0e73: Firehose auto-tick-rate anti-feature, closes #2665 2019-03-09 19:20:53 +00:00
Dylan K. Taylor
6bd43a8215 Firehose auto-tick-rate anti-feature, closes #2665 2019-03-03 13:24:53 +00:00
Dylan K. Taylor
2bffd5cc1c Add timer measurements for autosave 2019-03-02 18:20:25 +00:00
Dylan K. Taylor
6c8fa8ae28 More nullable and void typehints 2019-03-02 10:29:11 +00:00
Dylan K. Taylor
9ad0ea85c7 Rename two misleadingly-named functions 2019-02-27 12:59:12 +00:00
Dylan K. Taylor
c26544475e More PHP 7.1 nullables 2019-02-22 12:55:34 +00:00
Dylan K. Taylor
73a565355b Make some forced-optional nullable parameters non-optional, PHP 7.1 style
these parameters did not make any sense to be optional, but were forced to be this way because of the way nullable types worked before 7.1.
2019-02-22 12:54:00 +00:00
Dylan K. Taylor
646fea5a4e Effect: Introduce a bunch of static getters, change a bunch of API to use objects
This introduces static getters for every currently-known effect type. At some point in the near future, the magic number constants (which are really network IDs, by the way) will disappear.

Migrating:
- If you used constants (like any sensible person would): for the most part it's just a case of adding a () anywhere you used an Effect constant.
- If you hardcoded magic numbers: ... well, have fun fixing your code, and I reserve the right to say "I told you so" :)

This achieves multiple goals:
1) creating an EffectInstance for application is much less verbose (see diff for examples, especially the Potion class)
2) plugin devs cannot use magic numbers to apply effects anymore and are forced to use type-safe objects. :)

This is a warning shot for plugin devs who use magic numbers. More changes like this are coming in the not-too-distant future.
2019-02-20 12:05:17 +00:00
Dylan K. Taylor
f49d590794 Level: remove getTiles(), more removal of tiles from user interface 2019-02-15 16:27:00 +00:00
Dylan K. Taylor
6424dc9c82 Merge branch '3.6' 2019-02-14 16:04:32 +00:00
Dylan K. Taylor
65529ff2ce Command: add @throws CommandException 2019-02-14 15:09:41 +00:00
Dylan K. Taylor
c346c45d42 Use regex for command argument parsing, fixes #2266
moral of the story: don't abuse functions for things they weren't designed for... lol
2019-02-14 15:07:58 +00:00
Dylan K. Taylor
470879c9bf Merge branch '3.6' 2019-02-13 14:53:20 +00:00
Jack Noordhuis
27767e7ddb Verify player name command input, closes #2729, closes #2749 2019-02-13 14:50:43 +00:00
Dylan K. Taylor
243c12de7c EffectCommand: fix bounds check, closes #2055 2019-02-13 14:37:40 +00:00
Dylan K. Taylor
3e58708130 Add some missing @throws annotations 2019-02-04 19:50:43 +00:00
Dylan K. Taylor
78dfcc5f2d Move Effect and EffectInstance to entity\effect namespace 2019-01-28 15:41:07 +00:00
Dylan K. Taylor
0b1bdec3ac GameMode::fromString() now throws InvalidArgumentException 2019-01-26 17:09:54 +00:00
Dylan K. Taylor
738e310798 Strip out RCON, closes #2686
Users should move to the new RconServer plugin instead.
2019-01-23 20:39:16 +00:00
Dylan K. Taylor
6df983da3e Merge branch '3.5' 2019-01-19 16:24:41 +00:00
Dylan K. Taylor
82dddde159 Remove dead code in /time command handler 2019-01-19 15:15:04 +00:00