Skip to content

Commit b6a07ec

Browse files
committed
add readme.md, fix , localization
1 parent 3fae56b commit b6a07ec

File tree

5 files changed

+33
-1
lines changed

5 files changed

+33
-1
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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.

src/main/java/com/xkball/key_command/JsonGen.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

src/main/java/com/xkball/key_command/network/packets/KeyEventToServerPacket.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import net.minecraft.command.ICommandSender;
99
import net.minecraft.entity.Entity;
1010
import net.minecraft.entity.player.EntityPlayer;
11+
import net.minecraft.entity.player.EntityPlayerMP;
1112
import net.minecraft.server.MinecraftServer;
1213
import net.minecraft.world.World;
1314
import 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
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
key.category.key_command=Command Key
2+
key.command.lm=Open LavaLocationManager
3+
key.command.cd=Open Main Menu
4+
5+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
key.category.key_command=命令按键
2+
key.command.lm=打开 地标管理
3+
key.command.cd=打开 菜单

0 commit comments

Comments
 (0)