Plugin category: Unsure Suggested name: Unsure (Can't think of anything clever.) What I want: I think it would be cool if you could right click on soil with coal, redstone, iron, gold, or diamond and it would place what looks like a melon stem. Over time though it would instead grow into an ore block (depending on what was planted) that could then be mined. Permissions don't seem necessary as you could prevent the item from being used on soil with a plugin like modifyworld. If possible configurable growth times would be cool. I apologize if this isn't possible, it just seemed like an awesome idea. Don't ask, don't receive. Ideas for commands: No commands needed for this plugin. <--- Ideas for permissions: player.canread. Set it to false if they can't read this post. When I'd like it by: No Hurry.
Egolfius Do you want the melon stem to grow the ore next to it like a melon would grow? Or do you want the stem to be replaced by the ore? Because if it's the latter, then there would be no point. I might be interested in making this quickly.
slayr288 is no longer interested in developing this. Apparently it is not possible to detect when a melon or pumpkin grows with bukkit api, but is anyone interested in giving it a try?
That is certainly one interesting idea, I'll be willing to give it a go. I'll start on Sunday, assuming no-one else beats me to it.
Jatoc gorbb Perhaps the following items/blocks could be considered? - *Clay - Clay Block - *Glowstone - Block - *Gunpowder - TnT - *Coal - Coal Ore - *Lapis - Ore - *Quartz - Ore - Redstone - Ore - Iron - Ore - Gold - Ore - Diamond - Ore - Emerald - Ore - *Fully Configurable - The user decides what they put in and what they get out Ultimately, as the developer, its your decision what makes it into the plugin, but the * indicates items/blocks that I wouldn't be too sad over losing. I imagine the last suggestion would be even more difficult to setup. Again, just ideas. EDIT: wouldn't, not would.
Egolfius I did a little bit of research and testing, and I can't find a way to make stems visually connect to the blocks to be mined. Is that what you were going for?
I expected that, I tried doing it myself with world edit. Don't worry about it, but if it's possible to stop another block from growing from that stem before the block is mined though, that would be great . Again, thanks.
Alright. Started some event listening and code now. Maybe I'll have a working alpha version soon Egolfius
Here's an idea. Let it grow like a melon, and when it becomes a melon, send a block change event to the client. Might work
hawkfalcon Skye (http://imgur.com/p5vbbyC) Issue: http://forums.bukkit.org/threads/question-on-blockgrowevent-melons.153905/ EDIT: Well... it looks like slayr is still looking into this plugin.
That thread says that you can delay by one tick and then it works What I was mentioning above, you could get the melon and do something like: Code: player.sendBlockChange(loc, Material.ORE, data) And then you could keep the stalk attached, maybe. Worth a try.
It just gives the BlockState of the Block where the plant is going to grow... you'll have to use getRelative() in all directions and check for the MELON_STEM material. It'd be nice if the event provided the information you were looking for without so many checks, but I'm not really sure why it hasn't been programmed to do so.
I'm already working on a solution that does so. hawkfalcon That's exactly what I'm doing, except the blocks are server-sided. edit: oh I misunderstood you. I see what you're saying now. How would I go about sending the block change to every player then? (I haven't tested it so I don't even know if it will work)
Something like Code: for(Entity e : player.getNearbyEntities(100,100,100)) { if(e instanceof Player) { Player player = (Player)e; } }
This would have to be run on a scheduler right? Otherwise every time someone logs in, etc they will see a melon?
Right Edit: Code: public void repeat() { new BukkitRunnable() { @Override public void run() { //dostuff } }.runTaskTimer(plugin, 0L, 20L);
Welp, no point in that I actually tried the code and it doesn't keep stems attached even when sending the player a blockchange instead of actually changing the block from the server. So I might as well just actually set the block lol..
heh. Yeah. It's fine. It's still pretty cool to have ores grow even if the stems aren't attached. Update: I've got a semi-working version done. The plants act just like normal melons, but instead of melons spawning, they have ores spawn instead. You plant them by right clicking farmland with the "seed" (e.g. redstone or iron ingots) and you mine the blocks normally (e.g. with a pickaxe) However, because I used metadata for this version, I'll have to work on making my changes persistent. I'll probably have a working alpha release by tomorrow. hawkfalcon, sorry bout the random tagging, but do you happen to know any efficient ways to keep metadata persistent? I was considering using hashmaps along with metadata and resetting all metadata every time the plugin loads, but I don't know too much about the efficiency of this... (I want to use block metadata so that any plugin can easily tell whether a stem is custom or natural) EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Awesome, thanks for the update. Good luck with your metadata and what not (no idea what you're talking about )