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

You are probably calling world.setBlockMetadata, you need to call world.setBlockMetadataWithNotify I think.

 

I changed my code to setBlockMetadataWithNotify . The texture still doesn't update unless there is a block change nearby.

 

EDIT: I figured it out. I need to set this:

this.setRequiresSelfNotify();

Ah, yes, forgot about that, I always set that on my blocks.  :)

 

EDIT 2: OK I have another problem now. I decided NOT to use metadata to save the direction and to use the tile entity instead. After the change, the texture of the block will not change or update unless a block besides it changes. Same problem. I tried cheating by setting the block metadata into the same metadata but it doesn't work.

Setting a metadata to the same thing causes MC to skip it, thus doing nothing.  To force an update you can mark your block as needing an update, forgot what the function was called but if you check the source of the setBlockMetadataWithNotify function it calls the functions that mark a block as needing to be updated like that, just call whatever functions it calls, but directly.

  • Author

there is a method that is called something  along the lines of needsUpdate() that needs to return true

 

here some things i found that might help

public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {}

protected Block setLightOpacity(int par1)
    {
        lightOpacity[this.blockID] = par1;
        return this;
    }

public boolean isOpaqueCube()
    {
        return false;
    }

public boolean renderAsNormalBlock()
    {
        return false;
    }

private Set blocksNeedingUpdate = new HashSet();
his.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4));

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.