Merge branch 'master' into 1.16
# Conflicts: # src/main/java/carpet/network/ServerNetworkHandler.java # src/main/java/carpet/script/CarpetExpression.java
This commit is contained in:
commit
80ca80fe24
22 files changed
+528
-3
No files matched your search
@@ -44,6 +44,9 @@ public class ClientNetworkHandler
|
||||
if (CarpetClient.shapes != null)
|
||||
CarpetClient.shapes.addShapes((ListTag) t);
|
||||
});
|
||||
put("clientCommand", (p, t) -> {
|
||||
CarpetClient.onClientCommand(t);
|
||||
});
|
||||
}};
|
||||
|
||||
|
||||
@@ -99,4 +102,17 @@ public class ClientNetworkHandler
|
||||
CarpetSettings.LOG.error("Unknown carpet data: "+key);
|
||||
}
|
||||
}
|
||||
|
||||
public static void clientCommand(String command)
|
||||
{
|
||||
CompoundTag tag = new CompoundTag();
|
||||
tag.putString("id", command);
|
||||
tag.putString("command", command);
|
||||
CompoundTag outer = new CompoundTag();
|
||||
outer.put("clientCommand", tag);
|
||||
CarpetClient.getPlayer().networkHandler.sendPacket(new CustomPayloadC2SPacket(
|
||||
CarpetClient.CARPET_CHANNEL,
|
||||
(new PacketByteBuf(Unpooled.buffer())).writeVarInt(CarpetClient.DATA).writeCompoundTag(outer)
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user