Posted July 6, 20178 yr Hi ! I'm creating a custom block that recieves a redstone signal from any face. A TileEntity implementing ITickable is created by this block. In the ITickable::update method, I'm getting the current power using World::isBlockIndirectlyGettingPowered. It works...a bit. Screenshot On this screenshot, the block on the right will receive a power of 15 whereas the block on the left will receive a power of 0. I really don't know why. My Block class : public class BlockRedstoneReceiver extends BlockRedstoneDevice { public BlockRedstoneReceiver(String name, Material mat, CreativeTabs tab, float hardness, float resistance, String tool, int harvest, float light) { super(name, mat, tab, hardness, resistance, tool, harvest, light, GuiHandler.REDSTONE_RECEIVER_GUI); } @Override public TileEntity createTileEntity(World world, IBlockState state) { return new TileEntityRedstoneReceiver(); } } The block superclass overrides Block::canConnectRedstone to return true. I'm stuck now. Maybe I forgot something on the block class but I'm not sure... if someone can help me !
July 6, 20178 yr Check how vanilla does it at BlockRedstoneDiode. I believe it has something to do with the fact that Block::canConnectRedstone is actually irrelevant when it comes to recieving weak power and is relevant when it comes to sending it. Edited July 6, 20178 yr by V0idWa1k3r
July 6, 20178 yr Author Yeah, that's probably that for the Block::canConnectRedstone. I looked at BlockRedstoneDiode::updateTick but it seems that it only checks if it has power or not - and I want to check how much power I have.
July 6, 20178 yr 1 minute ago, Franckyi said: I looked at BlockRedstoneDiode::updateTick BlockRedstoneDiode::calculateInputStrength is the method you are looking for, not it's update tick. You can adapt the code from that method to check all faces instead of just the input one.
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.