Forever Burning Furnace

Discussion in 'Plugin Development' started by ChrisixStudios, Oct 25, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    ChrisixStudios

    Is there a way to make a furnace burn forever or at least seem like forever? Thank you for any response!
     
  2. Offline

    makskay

    I'm pretty sure that a burning furnace has its own block ID and as such doesn't require any special code to create (you can just spawn them in like any other item.)
     
  3. Offline

    ChrisixStudios

    I know that part but how can you make the burn time never end in that block?
     
  4. Offline

    Vandrake

    I believe the burning furnace is item 61? 62 is turned off one. So either repeat a task every x time or whenever the furnace de-spawns(along with the chunk) simply set the block as a burning furnace when it "re-spawns" :3
     
  5. Offline

    CorrieKay

    get the furnace block in a furnace burn event, every couple of ticks, add to its burn time. If you want to be able to do any/all furnaces, put it in a set or a list, and iterate through it and add to all furnaces burn times.

    Theres a bit more code involved, such as checking if the block still exists and stuff, but thats the gist of it.
     
  6. Offline

    ChrisixStudios

    Well as of right now i just have the burn time set to 10,000. How would you get every tick with the Bukkit APIs?
     
  7. Offline

    CorrieKay

    use the scheduler.

    Heres an example of how you'd do this.

    Code:
    HashSet<Block> furnaces = new HashSet<Block>();
     
    Bukkit.getScheduler().scheduleAsyncRepeatingTask(yourPlugin, new Runnable(){
      @Override
      public void run(){
        for(Block b : furnaces){
          if(b.getState() instanceof Furnace){
            Furnace f = (Furnace)b.getState();
            f.setBurnTime(20*60*2); //more than one minute
          }
        }
      }
    }, 0, 20*60);//fires every one minute
     
    @EventHandler
    public void onBurn(FurnaceBurnEvent event){
      Block furnace = event.getBlock();
      if(furnace.getState() instanceof Furnace){
        furnaces.add(furnace);
      }
    }
     
    
    Something like that.
     
  8. Offline

    cman1885

    Why not just change the block type to the one that burns forever? Saves a lot of trouble.
     
    makskay likes this.
  9. Offline

    ChrisixStudios

    what is the one that burns for ever?
     
  10. Offline

    cman1885

    62
     
  11. Offline

    ChrisixStudios

    Thanks! I will use that. :)
     
  12. Offline

    CorrieKay

    I could be wrong, because im just spectulating, but isnt 62 the block it changes to when you light an unlit furnace?

    Im guessing it would have a timer on it, and it would eventually go out.
     
  13. Offline

    cman1885

    Try it for yourself, it doesn't.
     
  14. Offline

    CorrieKay

    ill take your word for it :p
     
  15. Offline

    kroltan

    The lit block would appear lit but would still require a fuel and would switch off when that ends.
     
  16. Offline

    cman1885

    Try. It. For. Yourself.
     
  17. Offline

    bob9

    I just tried it. You still need fuel and it does go off if you try to use it with fuel.
     
  18. Offline

    CorrieKay

    I did the same thing. I set a block type to a burning furnace, and it wasnt even burning, lol.
     
  19. Offline

    cobie555555

    But wouldn't the furnace stop burning when it receives a block update?
     
  20. Offline

    cman1885

    When the furnace is done cooking set it to item 62 and add the items into the end slot. Then it's never using fuel and burns infinitely. Why can't anybody here problem solve.
     
  21. Offline

    CorrieKay

    Because when we did problem solve, you said "naw man, just set the block to burning furnace, thats all you gotta do"

    So we did that, and it didnt work. We were problem solving before you came in and told us not to.
     
  22. Offline

    Vandrake

    lol cocky much. Just admit your "solution" was not what solved the request. It will save the rest of your dignity
     
  23. Offline

    cman1885

    You consider a repeating task problem solving? Good one.
     
  24. Offline

    CorrieKay

    At the very least it would have worked.

    Unlike a certain someone's suggestion.
     
  25. Offline

    cman1885

    My suggestion works better, given that you have a brain and can problem solve.
     
  26. Offline

    bob9

    You suggested something that was already suggested.
    makskay: "a burning furnace has its own block ID and as such doesn't require any special code to create"
    you: "Why not just change the block type to the one that burns forever? Saves a lot of trouble."

    Not only that, but after makskay posted, the op said he already knew that and clarified that he need it to actually cook things, which your suggestion doesn't do. So you're suggestion was not only already known, but wrong.

    Also, maybe stop being so arrogant and insulting to people? No one is impressed by you at all and everyone can see you for what you really are which is an average coder/person who has to put other people down to feel like they are better than everyone. And your ego is so big you get insulted when someone points out a mistake you made. I'm sure you will reply to this with another flippant and snarky post, but I don't care. :)
     
  27. Offline

    CorrieKay

    I'd like you to show me how it works better. (or at all)
     
    kroltan likes this.
  28. Offline

    Butkicker12

    cman1885 Please do not create flamebait
     
    kroltan likes this.
  29. Offline

    cman1885

    Someone suggested using the other furnace. Then someone suggested the scheduler. The OP then inquired about the scheduler and I said it'd be easier to use the forever burning furnace. Can you read?
     
  30. Offline

    CorrieKay

    Can you read? stop being a dick.
    You said to use a forever burning furnace. There is no such thing, as the BURNING_FURNACE neither burns(though it does create a light effect around it), nor does it cook/smelt any items as is.

    How about you show us how you do it, if you're so adamant that you're correct?
     
    kroltan likes this.
Thread Status:
Not open for further replies.

Share This Page