SpoutDev/Spout — Issue #750: Ability to force server-provided texture pack(s)
Author: Brettflan
Created: 2011-10-18 04:26:14+00:00
State: open

So this almost works currently, using the existing SpoutPlayer.setTexturePack(String URL).
The way it works is not sufficient (or likely intended) for forcing use of a server-specified texture pack, though. It downloads the texture pack to the client's texture pack folder, but if a file already exists with the same filename as the one to be downloaded, it will instead simply use that texture pack.

Perhaps for server-provided texture packs, they could either:
A. be stored and referenced in memory instead of actually downloading to and reading from a file, so that they couldn't be tampered with.
B. be downloaded to a unique texture pack name (server IP/domain or similar perhaps), with it forcibly overwriting the file if it already exists.

In case you're wondering why I want to be able to force a server specified texture pack: I want to prevent x-ray texture packs.

Another solution might be to build in support for x-ray texture pack prevention, by simply disabling transparency/alpha on most solid block types. Any transparent bits in the texture would simply be rendered as white or black.
This would actually be a better solution for me, but I'm not sure whether it would be feasible or not.