6447 Commits

Author SHA1 Message Date
Dylan K. Taylor
cc1a3d695f Implemented basic Ender Pearls
this doesn't have full functionality yet (like spawning endermites) because some things aren't implemented yet.
2018-03-09 19:05:14 +00:00
Dylan K. Taylor
8020780fc5 LevelEventPacket: added enderman teleport particle cloud constant 2018-03-09 17:20:35 +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
3827892e48 ArmorInventory: fixed debug spam when sending contents to the player itself 2018-03-09 13:23:51 +00:00
Dylan K. Taylor
e06b78b0ee Implemented armor durability 2018-03-09 13:21:05 +00:00
Dylan K. Taylor
74cff89df3 Instant Damage splash potions now deal knockback 2018-03-09 12:52:09 +00:00
Dylan K. Taylor
a9957c3db3 Water bottles extinguish fires when hitting a block 2018-03-09 12:25:34 +00:00
Dylan K. Taylor
2e9bf7e93b Implemented Splash Potions 2018-03-09 12:25:02 +00:00
Dylan K. Taylor
dbcc69c2de LevelEventPacket: added useless constant 2018-03-09 11:35:08 +00:00
Dylan K. Taylor
cdd3fe81e1 Projectile: allow using negative damage amounts to remove damage effects 2018-03-09 11:35:08 +00:00
Dylan K. Taylor
a8a3eb3866 Added particles for snowballs and eggs 2018-03-09 11:35:07 +00:00
Dylan K. Taylor
83a3c6f614 Arrow: added shake effect and strike sound 2018-03-09 11:35:07 +00:00
Dylan K. Taylor
8cc6a32a04 Rewritten Projectile movement handling, added ProjectileHitBlockEvent and ProjectileHitEntityEvent, fixed a swathe of arrow-related bugs
I usually avoid mega-commits, but one thing led to another.
2018-03-09 11:35:07 +00:00
Dylan K. Taylor
c1a2144f60 Particle: added some new constants 2018-03-09 10:42:59 +00:00
Dylan K. Taylor
b2491a5874 CraftingTransaction: clean up some logic 2018-03-08 20:44:52 +00:00
Dylan K. Taylor
2e125168c3 CraftingTransaction: Fixed ingredient map trimming
I really don't know why I made this so complicated to start with. This works much better and is much easier to read.

Fixes #2083.
2018-03-08 19:51:06 +00:00
Dylan K. Taylor
5059a92b91 Fixed bow and throwable sounds 2018-03-08 13:20:26 +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
1f77c074e9 Level: Unload chunks prior to save() to avoid saving chunks twice on shutdown
save() calls saveChunks() which saves any chunks found to be modified. But chunk unloading does this anyway, so it's better to unload first and then trigger the save mechanism, to avoid saving chunks twice.
2018-03-07 19:47:54 +00:00
Dylan K. Taylor
73a5788774 Door: remove unused local variable 2018-03-07 18:53:38 +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
c7f8796136
Implemented Paintings (#2073)
This supports vanilla placement of paintings, with overlap and collision checking.
Paintings are removed when a block is placed inside them or if any of their supporting blocks are removed.

As per vanilla, a random painting is chosen from the largest subset that will fit into the given space.
2018-03-07 09:03:30 +00:00
Dylan K. Taylor
b623c4aba1 Remove accidentally committed file 2018-03-04 15:17:14 +00:00
Dylan K. Taylor
49a39fc7bd Split DestroyBlockParticle into two classes
this level-event is not only used for blocks, it's also used for paintings.
2018-03-04 13:11:38 +00:00
Dylan K. Taylor
2e4519cb36 ExperienceOrb: fixed behaviour when placing blocks on top of them 2018-03-04 12:47:09 +00:00
Dylan K. Taylor
2ff3b12376 Cleaned up projectile "collide" checks 2018-03-04 12:19:41 +00:00
Dylan K. Taylor
9e4bccd8c0 updated Language submodule 2018-03-03 19:59:13 +00:00
Dylan K. Taylor
1c5180b720 McRegion: don't assign regions to the index until all exception handling is done
it appears that errors are occurring in the exception handler when handling corrupted regions, leaving regions in the provider index with incomplete location tables. This causes strange-looking errors later down the line.

This moves the region assignment to the end of the condition to avoid leaving incomplete/corrupted regions in the location table when errors occur.
2018-03-02 18:30:45 +00:00
Dylan K. Taylor
fa6d44ea9e Move Attribute and Effect init calls to Entity::init()
since entities are dependent on these, they should be here.
2018-03-02 10:05:50 +00:00
Dylan K. Taylor
9d018e8d9e Level: cleaned up chunk loading error handling, close #2056
This now removes logging from the level providers (for the most part) and replaces it with exception throws and catches. The implementation using the providers should catch these exceptions if they are thrown.
2018-03-01 12:30:12 +00:00
Dylan K. Taylor
ae2e1fdd5a McRegion: Make nbtDeserialize() and nbtSerialize() protected
Not really sure why these are still exposed publicly.
2018-03-01 10:42:27 +00:00
Dylan K. Taylor
5457c7a202 Updated PocketMine-Language submodule 2018-03-01 09:53:14 +00:00
Dylan K. Taylor
ee28296d60 Server: fixed authentication messages
why did I do this...
2018-03-01 09:32:04 +00:00
Dylan K. Taylor
06af742bef wtf 2018-03-01 09:30:50 +00:00
Dylan K. Taylor
6bdf5e15c0 Fixed a couple of mistakes in generateLevel() docs 2018-03-01 09:23:50 +00:00
Dylan K. Taylor
d4eba3f4b1 Moved some things out of Server to appropriate init() functions 2018-03-01 09:18:40 +00:00
Dylan K. Taylor
5a89e80873 Server: added getPlayerByUUID() and getPlayerByRawUUID()
closes #2047

Since the player list already indexes players by UUID, it's simple to just use that for fetching the player.

A possible future improvement could be to allow fetching an _offline_ player by UUID, but no capability to do that is yet available.
2018-03-01 09:09:34 +00:00
Dylan K. Taylor
28e601bbb9 Tile: added handling for PC 1.11 save IDs 2018-02-28 19:58:18 +00:00
Dylan K. Taylor
7e9f1324a7 Entity: fixed tiny sub optimal code in registerEntity() 2018-02-28 19:30:30 +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
533d139385 Server: Move removePlayer() to somewhere more sensible 2018-02-28 18:28:36 +00:00
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