Jump to content

[Resolved]Strong redstone powering my block


pantheis

Recommended Posts

I'm trying to get my block to emit a strong redstone signal, controlled from the TileEntity, so that attached redstone wire, repeaters, etc, will light up and carry that signal.

 

To troubleshoot my issues, I've looked at the base code for the lever, redstone torch, repeater, redstone wire block and even other mods online. I cannot figure out what I'm doing wrong.

 

My block code is on github https://github.com/pantheis/StorageMonitor/tree/Working. It's a mess at the moment because of everything I've been trying to get this to work. From the debug statements it looks like only isIndirectlyPoweringTo is ever firing and only when another block is placed adjacent to my block.

 

If I place one of my blocks down, place another block next to it (such as some cobble), then wire redstone to the cobble, the redstone is powered. Redstone wired directly to my own block is not. It's like my block is strongly powering blocks around it, but not itself and will not power redstone wire or repeaters hooked directly to my block.

 

Any advice would be most welcome. I know I must be missing something really simple here, but it's completely eluding me. I have isIndirectlyPoweringTo, canProvidePower, and isPoweringTo simply returning true to try to troubleshoot the problem.

 

[edit]

I fixed it. It requires overriding these two things in order to act like a lever or redstone torch but still be a full cube, and to return true on isPoweringTo but false to isIndirectlyPoweringTo.

 

@Override
public boolean isBlockNormalCube(World world, int x, int y, int z)
{
	return false;
}

@Override
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
{
	return true;
}

 

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

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