private void func_176462_k(World world, BlockPos pos, IBlockState state) { int newStrength = this.func_176460_j(world, pos, state); int oldStrength = F.or( world.bindTileEntity( pos, TileEntityComparator.class, t -> { int old = t.getOutputSignal(); t.setOutputSignal(newStrength); return old; }), 0); if (oldStrength != newStrength || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE) { boolean var9 = this.isPowered(world, pos, state); boolean var8 = this.isPowered(state); if (var8 && !var9) { world.setBlockState(pos, state.withProperty(POWERED, false), 2); } else if (!var8 && var9) { world.setBlockState(pos, state.withProperty(POWERED, true), 2); } this.updateRedstoneState(world, pos, state); } }
protected void func_176398_g(World world, BlockPos pos, IBlockState state) { if (!world.isBlockTickPending(pos, this)) { int var4 = this.func_176460_j(world, pos, state); int var6 = F.or( world.bindTileEntity( pos, TileEntityComparator.class, TileEntityComparator::getOutputSignal), 0); if (var4 != var6 || this.isPowered(state) != this.isPowered(world, pos, state)) { if (this.func_176402_i(world, pos, state)) { world.scheduleUpdate(pos, this, 2, -1); } else { world.scheduleUpdate(pos, this, 2, 0); } } } }