Skip to content

RegionAccessor#getMoonPhase is outdated #13542

@ShaneBeee

Description

@ShaneBeee

Expected behavior

The method RegionAccessor#getMoonPhase should be updated to follow the new moon phase Environmental Attribute in a Timeline.

Observed/Actual behavior

Minecraft 1.21.11 introduced Environment Attributes.
One of them being a moon phase attribute which can be controlled by the dimension, biome or timeline.
In Minecraft's case it's part of a Timeline.
It's no longer hard coded.
The timeline can be modified in a datapack.

That being said in the code for CraftRegionAccessor:

@Override
public io.papermc.paper.world.MoonPhase getMoonPhase() {
    return io.papermc.paper.world.MoonPhase.getPhase(this.getHandle().getLevel().getDayTime() / SharedConstants.TICKS_PER_GAME_DAY);
}

This is now outdated as it goes based on the old method assuming the timeline file is never modified.

Steps/models to reproduce

see above!

Plugin and Datapack List

null
(just looking at the code)

Paper version

Paper version 1.21.11-91-main@a0f626b
Thats what im running, but I'm actually just looking at the code.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.version: 1.21.11Game version 1.21.11

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions