SpecialDates .java

net.minecraft.util.SpecialDates (class, 26 lines): members: isExtendedChristmas, CHRISTMAS_RANGE, isHalloween, dayNow, HALLOWEEN, NEW_YEAR, CHRISTMAS.

net.minecraft.utilclass26 linescommon809 B

API Surface (3)

MonthDay dayNow()
boolean isHalloween()
boolean isExtendedChristmas()

Fields & Constants (4)

HALLOWEEN
CHRISTMAS_RANGE
CHRISTMAS
NEW_YEAR

Full Source

SpecialDates.java26 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util;
2
3
import java.time.Month;
4
import java.time.MonthDay;
5
import java.time.ZonedDateTime;
6
import java.util.List;
7
8
public class SpecialDates {
9
	public static final MonthDay HALLOWEEN = MonthDay.of(Month.OCTOBER, 31);
10
	public static final List<MonthDay> CHRISTMAS_RANGE = List.of(MonthDay.of(Month.DECEMBER, 24), MonthDay.of(Month.DECEMBER, 25), MonthDay.of(Month.DECEMBER, 26));
11
	public static final MonthDay CHRISTMAS = MonthDay.of(Month.DECEMBER, 24);
12
	public static final MonthDay NEW_YEAR = MonthDay.of(Month.JANUARY, 1);
13
14
	public static MonthDay dayNow() {
15
		return MonthDay.from(ZonedDateTime.now());
16
	}
17
18
	public static boolean isHalloween() {
19
		return HALLOWEEN.equals(dayNow());
20
	}
21
22
	public static boolean isExtendedChristmas() {
23
		return CHRISTMAS_RANGE.contains(dayNow());
24
	}
25
}
26

Decompiled Minecraft 26.3 source of SpecialDates (net/minecraft/util/SpecialDates.java) with Mojang official mappings, stored verbatim on the site.