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

Hey there.  I have a block which extends BlockRedstoneWire and I'm trying to change the texture of it.  The normal methods of changing a texture don't seem to be having an effect; no matter what I name the new textures, it still always shows the normal Redstone textures.

 

EDIT:

The solution is to create a custom renderer.

  • Author

So there's really no way to have a custom colored redstone wire other than using a resource pack?

  • Author

Nothing is wrong with Resource Packs.  I was just hoping to keep the vanilla version and my version.

  • Author

Derp me... I was misunderstanding your entire question.

You need to override registerIcons in your Block

 

That's what I've done, but it still shows up red for some reason.  Here's what the code looks like:

    @SideOnly(Side.CLIENT)
    public IIcon cross;
    @SideOnly(Side.CLIENT)
    public IIcon line;
    @SideOnly(Side.CLIENT)
    public IIcon cross_overlay;
    @SideOnly(Side.CLIENT)
    public IIcon line_overlay;

    @SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister registerer)
    {
        this.cross = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "cross");
        this.line = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "line");
        this.cross_overlay = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "cross_overlay");
        this.line_overlay = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "line_overlay");
this.blockIcon = this.cross;
    }

  • Author

I've looked through the code to see where getRedstoneWireIcon is called, but the BlockRedstoneWire.class didn't seem to call it anywhere.

 

    @SideOnly(Side.CLIENT)
    public static IIcon cross;
    @SideOnly(Side.CLIENT)
    public static IIcon line;
    @SideOnly(Side.CLIENT)
    public static IIcon cross_overlay;
    @SideOnly(Side.CLIENT)
    public static IIcon line_overlay;

    @SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int meta)
{
		return this.blockIcon;
	}
    
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(int par1, int par2)
    {
		return this.blockIcon;
    }

    @SideOnly(Side.CLIENT)
    public IIcon func_149735_b(int par1, int par2)
    {
		return this.blockIcon;
    }

    @SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister registerer)
    {
        this.cross = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "cross");
        this.line = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "line");
        this.cross_overlay = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "cross_overlay");
        this.line_overlay = registerer.registerIcon(ModReferences.MODID + ":redstone_dust" + "_" + "line_overlay");
this.blockIcon = this.cross;
    }

    @SideOnly(Side.CLIENT)
    public static IIcon getRedstoneWireIcon(String icon)
    {
        return icon.equals("cross") ? cross : (icon.equals("line") ? line : (icon.equals("cross_overlay") ? cross_overlay :
                           (icon.equals("line_overlay") ? line_overlay : null)));
    }

 

Edit: This code didn't work either, by the way.

This class, if I am remembering correctly, is a modified version of the redstone renderer.

 

https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/client/RenderLaserBeam.java

 

It's got some alterations to handle "corners" as pluses and to render "into" glass and other transparent blocks that don't actually interrupt the beam (but in which it can't occupy due to the cellular automata nature of Minecraft).  But it might help you get started.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

This class, if I am remembering correctly, is a modified version of the redstone renderer.

 

https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/client/RenderLaserBeam.java

 

It's got some alterations to handle "corners" as pluses and to render "into" glass and other transparent blocks that don't actually interrupt the beam (but in which it can't occupy due to the cellular automata nature of Minecraft).  But it might help you get started.

 

Oh, thanks very much Draco!  Very helpful!

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.