Force Resourcepacks
0Ga9kU0.png



Did you ever wanted to force players to use a certain server resourcepack on one of your servers? Maybe for a minigame as part of your network? Or maybe you don't want to force the pack on the users but just want to inform the ones who do not accepted it about what they are missing out? Then this is the plugin you always searched for!

Force Resourcepacks is the enhanced version of my Bungee Resourcepacks and World Resourcepacks plugins. In addition to beeing able to set different resourcepacks per world, server or on your whole BungeeCord network you can also react on whether the user accepted downloading the pack and send them a message or even kick them if they did not do that!

It even notices when a Bukkit server behind the Bungee sends a resourcepack and applies the server's pack status rules on it! That way it is compatible with minigames plugins that manage their own server resourcepacks while still providing the ability to kick a user from the game's server when they did not download the pack!

Compatibility Note:
This plugin is currently (1.13) compatible with BungeeCords above 1.8, Spigots above 1.8.8 and clients above 1.8.
(You may need older plugin versions to run it on an outdated Bungee/Spigot)
Requires Java 8!
Please also note that the Vanilla Minecraft client only applies server resource packs that are smaller than 50MB!
The server is not able to detect client resource packs so this plugin only works with server resource packs!

Features
  • Automatically generates the sha1 hashes!
  • Set different server resourcepacks per world, server or whole BungeeCord network
  • Match server/world names with regex!
  • Set packs via WorldGuard flags (requires WorldGuard above version 6.1.3)
  • Configurable delay before sending the pack to a player
  • Remembers which pack a user has currently applied and doesn't resend on server switch
  • Send a message or title to the player when he accepts, loads, denies or fails to download the resourcepack
  • Let the user set the pack himself. The pack can be re-applied on each login and will be used for resets on servers that don't have the pack
  • Inform the user which pack the server send them if it was done automatically
  • Kick the player from the Server if he doesn't accept resourcepack or send him to a specific server (that way you can have two versions of the same server, one with resourcepacks and one without)
  • Different set of actions for when it is the first time a player joins your server
  • Stop the user from joining a certain server in your network if he didn't accepted an optional the resourcepack before
  • ResourcePackStatusEvent (for Bukkit use the PlayerResourcePackStatusEvent) for developers to react on the accepting or denying of a pack in their own plugins
  • Send the correct pack format depending on the client's version and kick player if he uses a version without an available pack (requires ViaVersion or ProtocolSupport on Bukkit when ForceResourcepacks is used on the Bukkit server!)
  • Compatible with AuthMe Reloaded.
    Do you need it to be compatible with more plugins? Contact me!

Statistics
Commands
/frp reload [resend]
Reloads the config file; resends the packs to every online player if the 2nd argument is "resend"
/frp generatehashes
Downloads the resource pack files and generates the sha1 hashes of them
/frp version
Shows the version of this plugin
/usepack
List all packs that you can choose
/usepack <packname> [<playername>] [<temporary>]
Send a specific pack to yourself or another player, depending on the value of temporary it will only apply for this session or also re-apply on the next login. Values are true or false, omitting it will use the usepack-is-temporary config value (defaults to true)

Permissions
forceresourcepacks.command - Access to the /frp command
forceresourcepacks.command.reload - Access to /frp reload
forceresourcepacks.command.generatehashes - Access to /frp generatehashes
forceresourcepacks.command.version - Access to /frp version
forceresourcepacks.command.usepack - Access to /usepack
forceresourcepacks.command.usepack.others - Send packs to other players via the /usepack command
forceresourcepacks.command.usepack.temporary- Select whether or not the selected pack is only temporary or should be stored and re-applied
forceresourcepacks.pack.<packname> - Gives access to a pack via the /usepack command, you can define these permissions via the config.yml on per pack basis
forceresourcepacks.updatenotification - Get ingame update notifications


Statuses you can react on
ACCEPTED
The player chose "yes" on the download screen or has the server pack enabled for this server entry in his multiplayer list

DECLINED
The player chose "no" on the download screen or has the server pack disabled for this server entry in his multiplayer list

LOADED
The player finished downloading the pack and the client applied it

FAILED
The client failed to download the pack, e.g. when the pack url is wrong

TIMEOUT
The client/player failed to react on the server resourcepack sent prompt in the amount of seconds set in the config at "prompttimeout"

NO_PERMISSION
No pack can be send to a player because all that would be available on that server are restricted and the player doesn't have the permissions he would need for that pack
If no extra actions for NO_PERMISSION are set the DECLINED actions are used

WRONG_VERSION
No pack can be send because all packs that would be available on that server have a pack format that would be incompatible with the player's client version. Currently pre 1.9 is pack format 1, 1.9 and higher is 2
If no extra actions for WRONG_VERSION are set the DECLINED actions are used


Actions you can run
All actions that send some kind of message or command support usage of ampersands (&) for color and formatting codes.
In all actions you can use
%pack% to get the name of the pack and %player% for the name of the player!

MESSAGE
Sends a message to the player

TITLE
Send a title (multi-line strings don't work in titles, subtitles and action bar messages)

SUBTITLE
Send a subtitle (can be used with or without the title action)

ACTION_BAR
Send a message in the action bar chat slot above the user's inventory bar (currently only supported on Bungee)

KICK
Kick the player from the proxy or the server with the value of this action as the kick message

SEND
Send the player to a specific server (Bungee version) or world ( Bukkit version), the value of this action is the server's/world's name!

CONSOLE_COMMAND
Execute a command as the server console.

PLAYER_COMMAND
Execute a command as the player who reacted on the status.
Please note that he needs the permission to run the command!


WorldGuard Flags
If you install this plugin on Bukkit then you have access to the following WorldGuard flags:

resourcepack-on-entry
resourcepack-on-exit
String flags with the name of a configured pack as the value and will apply the pack as soon as the region is entered.

entry-without-resourcepack
exit-without-resourcepack
Boolean (allow/deny) flags. Default value is allow. You can bypass it with the same bypass permission as the normal entry and deny flags. If the entry-deny-message or exit-deny-message is set it will send it to the user.

Please note that the flags require at least WorldGuard 6.1.3!

Config
This config is for the Bungee plugin. For configuration differences on the Bukkit part please read this update note and see the below.
Code (YAML):
# Log some stuff about the players packs to the console (pack sending and the status, turn that of on large servers!)
debug: true
# Whether or not resourcepack file hashes should be generated on startup:
autogeneratehashes: true
# Store joins of players to the disk in order to determinate if this is a first join or not over restarts
# Only necessary if you want to use first-join-actions
store-joins: false
# Time in seconds in which a user needs to respond to the resourcepack prompt
# This is needed as users can just ESC out of the prompt
prompttimeout: 15
# Time in seconds for which a kick is delayed that way you
# can display a title or chat message before the kick
kickdelay: 0
# Whether /usepack should apply packs temporary or permanent when run without any argument:
usepack-is-temporary: true
# When manually setting a permanent pack then it will be reset if the user disconnects in under x amount of seconds.
# 0 or anything below will disable this functionality
permanent-pack-remove-time: 30
messages:
usepack: You now use the pack %pack%!
packlisthead: "Packs available to you:"
nopacks: No packs found!
packs:
lobby:
# The url the client should download the resourcepack from.
# Has to be a direct download link! No mediafire/mega/other oneclick-hoster!
url: http://example.com/lobbyresourcepack.zip
# The sha1 hash of the resourcepack's zip file,
# if not correct the client will waste bandwidth but it will still work!
# At least that's what the Minecraft wiki says... (Site: Server.properties#Minecraft_server_properties)
hash: abcdef012345678abcdef012345678abcdef0123
# The format version of this resourcepack. To define different packs per format you have to
# add them in a decending format order to the secondary list.
# 1 is for 1.8 packs
# 2 is for 1.9-1.10
# 3 is for 1.11-1.12
# 4 is for 1.13 and above
format: 1
# Whether or not this pack will only be send to players with a certain permission
# permission: forceresourcepacks.pack.<packname>
restricted: false
# If you want you can define a specific permission for this pack if you don't want
# the default forceresourcepacks.pack.<packname> permission!
permission: forceresourcepacks.pack.lobby
game:
url: http://example.com/minigameresourcepack.zip
hash: 012345678abcdef012345678abcdef012345678a
# Empty pack to use for resetting of the pack for servers which don't have one assigned
empty:
url: http://cdn.moep.tv/files/Empty.zip
hash: c05faed4680570a6159823e13fbae2ae830166ab
global:
pack: lobby
# Secondary is the list of packs to not replace if the user already has them
# If no main pack is set the first one also gets used to reset
# the pack if the user has a non secondary one
# secondary:
# - gamepack

# Delay in ticks before sending the pack to a player after he logs in/switches to the world
send-delay: 20

actions:
# Possible pack status:
# ACCEPTED:
# The player choose "yes" on the download screen or has the server pack enabledfor this server entry in his multiplayer list
# DECLINED:
# The player choose "no" on the download screen or has the server pack disabled for this server entry in his multiplayer list
# LOADED:
# The player finished downloading the pack and the client applied it
# FAILED:
# The client failed to download the pack, e.g. when the pack url is wrong
# TIMEOUT:
# The client failed to react on the server resourcepack sent prompt in the amount of seconds set at "prompttimeout"
# If no extra reaction on TIMEOUT is set the DECLINED actions are used
# NO_PERMISSION:
# No pack can be send to a player because all that would be available on that server are restricted
# and the player doesn't have the permissions he would need for that pack
# If no extra reaction on NO_PERMISSION is set the DECLINED actions are used
# WRONG_VERSION:
# No pack can be send because all packs that would be available on that server have a pack format that would be
# incompatible with the player's client version. Currently pre 1.9 is pack format 1, 1.9 and higher is 2
# If no extra reaction on WRONG_VERSION is set the DECLINED actions are used
loaded:
message: "&aYou are now using the &e%pack%&a pack!"

# Possible actions:
# MESSAGE:
# Sends a message to the player
# TITLE:
# Send a title (multiline strings don't work in titles and action bar)
# SUBTITLE:
# Send a subtitle (can be used without the title action)
# ACTION_BAR:
# Send a message in the action bar chat slot above the user's inventory bar
# KICK:
# Kick the player from the BungeeCord proxy with the value of this action as the kick message
# SEND:
# Send the player to a specific server on your bungeecord network, the value of this action is the server's name!
# Formatting codes with & work in all actions besides the send action
# %pack% will get replaced by the name of the pack from the packs section in all reactions
# CONSOLE_COMMAND:
# Execute a command as the bungeecord console. %player% is the player's name
# Use a list or new lines to execute multiple commands!
# PLAYER_COMMAND:
# Execute a command as the player who reacted on the status.
# Use a list or new lines to execute multiple commands!
# Please note that he needs the permission to run the command!

# Example definition to kick a player when he declines the pack
declined:
kick: "&cYou have to accept the server resource pack in order to play!\n&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable it!"

# If this is the first join of the playerrun different actions!
# Only works if "track-joins" is set to true!
first-join-actions:
loaded:
message: "&aYou are now using the &e%pack%&a pack!"
declined:
kick: "&cYou have to accept the server resource pack in order to play!\n&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable it!"

# Example servers config structure below
servers:
example_lobby:
pack: lobby
secondary:
- game
actions:
loaded:
message: You are now using the &e%pack%&a pack!
declined:
title: "&cPlease accept pack!"
subtitle: "&eIt looks a lot nicer with it!"
message: "&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable the server resource pack!"
failed:
kick: "&ePlease try rejoining, you need the pack!"
accepted:
message: "&cDownloading server resource pack..."
action_bar: "&eDownload server resource pack..."
example_minigame:
# Use a regex to target all servers with a certain name
regex: 'example_minigame_.*'
pack: game
actions:
declined:
send: example_lobby
title: "&cYou need the pack!"
subtitle: "&3You cannot play without it!"
message: "&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable the server resource pack!"
timeout:
send: example_lobby
title: "&cPlease accept the pack!"
subtitle: "&eYou cannot play without it!"

If you run the plugin under Bukkit then the config has a slightly different format:
Code (YAML):
# Log some stuff about the players packs to the console (pack sending and the status, turn that of on large servers!)
debug: true
# Whether or not resourcepack file hashes should be generated on startup:
autogeneratehashes: true
# Time in seconds in which a user needs to respond to the resourcepack prompt
# This is needed as users can just ESC out of the prompt
prompttimeout: 15
# Time in seconds for which a kick is delayed that way you
# can display a title or chat message before the kick
kickdelay: 0
# Whether /usepack should apply packs temporary or permanent when run without any argument:
usepack-is-temporary: true
# When manually setting a permanent pack then it will be reset if the user disconnects in under x amount of seconds.
# 0 or anything below will disable this functionality
permanent-pack-remove-time: 30
messages:
usepack: You now use the pack %pack%!
packlisthead: "Packs available to you:"
nopacks: No packs found!
packs:
overworld:
# The url the client should download the resourcepack from.
# Has to be a direct download link! No mediafire/mega/other oneclick-hoster!
url: http://example.com/serverresourcepack.zip
# The sha1 hash of the resourcepack's zip file,
# if not correct the client will waste bandwidth but it will still work!
# At least that's what the Minecraft wiki says... (Site: Server.properties#Minecraft_server_properties)
hash: abcdef012345678abcdef012345678abcdef0123
# The format version of this resourcepack. To define different packs per format you have to
# add them in a decending format order to the secondary list.
# 1 is for 1.8 packs
# 2 is for 1.9-1.10
# 3 is for 1.11-1.12
# 4 is for 1.13 and above
format: 1
# Whether or not this pack will only be send to players with a certain permission
# permission: forceresourcepacks.pack.<packname>
restricted: false
# If you want you can define a specific permission for this pack if you don't want
# the default forceresourcepacks.pack.<packname> permission!
permission: forceresourcepacks.pack.overworld
nether:
url: http://example.com/netherresourcepack.zip
hash: 012345678abcdef012345678abcdef012345678a
# Empty pack to use for resetting of the pack for servers which don't have one assigned
empty:
url: http://cdn.moep.tv/files/Empty.zip
hash: c05faed4680570a6159823e13fbae2ae830166ab
server:
pack: overworld
# Secondary is the list of packs to not replace if the user already has them
# If no main pack is set the first one also gets used to reset
# the pack if the user has a non secondary one
# secondary:
# - gamepack
# Delay in ticks before sending the pack to a player after he logs in/switches to the world
send-delay: 10
actions:
# Possible pack status:
# ACCEPTED:
# The player choose "yes" on the download screen or has the server pack enabledfor this server entry in his multiplayer list
# DECLINED:
# The player choose "no" on the download screen or has the server pack disabled for this server entry in his multiplayer list
# LOADED:
# The player finished downloading the pack and the client applied it
# FAILED:
# The client failed to download the pack, e.g. when the pack url is wrong
# TIMEOUT:
# The client failed to react on the server resourcepack sent prompt in the amount of seconds set at "prompttimeout"
# If no extra reaction on TIMEOUT is set the DECLINED actions are used
# NO_PERMISSION:
# No pack can be send to a player because all that would be available in that world are restricted
# and the player doesn't have the permissions he would need for that pack
# If no extra reaction on NO_PERMISSION is set the DECLINED actions are used
# WRONG_VERSION:
# No pack can be send because all packs that would be available in that world have a pack format that would be
# incompatible with the player's client version. Currently pre 1.9 is pack format 1, 1.9 and higher is 2
# (If ViaVersion is not installed it will use the server version to determinate which pack format is the correct one.)
# If no extra reaction on WRONG_VERSION is set the DECLINED actions are used
loaded:
message: "&aYou are now using the &e%pack%&a pack!"

# Possible actions:
# MESSAGE:
# Sends a message to the player
# TITLE:
# Send a title (multiline strings don't work in titles and action bar)
# SUBTITLE:
# Send a subtitle (can be used without the title action)
# ACTION_BAR:
# Send a message in the action bar chat slot above the user's inventory bar
# KICK:
# Kick the player from the BungeeCord proxy with the value of this action as the kick message
# SEND:
# Send the player to a specific server on your bungeecord network, the value of this action is the server's name!
# Formatting codes with & work in all actions besides the send action
# %pack% will get replaced by the name of the pack from the packs section in all reactions
# CONSOLE_COMMAND:
# Execute a command as the minecraft server console. %player% is the player's name
# Use a list or new lines to execute multiple commands!
# PLAYER_COMMAND:
# Execute a command as the player who reacted on the status.
# Use a list or new lines to execute multiple commands!
# Please note that he needs the permission to run the command!

# Example definition to kick a player when he declines the pack
declined:
kick: "&cYou have to accept the server resource pack in order to play!\n&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable it!"

# If this is the first join of the player run different actions!
first-join-actions:
loaded:
message: "&aYou are now using the &e%pack%&a pack!"
declined:
kick: "&cYou have to accept the server resource pack in order to play!\n&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable it!"

# Example worlds config structure below
worlds:
your_example_world:
# Use a regex to target all worlds with a certain name
regex: 'example_world_.*'
pack: overworld
secondary:
- nether
actions:
loaded:
message: "&aYou are now using the &e%pack%&a pack!"
declined:
title: "&cPlease accept pack!"
subtitle: "&eIt looks a lot nicer with it!"
message: "&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable the server resource pack!"
failed:
kick: "&ePlease try rejoining, you need the pack!"
accepted:
message: "&cDownloading server resource pack..."
your_example_nether:
pack: nether
actions:
declined:
send: world
title: "&cYou need the pack!"
subtitle: "&eYou cannot play without it!"
message: "&cVisit &ehttp://s.moep.tv/rp&c for info on how to enable the server resource pack!"
timeout:
send: lobby
title: "&cPlease accept the pack!"
subtitle: "&eYou cannot play without it!"
(Plugin versions above 1.6.5 will try to generate the sha1 hashes automatically and include a /frp generatehashes command!)

If you have any questions about this resource feel free to contact me any time! The best way is via a private message here or the discussion thread to this resource.

I should always be able to get back to you with an answer in less then 12 hours ‒ during East Coast working hours it can even be under 1 hour!
About the client freeze
When a server resource pack is send to a client it will shortly freeze after the download is complete. (Same as manually applying a local pack) This happens because the client has to reload all resources, check which resources overlap and do some other calculation and manipulation with them. (Like stitching all the textures together to a single image like they were in the first texture pack format) It's not a download issue as the client will locally cache the pack files and not re-download them if their hash didn't change.

How long this takes generally depends on the PC's performance and the size of the textures (HD packs take longer) that are used in all resource packs that the player has applied. (So even if the server resource pack doesn't contain any HD textures or textures at all the client will still completely reload all locally applied resource packs) This is something that has to be fixed in the client by Mojang for example by only reloading resources that changed. There's not a lot I can do about that offer than advice people to put pressure on Mojang to improve that behaviour.

Metrics
This resource includes MetricsLite for Bukkit and StatsLite for Bungee to add some statistics via mcstats.org. You can opt-out by changing the settings in the PluginMetrics/config.properties (bungee) or PluginMetrics/config.yml (bukkit)! They are licensed under the following licenses:Because mcstats seems to be dying a new metrics site was added with version 1.7.1: bstats.org. We'll see if it stick around, if not I'll just remove it again otherwise we already have some cool data to draw graphs with! If you don't want bstats to collect info on your server then you can disable it in the bStats/config.yml file. The license the used bStats-lite class is under can be found here.

Terms
By purchasing this resource you are gaining the right to use this plugin on any server you own, manage or work for for as long as you are in contact with the actual Minecraft aspect of the server and as long as the following conditions aren't violated.
You are not allowed to distribute this plugin in any form to anyone who has not obtained the right to use the plugin himself for example by purchasing it from this resource page.
You cannot refund your purchase after already acquiring the resource. It should work as described and if you have problems contact me!
You are allowed to modify this plugin as long as you follow the previous terms.
All of the rights given to you can be revoked at any time by the author, especially in the case that the terms were violated.
By downloading you accept the previous terms and that this resource is distributed without any (not even implied) warranty or liability by the author.
Author
Wifi
Downloads
0
Views
21
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Wifi

Top