I've always thought this should be implemented. Why not make a burning furnace generate power as well? I think this would be a great, small, and useful plugin, and need it for my server (high demand), so it would be great if it was made. Optionally, you could make fuel alone supply a redstone current, but quite optional, as it would make more sense to require something being burned to generate power. Pretty straightforward, no?
I'm requesting a server mod, to make that a lot easier and less manual - Again, I'm requesting it for my server and other servers, I doubt my users want to make BUD switches to do this. I'm looking for a direct current.
That's a very low quality plugin, but it will work I suppose. Perhaps more along the lines of a sign on the back of it, which generates a redstone current? It's been done countless times with integrated circuits. EDIT: Given the furnace is burning something at the moment, of course. Perhaps place the torch in the block behind the furnace, and then when it's done burning, remove the torch and place the block back in it's place? This would probably cause an easy-to-abuse duping bug however. There are many things that take an incoming redstone circuit, and transfer the current to another place, so I know this doesn't require a torch. Perhaps this is a bit too advanced for you..? Not to insult your knowledge, or anything. Only taking that from the basic torch placement idea.
The issue is that redstone dust doesn't have an "on" or "off" state, but rather a current state that is updated every tick... So if you "apply" power and then stop it will turn back off the next game tick; instead you have to apply current every tick... So with that said, the furnaces work on timers... the furnace event triggers a "burn" timer, this is a one time event for when the furnace is lit and nothing else happens until the furnace stops burning, which occurs when the timer expires. So here is my take on how this would have to be done... When a furnace burn event is triggered you would start a timer that ticks on every game tick (1L) and runs for as long as the furnace burn time is (can be retrieved from the event), this timer would take that furnaces location, look at the n/e/s/w blocks for redstone, and if redstone exist set its power to 16 (the max). Every tick do this over and over until the furnaces burn timer wears off (Sounds resource intense, but this is how natural redstone works, so it's somewhat minimal), which will make the furnace stop burning, and because your timer is for the exact time frame it will result in the restone turning off at the same time. I want to note that this may get labor intensive if you have a significant quantity of furnaces going at once, so you may want to have a single timer that just ticks every tick none stop, and have a hashmap that you add and remove powered furnaces from, that way even if you have 100 burning furnaces you have one timer handling all of their power, not one per furnace. I know I didn't explain this terribly well, but I am fairly sure my proposed solution will work. I hope this helps, GL!
Well, since Burning Furnaces are different blocks than Furnaces, it should be easy to simply make the burning furnace block act as a power source, and then whenever it burns it will send out a current, and whenever it stops burning it will change back to a normal furnace and stop the current. It's more of an already-built system, no changes need to be made other than the fact that BURNING_FURNACE needs to have power in it, the same as a redstone torch would. FURNACE and BURNING_FURNACE are entirely different blocks.
What specific events to furnaces fire on/off through? I was just thinking about adding them the Quantum Connectors plugin today.
Its the furnace burn event: http://jd.bukkit.org/doxygen/dd/d4d..._1event_1_1inventory_1_1FurnaceBurnEvent.html Not to be mistaken for furnace smelt event, which is triggered when an item successfully is cooked.
You raise a good point... I don't know if you can set the Furnace block itself to powered, and therefore every redstone around it will be powered until the next tick; or if you have to do it like I did where you look at the N/W/E/S relative blocks on each tick, and if the block is something that can carry current power it. As I said before, current is a single tick lived event, meaning if you power something the next tick it will become unpowered if not continually powered. Although furnaces cannot power anything they themselves can be powered by other power sources, which then can powers anything in contact with it. So what I would guess (it's just that, a guess) is that on every tick you would need to look to see if the furnace is lit, and if it's lit power the furnace itself (so that everything that is attached to it becomes powered as well ). Just keep in mind, you can't just set it to powered once and watch everything be powered until you turn it off, you will need to every single game tick re-evaluate the status of the furnace, and if that furnace is burning apply power. Again, I am basing all of this off of about 30 minutes of code experimenting, so I could be mistaken and/or the API could have changed since then. With that said, I hope this helps give you a little insight on the situation. Good luck with your project!
Father Of Time So here's an issue I've run into... FurnaceBurnEvent only seems to fire when it's lit, but not when unlit. That there's an isBurning() method if this is the case confuses me. I noticed there is a getBurnTime() method, which could be used with a delayed task to simulate a furnace unlit event (if the furnace is at that point unlit, otherwise the task would disregard). This seems a little kludgey though, is there a simpler way to capture an imaginary "FurnaceCoolEvent"? Good info btw, I hadn't thought of redstone as a single tick event... That is interesting, and maybe a little scary.
I never thought about that, but you are right; why have the furnace "isBurning" function within an event that only occurs when the furnace is set to "burning"... odd! However, I think that function also resides in the furnace block itself and is utilized more for checking if a relative block is burning. As you stated, the simple fact that redstone current is a single tick lived event is... "scary".... to say the least. It was that simple fact alone that caused me to abandon the exact project you are currently attempting. It's doable, but depending on the quantity of "furnace power plants" you have I could only imagine it would begin to cause lag/inefficiency. The methodology I believe you would need to get something like this to work would be to have a collection of furnaces that are to act like power plants (or a collection of global furnaces if all will act that way) and on every tick evaluate them individually in a loop to see if they are burning, and if so set their powered to true. Although this would work it's the "scalability" issue that concerns me. On a test server this may work perfectly as you add 1, 2, 10, 50 furnaces; but when the collection gets into the 500, 1000, etc range from a full sized server the workload of a collection loop on a per tick level is concerning to me, and frankly nothing I wanted to explore. I am sure there are more efficient alternative to this methodology, but sadly nothing will change the simple fact that in order to generate redstone current from an object that does not naturally generate it you will need something that triggers on each game tick. Thats my two cents on the subject anyways... Hope my ranting helped.
You can just update the current on the adjacent redstone dust, and set the current to zero after the furnace turns off and find out when to shut it off by deciding what fuel type is in it (and in what amount). And perhaps update the time it should burn whenever fuel is removed or added, or items. Or find out whether it's burning, find out what fuel it's using, and then set the current to it's fullest. Once it finishes burning, (determined prior to this by the fuel type) you can either stop the redstone current, or check if there's more fuel. Not entirely sure how furnaces update, but there's a small chance that it stops burning for a split second when it takes more fuel. I am not concerned with lag, as my server is quite small for it's massive monthly payment. Not many people are making huge furnace houses, because most people assume they won't use that many at once (and most are right) so I'd factor in common logic, and assume this wouldn't take much of a toll on the server it's running on. EDIT: Oh, and I use your plugin, too. So if you simply added it to that, it would be awesome.