mirror of https://github.com/LOOHP/Limbo.git
Compare commits
4 Commits
ecaa9bbcc5
...
6320c72961
| Author | SHA1 | Date |
|---|---|---|
|
|
6320c72961 | |
|
|
75191a83f7 | |
|
|
04ed353ab9 | |
|
|
502aa78c3b |
2
pom.xml
2
pom.xml
|
|
@ -24,7 +24,7 @@
|
||||||
<groupId>com.loohp</groupId>
|
<groupId>com.loohp</groupId>
|
||||||
<artifactId>Limbo</artifactId>
|
<artifactId>Limbo</artifactId>
|
||||||
<name>Limbo</name>
|
<name>Limbo</name>
|
||||||
<version>0.7.15-ALPHA</version>
|
<version>0.7.16-ALPHA</version>
|
||||||
|
|
||||||
<description>Standalone Limbo Minecraft Server.</description>
|
<description>Standalone Limbo Minecraft Server.</description>
|
||||||
<url>https://github.com/LOOHP/Limbo</url>
|
<url>https://github.com/LOOHP/Limbo</url>
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,19 @@ public class DeclareCommands {
|
||||||
public static PacketPlayOutDeclareCommands getDeclareCommandsPacket(CommandSender sender) throws IOException {
|
public static PacketPlayOutDeclareCommands getDeclareCommandsPacket(CommandSender sender) throws IOException {
|
||||||
List<String> commands = Limbo.getInstance().getPluginManager().getTabOptions(sender, new String[0]);
|
List<String> commands = Limbo.getInstance().getPluginManager().getTabOptions(sender, new String[0]);
|
||||||
|
|
||||||
if (commands.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||||
DataOutputStream output = new DataOutputStream(buffer);
|
DataOutputStream output = new DataOutputStream(buffer);
|
||||||
|
|
||||||
|
if (commands.isEmpty()) {
|
||||||
|
DataTypeIO.writeVarInt(output, 1);
|
||||||
|
|
||||||
|
output.writeByte(0);
|
||||||
|
DataTypeIO.writeVarInt(output, 0);
|
||||||
|
DataTypeIO.writeVarInt(output, 0);
|
||||||
|
|
||||||
|
return new PacketPlayOutDeclareCommands(buffer.toByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
DataTypeIO.writeVarInt(output, commands.size() * 2 + 1);
|
DataTypeIO.writeVarInt(output, commands.size() * 2 + 1);
|
||||||
|
|
||||||
output.writeByte(0);
|
output.writeByte(0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue