|
9 | 9 | import com.mojang.brigadier.builder.LiteralArgumentBuilder; |
10 | 10 | import com.mojang.brigadier.context.CommandContext; |
11 | 11 | import com.mojang.brigadier.exceptions.CommandSyntaxException; |
| 12 | +import io.github.optijava.opt_carpet_addition.OptCarpetAddition; |
12 | 13 | import io.github.optijava.opt_carpet_addition.OptCarpetSettings; |
13 | 14 | import net.minecraft.server.MinecraftServer; |
14 | 15 | import net.minecraft.server.command.ServerCommandSource; |
@@ -44,6 +45,8 @@ private static int teleport(CommandContext<ServerCommandSource> context) { |
44 | 45 | try { |
45 | 46 | final String commandSourcePlayerName = context.getSource().getPlayer().getGameProfile().getName(); |
46 | 47 |
|
| 48 | + OptCarpetAddition.LOGGER.info(commandSourcePlayerName + " submit command: /player " + StringArgumentType.getString(context, COMMAND_PREFIX) + " tp"); |
| 49 | + |
47 | 50 | if (server.getPlayerManager().getPlayer(StringArgumentType.getString(context, COMMAND_PREFIX)) instanceof EntityPlayerMPFake) { |
48 | 51 | if (OptCarpetSettings.commandTpToFakePlayer.equals("true")) { |
49 | 52 | server.getCommandManager().execute(server.getCommandSource(), "tp " + commandSourcePlayerName + " " + StringArgumentType.getString(context, "player")); |
@@ -93,6 +96,8 @@ private static int teleportHere(CommandContext<ServerCommandSource> context) { |
93 | 96 | try { |
94 | 97 | final String commandSourcePlayerName = context.getSource().getPlayer().getGameProfile().getName(); |
95 | 98 |
|
| 99 | + OptCarpetAddition.LOGGER.info(commandSourcePlayerName + " submit command: /player " + StringArgumentType.getString(context, COMMAND_PREFIX) + " tphere"); |
| 100 | + |
96 | 101 | if (server.getPlayerManager().getPlayer(StringArgumentType.getString(context, COMMAND_PREFIX)) instanceof EntityPlayerMPFake) { |
97 | 102 | if (OptCarpetSettings.commandTpHereFakePlayer.equals("true")) { |
98 | 103 | server.getCommandManager().execute(server.getCommandSource(), "tp " + StringArgumentType.getString(context, COMMAND_PREFIX) + " " + commandSourcePlayerName); |
@@ -122,7 +127,7 @@ private static int teleportHere(CommandContext<ServerCommandSource> context) { |
122 | 127 |
|
123 | 128 | } catch (CommandSyntaxException e) { |
124 | 129 | Messenger.m(context.getSource(), "r Unknown error occurred when execute command : com.mojang.brigadier.exceptions.CommandSyntaxException"); |
125 | | - e.printStackTrace(); |
| 130 | + OptCarpetAddition.LOGGER.error("Unknown error occurred when execute command.", e); |
126 | 131 | } |
127 | 132 | return 1; |
128 | 133 | } |
|
0 commit comments