Disabling Fire Spread

Discussion in 'Plugin Development' started by azoundria, Jan 28, 2011.

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

    azoundria

    I'm just completely unsure how to get started with this one. I just want to make it so people can still light things on fire, lava can still be placed, but there's no fire spreading.

    I've got a lot of problems with other mods not working/fighting to the death with one another/heavily lagging the server, and I'm an experienced coder. There is currently a fire lagging the server, and I do have a mod enabled that's supposed to stop it. I'd really just like to add this simple functionality to the custom mod I am working on.

    All I really need to know - what event is triggered by the spread of fire?
     
  2. Offline

    Derek Peterson

    BlockIgniteEvent is called each time a block tries to catch on fire. You could mess around with that.
     
  3. Offline

    void420

    I did this exact thing for our test server. Fire spreading disabled but you can still use flint&steel to set fire to 1 block.

    All you need is this 1 hook in a BlockListner
    Code:
    @Override
        public void onBlockIgnite(BlockIgniteEvent event) {
            if (event.getCause() != IgniteCause.FLINT_AND_STEEL) {
                event.setCancelled(true);
            }
        }
     
  4. Where would one put that code? I'm a total java noob... I know some coding in genral, but I don't know the java infastructure.
     
  5. Offline

    Creepar

    I've had this problem too, hopefully someone posts a fix. -_-
     
  6. Would be great.
     
  7. Offline

    lostaris

    <Edit by Moderator: Redacted mediafire url>
    Fire wont spread, nothing gets set on fire apart from manually with flint and steel, and blocks wont get consumed by fire.
     
    Last edited by a moderator: Dec 15, 2016
  8. Offline

    jochen1147

    what server program do you use ??
     
  9. Thanks! But could you make one that ONLY stops the spread? That would be incredible!
     
    Last edited by a moderator: Dec 15, 2016
  10. Offline

    void420

    That seems to be bugged right now. The code I posted used to work but now as soon as a block gets destroyed by fire, it spreads and cancelling it doesn't work.

    I think the only options are to prevent blocks from being consumed by fire or disabling flint&steel.
     
  11. Offline

    feverdream

    I coded a version of this for my own server several weeks ago but never released it thinking it was so simple; it blocks spreading of fire and lava starting things on fire, but allows flint to work.

    A version that onyl blocks the spread of fire is even easier; look below.

    Jar File for version that blocks spread and lava fires: http://dl.dropbox.com/u/18627325/minecraft/FireFighter.jar
     
  12. Offline

    Thyme676

    Error 404 0n your last link :<
     
  13. Offline

    feverdream

    I removed the file at the link, so it 404'ed. I just removed the link so people would not think it worked.

    A bug keeps the plugin from working; So its not worth updating at this time. A guy has a plugin just like this named vFireStop check that out.
     
  14. Offline

    multi_coder

    Updated Code:
    public void onBlockIgnite(BlockIgniteEvent event)
    {
    Block block = event.getBlock();
    if (event.getCause().FLINT_AND_STEEL != event.getCause().FLINT_AND_STEEL) {

    }
    else{
    event.setCancelled(true);
    }
     
  15. Offline

    DKDunnings

    Guys, this guy was obviously trying to learn a bit of code which stops fire spreading and destroying blocks. Why post your own plugins? Just provide source snippets.
    And @multi_coder that code will just stop Flint and Steel working?
     
  16. Offline

    multi_coder

    Thats all I needed back then, my plugin is 1.3 megs now.
     
  17. Offline

    itzrobotix

    -.- @Override you mean @EventHandler ...

    Code:java
    1. @EventHandler
    2. public void onBlockIgnite(BlockIgniteEvent event){
    3. if (event.getCause() == IgniteCause.SPREAD){
    4. event.setCancelled(true);
    5. }
    6. }


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 7, 2016
  18. Offline

    Syd

    itzrobotix
    You realize that you just raped a 3 year old thread?
    Back in these days, the given code was completly valid, as the old event system was still in place. ;)
     
  19. Offline

    itzrobotix

    Why was it on the first page -.- Universe y u do dis?
     
Thread Status:
Not open for further replies.

Share This Page