Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.10] How to Make Block Infinitely Burn?????
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Mattkx10

[1.7.10] How to Make Block Infinitely Burn?????

By Mattkx10, August 9, 2014 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Mattkx10    0

Mattkx10

Mattkx10    0

  • Tree Puncher
  • Mattkx10
  • Members
  • 0
  • 20 posts
Posted August 9, 2014

I'm making a Netherrack Furnace, and would like to give the feature that would give it infinite fire! So just like regular netherrack, I would want it to be like if you lit the furnace on the top, then it would burn forever until you put it out.

 

If you could come up with somewhere to point me, or some code, that would be great!

 

~Mattkx10 (AKA: Mattkx4 or Mattkx9)

http://mattkx4.github.io/

  • Quote

Check out my website at:

 

http://mattkx4.github.io/

Share this post


Link to post
Share on other sites

MikeZ    1

MikeZ

MikeZ    1

  • Stone Miner
  • MikeZ
  • Members
  • 1
  • 77 posts
Posted August 9, 2014

Hi!

Look in the Netherrack class.

There must be some code for that.

 

Mike

  • Quote

Share this post


Link to post
Share on other sites

Mattkx10    0

Mattkx10

Mattkx10    0

  • Tree Puncher
  • Mattkx10
  • Members
  • 0
  • 20 posts
Posted August 9, 2014

Already, checked. There isn't anything.

  • Quote

Check out my website at:

 

http://mattkx4.github.io/

Share this post


Link to post
Share on other sites

Mitchellbrine    18

Mitchellbrine

Mitchellbrine    18

  • Creeper Killer
  • Mitchellbrine
  • Forge Modder
  • 18
  • 193 posts
Posted August 9, 2014

Check the fire class.

  • Quote

-Mitchellbrine

 

Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible.

It may be freaking fucking hard though, but still possible ;)

 

If you create a topic on Modder Support, live by this motto:

I don't want your charity, I want your information

Share this post


Link to post
Share on other sites

Mattkx10    0

Mattkx10

Mattkx10    0

  • Tree Puncher
  • Mattkx10
  • Members
  • 0
  • 20 posts
Posted August 9, 2014

Check the fire class.

 

BlockFire?

  • Quote

Check out my website at:

 

http://mattkx4.github.io/

Share this post


Link to post
Share on other sites

coolboy4531    66

coolboy4531

coolboy4531    66

  • Dragon Slayer
  • coolboy4531
  • Members
  • 66
  • 584 posts
Posted August 9, 2014

Yes, I believe there is a code when it is placed on a netherrack block.

  • Quote

Share this post


Link to post
Share on other sites

Mattkx10    0

Mattkx10

Mattkx10    0

  • Tree Puncher
  • Mattkx10
  • Members
  • 0
  • 20 posts
Posted August 9, 2014

Yes, I believe there is a code when it is placed on a netherrack block.

 

Still can't find anything.

  • Quote

Check out my website at:

 

http://mattkx4.github.io/

Share this post


Link to post
Share on other sites

jabelar    594

jabelar

jabelar    594

  • Reality Controller
  • jabelar
  • Members
  • 594
  • 3266 posts
Posted August 9, 2014

Are you actually making a furnace that you want to burn forever, or do you mean just some standard block?  I think for furnaces you want to look at how they handle fuel.  If you look in the TileEntityFurnace class you'll see a field called currentItemBurnTime and one called furnaceBurnTime that control how long the fuel burns.  If your furnace is extending TileEntityFurnace you can @Override the updateEntity() method so it never does the decrement of the furnaceBurnTime.

  • Quote

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Share this post


Link to post
Share on other sites

Mattkx10    0

Mattkx10

Mattkx10    0

  • Tree Puncher
  • Mattkx10
  • Members
  • 0
  • 20 posts
Posted August 9, 2014

Are you actually making a furnace that you want to burn forever, or do you mean just some standard block?  I think for furnaces you want to look at how they handle fuel.  If you look in the TileEntityFurnace class you'll see a field called currentItemBurnTime and one called furnaceBurnTime that control how long the fuel burns.  If your furnace is extending TileEntityFurnace you can @Override the updateEntity() method so it never does the decrement of the furnaceBurnTime.

 

Thanks, but I'm just looking for a standard block. I already have it working so that it doesn't need any fuel :)

  • Quote

Check out my website at:

 

http://mattkx4.github.io/

Share this post


Link to post
Share on other sites

TheGreyGhost    819

TheGreyGhost

TheGreyGhost    819

  • Reality Controller
  • TheGreyGhost
  • Members
  • 819
  • 3280 posts
Posted August 10, 2014

Hi

 

Check out Block.isFireSource(), .getFlammability(), .isFlammable().

 

You can see how vanilla uses them in BlockFire.updateTick()

 

-TGG

 

    public void updateTick(World par1World, int wx, int wy, int wz, Random par5Random)
    {
        if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick"))
        {
            Block base = Block.blocksList[par1World.getBlockId(wx, wy - 1, wz)];
            boolean blockBelowIsFireSource = (base != null && base.isFireSource(par1World, wx, wy - 1, wz, par1World.getBlockMetadata(wx, wy - 1, wz), UP));

            if (!this.canPlaceBlockAt(par1World, wx, wy, wz))
            {
                par1World.setBlockToAir(wx, wy, wz);
            }

            if (!blockBelowIsFireSource && par1World.isRaining() && (par1World.canLightningStrikeAt(wx, wy, wz) || par1World.canLightningStrikeAt(wx - 1, wy, wz) || par1World.canLightningStrikeAt(wx + 1, wy, wz) || par1World.canLightningStrikeAt(wx, wy, wz - 1) || par1World.canLightningStrikeAt(wx, wy, wz + 1)))
            {
                par1World.setBlockToAir(wx, wy, wz);
            }
            else
            {
                int l = par1World.getBlockMetadata(wx, wy, wz);

                if (l < 15)
                {
                    par1World.setBlockMetadataWithNotify(wx, wy, wz, l + par5Random.nextInt(3) / 2, 4);
                }

                par1World.scheduleBlockUpdate(wx, wy, wz, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10));

                if (!blockBelowIsFireSource && !this.canNeighborBurn(par1World, wx, wy, wz))
                {
                    if (!par1World.doesBlockHaveSolidTopSurface(wx, wy - 1, wz) || l > 3)
                    {
                        par1World.setBlockToAir(wx, wy, wz);
                    }
                }
                else if (!blockBelowIsFireSource && !this.canBlockCatchFire(par1World, wx, wy - 1, wz, UP) && l == 15 && par5Random.nextInt(4) == 0)
                {
                    par1World.setBlockToAir(wx, wy, wz);
                }
                else
                {
                    boolean flag1 = par1World.isBlockHighHumidity(wx, wy, wz);
                    byte b0 = 0;

                    if (flag1)
                    {
                        b0 = -50;
                    }

                    this.tryToCatchBlockOnFire(par1World, wx + 1, wy, wz, 300 + b0, par5Random, l, WEST );
                    this.tryToCatchBlockOnFire(par1World, wx - 1, wy, wz, 300 + b0, par5Random, l, EAST );
                    this.tryToCatchBlockOnFire(par1World, wx, wy - 1, wz, 250 + b0, par5Random, l, UP   );
                    this.tryToCatchBlockOnFire(par1World, wx, wy + 1, wz, 250 + b0, par5Random, l, DOWN );
                    this.tryToCatchBlockOnFire(par1World, wx, wy, wz - 1, 300 + b0, par5Random, l, SOUTH);
                    this.tryToCatchBlockOnFire(par1World, wx, wy, wz + 1, 300 + b0, par5Random, l, NORTH);

                    for (int i1 = wx - 1; i1 <= wx + 1; ++i1)
                    {
                        for (int j1 = wz - 1; j1 <= wz + 1; ++j1)
                        {
                            for (int k1 = wy - 1; k1 <= wy + 4; ++k1)
                            {
                                if (i1 != wx || k1 != wy || j1 != wz)
                                {
                                    int l1 = 100;

                                    if (k1 > wy + 1)
                                    {
                                        l1 += (k1 - (wy + 1)) * 100;
                                    }

                                    int i2 = this.getChanceOfNeighborsEncouragingFire(par1World, i1, k1, j1);

                                    if (i2 > 0)
                                    {
                                        int j2 = (i2 + 40 + par1World.difficultySetting * 7) / (l + 30);

                                        if (flag1)
                                        {
                                            j2 /= 2;
                                        }

                                        if (j2 > 0 && par5Random.nextInt(l1) <= j2 && (!par1World.isRaining() || !par1World.canLightningStrikeAt(i1, k1, j1)) && !par1World.canLightningStrikeAt(i1 - 1, k1, wz) && !par1World.canLightningStrikeAt(i1 + 1, k1, j1) && !par1World.canLightningStrikeAt(i1, k1, j1 - 1) && !par1World.canLightningStrikeAt(i1, k1, j1 + 1))
                                        {
                                            int k2 = l + par5Random.nextInt(5) / 4;

                                            if (k2 > 15)
                                            {
                                                k2 = 15;
                                            }

                                            par1World.setBlock(i1, k1, j1, this.blockID, k2, 3);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

 

 

  • Quote

Share this post


Link to post
Share on other sites

Mattkx10    0

Mattkx10

Mattkx10    0

  • Tree Puncher
  • Mattkx10
  • Members
  • 0
  • 20 posts
Posted August 10, 2014

Hi

 

Check out Block.isFireSource(), .getFlammability(), .isFlammable().

 

You can see how vanilla uses them in BlockFire.updateTick()

 

-TGG

 

    public void updateTick(World par1World, int wx, int wy, int wz, Random par5Random)
    {
        if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick"))
        {
            Block base = Block.blocksList[par1World.getBlockId(wx, wy - 1, wz)];
            boolean blockBelowIsFireSource = (base != null && base.isFireSource(par1World, wx, wy - 1, wz, par1World.getBlockMetadata(wx, wy - 1, wz), UP));

            if (!this.canPlaceBlockAt(par1World, wx, wy, wz))
            {
                par1World.setBlockToAir(wx, wy, wz);
            }

            if (!blockBelowIsFireSource && par1World.isRaining() && (par1World.canLightningStrikeAt(wx, wy, wz) || par1World.canLightningStrikeAt(wx - 1, wy, wz) || par1World.canLightningStrikeAt(wx + 1, wy, wz) || par1World.canLightningStrikeAt(wx, wy, wz - 1) || par1World.canLightningStrikeAt(wx, wy, wz + 1)))
            {
                par1World.setBlockToAir(wx, wy, wz);
            }
            else
            {
                int l = par1World.getBlockMetadata(wx, wy, wz);

                if (l < 15)
                {
                    par1World.setBlockMetadataWithNotify(wx, wy, wz, l + par5Random.nextInt(3) / 2, 4);
                }

                par1World.scheduleBlockUpdate(wx, wy, wz, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10));

                if (!blockBelowIsFireSource && !this.canNeighborBurn(par1World, wx, wy, wz))
                {
                    if (!par1World.doesBlockHaveSolidTopSurface(wx, wy - 1, wz) || l > 3)
                    {
                        par1World.setBlockToAir(wx, wy, wz);
                    }
                }
                else if (!blockBelowIsFireSource && !this.canBlockCatchFire(par1World, wx, wy - 1, wz, UP) && l == 15 && par5Random.nextInt(4) == 0)
                {
                    par1World.setBlockToAir(wx, wy, wz);
                }
                else
                {
                    boolean flag1 = par1World.isBlockHighHumidity(wx, wy, wz);
                    byte b0 = 0;

                    if (flag1)
                    {
                        b0 = -50;
                    }

                    this.tryToCatchBlockOnFire(par1World, wx + 1, wy, wz, 300 + b0, par5Random, l, WEST );
                    this.tryToCatchBlockOnFire(par1World, wx - 1, wy, wz, 300 + b0, par5Random, l, EAST );
                    this.tryToCatchBlockOnFire(par1World, wx, wy - 1, wz, 250 + b0, par5Random, l, UP   );
                    this.tryToCatchBlockOnFire(par1World, wx, wy + 1, wz, 250 + b0, par5Random, l, DOWN );
                    this.tryToCatchBlockOnFire(par1World, wx, wy, wz - 1, 300 + b0, par5Random, l, SOUTH);
                    this.tryToCatchBlockOnFire(par1World, wx, wy, wz + 1, 300 + b0, par5Random, l, NORTH);

                    for (int i1 = wx - 1; i1 <= wx + 1; ++i1)
                    {
                        for (int j1 = wz - 1; j1 <= wz + 1; ++j1)
                        {
                            for (int k1 = wy - 1; k1 <= wy + 4; ++k1)
                            {
                                if (i1 != wx || k1 != wy || j1 != wz)
                                {
                                    int l1 = 100;

                                    if (k1 > wy + 1)
                                    {
                                        l1 += (k1 - (wy + 1)) * 100;
                                    }

                                    int i2 = this.getChanceOfNeighborsEncouragingFire(par1World, i1, k1, j1);

                                    if (i2 > 0)
                                    {
                                        int j2 = (i2 + 40 + par1World.difficultySetting * 7) / (l + 30);

                                        if (flag1)
                                        {
                                            j2 /= 2;
                                        }

                                        if (j2 > 0 && par5Random.nextInt(l1) <= j2 && (!par1World.isRaining() || !par1World.canLightningStrikeAt(i1, k1, j1)) && !par1World.canLightningStrikeAt(i1 - 1, k1, wz) && !par1World.canLightningStrikeAt(i1 + 1, k1, j1) && !par1World.canLightningStrikeAt(i1, k1, j1 - 1) && !par1World.canLightningStrikeAt(i1, k1, j1 + 1))
                                        {
                                            int k2 = l + par5Random.nextInt(5) / 4;

                                            if (k2 > 15)
                                            {
                                                k2 = 15;
                                            }

                                            par1World.setBlock(i1, k1, j1, this.blockID, k2, 3);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

 

Thanks this helped a lot!

  • Quote

Check out my website at:

 

http://mattkx4.github.io/

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • cadbane86140
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140 · Posted 45 minutes ago

      Hello There! Today we are back on Hunger Games after a little break but we are finally back! In this episode we are on the good ol' map Survival Games 4 and it ACTUALLY went well for once. Also we have so many great battles on rooftops, small rooms and just out in the open! We also use shears to fight at one point and that was pretty crazy! There are so many hilarious moments in this episode that I know you guys are gonna love! I hope you all enjoy this video and if you did don't forget to like and sub for more Hunger Games in the future!  
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 57 minutes ago

      latest.log
    • diesieben07
      Game crashes whenever I try to increase the RAM

      By diesieben07 · Posted 1 hour ago

      In the logs folder of your game directory.
    • Unusualty
      GUI'S and player editing

      By Unusualty · Posted 1 hour ago

      So I'm trying to make a mod that is inspired by Origin's because this mod isn't for forge I was wondering if anyone can help me do something like this where you get a GUI when you join the world where you can select a race that has abilities and down sides to them, I also want to have classes but first I want these race's done so if anyone can help this would be appreciated.
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 1 hour ago

      Would you mind explaining where I can find the debug.log
  • Topics

    • cadbane86140
      0
      Minecraft: Hunger Games Game #36- Shear FIGHT!

      By cadbane86140
      Started 46 minutes ago

    • Sad Whale
      6
      Game crashes whenever I try to increase the RAM

      By Sad Whale
      Started 2 hours ago

    • Unusualty
      0
      GUI'S and player editing

      By Unusualty
      Started 1 hour ago

    • fluiX
      1
      server wont start

      By fluiX
      Started 2 hours ago

    • Luis_ST
      6
      [1.16.5] Help with custom Event

      By Luis_ST
      Started 7 hours ago

  • Who's Online (See full list)

    • fluiX
    • brok4d
    • CookieLukas
    • NullDev
    • redlynx
    • Microcellule
    • Ch1m3r4
    • ChampionAsh5357
    • ModMCdl
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.10] How to Make Block Infinitely Burn?????
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community