File tree Expand file tree Collapse file tree 5 files changed +33
-1
lines changed
java/com/xkball/key_command
resources/assets/key_command/lang Expand file tree Collapse file tree 5 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 1+ # KeyCommand
2+
3+ 本模组允许玩家自定义一个按键并且绑定一个命令.
4+
5+ 需要在服务端也安装本模组 并且只有服务端也有** 完全一样** 的自定义命令时才能执行命令.
6+
7+ 当玩家处在多人游戏时,执行的命令无视玩家是否有op,只要服务端允许 可以执行玩家本不能执行的命令.
8+
9+ 当玩家处在单机模式时,能执行的命令由玩家本身权限决定.
10+
11+ ***
12+
13+ This mod allows players to customize a key and bind a command.
14+
15+ This mod needs to be installed on both side and only the server side also has
16+ ** Exactly The Same** command key bind, it can be executed.
17+
18+ When the player is in a multiplayer game,
19+ the executed command ignores whether the player has op or not, as long as the server allows it to execute commands that the player cannot execute.
20+
21+ When the player is in single player game,the commands can be executed or not are determined by the player's own authority.
Original file line number Diff line number Diff line change @@ -15,5 +15,7 @@ public static void main(String[] args) {
1515 out .add ("key_array" ,array );
1616
1717 System .out .println (KeyCommand .jsonToString (out ));
18+ System .out .println (0xC7 );
19+ System .out .println (0x31 );
1820 }
1921}
Original file line number Diff line number Diff line change 88import net .minecraft .command .ICommandSender ;
99import net .minecraft .entity .Entity ;
1010import net .minecraft .entity .player .EntityPlayer ;
11+ import net .minecraft .entity .player .EntityPlayerMP ;
1112import net .minecraft .server .MinecraftServer ;
1213import net .minecraft .world .World ;
1314import net .minecraftforge .fml .common .network .ByteBufUtils ;
@@ -47,7 +48,7 @@ public String getName() {
4748
4849 @ Override
4950 public boolean canUseCommand (int permLevel , String commandName ) {
50- return true ;
51+ return player instanceof EntityPlayerMP || player . canUseCommand ( permLevel , commandName ) ;
5152 }
5253
5354 @ Override
Original file line number Diff line number Diff line change 1+ key.category.key_command=Command Key
2+ key.command.lm=Open LavaLocationManager
3+ key.command.cd=Open Main Menu
4+
5+
Original file line number Diff line number Diff line change 1+ key.category.key_command=命令按键
2+ key.command.lm=打开 地标管理
3+ key.command.cd=打开 菜单
You can’t perform that action at this time.
0 commit comments