RegionJukebox
Is the default Minecraft music a little dull? Would you like to add atmospheric music to your regions? Now you can, with RegionJukebox! Setup your cemeteries with scary organ pipes, or your relaxing vacation home with nice chimes. Just define a region with WorldGuard and then assign either a Minecraft record or a custom resource pack sound to the region. Whenever a player enters the region, the music will play for that player!
Bring in Version 2.0! :D
Holy crap people! I finally did it! Version 2.0 is here! The one feature everyone has been asking for is here now. Drum roll please... Custom music! You can now assign regions to play sounds from resource packs. Just use the same name you use in the sounds.json file in the command. For those that still use the beautiful default Minecraft records, don't worry, you can still use those.
Music. Is. Everywhere. EVERYWHERE! The music now plays at a configurable "speaker" block in the region. If you configure the region to play from a note block, then the music will play from every note block in the region. This way you can have it play from different spots in the region, or even have it play from every grass block (I suggest not doing this, it's pretty intense).
Looping works wonderfully now. Looping is no longer a global setting, and can now be configured per region. The only thing that is needed to loop is the length of the music being played. For custom sounds, you're going to have to guess and check a little bit to get it right. For those using default Minecraft records, you don't even have to worry about it. The plugin already knows the lengths of each record, so you can just leave that argument out of the command.
How to Install:
- WorldGuard IS NEEDED
- WorldGuard Region Events IS NEEDED
- Just drop jar into the plugins folder and you're set!
Current Features:
- Assign music to predefined WorldGuard regions
- Play either Minecraft records or custom resource pack music
- Loop the music! Configurable per region
- Assign a "speaker" block to play the sound at in the region
- Auto-updating
Planned Features:
- Got any suggestions? Go ahead and tell me about them!
Commands:
- /rj help - Shows a list of commands
- /rj recordlist - Shows list of records to play
- /rj regionlist - Shows list of regions with jukebox enabled
- /rj remove - Removes the jukebox from a region
- /rj reload - Reloads configuration file
- /rj set - Sets the region's jukebox music
For additional help with the commands, just type out the command in chat, and their usages along with what each parameter means will be shown.
Permissions:
- regionjukebox.command.rj - Allows the use of the rj command
Source
If you really want the source code, go ahead and decompile the jar file. Really, I don't care. Do what you want!
QA:
Q: Is it possible to make the music play throughout the whole region?
A: Yes! Version 2.0 fixed that! You can configure a "speaker" block to play the sound out of. You then place the designated "speaker" block all around your region.
Q: Can you make the music fade when a player leaves the region?
A: Kind of... Depends on if you're using the default Minecraft records or not. If you're using the records, they stop pretty abruptly. If you're using custom sounds, I actually can't stop those from playing. So as the player walks away from the sound source, it will fade away. If you guys want the records to act the same way as the custom sounds, let me know. I can definitely do that.
Q: Can you add custom music?
A: Yes! Version 2.0 to the rescue again! You can now configure regions to play custom resource pack sounds. Just use the same sound name as the sound.json file.
Q: Can you fix the region within a region thing?
A: I could, but don't want to. That goes beyond the scope of simplicity. That also gets into region detection and that's a lot more complicated.
Another thing that comes up a lot is people telling me the plugin is unresponsive or the events stopped working. I would like to let you know how I handle these. I first see a comment and trying to recreate the problem, load the freshest plugin onto my server. My dev server is always, ALWAYS, running the latest build to keep up with the client. The plugins however, are not, as plugins do not need to run the latest build to stay stable. I then try to recreate the problem using the current available plugin version and the current server. Most of the time, it works. If something doesn't work for you, you can try to delete the plugin and the data folder, and reinstall a fresh copy. If the problem persists, please explain exactly what the problem is and/or a step by step on how to reproduce the problem. Telling me "it doesn't work" doesn't help me at all.
Changelog:
- Version 2.0: *Latest Version*
- You can now play custom music! So excited for this!
- Looping is now configurable on a per region basis
- You can now assign a "speaker" block to play the music out of
- Version 1.6:
- Updated to 1.7.9
- Fixed a bug where leaving a region wouldn't stop the music
- Preparations were made for version 2.0!
- Version 1.52:
- Updated to 1.6.2
- Version 1.51:
- Fixed problem with not being able to remove configured regions
- Version 1.5:
- Rewrote plugin to save regions to config file. No more serialized objects!
- Version 1.45:
- Fixed a metadata error I came across
- Version 1.44:
- Added console log when user doesn't have permission to use command
- Version 1.43:
- Couple minor plugin.yml changes and console spam fixes
- Updated to 1.5.2.
- No changes to functionality
- Version 1.4:
- Regions are saved differently. No longer in unsightly text file. Please delete the text file!
- Version 1.31:
- Updated to 1.5.1
- Version 1.3:
- Added permissions
- Version 1.23:
- Added /rj reload command to reload the configuration file
- Fixed a null issue when leaving a region
- Music replays at the players location every loop cycle
- Version 1.22:
- Fixed console command usage
- Fixed a metadata issue when leaving a region
- Version 1.2:
- Added looping music
- Add configuration toggle for looping music
- Command syntax was slightly changed to accommodate the change in code for looping music
- Version 1.1:
- Fixed bug when updating a region with a new sound
- Added notification to updater so the user knows the plugin is updating itself
- Version 1.0:
- Initial Release
@AniKaBa
Did you give yourself the permission?
@FunnyGopher
what about some sort of command/movement check? as in if the player moves really fast or types something before entering the region. And even having something like a 5 tick delay after the world guard region trigger or however it works happens may make all the difference.
It is not work to use all commands.
My plugins :RegionJukebox,WGRegionEvents,WorldEdit,WorldGuard
Bukkit:craftbukkit-1.5.2-R0.2-20130606.060208-12
@N1T3SLAY3R
How am I supposed to detect if your teleporting or just walking in?
@FunnyGopher
alright makes sense, but what about if you had a lets say wait 5 ticks before playing the jukebox at that co-ordinates? so that the player can cross the entire region in time etc.?
@N1T3SLAY3R
No. Haha. The reason your experiencing this is because, like you said, when you enter and leave a region, the sound plays where you enter. Teleporting or warping doesn't immediately take you from location A to location Z, you physically move to Z hitting every location between A and Z. Because you hit every location, when you enter the region, it plays at the spot you entered. So, warping to the center of a big region does in fact play the music, you're just too far away to hear the noise. I can't detect what region you have teleported to, and therefore can't trigger an event based on that region.
The plugin triggers the music when you enter and leave a region. Warping from inside the region to another location inside the region doesn't trigger anything because you have neither entered nor left the region.
I am not going to make the music reset every time you walk away from the source. If you had to travel through a vast open field, just running from one end to the other, you would be constantly hearing the same five seconds of song over and over again. That's just annoying.
Sorry, but the limitations of minecraft don't allow me to fix any of the problems with big regions without annoying me. This is the cleanest I plan to make this plugin unless a miracle solution is presented that isn't annoying. Trust me, you're not the only one experiencing these problems.
@FunnyGopher
alright using the new v1.44 i've discovered: -the sound triggers on/off correctly when u walk in/leave a region -when u have a giant region (spawn) and try warping into the center the music words show but no sound -when u warp from 1 end of the spawn to the other (over 100 block difference) the song doesn't reset) (same region)
Possible solutions: fix the teleport glitch, whenever you use a warp or teleport automatically restart the song (providing your co-ordinates have changed greater than 15 or something like that), and if you walk lets say 15 blocks (whatever it is) away from your initial play position restart the song/music
@N1T3SLAY3R
So, in all my attempts of warping and teleporting into a region, the music has always started playing. I did change a line of code that might help, but I don't know because it always worked for me. The 1.44 update needs approval, then try to warp into a place again.
i have a few things to ask of you, by any chance could you add support for warps? because when i type something like /warp casino it doesn't play but shows the play text, if i wait long enough it plays, by any chance if a player lets say warps or types /spawn could u restart the song *for stuff like big regions*, same thing for if players walk lets say too far from where the song is being played or initially played, thanks xD
@FunnyGopher
will that's surprising, it worked after i gave myself the perm, y does that over-ride op tho? i find that weird lol
@Slymansyman
Okay, well, I'm out of ideas. The error log doesn't show anything about my plugin other than the fact that it can't load it. Unsupported class version has to do with java itself, not bukkit. Sorry.
@N1T3SLAY3R
Did you give yourself the permission?
As this seems to be a problem, I'm going to add a console log when the player doesn't have permission.
the plugin appears to be unresponsive to me, when i type any it just doenst say any message, such as /rj, /rj help, /rj set, etc. no message and no errors in log
Sadly that didn't work. 2013-06-09 00:20:10 [SEVERE] Could not load 'plugins\RegionJukebox.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gmail/kyle/huntsman/regionjukebox/RegionJukebox : Unsupported major.minor version 51.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugins(CraftServer.java:239) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.<init>(CraftServer.java:217) at net.minecraft.server.v1_5_R3.PlayerList.<init>(PlayerList.java:55) at net.minecraft.server.v1_5_R3.DedicatedPlayerList.<init>(SourceFile:11) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:106) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.UnsupportedClassVersionError: com/gmail/kyle/huntsman/regionjukebox/RegionJukebox : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) ... 9 more
Thank you for the reply, Currently Updating Java and will edit to say how it goes.
EDIT: Sadly it didn't work, I still get the same error on startup.
@Slymansyman
Unsupported major or minor version usually means you the jar your trying to run was compiled with a version of java that your machine doesn't support. I recommend you update java and see if that helps.
@Hawkeyestrike
YAY! I'm glad your problem as solved. :)
Hi, I currently get this error.. 2013-06-08 21:43:24 [SEVERE] Could not load 'plugins\RegionJukebox.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gmail/kyle/huntsman/regionjukebox/RegionJukebox : Unsupported major.minor version 51.0 at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugins(CraftServer.java:239) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.<init>(CraftServer.java:217) at net.minecraft.server.v1_5_R3.PlayerList.<init>(PlayerList.java:55) at net.minecraft.server.v1_5_R3.DedicatedPlayerList.<init>(SourceFile:11) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:106) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.UnsupportedClassVersionError: com/gmail/kyle/huntsman/regionjukebox/RegionJukebox : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) ... 9 more>>
And I don't know how to fix it? I use beta build bukkit and have the latest version of worldguard and worldedit and worldguard region events.
I am owner of my server. I have all commands from one permission. '*'. But if you think that's the problem i'll put the perm in my rank. There was a problem with my rank. I added the Permission and it showed up. Thanks FunnyGopher
@Hawkeyestrike
Oh oh, did you give yourself the permission?