Introduction: In our world we set the direction as 0 degrees north and 90 degrees east ... and so on. However, it seems not to be so in the world of Minecraft. Subject: We can get the direction and the corresponding integer value (0 to 3) with the function getDirection() in pmmp world. However, referring to this value, the sun will climb from the west as shown in the picture. Even in reality, even in Minecraft: JavaEdition, the sun climbs east. Should I issue a pull request to fix this? reference: ・Entity::getDirection(): https://github.com/pmmp/PocketMine-...fe01ba/src/pocketmine/entity/Entity.php#L1285 ・Minecraft: Sun: https://minecraft.gamepedia.com/Sun
East, West, South, North are defined by the directions of the X-Z plane. It is not defined by the place where the sun comes out. These compass directions were introduced into Minecraft before the sun even came out. Developers use the X-Z definition of EWSN, not the sun definition. I documented this behaviour here: https://github.com/SOF3/forums-common-sense/wiki/PocketMine-Plugin-Development-FAQ#coordinate-system
SOF3's bihaviour certainly makes sense. But it is very incongruous that the direction is different from Minecraft: JavaEdition(and reality).
Changing this will break lots of code that depends on it (block placement for example) so I've avoided touching this at the moment. If I remember correctly, the direction values are correct (as commented in the code), but the function returns unexpected results - this needs investigating further.
just hotfix the sun for now? since it's generally UI only, degrees will break a shit ton of hardcoded plugins doe but for consistency some day maybe we could...
the sun is client-sided. It's just that plugins have to differently interpret the results of getDirection().
I know this is an old thread, but it caught my eye... anyway, this bug is fixed in 4.0 development builds.