Commit Graph

662 Commits

Author SHA1 Message Date
083d1e9ef8 Deprecated Item->deepEquals(), added automatic deep checking in equals(), added some documentation for Item API methods 2017-03-12 14:46:34 +00:00
132e04fdbb Hotbar/inventory bugfixes (#399)
- Fixed most issues with item equipment in creative
- Added save and restore of currently-held item
- Reset hotbar on death, added API method PlayerInventory->resetHotbar()
- Creative players now have more leeway to get items, alleviates issues with item equipment in desktop GUI
- Fixed creative players wearing armour
- Found unknown field in ContainerSetSlotPacket
- Removed outdated/redundant constants
- Use a case statement in ContainerSetSlotPacket handler, added handling for 0x7a hotbar slot link update
2017-03-09 20:31:55 +00:00
7e1bdd474a Revert multi-world hack (client issue fixed in 1.0.4.0), close #260
This reverts commit 162b993e65.
2017-03-09 17:55:25 +00:00
93896977d0 Add default 2017-03-07 10:18:58 +00:00
f204422432 Fixed precedence issue 2017-03-06 11:40:28 +00:00
d6d3184e37 Fixed players can't join if spawn-radius is higher than the player's view distance
TODO: use this properly instead of calculating a count
2017-03-06 11:37:39 +00:00
4ee8d14584 Added API for transferring players to other servers (#355)
* Added API method `Player->transfer()` and PlayerTransferEvent
2017-03-04 18:22:31 +00:00
1ee689e759 Fixed mess of entity ID 0 for players, fixed emeralds 2017-03-02 11:04:00 +00:00
4fbc5738e3 Re-implemented chunk sending (#304)
Re-implement chunk sending, send chunks inside a radius instead of below a count

This sends chunks in concentric squares around players. When the radius is hit, it will pad out the radius until a full circle of chunks is loaded around the player.
TODO: implement radius-per-tick, send chunks in concentric circles, use radius for player spawning.

To set your server chunk radius, change `view-distance` in server.properties. Values are intended to be the same as MCPE render distance values. With matching client and server render distances the chunks should reach the horizon.

NOTE: You may notice significantly increased memory usage per player when increasing these values to something respectable. This is normal and expected.
A player with render distance 14 for example will cause loading of 600+ chunks. A player cannot however exceed the render distance limit set in server.properties - the server will simply not send any more chunks.

Render distance of 8 chunks is approximately 200 chunks. This is roughly equivalent to the original default max-chunks of 192 in pocketmine.yml, but sent in a circle instead of a square.

Wait for client to request a chunk radius before ordering chunks

Use 8 for default maximum radius (roughly matches old setting of 192)

Calculate spawn chunk count from chunk-sending.spawn-radius
2017-03-02 10:30:30 +00:00
d588222e84 Added an exception throw for accessing permissions of closed players 2017-02-28 10:49:09 +00:00
c3fb2e9f23 Fixed broadcasting quit messages to quitting player, fixed accessing permission of closed players on quit 2017-02-28 10:43:11 +00:00
cfb6856634 Fixed Player object memory leak when players with admin channel permissions are closed 2017-02-25 15:39:36 +00: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
408f63f8fa Accuracy again -_- 2017-02-20 19:46:10 +00:00
20c7e51077 Allow 0.01 of a block diff
Fixes loss of precision when handling player movements causing some position issues.
2017-02-19 17:35:23 +00:00
834dc343b0 Updated ItemFrameDropItemPacket for >=1.0.3, fix decode errors
Sorry, this DOES NOT FIX creative, blame Mojang. https://bugs.mojang.com/browse/MCPE-20070
2017-02-18 15:09:44 +00:00
ee523eb5cc Reverted botched fix for #284, close #362
Revert "fixed player data not saving"

This reverts commit b3beb9f71d.

Revert "Call PlayerQuitEvent after unloading chunks, removed some weird code, fixed crash when unloading player level on quit, close #284"

This reverts commit 14a0ff5caa.
2017-02-16 21:04:39 +00:00
abffe1297d Fixed crashes closing entities with unloaded levels 2017-02-15 17:51:41 +00:00
b3beb9f71d fixed player data not saving 2017-02-14 13:40:58 +00:00
14a0ff5caa Call PlayerQuitEvent after unloading chunks, removed some weird code, fixed crash when unloading player level on quit, close #284 2017-02-14 12:44:31 +00:00
903534572d Shut some inspections up 2017-02-13 14:27:17 +00:00
91fd99d76a Fixed DestroyBlockParticle 2017-02-12 16:01:23 +00:00
595fffc432 Fix chunks not being updated client-side when Level->setChunk() is called (#328)
Fixes half-trees, probably fixes #265
2017-02-09 11:10:25 +00:00
0c35c16727 Fix some doc comments 2017-02-06 14:50:05 +00:00
f881cea8e0 Remove some unused properties from Player 2017-01-28 17:53:52 +00:00
8beefabbbc Remove useless unset() from 2014 2017-01-28 16:14:37 +00:00
478a62e17b Merge branch 'master' into mcpe-1.0 2017-01-27 16:58:53 +00:00
9661d845bb Fix some command stupidity
This is why NOT to write code at 11PM when one is shattered.
2017-01-27 16:57:07 +00:00
740a8ad436 Lock player position for delayed teleport, and add related assertions 2017-01-26 11:13:35 +00:00
ccef0455ab Fixed CPU/mem leak when teleporting with movement checks disabled, close #231 2017-01-25 19:45:47 +00:00
661f17b6e0 Anti-cheat fixes, settings and API (#287)
* Added options to disable movement checks and anti-instabreak and API methods to control this
* Fixed anti-flight false positives
* Fix flight toggle kick cannot be disabled
* Added PlayerIllegalMoveEvent
2017-01-25 09:40:48 +00:00
50b9034e16 Merge master into mcpe-1.0 2017-01-21 13:43:41 +00:00
52748fcf64 TODO: REVERT - Added a workaround for client text duplication 2017-01-20 10:24:52 +00:00
19572b8c51 Remove multiline separation (unnecessary) 2017-01-20 10:24:52 +00:00
8ea03524ff Fixed most movement-check false-positives (finally!)
Removed ySize hack, fixes ladders, fixed original autojump and dropdown issues. These were due to a tiny, tiny tiny margin for error when decoding network floats (usually less than 0.000001, but enough to cause issues. Added Binary floating-point decode accuracy option to combat this. Network Vector3s are now rounded to 4 decimal places.
2017-01-20 10:00:20 +00:00
162b993e65 Added a hack for multiworld. This is not always reliable! (#263) 2017-01-17 10:28:48 +00:00
2d3b8845fd Add a message for movement reverting 2017-01-14 10:19:53 +00:00
39c3b16e49 Micro optimization (#252) 2017-01-12 15:38:30 +00:00
4bf8f00b0f Use MODE_RESET for forceMovement, fixes most teleportation issues 2017-01-09 15:41:05 +00:00
6e87a48100 Revert "Fix a really annoying movement bug on player join", close #231
This reverts commit b16f7e4dd5.
2017-01-09 15:32:10 +00:00
0a3fd8737a This is not needed anymore 2017-01-09 11:00:39 +00:00
86dc8c48b9 Fix player burn time in creative 2017-01-06 20:01:21 +00:00
598e7aac8f More PhpStorm inspections, import cleanup 2017-01-04 14:55:11 +00:00
1cb96d24ce Some fixes, thanks PhpStorm 2017-01-04 11:29:24 +00:00
0bd7ea211d Refactored Server::broadcastPacket() to be non-static
Why the hell was this static at all? Seriously Shoghi?
2017-01-03 22:24:40 +00:00
fb0c8c2c97 Merge branch 'item-fixes' into mcpe-1.0 2016-12-21 17:15:19 +00:00
7190f6a4ca Fix bow cannot be shot after jumping or sneaking, fix #190 2016-12-21 15:23:03 +00:00
77b3cd71a3 Fixed cannot use items with custom NBT in regular crafting recipe, close #135 2016-12-21 14:55:13 +00:00
5443b10257 Use -1 for anydamage and empty string for null NBT, closes #146 2016-12-21 14:45:34 +00:00
8c772fe671 Working item frames 2016-12-20 13:01:28 +00:00