SpecialDates.java

net.minecraft.util.SpecialDates

信息

  • 全限定名:net.minecraft.util.SpecialDates
  • 类型:public class
  • 包:net.minecraft.util
  • 源码路径:src/main/java/net/minecraft/util/SpecialDates.java
  • 起始行号:L8
  • 职责:

    TODO

字段/常量

  • HALLOWEEN

    • 类型: MonthDay
    • 修饰符: public static final
    • 源码定位: L9
    • 说明:

      TODO

  • CHRISTMAS_RANGE

    • 类型: List<MonthDay>
    • 修饰符: public static final
    • 源码定位: L10
    • 说明:

      TODO

  • CHRISTMAS

    • 类型: MonthDay
    • 修饰符: public static final
    • 源码定位: L13
    • 说明:

      TODO

  • NEW_YEAR

    • 类型: MonthDay
    • 修饰符: public static final
    • 源码定位: L14
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public static MonthDay dayNow() @ L16

  • 方法名:dayNow
  • 源码定位:L16
  • 返回类型:MonthDay
  • 修饰符:public static

参数:

说明:

TODO

public static boolean isHalloween() @ L20

  • 方法名:isHalloween
  • 源码定位:L20
  • 返回类型:boolean
  • 修饰符:public static

参数:

说明:

TODO

public static boolean isExtendedChristmas() @ L24

  • 方法名:isExtendedChristmas
  • 源码定位:L24
  • 返回类型:boolean
  • 修饰符:public static

参数:

说明:

TODO

代码

public class SpecialDates {
    public static final MonthDay HALLOWEEN = MonthDay.of(Month.OCTOBER, 31);
    public static final List<MonthDay> CHRISTMAS_RANGE = List.of(
        MonthDay.of(Month.DECEMBER, 24), MonthDay.of(Month.DECEMBER, 25), MonthDay.of(Month.DECEMBER, 26)
    );
    public static final MonthDay CHRISTMAS = MonthDay.of(Month.DECEMBER, 24);
    public static final MonthDay NEW_YEAR = MonthDay.of(Month.JANUARY, 1);
 
    public static MonthDay dayNow() {
        return MonthDay.from(ZonedDateTime.now());
    }
 
    public static boolean isHalloween() {
        return HALLOWEEN.equals(dayNow());
    }
 
    public static boolean isExtendedChristmas() {
        return CHRISTMAS_RANGE.contains(dayNow());
    }
}

引用的其他类