1092 Commits

Author SHA1 Message Date
Dylan K. Taylor
22dd8faf1d Player: don't jump to bad position when reverting movement 2018-03-24 10:57:59 +00:00
Dylan K. Taylor
7354a55af8 Player: use vector methods for calculating diff on move 2018-03-24 10:50:09 +00:00
Dylan K. Taylor
611f5d684b Player: removed redundant isFirst check for movement
Since the addition of resetLastMovements(), this code is useless.

Additionally, it doesn't make sense to ignore the first movement, because the first movement still _moves the player_ from point A to point B.
2018-03-24 10:40:30 +00:00
Dylan K. Taylor
9a099d3f5d Player: remove a couple of useless lines from respawn()
teleport() handles these already.
2018-03-24 10:34:30 +00:00
Dylan K. Taylor
e4b6a18404 Player: removed redundant proxy function 2018-03-23 19:56:35 +00:00
Dylan K. Taylor
364d278714 Player: removed useless condition for chunk ordering
This just causes it to attempt to spam chunk orders prior to the player spawning. It won't succeed, because the render distance is zero.

The other time this could occur is when teleporting into an unloaded chunk, but it's not necessary to continually spam chunk orders in that case, especially since chunk orders are done on teleport anyway.
2018-03-23 19:48:33 +00:00
Dylan K. Taylor
c464d39401 Player: Order chunks immediately on receiving chunk radius request 2018-03-23 19:44:03 +00:00
Dylan K. Taylor
a185b78486 Player: fixed logic of move-into-bad-chunk checks
particularly the hack with chunk switching was causing unexpected behaviour wrt. invisible players.
2018-03-23 19:34:45 +00:00
Dylan K. Taylor
73e09392b6 Timings: Clean up some terrible code, move namespaces 2018-03-19 19:05:51 +00:00
Dylan K. Taylor
ac5a91b67e Cleaned up bool comparison mess 2018-03-19 14:10:55 +00:00
Dylan K. Taylor
9d5eeb328e Player: cleanup how login verification is handled
Players are now only considered authenticated if they have an XUID AND have a keychain with a Mojang signature in it somewhere.
2018-03-17 18:44:26 +00:00
Dylan K. Taylor
b2ee6b2ca5 Player: consolidate and add type docs for fields 2018-03-17 17:42:01 +00:00
Dylan K. Taylor
2860e9e8ee Player: remove clientSecret (useless) 2018-03-17 16:44:34 +00:00
Dylan K. Taylor
e82073834f Player: protect some fields 2018-03-17 16:43:34 +00:00
Dylan K. Taylor
fdad965db8 Player: if command has aliases, add command name as alias if not found
closes #2106

For some strange reason, using aliases overwrites the original command name instead of coexisting with it. This is rather astonishing behaviour, and probably a bug in the client. However, this workaround is the same thing vanilla does (see /tp in vanilla).
2018-03-16 10:41:00 +00:00
Dylan K. Taylor
ddc9dca8b4 Player: fixed being able to eat cake in creative
closes #2070
2018-03-13 18:32:08 +00:00
Dylan K. Taylor
590826b9bd Player: Disallow modifying NBT of tiles inside spawn protection 2018-03-10 18:19:17 +00:00
Dylan K. Taylor
a5e87484d9 Player: removed superfluous null-check from setMotion()
this is already checked by broadcastMotion().
2018-03-10 17:08:00 +00:00
Dylan K. Taylor
b39bbffdc5 Entity: Moved and renamed entity\Item to entity\object\ItemEntity 2018-03-10 12:36:46 +00:00
Dylan K. Taylor
2f266a5922 Player: added a server-side forced cooldown mechanism
This is necessary because the stupid client constantly spams right-click actions if you carry on trying to eat/throw/whatever the item when cooldown is in effect. Therefore ender pearls would be fired like machine guns without these checks server side.
2018-03-09 14:45:01 +00:00
Dylan K. Taylor
ea5db98d12 Player: fixed draining hunger when teleporting
this was caused by abe5d94d5b42ecc436fadfcf4786128bcb550ea4 because player's lastBlah wasn't getting updated anymore.

Player movement handling really needs cleaning up, but for now this fixes the issue.
2018-03-08 12:18:22 +00:00
Dylan K. Taylor
dc3bf8546e Refactored effects handling, split up concerns of effect types and instances
Removed json insanity for effects

Split up effect types and effect instances

Saturation is an instant effect
2018-03-07 12:42:31 +00:00
Dylan K. Taylor
973d5dc251 Small de-spaghettification of login handling
no need for these to be split up, it just makes the player login code flow look confusing.
2018-02-28 18:48:08 +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
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
aa11dbb928 Player: Add warnings for messing with movement checks 2018-02-20 13:50:30 +00:00
Encritary
ad8d67137e Implemented critical hits (#1929) 2018-02-19 10:14:32 +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
093cb5b39e Updated PocketMine-NBT dependency 2018-02-17 14:29:20 +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
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
e7e4645c0b Fixed a wide range of bugs with floating-point coordinates getting incorrectly int-casted
This causes lots of bugs in negative coordinates.

This fixes #1789 after world load & save.
2018-02-15 10:27:42 +00:00
Dylan K. Taylor
f66928c345
Player: patch exploits relating to quitting on death (#2017)
* Revert "Revert bad duct-tape fix that broke lots of other things"
This reverts commit 4a4900e5e7ea1fd7b897b025b4b666fd2050f80a.

Player: Perform respawn actions when joining while dead
This fixes exploits related to #1567 by calling respawn logic on join when the player has zero health.
This is a shitty fix and doesn't solve the actual issues described in #1567, but it's a simple solution for the exploits related to it.
2018-02-13 21:23:31 +00:00
Dylan K. Taylor
98d6aea7fe Server: rename getResourcePackManager()
casual BC break, ain't nobody got time for deprecations!

closes #1797
2018-02-11 17:17:56 +00:00
Dylan K. Taylor
63fa6a36a9 Merge branch 'pr/1982' 2018-02-08 12:09:29 +00:00
Dylan K. Taylor
906d7eb176 Lang: Move TranslationContainer and TextContainer to \pocketmine\lang namespace
why the hell were they ever put in \pocketmine\event in the first place??

This change was suggested many months ago but I forgot all about it.
2018-02-04 20:03:30 +00:00
Dylan K. Taylor
f993358c5f fixed extremely stupid bug with player spawns
This was causing new players to inexplicably spawn in the wrong place when joining a world for the first time which had a different level name than folder name. With LevelDB worlds, this caused them to spawn wayyyy up at y=32767 for no good reason.
2018-02-02 16:00:28 +00:00
Oreo Oreo
54f7a88fbb Added getXuid() 2018-01-30 01:25:27 +03:00
Dylan K. Taylor
ffb3e2b47a Player: Fixed logical nonsense in removeWindow()
The only time this is set anyway is obviously if the ID is non-null.
2018-01-27 11:02:03 +00:00
Dylan K. Taylor
ef816c0a52 Player: Fixed window ID of closing inventory always being -1
reported by @Muqsit, thank you sir
2018-01-27 11:00:08 +00:00
Muqsit
6c71b443e8 Fixed armor not dropping (#1962) 2018-01-24 20:01:32 +00:00
Dylan K. Taylor
7d88a8b315 Player: Remove useless assignments from constructor 2018-01-24 18:22:23 +00:00
Dylan K. Taylor
28996f561f Player: Added a hack for knockback being messed up
This needs to be updated server side and isn't because of the way player movement is currently handled. Fixing this properly will require a lot more work than this.
2018-01-24 11:56:32 +00:00
Dylan K. Taylor
6543d96910
Inventory: Split up armor and player inventory (#1957)
* Inventory: Split up PlayerInventory and armour handling
* Fixed other players don't see armour changes. This bug also exists on master.
2018-01-23 20:01:26 +00:00
Dylan K. Taylor
fd5557861b Changed how login verification is handled, add more useful error messages
closes #1955
2018-01-28 14:13:59 +00:00
Dylan K. Taylor
e5ca22a9a6 Player: Simplified implementation of windows => window ID map
it is not necessary to reference the actual objects here. Doing so makes the implementation more confusing. Hashes are sufficient.
2018-01-22 18:58:19 +00:00
Dylan K. Taylor
897a31e608 Player: Moved logic of setUsingItem()
plugins might be using this method, or the item may have been dropped involuntarily due to server-side logic. Therefore it should be handled when the transaction is received and not when the item is dropped into the world.
2018-01-22 18:36:48 +00:00
Dylan K. Taylor
2eb6e075ae
Refactored entity metadata handling into its own class, with type-safe methods (#1876)
This includes several other changes, including:
- SLOT data properties now accept items directly
- POS data properties now accept floored Vector3s (in future this will be block positions) or null for 0,0,0
- VECTOR3F data properties now accept Vector3s or null for 0,0,0
2018-01-20 10:52:14 +00:00