1027 Commits

Author SHA1 Message Date
Dylan K. Taylor
a19651a8dc Painting: reduce complexity of getPaintingBB()
this makes it easier to unit-test.
2019-05-12 16:15:31 +01:00
Dylan K. Taylor
adf4639625 Painting: Clean up painful BB calculation code 2019-05-12 16:10:51 +01:00
Dylan K. Taylor
cf0c0e72a9 Assume the player is online when they are, uh, assumed to be online
the checks removed here should never be hit under normal circumstances. If they were hit, they'd just conceal bugs which would cause a crash to happen later anyway.
2019-05-07 19:49:06 +01:00
Dylan K. Taylor
66481fedeb Entity: Protect internal methods setPosition() and setPositionAndRotation()
teleport() should be used instead (or setRotation() for rotation-only changes).
2019-05-07 17:38:33 +01:00
Dylan K. Taylor
00944eff72 Removed EntityWorldChangeEvent
there's nothing that can be done with this event that can't be done with EntityTeleportEvent. Having this extra event needlessly increases system complexity.
2019-05-07 17:37:10 +01:00
Dylan T
3cd6e12e71
Renaming "Level" -> "World" (#2907)
This has been a pain point for a long time due to the misleading nature of the name "level". It's also confusing when trying to do things like getting the XP level of the player or such, and also does not translate well to other languages.

This transition was already executed on the UI some time ago (language strings) and now it's time for the same change to occur on the API.

This will burn a lot of plugins, but they'll acclimatize. Despite the scary size of this PR, there isn't actually so many changes to make. Most of this came from renaming `Position->getLevel()` to `Position->getWorld()`, or cosmetic changes like changing variable names or doc comments.
2019-05-07 14:47:28 +01:00
Dylan K. Taylor
0317b0f22d Merge branch 'next-minor' 2019-05-02 15:07:38 +01:00
Dylan K. Taylor
d7a35a5302 Entity: fixed motion not being initialized when Motion NBT tag is missing
fixes CA 2355485
2019-05-02 14:00:28 +01:00
Dylan K. Taylor
67e75d6c0a Moved DataPropertyManager to network namespace
this is _extremely_ network-focused code.
2019-04-26 18:57:44 +01:00
Dylan K. Taylor
854a2f5135 Move a giant heap of network garbage out of Entity 2019-04-26 18:52:38 +01:00
Dylan K. Taylor
ea8c723092 EntityFactory: added some documentation 2019-04-26 18:15:31 +01:00
Dylan K. Taylor
396efbac7e Human: simplify setFood() 2019-04-26 12:40:15 +01:00
Dylan K. Taylor
c5ca623124 Merge branch 'stable' 2019-04-25 15:27:13 +01:00
Dylan K. Taylor
fa70127241 1.11.0 protocol changes 2019-04-24 19:54:16 +01:00
Dylan K. Taylor
5913d5038b Cleaned up Entity->close() handling 2019-04-18 17:23:48 +01:00
Dylan K. Taylor
5f23fffdda Merge remote-tracking branch 'origin/3.7' 2019-04-12 18:33:13 +01:00
Dylan K. Taylor
95313e0a90 Updated some entity metadata properties 2019-04-08 14:42:33 +01:00
Dylan K. Taylor
e5756dbf0b Move a whole bunch of packet crap to NetworkSession 2019-04-02 18:31:16 +01:00
Dylan K. Taylor
c59a2d1b93 More hasFiniteResources() usages 2019-03-31 16:51:43 +01:00
Dylan K. Taylor
f8ce7797db Player: add hasFiniteResources() 2019-03-31 16:40:54 +01:00
Dylan K. Taylor
0aebb3f4fb Clean up LevelSoundEvent handling 2019-03-26 19:53:40 +00:00
Dylan K. Taylor
10db57655e clean up some direct LevelEvent usages for sounds 2019-03-26 18:06:12 +00:00
Dylan K. Taylor
37b5ad8350 Remove remaining direct protocol usages for particles 2019-03-26 17:00:00 +00:00
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
0659d2fbef Backport 6bd43a8215b9e612478fe789da9a58b36f0f0e73: Firehose auto-tick-rate anti-feature, closes #2665 2019-03-09 19:20:53 +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