MCPcopy Create free account
hub / github.com/Hypejet/Jet / ChatMode

Class ChatMode

api/src/main/java/net/hypejet/jet/entity/player/Player.java:123–170  ·  view source on GitHub ↗

Represents a Minecraft chat mode setting of plain Player a player. This is not an enum, since it depends on Minecraft. Adding an enum entry could break enum switch cases for example. @since 1.0 @see Player

Source from the content-addressed store, hash-verified

121 * @see Player
122 */
123 final class ChatMode {
124 /**
125 * A chat mode used when a player allows all chat messages to be sent.
126 *
127 * @since 1.0
128 */
129 public static final ChatMode ENABLED = new ChatMode("enabled");
130
131 /**
132 * A chat mode used when a player allows only chat messages from commands to be sent.
133 *
134 * @since 1.0
135 */
136 public static final ChatMode COMMANDS_ONLY = new ChatMode("commands only");
137
138 /**
139 * A chat mode used when a player does not allow any chat messages to be sent.
140 *
141 * @since 1.0
142 */
143 public static final ChatMode HIDDEN = new ChatMode("hidden");
144
145 private final String name;
146
147 private ChatMode(@NonNull String name) {
148 this.name = Objects.requireNonNull(name, "name");
149 }
150
151 /**
152 * Gets a readable lower-case name of this chat mode.
153 *
154 * @return the name
155 * @since 1.0
156 */
157 public @NonNull String name() {
158 return this.name;
159 }
160
161 /* Methods #equals and #hashCode are not implemented, since this class is intended to be identity-compared only
162 since all instances are defined in constants of this class. */
163
164 @Override
165 public String toString() {
166 return "ChatMode{" +
167 "name='" + this.name + '\'' +
168 '}';
169 }
170 }
171
172 /**
173 * Represents skin part of {@linkplain Player a player}.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected