1003 Commits

Author SHA1 Message Date
Dylan K. Taylor
2a3e6dcf00 Rename BlockIds -> BlockLegacyIds 2019-03-23 19:46:31 +00:00
Dylan K. Taylor
79ef8e0803 Replace all legacy blockID references with BlockIds:: 2019-03-23 19:44:33 +00:00
Dylan K. Taylor
e088da320c ItemEntity: fixed mineWood achievement not working for acacia/dark-oak 2019-03-23 19:06:35 +00:00
Dylan K. Taylor
9ec62643d5 Player construction now happens when we're ready to create the player entity
this fixes a wide range of bugs with the initial spawn sequence, and allows to simplify a whole lot of player setup logic.
2019-03-23 10:13:14 +00:00
Dylan K. Taylor
9b11e39efc use ?? 2019-03-22 15:03:46 +00:00
Dylan K. Taylor
3dbed830ef Fixed entities not loading on imported MCPE worlds 2019-03-21 20:03:10 +00:00
Dylan K. Taylor
b8d1eb20b0 EntityDeathEvent: add XP amount API, closes #2690 2019-03-21 19:53:14 +00:00
Dylan K. Taylor
89c0836047 Fixed paintings dropping multiple times, closes #2774 2019-03-21 19:46:43 +00:00
Dylan K. Taylor
8c536c248d Updating for latest PocketMine-NBT changes 2019-03-21 15:58:22 +00:00
Dylan K. Taylor
6f54b53f7a thanks for being useless PhpStorm
these problems didn't show up in any inspections until I opened the fucking files...
2019-03-17 15:53:59 +00:00
Dylan K. Taylor
ad19696364 Make Effect and Enchantment functions less verbose 2019-03-13 15:26:21 +00:00
Dylan T
c266f86b1b
ItemEntity: introduce controls for despawn timers (#2769)
This opts _not_ to expose item "age" a la #2753 because "age" is a misleading term for it. In addition, further inspection of the problem led me to realize that exposing control of that AND despawn timeout was more complicated than simply having a despawn delay timer exactly like the pickup delay one. Everyone knows a countdown timer stops at 0, so this way we don't need any method to control the limit.

Closes #2667
Closes #2753
2019-03-10 12:05:21 +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
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
440dd21550 Merge branch '3.6' 2019-02-26 19:59:24 +00:00
Dylan K. Taylor
2164dbae67 Fixed reloaded arrows not despawning, closes #2781 2019-02-26 19:58:21 +00:00
Dylan K. Taylor
0bd1c1529e Block: Rename getItem() to asItem()
this has clearer meaning and is less likely to collide with other things.
2019-02-24 10:23:40 +00:00
Dylan K. Taylor
7170d9009d Enchantment: more static getters, firehose magic numbers
This is similar in nature to 646fea5a4ecbbdf3f0cbfc590d874dedc1a7bfc0.

On a side note: Migrating this way is a pain in the ass due to lack of types. What the heck is int supposed to mean?!?!?!?! At least if we wanted to go _back_ to magic numbers, it would be easy to locate everything with an Enchantment typehint...
2019-02-20 13:45:50 +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
a4c3ee20b2 Extract Fallable into trait + interface
Traits are inferior to components in pretty much every aspect imaginable :(
2019-02-19 09:58:10 +00:00
Dylan K. Taylor
3bbc0b5d5f Merge branch '3.6' 2019-02-17 17:08:44 +00:00
Dylan K. Taylor
074baf7e1c Merge branch '3.5' into 3.6 2019-02-17 17:08:15 +00:00
Dylan K. Taylor
2e0dd574e0 Set default health attribute value when changing max health, closes #2771 2019-02-17 17:06:32 +00:00
Dylan K. Taylor
c2735286ab Merge branch '3.6' 2019-02-17 11:35:07 +00:00
Dylan K. Taylor
e16d8e31af Merge branch '3.5' into 3.6 2019-02-17 11:33:46 +00:00
Dylan K. Taylor
3c93a57397 Entity: add a hack to prevent client-side movement when entity is not moving
this fixes #2227.
2019-02-17 11:33:34 +00:00
Dylan K. Taylor
6424dc9c82 Merge branch '3.6' 2019-02-14 16:04:32 +00:00
Dylan K. Taylor
e71e18fc88 Merge branch '3.5' into 3.6 2019-02-14 16:02:30 +00:00
Dylan K. Taylor
e1bacb5c6d Human: fixed hunger underflow when value is a fraction, closes #2761 2019-02-14 16:01:25 +00:00
Dylan K. Taylor
9ebd559907 Merge branch '3.6' 2019-02-10 13:59:44 +00:00
Dylan K. Taylor
9da7c6af27 new metadata properties 2019-02-10 13:59:21 +00:00
Dylan K. Taylor
c6a5829a92 Entity: remove dead function 2019-02-04 19:54:18 +00:00
Dylan K. Taylor
c872b120d0 Entity->entityBaseTick() is now protected 2019-02-04 19:54:06 +00:00
Dylan K. Taylor
acd0a8f2d4 fix possible crash in Projectile 2019-02-04 19:53:55 +00:00
Dylan K. Taylor
537afbc23b EffectInstance: Require positive amplifiers, closes #2723 2019-02-04 19:53:28 +00:00
Dylan K. Taylor
002f030970 EnderPearl: make a hack less messy 2019-02-04 19:51:49 +00:00
Dylan K. Taylor
c9f9f551f4 Merge branch '3.5' into master-rollback 2019-02-04 19:47:21 +00:00
Dylan K. Taylor
791b4d8ef3 SplashPotion: measure distance from eye height instead of base
this fixes effect durations being off (mostly), closes #2650
there are still some minor differences, but this is closer matching than the previous version.
2019-02-03 11:32:47 +00:00
Dylan K. Taylor
c3bbb8905c Human: simplify setFood() 2019-01-28 17:33:58 +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
9ec40c421f Split up Effects into a bunch of classes
Server-side levitation now works too.
2019-01-27 19:45:15 +00:00
Dylan K. Taylor
ac551cf248 Entity: add addMotion() to allow updating motion vector
this allows updating motion without needing to create new objects for the task.
2019-01-27 15:43:57 +00:00
Dylan K. Taylor
bccc07633c Entity: Allow disabling gravity for a mob 2019-01-27 15:42:46 +00:00
Dylan K. Taylor
6ee484e401 ChunkLoader: remove getLoaderId() (take 2) 2019-01-25 18:58:01 +00:00
Dylan K. Taylor
61e04d5284 Merge branch '3.5' 2019-01-23 16:48:12 +00:00
Dylan K. Taylor
187f36fe38 ExperienceOrb: clean up some confusing code 2019-01-23 16:46:18 +00:00
Dylan K. Taylor
dc89b48354 Human: Fixed XP drop amount to match vanilla
In vanilla it doesn't drop the exact number of points you collected. Rather, you lose a little for every level above 1 you had (1 level requires 7 points, later levels require +2 per level), and can recover at most 100 points. Hence, if you had 10 levels, you get back enough points to fill 5 levels and most of a 6th. 14-15 levels gets you the upper bound of about 7.5 levels.
2019-01-23 12:39:25 +00:00
Dylan K. Taylor
e6d1c1dfbc Living: Get rid of delayed XP spawning, closes #2644
This is not identical to vanilla, but I don't care because it gets rid of edge cases and also makes it easier to integrate with EntityDeathEvent in the future.
2019-01-23 12:31:05 +00:00
Dylan K. Taylor
4ae6428641 Level: rename getCollisionCubes() -> getCollisionBoxes()
these aren't cubes! shoghi, please read the dictionary.
2019-01-20 18:11:20 +00:00