Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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);
    }

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.