465 Commits

Author SHA1 Message Date
Dylan K. Taylor
adbb53929e Fixed scaling issues with height and width on the client, close #819
Seems these metadata fields are actually the _base_ height/width. Setting the scale will cause the client to calculate bounding boxes with the scale already taken into account. This caused the scale to be applied twice on the client.
2017-05-05 16:51:15 +01:00
smarticles101
8a7259aa73
Merge #826: use getEffectLevel() instead of getAmplifier() + 1
Closes #412
2017-05-05 19:01:04 +08:00
Dylan K. Taylor
c4f461f65d Fixed fall damage in 1 block of water, close #470 2017-05-05 10:41:44 +01:00
Dylan K. Taylor
d682fdfdf0 Food and exhaustion should not apply in creative, close #860 2017-04-24 13:31:05 +01:00
Dylan K. Taylor
559504225a Throw an exception before calling base entity constructor if skin is not set or invalid, close #835 (#855) 2017-04-24 09:50:55 +01:00
Dylan K. Taylor
6ece57e23e Merge changes from master 2017-04-21 22:48:18 +01:00
Dylan K. Taylor
2204942338 Fixed the half-done hunger implementation, fixed lots of bugs related to hunger
- Fixed starvation doesn't deal any damage at all (Human->getFood() returns a float, not an int, === 0 won't work so great)
- Added exhaustion for sprinting, walking, jumping and sprint-jumping as per MCPE (these use MCPE values, and yes MCPE does walking exhaustion!)
- Fixed attributes don't get reset after player death
- Added food and hunger regeneration in peaceful difficulty
- Added API methods Living->jump() (motion isn't updated yet, so this won't actually do much if plugins try to use it) and Living->getJumpVelocity()

TODO: implement exhaustion for swimming
2017-04-21 19:48:25 +01:00
Dylan K. Taylor
e7406ba096 Fixed squid health attribute errors 2017-04-21 14:42:19 +01:00
Sandertv
1c7773c5f1 Visibility keyword before final or abstract keyword. (#814) 2017-04-13 20:58:53 +08:00
Dylan K. Taylor
1c2895eb12 Fixed absorption application logic, close #518 2017-04-05 21:16:40 +01:00
Dylan K. Taylor
202bac28fc Merge master into api3/network 2017-04-01 19:37:15 +01:00
Dylan K. Taylor
69ac80518c some improvements to the horrendous mess that is the handling of joining and quitting, fixed some crashes, probably caused some other crashes
I can't fix this completely because it's just too much of a fucking mess. NEED to separate network stuff from Player.
2017-03-30 19:33:47 +01:00
Dylan K. Taylor
cb059ea713 fix some PhpStorm inspections 2017-03-30 12:10:59 +01:00
Dylan K. Taylor
afb2e0c51f fixed setting entity scale doesn't resize bounding box, close #484 2017-03-30 09:34:52 +01:00
Dylan K. Taylor
52f2596dc5 Merge branch 'master' into api3/network 2017-03-28 12:27:40 +01:00
Dylan K. Taylor
2079e2fd88 Fixed entity visibility Player object memory leak, close #416 2017-03-28 12:26:02 +01:00
Dylan K. Taylor
217f66e180 Removed redundant method override leftover from 0.15 2017-03-28 12:25:54 +01:00
Dylan K. Taylor
bb79684480 Merge branch 'api3/network' into api3/network_mcpe-1.0.5 2017-03-25 21:31:48 +00:00
Dylan K. Taylor
4245274aec Merge branch 'master' into api3/network 2017-03-25 21:26:46 +00:00
Dylan K. Taylor
34f833fa79 Do not save empty inventory slots 2017-03-25 12:02:09 +00:00
Dylan K. Taylor
9a35b4fbc8 Removed redundant TODO comment 2017-03-21 14:03:53 +00:00
Dylan K. Taylor
940b20c191 Implemented Absorption effect
This is a little buggy due to a client-sided bug. https://bugs.mojang.com/browse/MCPE-20520
TODO: add attribute save/restore
2017-03-21 13:23:57 +00:00
Dylan K. Taylor
c21768df26 Updated Effect constants, removed incorrect/misleading SWIFTNESS constant
So what? I'd rather crash plugins than have them suddenly behave strangely because SWIFTNESS is now an alias for SPEED instead of HASTE.
2017-03-21 11:49:18 +00:00
Dylan K. Taylor
2d927db264 Implemented Instant Health and Instant Damage effects 2017-03-21 11:38:08 +00:00
Dylan K. Taylor
a5a51fb9c5 Merge branch 'master' into api3/network_mcpe-1.0.5 2017-03-21 10:47:41 +00:00
Dylan K. Taylor
b7a3230f73 Fixed botched effect override condition for equivalent amplifiers 2017-03-20 18:56:54 +00:00
Irish
66fbfdd47b Fixed hunger not saving, resolves 1 of #435 (#439) 2017-03-18 21:58:02 +00:00
Dylan K. Taylor
ab1150382a Merge branch 'api3/network' into api3/network_mcpe-1.0.5 2017-03-18 16:30:06 +00:00
Dylan K. Taylor
8114ceaf68 Merge branch 'master' into api3/network 2017-03-18 16:29:38 +00:00
Dylan K. Taylor
92193fd27b Use entity IDs in EntityDamageBy*EntityEvents, fixed memory leaks related to PvP/PvE/PvM (#418) 2017-03-13 10:30:31 +00:00
Dylan K. Taylor
78278a0b93 Fixed a mistake in old effect handling 2017-03-12 20:15:21 +00:00
Dylan K. Taylor
955dc38be4 Fixed botch-job implementation of Health Boost, will now actually work and not crash the server 2017-03-12 20:06:39 +00:00
Dylan K. Taylor
f58ee2028e Moved effects stuff to json 2017-03-12 19:52:57 +00:00
Dylan K. Taylor
6c5dbd7359 Merge branch 'master' into api3/network 2017-03-12 12:22:11 +00:00
Dylan K. Taylor
4f27bce5b3 Destroy NBT references when closing entities, alleviates memory issues on leaked Player objects
This does NOT FIX THE ACTUAL ISSUES, only eliminates some of the symptoms.
2017-03-12 10:53:27 +00:00
Dylan K. Taylor
c925845173 Added forceSend for attribute value setting, fixed slowness >= 7 removed client-side when sprinting 2017-03-09 21:33:55 +00:00
Dylan K. Taylor
7fb3c7343f Fit attribute value to range when applying slowness, close #410
According to http://minecraft.gamepedia.com/Status_effect#Slowness, anything higher than slowness 7 will cause the player to be unable to move. Therefore this value should be clamped to a minimum of 0, not crash.
2017-03-09 21:01:10 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
08cd944e5d Merge branch 'master' into api3/network 2017-03-09 18:12:37 +00:00
Dylan K. Taylor
f87b745771 New entity metadata and found some UpdateTradePacket fields 2017-03-09 17:55:26 +00:00
Dylan K. Taylor
c052ee5847 Set alpha value to 0xff, fixed potion bubbles, close #407
TODO: implement transparency
2017-03-09 12:26:24 +00:00
Dylan K. Taylor
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00
Dylan K. Taylor
1ee689e759 Fixed mess of entity ID 0 for players, fixed emeralds 2017-03-02 11:04:00 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
abffe1297d Fixed crashes closing entities with unloaded levels 2017-02-15 17:51:41 +00:00
Sandertv
6dc6e32656 Added some very useless functions for easier size changing of entities. (#348) 2017-02-11 21:24:38 +00:00
Dylan K. Taylor
740a8ad436 Lock player position for delayed teleport, and add related assertions 2017-01-26 11:13:35 +00:00
Dylan K. Taylor
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
Dylan K. Taylor
92b85e0f15 Fix players regenerating health from food while dead, fixes issue 2 in #23 2017-01-09 14:10:05 +00:00
Dylan K. Taylor
86dc8c48b9 Fix player burn time in creative 2017-01-06 20:01:21 +00:00