summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorWojciech Stryjewski <thvortex@gmail.com>2012-10-09 16:12:24 -0500
committerEvilSeph <evilseph@gmail.com>2012-12-20 22:20:56 -0500
commit5c446a97ae815e6cc2a112d2c24ea5cf81943fb0 (patch)
treee16e26b6f67bcb5b90769c1278149d5c2ec92b67 /src/main/java/org
parentd9f1255e1d45910468beca2da40888642279b45a (diff)
downloadbukkit-5c446a97ae815e6cc2a112d2c24ea5cf81943fb0.tar
bukkit-5c446a97ae815e6cc2a112d2c24ea5cf81943fb0.tar.gz
bukkit-5c446a97ae815e6cc2a112d2c24ea5cf81943fb0.tar.lz
bukkit-5c446a97ae815e6cc2a112d2c24ea5cf81943fb0.tar.xz
bukkit-5c446a97ae815e6cc2a112d2c24ea5cf81943fb0.zip
Add API to allow plugins to request players switch to a texture pack. Adds BUKKIT-2579
The setTexturePack method causes the player's client to download and switch to a texture pack specified by a URL. Note: Players can disable server textures on their client, in which case this API would not affect them.
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/entity/Player.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 73a9ea4e..d287d78a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -569,4 +569,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* @return The current allowed speed, from -1 to 1
*/
public float getWalkSpeed();
+
+ /**
+ * Request that the player's client download and switch texture packs.
+ * <p />
+ * The player's client will download the new texture pack asynchronously in the background, and
+ * will automatically switch to it once the download is complete. If the client has downloaded
+ * and cached the same texture pack in the past, it will perform a quick timestamp check over
+ * the network to determine if the texture pack has changed and needs to be downloaded again.
+ * When this request is sent for the very first time from a given server, the client will first
+ * display a confirmation GUI to the player before proceeding with the download.
+ * <p />
+ * Notes:
+ * <ul>
+ * <li>Players can disable server textures on their client, in which case this method will have no affect on them.</li>
+ * <li>There is no concept of resetting texture packs back to default within Minecraft, so players will have to relog to do so.</li>
+ * </ul>
+ *
+ * @param url The URL from which the client will download the texture pack. The string must contain
+ * only US-ASCII characters and should be encoded as per RFC 1738.
+ * @throws IllegalArgumentException Thrown if the URL is null.
+ * @throws IllegalArgumentException Thrown if the URL is too long.
+ */
+ public void setTexturePack(String url);
}