Skip to content

Commit c3ac051

Browse files
committed
Fixed crash while joining world.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent b26e3c6 commit c3ac051

File tree

1 file changed

+5
-1
lines changed
  • src/main/kotlin/com/mairwunnx/projectessentials/core/impl/vanilla/commands

1 file changed

+5
-1
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/core/impl/vanilla/commands/GameModeCommand.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ import net.minecraft.world.GameType
2121
internal object GameModeCommand : VanillaCommandBase("gamemode") {
2222
override fun register(dispatcher: CommandDispatcher<CommandSource>) {
2323
super.register(dispatcher).also { aliases() }
24+
// @formatter:off
2425
GameType.values().forEach {
25-
if (!it.name.startsWith("sp")) short("gm${it.getName()[0]}", it) else short("gmsp", it)
26+
if (it != GameType.NOT_SET) {
27+
if (!it.getName().startsWith("sp")) short("gm${it.getName()[0]}", it) else short("gmsp", it)
28+
}
2629
}
30+
// @formatter:on
2731
val literal = Commands.literal(name)
2832
GameType.values().forEach { type ->
2933
if (type != GameType.NOT_SET) {

0 commit comments

Comments
 (0)