diff options
author | Adam Thomas <aet2505@gmail.com> | 2015-07-13 18:21:21 +0100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-07-25 18:20:09 +1000 |
commit | 0eb94c0109553fcfa7dfd9500434ea6dafbbf0db (patch) | |
tree | 56e313eed3610f2a0292527a2b5fff66a22bf6f3 | |
parent | 9cda1d21ad30511c89c051295d20a32b992923a9 (diff) | |
download | bukkit-0eb94c0109553fcfa7dfd9500434ea6dafbbf0db.tar bukkit-0eb94c0109553fcfa7dfd9500434ea6dafbbf0db.tar.gz bukkit-0eb94c0109553fcfa7dfd9500434ea6dafbbf0db.tar.lz bukkit-0eb94c0109553fcfa7dfd9500434ea6dafbbf0db.tar.xz bukkit-0eb94c0109553fcfa7dfd9500434ea6dafbbf0db.zip |
Add PlayerResourcePackStatusEvent.
This event is called when the server received status updates about the progress of a resource pack which it attempted to send to the client.
-rw-r--r-- | src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java new file mode 100644 index 00000000..4c498016 --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java @@ -0,0 +1,61 @@ +package org.bukkit.event.player; + +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; + +/** + * Called when a player takes action on a resource pack request sent via + * {@link Player#setResourcePack(java.lang.String)}. + */ +public class PlayerResourcePackStatusEvent extends PlayerEvent { + + private static final HandlerList handlers = new HandlerList(); + private final Status status; + + public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus) { + super(who); + this.status = resourcePackStatus; + } + + /** + * Gets the status of this pack. + * + * @return the current status + */ + public Status getStatus() { + return status; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + /** + * Status of the resource pack. + */ + public enum Status { + + /** + * The resource pack has been successfully downloaded and applied to the + * client. + */ + SUCCESSFULLY_LOADED, + /** + * The client refused to accept the resource pack. + */ + DECLINED, + /** + * The client accepted the pack, but download failed. + */ + FAILED_DOWNLOAD, + /** + * The client accepted the pack and is beginning a download of it. + */ + ACCEPTED; + } +} |