RandomDiscs
RandomDiscs
"Shut up, and stop asking me to spawn you music discs."
If you run a server, you have probably run across someone begging you relentlessly to spawn them music discs. Sure, you could hold contests and artificially spawn them in, but the simple answer is just to include them in dungeon chests, and make them drop from creepers like the green and gold discs do. As we all know, obliging a whining player once leads to further requests for them to spawn things for them. Just saying no repeatedly only keeps them from asking for so long, and there's only so many times you can say no without getting annoyed.
This mod will alleviate this particular headache, by checking the world for chests containing discs when that chunk is spawned, as well as checking creepers' loot drops for discs. It will then randomize the disc into one of the eleven others implemented in the game.
When a player asks for a music disc, tell them to start hunting some dungeons!
Efficiency
This mod checks only TileEntities on the spawn of a chunk. I've timed the loop, and my tests indicate that the loop itself is lightning fast. If this adds any CPU overhead to your world generation, it should be negligible.
Features
- Changes out music discs in world-generated chests, and when dropped by Creepers.
- Will NOT modify existing music discs, and can be safely installed or uninstalled at any time.
- Will change the type of disc given ONLY in chunks that have never been explored before.
- Lightweight, efficient, and configuration-free!
Future Additions
Make a request! I'm always open for suggestions.
Known Bugs
None at this time. Please submit tickets!
Source code is also available on GitHub!
Hope to see an update for this... :)
Creat plugin tnx for sharing it with us.. =)
Currently the creepers are not dropping any modified discs.
Currently the creepers are not dropping any modified discs.
Is it possible to add the discs to abandoned mineshaft and stronghold chests? I understand this is beyond the scope of what the plugin currently does, but I was just wondering.
This is a great plugin, thanks :)
No problem. I'll still be using it for the ones we find in chests. Thanks for the plugin!
@poiNt3D
Unfortunately, there is no way to check if a chest in a dungeon has been opened previously, or if the chest is owned by a player.
Theoretically, I could use the damage value of the discs to denote which had been changed out, and which hadn't. Unfortunately, this would cause all music discs already obtained by players to be marked, regardless of what sort of chests they reside in.
It would be possible to check if a chest is within a certain proximity to a mob spawner as well, but I don't think I like iterating through that many tiles at chunk load. This would cause quite a little bit of unnecessary CPU usage immediately after every single chunk was loaded, so I would like to avoid it.
@ARandomBob
I'll investigate this presently. I'm not sure why exactly this is happening, but it will be looked into tonight. When I tested it on a clean install, I did not have any problems with it, but I will investigate the cause of this. I assure you, it does work with dungeons, there's probably just a small issue with creeper deaths. Something strange I didn't account for, I think.
EDIT: I've looked into it. Currently, creeper discs do not comply with the droplist member of entitydeathevents. This means that I am unable to bring this into compliance. However, today's minecraft update fixes this, as creepers now drop all music discs except for 11. My advice is to simply wait. Sorry about this, and happy trails. I will be updating my plugin to remove the entity listener entirely, so that the only functionality will be dungeon chests.
@ARandomBob
Me too
Still only getting the 2 old disks on my server. Recommended build of craftbukkit for 1.0.0. I shut the server down, put the plugin in and restarted. I even get "[RandDisk] Disks aren now random." when starting the server, but I have got 4 disks from creeper deaths and all are old disks.
Is there a way to make it change disk types in alredy explored chunks?
I have some guy on my server that constantly asks me to give him music disks! It's like you read my mind!
Does this generate more discs in the world or just modify the kinds of new discs?