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
  • Minecraft Forge
  • General Discussion
  • Switching facing texture of a block
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
DarkGuardsman

Switching facing texture of a block

By DarkGuardsman, May 24, 2012 in General Discussion

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • Next
  • Page 2 of 2  

Recommended Posts

OvermindDL1    333

OvermindDL1

OvermindDL1    333

  • World Shaper
  • OvermindDL1
  • Members
  • 333
  • 1439 posts
Posted May 26, 2012

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.

  • Quote

Share this post


Link to post
Share on other sites

calclavia    81

calclavia

calclavia    81

  • World Shaper
  • calclavia
  • Forge Modder
  • 81
  • 2281 posts
Posted May 28, 2012

I tried using the function par1World.scheduleBlockUpdate(), but that didn't work. Also tried the function par1World.notifyBlocksOfNeighborChange(). Is there a function that will make the block update it's texture?

  • Quote

width=409 height=100http://calclavia.com/uploads/banner.png[/img]

Share this post


Link to post
Share on other sites

DarkGuardsman    61

DarkGuardsman

DarkGuardsman    61

  • World Shaper
  • DarkGuardsman
  • Forge Modder
  • 61
  • 1479 posts
Posted May 28, 2012

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

  • Quote

width=400 height=73http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • Next
  • Page 2 of 2  

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 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Eksity
      Another freaking "error in currently selected datapacks prevented world from loading"

      By Eksity · Posted 1 minute ago

      Basically the title. I Try to get into my pre-existing world, and gave me an error that said "Error in currently selected data packs prevented the world from loading." along with safe mode and return to title. I mess around with my mod list a lot because I make modded MC content for YouTube and TikTok, But the mods I have removed in the past 3 days are quark, quark oddities, quark biomes o' plenty, armorplus, and thedragonlib along with a custom mcreator mod I never uploaded anywhere. I don't use a specific modpack, but rather a collection of mods i find interesting. latest.log: https://gist.github.com/Eksity/9e4b219018a1a519c9ab615c31c629f7   is there any advice, or anything you can do to help?
    • Zeher_Monkey
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey · Posted 8 minutes ago

      Very true, but to be honest my code only needed a few lines updated. I want to move to something more native, but am struggling to find references to WorldSavedData. I am not worried about compact data, there is only 1 master file which contains each registered object, and each object is only ~3KB in size. It allows easy debugging, and on servers specifically, tweaks to the data that do not require things like NBTExplorer to use. It works for my purposes.
    • Differentiation
      Is it possible to change the color of Firework Spark particle?

      By Differentiation · Posted 15 minutes ago

      Hey,   Pretty simple question: is it possible to specify a color for the firework spark particle effect when spawning it?   Thanks
    • brok4d
      Modded 1.16 fluid has no physics

      By brok4d · Posted 23 minutes ago

      Well, you should have it, since that's why you get the error, the .png files and the .mcmeta files since the .mcmeta files are for animation if I'm not mistaken. This is what the .mcmeta have. { "animation": { "frametime": 4 } }
    • sc0rich
      how do I config mods in 1.16.4?

      By sc0rich · Posted 25 minutes ago

      Oh, okay.       wait, then how do I access the configurations? do you know where do I go? how I edit .cfg and .toml files? cause I just found it
  • Topics

    • Eksity
      0
      Another freaking "error in currently selected datapacks prevented world from loading"

      By Eksity
      Started 1 minute ago

    • Zeher_Monkey
      8
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey
      Started Wednesday at 12:20 AM

    • Differentiation
      0
      Is it possible to change the color of Firework Spark particle?

      By Differentiation
      Started 15 minutes ago

    • NullDev
      3
      Modded 1.16 fluid has no physics

      By NullDev
      Started 4 hours ago

    • sc0rich
      6
      how do I config mods in 1.16.4?

      By sc0rich
      Started Yesterday at 02:11 AM

  • Who's Online (See full list)

    • abbepe
    • Eksity
    • Hubmac
    • CookieLukas
    • Deadlocked47
    • Kaiser Frederick
    • Seynox
    • Differentiation
    • Pickle_Face5
    • TeaWithBebeLoca
    • brok4d
    • Seika85
    • Zeher_Monkey
    • FactionsFire
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Switching facing texture of a block
  • Theme

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