23w41a
This commit is contained in:
1 parent
4a881264b4
commit
1fe486a5e8
7 files changed
+17
-23
No files matched your search
@@ -94,7 +94,6 @@ public class CarpetClient
|
||||
CarpetSettings.LOG.info("Server Response:");
|
||||
CompoundTag tag = (CompoundTag) t;
|
||||
CarpetSettings.LOG.info(" - id: " + tag.getString("id"));
|
||||
CarpetSettings.LOG.info(" - code: " + tag.getInt("code"));
|
||||
if (tag.contains("error"))
|
||||
{
|
||||
CarpetSettings.LOG.warn(" - error: " + tag.getString("error"));
|
||||
|
||||
@@ -84,20 +84,18 @@ public class ServerNetworkHandler
|
||||
String id = commandData.getString("id");
|
||||
List<Component> output = new ArrayList<>();
|
||||
Component[] error = {null};
|
||||
int resultCode = -1;
|
||||
if (player.getServer() == null)
|
||||
{
|
||||
error[0] = Component.literal("No Server");
|
||||
}
|
||||
else
|
||||
{
|
||||
resultCode = player.getServer().getCommands().performPrefixedCommand(
|
||||
player.getServer().getCommands().performPrefixedCommand(
|
||||
new SnoopyCommandSource(player, error, output), command
|
||||
);
|
||||
}
|
||||
CompoundTag result = new CompoundTag();
|
||||
result.putString("id", id);
|
||||
result.putInt("code", resultCode);
|
||||
if (error[0] != null)
|
||||
{
|
||||
result.putString("error", error[0].getContents().toString());
|
||||
|
||||
Reference in new issue
Block a user