Jump to content
  • Home
  • Files
  • Docs
  • Merch
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
  • Minecraft Forge
  • Support & Bug Reports
  • 1.14.4 Error on Fire Block
Sign in to follow this  
Followers 0
wilpito

1.14.4 Error on Fire Block

By wilpito, September 11 in Support & Bug Reports

  • Reply to this topic
  • Start new topic

Recommended Posts

wilpito    0

wilpito

wilpito    0

  • Tree Puncher
  • wilpito
  • Members
  • 0
  • 4 posts
Posted September 11

The FireBlock in Forge ist different in function to the Fire Block in Vanilla.

Details: In Vanilla wenn a Block Catch Fire the Fire will replaced only an Air Blocks on Top of burning Material.
In forge (forge-1.14.4-28.0.100)  the Fire will replace the burning Material.
In this Case Catching fire will not work correctly for  Burning Blocks ( In my Case on Oil).

Some Program Details:

In Function:  public void tick ...

TryCatchFire will be called:

this.tryCatchFire(worldIn, pos.east(), 300 + k, random, i, Direction.WEST);
            this.tryCatchFire(worldIn, pos.west(), 300 + k, random, i, Direction.EAST);
            this.tryCatchFire(worldIn, pos.down(), 250 + k, random, i, Direction.UP);
            this.tryCatchFire(worldIn, pos.up(), 250 + k, random, i, Direction.DOWN);
            this.tryCatchFire(worldIn, pos.north(), 300 + k, random, i, Direction.SOUTH);
            this.tryCatchFire(worldIn, pos.south(), 300 + k, random, i, Direction.NORTH);

In TryCatchFire Fire the Int i will be Filled with Flamability of this Block  and then te block will replaced with the fire Block;

   private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, Direction face) {
      int i = worldIn.getBlockState(pos).getFlammability(worldIn, pos, face);
      if (random.nextInt(chance) < i) {
         BlockState blockstate = worldIn.getBlockState(pos);
         if (random.nextInt(age + 10) < 5 && !worldIn.isRainingAt(pos)) {
            int j = Math.min(age + random.nextInt(5) / 4, 15);
            worldIn.setBlockState(pos, this.getStateForPlacement(worldIn, pos).with(AGE, Integer.valueOf(j)), 3);
         } else {
            worldIn.removeBlock(pos, false);
         }

In get Flamability, the Direction is ignored:

 

See IForgeBlockStatre 

    default int getFlammability(IBlockReader world, BlockPos pos, Direction face)
    {
        return getBlockState().getBlock().getFlammability(getBlockState(), world, pos, face);
    }

And IForgeBlock

    default int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face)
    {
        return ((FireBlock)Blocks.FIRE).func_220274_q(state);
    }

 

 

To Correct Problem it rmay be nessesary to insert 2 Changes:

in In TryCatchFire it might be helpfully to Check the Block for Place a Fire must be an Air Block:

 

   private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, Direction face) {
     if (! worldIn.getBlockState(pos).isAir() return;
    int i = worldIn.getBlockState(pos).getFlammability(worldIn, pos, face);

 

in IForgeBlock Direction may be used: I Downt know if this function will be called elsewhere. So it might be nessesary to allow use direction null

 

    default int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face)
    {

         if (face == null)
              return ((FireBlock)Blocks.FIRE).func_220274_q(state);

         Blockstate,blockstate = world.getBlockState(pos.offset(face));

         return ((FireBlock)Blocks.FIRE).func_220274_q(blockstate);
    }

 

 

 

  • Quote

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

    • Darth_Cobalt
      Forge 1.14.4 crashes.

      By Darth_Cobalt · Posted 32 minutes ago

      Hi I just downloaded forge and every time i try to load it, it crashes. I have tried 1.14.4 - 28.1.0 and 1.14.4 - 28.1.106. It crashes with both versions. I couldn't figure out how to upload the crash files, could somebody explain how I can do that?
    • leonardsores
      Fun mod interactions

      By leonardsores · Posted 33 minutes ago

      What's everyone's favorite ways mods tend to intertwine and kinda synergize? I got a couple from older packs but I've been outta the game a while. Mine comes to a tie, between Rotarycraft and Tinker's and old Railcraft and the big reactors mod.
    • DavidM
      [1.12.2] Water Crafting with dropped items like AE2

      By DavidM · Posted 1 hour ago

      I would recommend creating a custom ItemEntity for your custom item, and return an instance of your ItemEntity in Item#createEntity (as well as override Item#hasCustomEntity to return true). With this approach you can simply check for water in your EntityItem’s update method.
    • Ommina
      These 1.15 Rendering Changes

      By Ommina · Posted 1 hour ago

      This is not the complaint thread.  I'll leave that one to somebody else.   It is, though, a question for those more familiar with the upcoming changes than I -- and all I know is what I read on Twitter.  Is my time going to be better served by putting aside any further FastTESR / particle / GUI (?) changes and work on other aspects of the mod instead?   Stuff changes.  I get that.  And if it is a change for the better, that's not a bad thing.  But just the same, I don't want to spend a whole lot of time over the weekend working on something that's going to be discarded days later.   Tks!
    • Ommina
      [1.14.4] Getting a Block Model's Element Clicked by the Player

      By Ommina · Posted 2 hours ago

      Well, it took me a couple of days, a handful of hours on 'mathisfun', and at least on instance of the problem intruding its way into dreams -- which is a sad commentary on my life.   The model elements are in block co-ordinates.  The hit vector is in world co-ordinates.  I was mixing units and simply took ages to make the connection.   So, yes, it is totally enough.
  • Topics

    • Darth_Cobalt
      0
      Forge 1.14.4 crashes.

      By Darth_Cobalt
      Started 32 minutes ago

    • leonardsores
      0
      Fun mod interactions

      By leonardsores
      Started 33 minutes ago

    • CrashDbo
      2
      [1.12.2] Water Crafting with dropped items like AE2

      By CrashDbo
      Started 5 hours ago

    • Ommina
      0
      These 1.15 Rendering Changes

      By Ommina
      Started 1 hour ago

    • Ommina
      4
      [1.14.4] Getting a Block Model's Element Clicked by the Player

      By Ommina
      Started Monday at 10:10 AM

  • Who's Online (See full list)

    • xerca
    • TrogloGeek
    • salvestrom
    • AdieCraft
    • mervinrasquinha
    • Ommina
    • Choonster
    • loordgek
    • Oliviafrostpaw
  • All Activity
  • Home
  • Minecraft Forge
  • Support & Bug Reports
  • 1.14.4 Error on Fire Block
  • Theme
  • Contact Us
  • Discord

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