001package com.ericlam.mc.minigames.core.game; 002 003import org.bukkit.ChatColor; 004 005import javax.annotation.Nonnull; 006import javax.annotation.Nullable; 007 008/** 009 * 場地狀態容器 010 */ 011public class InGameState { 012 013 private final String stateName; 014 private final String motd; 015 016 /** 017 * @param stateName 狀態名稱 018 * @param motd 該狀態時顯示的 motd, 支援顏色 019 */ 020 public InGameState(@Nonnull String stateName, @Nullable String motd) { 021 this.stateName = stateName; 022 this.motd = motd; 023 } 024 025 /** 026 * @return 狀態名稱 027 */ 028 public String getStateName() { 029 return stateName; 030 } 031 032 /** 033 * @return 該狀態時顯示的 motd 034 */ 035 @Nullable 036 public String getMotd() { 037 return motd == null ? null : ChatColor.translateAlternateColorCodes('&', motd); 038 } 039 040}