This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements (ProxyWindow, Surround, LegitHelper, BreadCrumbs, etc.)
- Loading branch information
Showing
45 changed files
with
533 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package thunder.hack.cmd.impl; | ||
|
||
import com.mojang.brigadier.arguments.StringArgumentType; | ||
import com.mojang.brigadier.builder.LiteralArgumentBuilder; | ||
import net.minecraft.command.CommandSource; | ||
import net.minecraft.world.GameMode; | ||
import thunder.hack.cmd.Command; | ||
|
||
import static com.mojang.brigadier.Command.SINGLE_SUCCESS; | ||
|
||
public class GamemodeCommand extends Command { | ||
public GamemodeCommand() { | ||
super("gamemode", "gm"); | ||
} | ||
|
||
@Override | ||
public void executeBuild(LiteralArgumentBuilder<CommandSource> builder) { | ||
|
||
builder.then(arg("mode", StringArgumentType.greedyString()).executes(context -> { | ||
final String mode = context.getArgument("mode", String.class); | ||
|
||
switch (mode) { | ||
case "survival", "0": | ||
mc.interactionManager.setGameMode(GameMode.SURVIVAL); | ||
case "creative", "1": | ||
mc.interactionManager.setGameMode(GameMode.CREATIVE); | ||
case "spectator", "2": | ||
mc.interactionManager.setGameMode(GameMode.SPECTATOR); | ||
case "adventure", "3": | ||
mc.interactionManager.setGameMode(GameMode.ADVENTURE); | ||
} | ||
|
||
return SINGLE_SUCCESS; | ||
})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.