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

Looking for a way to allow pistons to move my block, with extends BlockContainer and has an TileEntity,

 

Do to BlockPistonBase's: return !par1World.blockHasTileEntity(par2, par3, par4); , my block well.... blocks pistons from extending.

 

private static boolean canPushBlock(int par0, World par1World, int par2, int par3, int par4, boolean par5)
    {
        if (par0 == Block.obsidian.blockID)
        {
            return false;
        }
        else
        {
            if (par0 != Block.pistonBase.blockID && par0 != Block.pistonStickyBase.blockID)
            {
                if (Block.blocksList[par0].getBlockHardness(par1World, par2, par3, par4) == -1.0F)
                {
                    return false;
                }

                if (Block.blocksList[par0].getMobilityFlag() == 2)
                {
                    return false;
                }

                if (Block.blocksList[par0].getMobilityFlag() == 1)
                {
                    if (!par5)
                    {
                        return false;
                    }

                    return true;
                }
            }
            else if (isExtended(par1World.getBlockMetadata(par2, par3, par4)))
            {
                return false;
            }

            ------------------------->   return !par1World.blockHasTileEntity(par2, par3, par4);     <--------------------------------
        }
    }

 

Is there a hook I can use to bypass the normal piston behavioral or another way to backdoor this problem?

 

-Thanks

 

 

Btw, I am using TileEntity to store the blocks "Durability", which when its durabiliy reaches 0, the block and tileentity are removed. via breakBlock();

 

I found TileEntitys are the only way to store NBT infomation for the block which they are located at =/, since the Block Meta is taken up by its placement direction (block is place able on walls).

You could make it see if the pistions variable to extant is true and then make you block move it self.

  • 5 years later...

You can use multiple blocks as a workaround. Like one block for 20 hp, one for 19 and so on and all drop the same block, even with silk touch.

5 minutes ago, GDavid said:

You can use multiple blocks as a workaround. Like one block for 20 hp, one for 19 and so on and all drop the same block, even with silk touch.

Please don't necropost. This is 5 years old.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.